Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 237 lines (198 sloc) 6.782 kB
df641c3 @mislav framework ☞ library
mislav authored
1 # Zepto.js – a minimalist JavaScript library
29173b0 @kossnocorp Rewrite README in markdown (source now highlighted)
kossnocorp authored
2
df641c3 @mislav framework ☞ library
mislav authored
3 Zepto is a minimalist JavaScript library for modern browsers with a
8b96474 @madrobby Update the README to point to the new documentation site.
authored
4 largely jQuery-compatible API. If you use jQuery, you already know how to use Zepto.
29173b0 @kossnocorp Rewrite README in markdown (source now highlighted)
kossnocorp authored
5
9e9682a @mislav add docs about the docs
mislav authored
6 See [zeptojs.com][] for an extended introduction, downloads
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
7 and documentation.
29173b0 @kossnocorp Rewrite README in markdown (source now highlighted)
kossnocorp authored
8
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
9 Zepto.js is licensed under the terms of the MIT License.
29173b0 @kossnocorp Rewrite README in markdown (source now highlighted)
kossnocorp authored
10
745f347 @madrobby Mention donations in README.
authored
11 Want to give us money or a tip? Don't.
f7f5f9d @madrobby Update README.md
authored
12 Instead please donate to [charity: water](http://charitywater.org/).
745f347 @madrobby Mention donations in README.
authored
13
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
14 ## Building
29173b0 @kossnocorp Rewrite README in markdown (source now highlighted)
kossnocorp authored
15
fddde41 @madrobby Retinafy the build badge
authored
16 [![Build Status](https://secure.travis-ci.org/madrobby/zepto.svg?branch=master)](http://travis-ci.org/madrobby/zepto)
c84f926 @madrobby Add build status via Travis CI
authored
17
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
18 The official site offers a download of the default distribution of Zepto. This
19 is good for starting out. However, at some point you might want to add some
20 optional modules and remove some of the default ones you don't need, to keep the
16e2baa @waynn "at a minimum" is the grammatically correct way to phrase it
waynn authored
21 size at a minimum. That's when you need to check out Zepto's source code and use
6bc371b @jasonly Correct typo
jasonly authored
22 the build commands. Alternatively you can use the web based [Zepto Builder](http://github.e-sites.nl/zeptobuilder/).
29173b0 @kossnocorp Rewrite README in markdown (source now highlighted)
kossnocorp authored
23
ed7b86c @mislav rewrite build system in node
mislav authored
24 You will need Node.js installed on your system.
29173b0 @kossnocorp Rewrite README in markdown (source now highlighted)
kossnocorp authored
25
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
26 ~~~ sh
ed7b86c @mislav rewrite build system in node
mislav authored
27 $ npm install
28 $ npm run-script dist
3ca4a06 @madrobby Example how to make a custom build when running npm, closes #894.
authored
29
30 # do a custom build
31 $ MODULES="zepto event data" npm run-script dist
c74bb6c @dotnetwise Added info about how to build on Windows
dotnetwise authored
32
33 # on Windows
34 c:\zepto> SET MODULES=zepto event data
35 c:\zepto> npm run-script dist
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
36 ~~~
37
38 The resulting files are:
39
e8a5510 @mislav show how to build with "selector" module
mislav authored
40 1. `dist/zepto.js`
41 2. `dist/zepto.min.js`
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
42
ed7b86c @mislav rewrite build system in node
mislav authored
43 If you install CoffeeScript globally, you can run `make` directly:
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
44
ed7b86c @mislav rewrite build system in node
mislav authored
45 ~~~ sh
c74bb6c @dotnetwise Added info about how to build on Windows
dotnetwise authored
46 # one-time operation
47 $ npm install coffee-script --global
48
ed7b86c @mislav rewrite build system in node
mislav authored
49 $ coffee make dist
50 $ MODULES="zepto event data ..." ./make dist
c74bb6c @dotnetwise Added info about how to build on Windows
dotnetwise authored
51
52 # on Windows
53 c:\zepto> SET MODULES=zepto event data
54 c:\zepto> coffee make dist
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
55 ~~~
32c7d54 @mislav notice for zsh users
mislav authored
56
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
57 ## Zepto modules
58
ed7b86c @mislav rewrite build system in node
mislav authored
59 Zepto modules are individual files in the "src/" directory.
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
60
61 <table>
62 <thead><tr>
63 <th>module</th> <th>default</th> <th>description</th>
64 </tr></thead>
65 <tbody>
66 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
67 <th><a href="src/zepto.js#files">zepto</a></th>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
68 <td>✔</td>
69 <td>Core module; contains most methods</td>
70 </tr>
71 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
72 <th><a href="src/event.js#files">event</a></th>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
73 <td>✔</td>
74 <td>Event handling via <code>on()</code> &amp; <code>off()</code></td>
75 </tr>
76 <tr>
769397d @madrobby Add `ie.js` to our default modules
authored
77 <th><a href="src/ajax.js#files">ajax</a></th>
78 <td>✔</td>
79 <td>XMLHttpRequest and JSONP functionality</td>
80 </tr>
81 <tr>
82 <th><a href="src/form.js#files">form</a></th>
83 <td>✔</td>
84 <td>Serialize &amp; submit web forms</td>
85 </tr>
86 <tr>
87 <th><a href="src/ie.js#files">ie</a></th>
88 <td>✔</td>
63619aa @mislav IE tests are not failing anymore :boom: :fire:
mislav authored
89 <td>Support for Internet Explorer 10+ on the desktop and Windows Phone 8</td>
769397d @madrobby Add `ie.js` to our default modules
authored
90 </tr>
91 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
92 <th><a href="src/detect.js#files">detect</a></th>
45b5f0b @madrobby Remove fx and detect from default distribution.
authored
93 <td></td>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
94 <td>Provides <code>$.os</code> and <code>$.browser</code> information</td>
95 </tr>
96 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
97 <th><a href="src/fx.js#files">fx</a></th>
45b5f0b @madrobby Remove fx and detect from default distribution.
authored
98 <td></td>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
99 <td>The <code>animate()</code> method</td>
100 </tr>
101 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
102 <th><a href="src/fx_methods.js#files">fx_methods</a></th>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
103 <td></td>
104 <td>
105 Animated <code>show</code>, <code>hide</code>, <code>toggle</code>,
106 and <code>fade*()</code> methods.
107 </td>
108 </tr>
109 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
110 <th><a href="src/assets.js#files">assets</a></th>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
111 <td></td>
112 <td>
113 Experimental support for cleaning up iOS memory after removing
114 image elements from the DOM.
115 </td>
116 </tr>
117 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
118 <th><a href="src/data.js#files">data</a></th>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
119 <td></td>
120 <td>
121 A full-blown <code>data()</code> method, capable of storing arbitrary
122 objects in memory.
123 </td>
124 </tr>
125 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
126 <th><a href="src/deferred.js#files">deferred</a></th>
8457096 @mislav Document new deferreds modules
mislav authored
127 <td></td>
128 <td>
129 Provides <code>$.Deferred</code> promises API.
130 Depends on the "callbacks" module.
131 </td>
132 </tr>
133 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
134 <th><a href="src/callbacks.js#files">callbacks</a></th>
8457096 @mislav Document new deferreds modules
mislav authored
135 <td></td>
136 <td>
137 Provides <code>$.Callbacks</code> for use in "deferred" module.
138 </td>
139 </tr>
140 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
141 <th><a href="src/selector.js#files">selector</a></th>
f716bad @mislav experimental support for jQuery CSS pseudo-selectors
mislav authored
142 <td></td>
143 <td>
144 Experimental <a href="http://api.jquery.com/category/selectors/jquery-selector-extensions/">jQuery
145 CSS extensions</a> support for functionality such as <code>$('div:first')</code> and
146 <code>el.is(':visible')</code>.
147 </td>
148 </tr>
149 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
150 <th><a href="src/touch.js#files">touch</a></th>
f98cb5c @madrobby Remove touch from default distribution. Add "modules" rake task.
authored
151 <td></td>
ee3091b @madrobby Land experimental IE10 support in Zepto.
authored
152 <td>
153 Fires tap– and swipe–related events on touch devices. This works with both
154 `touch` (iOS, Android) and `pointer` events (Windows Phone).
155 </td>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
156 </tr>
157 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
158 <th><a href="src/gesture.js#files">gesture</a></th>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
159 <td></td>
160 <td>Fires pinch gesture events on touch devices</td>
161 </tr>
162 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
163 <th><a href="src/stack.js#files">stack</a></th>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
164 <td></td>
165 <td>Provides <code>andSelf</code> &amp; <code>end()</code> chaining methods</td>
166 </tr>
abe1c04 @madrobby Rename polyfill module to ios3 and remove from default distribution.
authored
167 <tr>
45a58ac @mislav Relative links to source files in README
mislav authored
168 <th><a href="src/ios3.js#files">ios3</a></th>
abe1c04 @madrobby Rename polyfill module to ios3 and remove from default distribution.
authored
169 <td></td>
170 <td>
ee3091b @madrobby Land experimental IE10 support in Zepto.
authored
171 String.prototype.trim and Array.prototype.reduce methods
abe1c04 @madrobby Rename polyfill module to ios3 and remove from default distribution.
authored
172 (if they are missing) for compatibility with iOS 3.x.
173 </td>
174 </tr>
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
175 </tbody>
176 </table>
177
178 ## Contributing
179
dfe1ada @madrobby Update README.md
authored
180 Please read our [contribution guidelines](https://github.com/madrobby/zepto/blob/master/CONTRIBUTING.md)
181 for information on how to contribute.
182
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
183 Get in touch:
184
185 * @[zeptojs](http://twitter.com/zeptojs)
186
9e9682a @mislav add docs about the docs
mislav authored
187 ### Write documentation
188
189 Zepto docs are written in Markdown and live in the ["gh-pages" branch][docs].
190 They are published on [zeptojs.com][].
191
192 You can use GitHub's web interface to make quick changes to documentation for
193 specific Zepto features
194 ([example: ajaxSettings](https://github.com/madrobby/zepto/blob/gh-pages/ajax/_posts/1900-01-01-Z-ajaxSettings.md)).
195 This will submit a pull request to us that we can review.
196
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
197 ### Report a bug
198
199 1. Check if the bug is already fixed in the [master branch][master] since the
200 last release.
201 2. Check [existing issues][issues]. Open a new one, including exact browser &
202 platform information. For better formatting of your report, see
203 [GitHub-flavored Markdown][mkd].
204
205 ### Running tests
206
ed7b86c @mislav rewrite build system in node
mislav authored
207 You will need to install [PhantomJS][]. On OS X, that's easy:
5f221a2 @mislav `rake test` runs tests with PhantomJS
mislav authored
208
209 ~~~ sh
ed7b86c @mislav rewrite build system in node
mislav authored
210 $ brew install phantomjs
4769efd @mislav make test server for proper Ajax tests
mislav authored
211 ~~~
212
fc72e1a @madrobby Update testing instructions in README
authored
213 To run the automated tests:
4769efd @mislav make test server for proper Ajax tests
mislav authored
214
215 ~~~ sh
ed7b86c @mislav rewrite build system in node
mislav authored
216 $ npm test
5f221a2 @mislav `rake test` runs tests with PhantomJS
mislav authored
217 ~~~
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
218
fc72e1a @madrobby Update testing instructions in README
authored
219 To run a test server, which you can hit with your browsers and devices:
220
221 ~~~ sh
222 $ npm start
223 ~~~
224
225 Go to `http://your-ip-address:3000/` on your browser and follow the
226 instructions. For your convenience test failures and exceptions will be
227 reported to the the console you started the test server in (as well as
228 the browser console if available).
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
229
9e9682a @mislav add docs about the docs
mislav authored
230 [zeptojs.com]: http://zeptojs.com
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
231 [master]: https://github.com/madrobby/zepto/commits/master
232 [issues]: https://github.com/madrobby/zepto/issues
9e9682a @mislav add docs about the docs
mislav authored
233 [docs]: https://github.com/madrobby/zepto/tree/gh-pages#readme
19895fa @mislav rewrite Readme to be more succinct & to the point
mislav authored
234 [mkd]: http://github.github.com/github-flavored-markdown/
235 [evidence.js]: https://github.com/tobie/Evidence
5f221a2 @mislav `rake test` runs tests with PhantomJS
mislav authored
236 [phantomjs]: http://code.google.com/p/phantomjs/wiki/Installation
Something went wrong with that request. Please try again.