Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 144 lines (86 sloc) 6.273 kb
d892205 @zenorocha Add Bower badge
zenorocha authored
1 # jQuery Boilerplate [![Build Status](https://secure.travis-ci.org/jquery-boilerplate/jquery-boilerplate.svg?branch=master)](https://travis-ci.org/jquery-boilerplate/jquery-boilerplate) ![Bower Version](https://badge.fury.io/bo/jquery-boilerplate.svg)
9bf4c09 @zenorocha a new readme file added
zenorocha authored
2
522284b @zenorocha Remove unnecessary HTML tag
zenorocha authored
3 ### A jump-start for jQuery plugins development
054a0fc @zenorocha adding a introduction text for 'how did we get here' guide
zenorocha authored
4
7eb4fdf creating a new branch for the french version
Zeno Rocha authored
5 So, you've tried your hand at writing jQuery plugins and you're comfortable putting together something that probably works. Awesome! Thing is, you think there might be better ways you could be writing them - you've seen them done a number of different ways in the wild, but aren't really sure what the differences between these patterns are or how to get started with them.
9bf4c09 @zenorocha a new readme file added
zenorocha authored
6
12f53f0 @zenorocha adding link to a new wiki page
zenorocha authored
7 This project won't seek to provide a perfect solution to every possible pattern, but will attempt to cover a simple template for beginners and above. By using a basic defaults object, simple constructor for assigning the element to work with and extending options with defaults and a lightweight wrapper around the constructor to avoid issues with multiple instantiations.
8
68d3324 @zenorocha Add usage section
zenorocha authored
9 ## Usage
571714f @zenorocha Add structure section
zenorocha authored
10
19af93c @zenorocha Fix syntax highlight and improve structure
zenorocha authored
11 1. Include jQuery:
054a0fc @zenorocha adding a introduction text for 'how did we get here' guide
zenorocha authored
12
19af93c @zenorocha Fix syntax highlight and improve structure
zenorocha authored
13 ```html
14 <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
15 ```
054a0fc @zenorocha adding a introduction text for 'how did we get here' guide
zenorocha authored
16
19af93c @zenorocha Fix syntax highlight and improve structure
zenorocha authored
17 2. Include plugin's code:
054a0fc @zenorocha adding a introduction text for 'how did we get here' guide
zenorocha authored
18
19af93c @zenorocha Fix syntax highlight and improve structure
zenorocha authored
19 ```html
20 <script src="dist/jquery.boilerplate.min.js"></script>
21 ```
054a0fc @zenorocha adding a introduction text for 'how did we get here' guide
zenorocha authored
22
19af93c @zenorocha Fix syntax highlight and improve structure
zenorocha authored
23 3. Call the plugin:
a8c46e1 @zenorocha adding a guide about the new jquery plugins registry #62
zenorocha authored
24
19af93c @zenorocha Fix syntax highlight and improve structure
zenorocha authored
25 ```javascript
26 $("#element").defaultPluginName({
27 propertyName: "a custom value"
28 });
29 ```
a8c46e1 @zenorocha adding a guide about the new jquery plugins registry #62
zenorocha authored
30
571714f @zenorocha Add structure section
zenorocha authored
31 ## Structure
054a0fc @zenorocha adding a introduction text for 'how did we get here' guide
zenorocha authored
32
571714f @zenorocha Add structure section
zenorocha authored
33 The basic structure of the project is given in the following way:
34
522284b @zenorocha Remove unnecessary HTML tag
zenorocha authored
35 ```
19af93c @zenorocha Fix syntax highlight and improve structure
zenorocha authored
36 ├── demo/
37 │ └── index.html
38 ├── dist/
39 │ ├── jquery.boilerplate.js
40 │ └── jquery.boilerplate.min.js
41 ├── src/
42 │ ├── jquery.boilerplate.coffee
43 │ └── jquery.boilerplate.js
44 ├── .editorconfig
45 ├── .gitignore
46 ├── .jshintrc
47 ├── .travis.yml
48 ├── boilerplate.jquery.json
49 ├── Gruntfile.js
50 └── package.json
522284b @zenorocha Remove unnecessary HTML tag
zenorocha authored
51 ```
571714f @zenorocha Add structure section
zenorocha authored
52
cac7d3a @zenorocha Update informations about v3.3.1
zenorocha authored
53 #### [demo/](https://github.com/jquery-boilerplate/boilerplate/tree/master/demo)
54
55 Contains a simple HTML file to demonstrate your plugin.
56
57 #### [dist/](https://github.com/jquery-boilerplate/boilerplate/tree/master/dist)
571714f @zenorocha Add structure section
zenorocha authored
58
59 This is where the generated files are stored once Grunt runs.
60
61 #### [src/](https://github.com/jquery-boilerplate/boilerplate/tree/master/src)
62
63 Contains the files responsible for your plugin, you can choose between JavaScript or CoffeeScript.
64
65 #### [.editorconfig](https://github.com/jquery-boilerplate/boilerplate/tree/master/.editorconfig)
66
67 This file is for unifying the coding style for different editors and IDEs.
68
69 > Check [editorconfig.org](http://editorconfig.org) if you haven't heard about this project yet.
70
71 #### [.gitignore](https://github.com/jquery-boilerplate/boilerplate/tree/master/.gitignore)
72
73 List of files that we don't want Git to track.
74
75 > Check this [Git Ignoring Files Guide](https://help.github.com/articles/ignoring-files) for more details.
76
77 #### [.jshintrc](https://github.com/jquery-boilerplate/boilerplate/tree/master/.jshintrc)
78
79 List of rules used by JSHint to detect errors and potential problems in JavaScript.
80
81 > Check [jshint.com](http://jshint.com/about/) if you haven't heard about this project yet.
0f9f523 @zenorocha Move contributing and history to readme
zenorocha authored
82
571714f @zenorocha Add structure section
zenorocha authored
83 #### [.travis.yml](https://github.com/jquery-boilerplate/boilerplate/tree/master/.travis.yml)
84
85 Definitions for continous integration using Travis.
86
87 > Check [travis-ci.org](http://about.travis-ci.org/) if you haven't heard about this project yet.
88
f5f25bd @zenorocha Fix url
zenorocha authored
89 #### [boilerplate.jquery.json](https://github.com/jquery-boilerplate/boilerplate/tree/master/boilerplate.jquery.json)
571714f @zenorocha Add structure section
zenorocha authored
90
91 Package manifest file used to publish plugins in jQuery Plugin Registry.
92
93 > Check this [Package Manifest Guide](http://plugins.jquery.com/docs/package-manifest/) for more details.
94
95 #### [Gruntfile.js](https://github.com/jquery-boilerplate/boilerplate/tree/master/Gruntfile.js)
96
97 Contains all automated tasks using Grunt.
98
99 > Check [gruntjs.com](http://gruntjs.com) if you haven't heard about this project yet.
100
101 #### [package.json](https://github.com/jquery-boilerplate/boilerplate/tree/master/package.json)
102
103 Specify all dependencies loaded via Node.JS.
104
105 > Check [NPM](https://npmjs.org/doc/json.html) for more details.
106
68d3324 @zenorocha Add usage section
zenorocha authored
107 ## Guides
108
109 #### How did we get here?
110
111 Have you got in this repo and still not sure about using this boilerplate?
112
113 Well, extending jQuery with plugins and methods is very powerful and can save you and your peers a lot of development time by abstracting your most clever functions into plugins.
114
115 [This awesome guide](https://github.com/jquery-boilerplate/boilerplate/wiki/How-did-we-get-here%3F), adapted from [jQuery Plugins/Authoring](http://docs.jquery.com/Plugins/Authoring), will outline the basics, best practices, and common pitfalls to watch out for as you begin writing your plugin.
116
117 #### How to publish plugins?
118
119 Also, check our guide on [How to publish a plugin in jQuery Plugin Registry](https://github.com/jquery-boilerplate/boilerplate/wiki/How-to-publish-a-plugin-in-jQuery-Plugin-Registry
120 )!
121
f1fcb9a @heldr insert npm registry links #98
heldr authored
122 **Note:** The jQuery Plugin Registry is in read-only mode. New plugin releases will not be processed.
123 jQuery recommends moving to [npm](https://www.npmjs.com/), using ["jquery-plugin"](https://www.npmjs.com/browse/keyword/jquery-plugin) as the keyword in your package.json. See [how to publish into npm registry](https://gist.github.com/coolaj86/1318304).
8555a91 @numediaweb Update README.md
numediaweb authored
124
0c340d6 @zenorocha Add team section
zenorocha authored
125 ## Team
126
f5f25bd @zenorocha Fix url
zenorocha authored
127 jQuery Boilerplate was made with love by these guys and a bunch of awesome [contributors](https://github.com/jquery-boilerplate/boilerplate/graphs/contributors).
0c340d6 @zenorocha Add team section
zenorocha authored
128
9acf24e @zenorocha Add @heldr to the Team \o/
zenorocha authored
129 [![Zeno Rocha](http://gravatar.com/avatar/e190023b66e2b8aa73a842b106920c93?s=70)](http://zenorocha.com) | [![Addy Osmani](http://gravatar.com/avatar/96270e4c3e5e9806cf7245475c00b275?s=70)](http://addyosmani.com) | [![Helder Santana](http://gravatar.com/avatar/63fb620ee7d14fc91030d4349d189b3e?s=70)](http://heldr.com)
0c340d6 @zenorocha Add team section
zenorocha authored
130 --- | --- | --- | --- | --- | --- | ---
9acf24e @zenorocha Add @heldr to the Team \o/
zenorocha authored
131 [Zeno Rocha](http://zenorocha.com) | [Addy Osmani](http://addyosmani.com) | [Helder Santana](http://heldr.com)
571714f @zenorocha Add structure section
zenorocha authored
132
6578d8a @zenorocha Move history and contributing sections to a separated file
zenorocha authored
133 ## Contributing
134
d892205 @zenorocha Add Bower badge
zenorocha authored
135 Check [CONTRIBUTING.md](https://github.com/jquery-boilerplate/boilerplate/blob/master/CONTRIBUTING.md) for more information.
6578d8a @zenorocha Move history and contributing sections to a separated file
zenorocha authored
136
571714f @zenorocha Add structure section
zenorocha authored
137 ## History
0f9f523 @zenorocha Move contributing and history to readme
zenorocha authored
138
d892205 @zenorocha Add Bower badge
zenorocha authored
139 Check [Releases](https://github.com/jquery-boilerplate/jquery-boilerplate/releases) for detailed changelog.
0f9f523 @zenorocha Move contributing and history to readme
zenorocha authored
140
141 ## License
142
d892205 @zenorocha Add Bower badge
zenorocha authored
143 [MIT License](http://zenorocha.mit-license.org/) © Zeno Rocha
Something went wrong with that request. Please try again.