Coder Social home page Coder Social logo

mjpalad / javascript-jquery-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prismicio/javascript-jquery-starter

0.0 2.0 0.0 302 KB

Starter project for JavaScript & JQuery – Works with any prismic.io repository

Home Page: http://developers.prismic.io

javascript-jquery-starter's Introduction

JQuery starter project for prismic.io

This is a purely client-side application using JQuery, that will connect to any prismic.io repository, and trivially list its documents. It uses the prismic.io JavaScript development kit, and provides a few helpers to integrate with JQuery, as well as a basic templating engine.

The embedded templating engine is JavaScript Micro-templating (http://ejohn.org/blog/javascript-micro-templating/), but you can easily switch for any other JavaScript templating engine you may want.

This starter project uses the browser sessionStorage to store the access token when you interactively login to preview the future releases of your repository. Therefore, to preview another release than Master, a modern browser supporting HTML5 is required.

Getting started

Launch the starter project

Since it's all client-side, you don't need more than a web browser: simply open the index.html file in your browser.

If you wish to simulate a client-server architecture anyway, you can also launch a local Web server using the server.sh script and open the home page at http://localhost:8000/ (Python is required)

Your JQuery starter project is now working! However, by default, it will list and display documents from our "Les Bonnes Choses" example repository.

Configure the starter project

Edit the script/prismic-configuration.js file to make the application point to the correct repository:

var Configuration = {

  // -- API endpoint
  apiEndpoint: 'https://lesbonneschoses.prismic.io/api'

  // -- Access token if the Master is not open
  // accessToken: 'xxxxxx',

  // -- OAuth
  // clientId: 'xxxxxx',
  // clientSecret: 'xxxxxx'
  
}

To set up the OAuth configuration and interactive signin, go to the Applications panel in your repository's settings, and create a new OAuth application. You simply have to fill in an application name and potentially the callback URL (localhost URLs are always authorized, so at development time you can omit to fill in the Callback URL field). After submitting, copy/paste the clientId & clientSecret tokens into the proper place in your configuration.

Publish your project

As this application is just made of static files, you can publish it to any web server. One simple way to do that is to use Github pages. Just push this Git repository on Github and create a gh-pages branch to publish it to your own Github pages:

git checkout --orphan gh-pages
git commit -a -m "Push to Github pages"
git push origin gh-pages

You can then visit your website at:

http://your-github-user.github.io/your-github-repository.

Get started with prismic.io

You can find out how to get started with prismic.io on our prismic.io developer's portal.

Understand the JavaScript development kit

You'll find more information about how to use the development kit included in this starter project, by reading its README file.

Contribute to the starter project

Contribution is open to all developer levels, read our "Contribute to the official kits" documentation to learn more.

Licence

This software is licensed under the Apache 2 license, quoted below.

Copyright 2013 Zengularity (http://www.zengularity.com).

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

javascript-jquery-starter's People

Contributors

guillaumebort avatar mrspeaker avatar rudyrigot avatar

Watchers

James Cloos avatar Michael Paladino avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.