├── .gitignore
├── .npmignore
├── .travis.yml
├── CONTRIBUTING.md
├── MIT-LICENSE
├── README.md
├── examples
├── anim.html
├── iphone
│ ├── index.html
│ └── iphone.css
├── load_jquery_on_ie.html
├── snow
│ └── index.html
└── touch_events.html
├── make
├── package-lock.json
├── package.json
├── script
├── bootstrap
├── guard
├── lint
└── test
├── src
├── ajax.js
├── amd_layout.js
├── assets.js
├── callbacks.js
├── data.js
├── deferred.js
├── detect.js
├── event.js
├── form.js
├── fx.js
├── fx_methods.js
├── gesture.js
├── ie.js
├── ios3.js
├── selector.js
├── stack.js
├── touch.js
└── zepto.js
├── test
├── ajax.html
├── ajax_deferred.html
├── callbacks.html
├── data.html
├── deferred.html
├── detect.html
├── event.html
├── evidence_runner.js
├── fixtures
│ ├── ajax_load_javascript.js
│ ├── ajax_load_selector.html
│ ├── ajax_load_selector_javascript.html
│ ├── ajax_load_simple.html
│ ├── iframe_document.html
│ └── zepto.json
├── form.html
├── functional
│ ├── assets.html
│ ├── fx.html
│ ├── gesture.html
│ ├── touch.html
│ └── touchcancel.html
├── fx.html
├── ie.html
├── index.html
├── ios3.html
├── runner.js
├── selector.html
├── server.coffee
├── stack.html
├── test.css
├── touch.html
└── zepto.html
└── vendor
└── evidence.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | dist/
3 | dist/zepto.min.js
4 | dist/zepto.js
5 | pkg
6 | *.swp
7 | docs/*
8 | .jhw-cache
9 | .rbenv-version
10 | public
11 | node_modules
12 | temp/
13 | npm-debug.log
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | *
2 | !README.md
3 | !MIT-LICENSE
4 | !dist/zepto.js
5 | !dist/zepto.min.js
6 | !src/*.js
7 | src/amd_layout.js
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 |
3 | node_js: '0.10'
4 |
5 | sudo: false
6 |
7 | script: script/test
8 |
9 | notifications:
10 | campfire:
11 | template: '%{message} [%{branch}] %{repository}/%{commit} %{author} %{build_url}'
12 | rooms:
13 | secure: VR6rWk0YhezBWnD8jPjSD8h/Q83S3NT0F34Au1vswt+/+Ku19S8X44vGVUG+NYdYyhg7uOqUaPN1Jr3KCpdcXgHEpUYiyBGJ8ebltavcjeHYWqK6ghcqgSnbDkifuC7Eu/9LcrOMOXgt+zkXjiVXW3+zyGVDcrs4cQ2vGY2DTYA=
14 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing to Zepto
2 |
3 | **Thanks for helping out!**
4 |
5 | In order for your code to make it in, several conditions must be met:
6 |
7 | * It's more likely your pull request will make it in if you adhere to **Zepto's
8 | project goals**. Be sure to read the README in its entirety before setting out
9 | to code.
10 | * Please talk to the maintainers (@madrobby and @mislav) first if you want
11 | to write a plugin, those are better kept in their own repositories.
12 | * Fix only ONE thing or have only ONE feature in your pull request.
13 | If you have multiple unrelated code updates, please submit a separate pull request for each one.
14 | * **Your pull request must be written in English and be accompanied by a
15 | detailed description**, ideally something we can use as documentation.
16 | If you're not fluent in English, try your best and let us know so we'll help!
17 | * Changes to jQuery-based API methods **must match their jQuery counterparts**.
18 | * Please **do not just copy code from jQuery**. Zepto strives for API compatibility,
19 | but has different goals for code style and size and target platforms.
20 | In case you do copy code, you must clearly indicate the origin of the code, and
21 | which license applies to it. However, it is likely your patch will be denied.
22 | * **All code must have tests, and all tests must pass.** See the README on running the test suite.
23 | * Please **also test manually** on as many target platforms you have access to,
24 | but at least on latest Chrome (desktop) and Firefox (desktop).
25 | See http://zeptojs.com for a full list of platforms.
26 | * It's required that you follow Zepto's **code style guidelines** (see below)
27 |
28 | Whew, now that we have that out of the way thanks again!
29 |
30 | ## Code style guidelines
31 |
32 | * Two spaces "soft tabs" indentation
33 | * Remove any trailing whitespace from the end of lines
34 | * `function name() { }` for named functions
35 | * `function(){ }` for anonymous functions
36 | * No curly braces for single-line control flow statements such as `if` & friends
37 | * Don't write [semicolons that are optional][optional]
38 | * Put a single semicolon _before_ statements that start with `(` or `[`
39 | (see above article as for why it's needed)
40 | * Use long, descriptive variable and method names
41 | * Use blank lines to separate "paragraphs" of code for readability
42 | * Use comments to describe non-obvious code behavior
43 |
44 |
45 | [optional]: http://mislav.uniqpath.com/2010/05/semicolons/
46 |
--------------------------------------------------------------------------------
/MIT-LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010-2019 Thomas Fuchs
2 | http://zeptojs.com/
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Zepto.js – a minimalist JavaScript library
2 |
3 | Zepto is a minimalist JavaScript library for modern browsers with a
4 | largely jQuery-compatible API. If you use jQuery, you already know how to use Zepto.
5 |
6 | See [zeptojs.com][] for an extended introduction, downloads
7 | and documentation.
8 |
9 | Zepto.js is licensed under the terms of the MIT License.
10 |
11 | Want to give us money or a tip? Don't.
12 | Instead please donate to [charity: water](http://charitywater.org/).
13 |
14 | ## Building
15 |
16 | [](http://travis-ci.org/madrobby/zepto)
17 |
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
21 | size at a minimum. That's when you need to check out Zepto's source code and use
22 | the build commands.
23 |
24 | You will need Node.js installed on your system.
25 |
26 | ~~~ sh
27 | $ npm install
28 | $ npm run-script dist
29 |
30 | # do a custom build
31 | $ MODULES="zepto event data" npm run-script dist
32 |
33 | # on Windows
34 | c:\zepto> SET MODULES=zepto event data
35 | c:\zepto> npm run-script dist
36 | ~~~
37 |
38 | The resulting files are:
39 |
40 | 1. `dist/zepto.js`
41 | 2. `dist/zepto.min.js`
42 |
43 | If you install CoffeeScript globally, you can run `make` directly:
44 |
45 | ~~~ sh
46 | # one-time operation
47 | $ npm install coffee-script --global
48 |
49 | $ coffee make dist
50 | $ MODULES="zepto event data ..." ./make dist
51 |
52 | # on Windows
53 | c:\zepto> SET MODULES=zepto event data
54 | c:\zepto> coffee make dist
55 | ~~~
56 |
57 | ## Zepto modules
58 |
59 | Zepto modules are individual files in the "src/" directory.
60 |
61 |
153 | Fires tap– and swipe–related events on touch devices. This works with both
154 | `touch` (iOS, Android) and `pointer` events (Windows Phone).
155 |
171 | String.prototype.trim and Array.prototype.reduce methods
172 | (if they are missing) for compatibility with iOS 3.x.
173 |
174 |
175 |
176 |
177 |
178 | ## Contributing
179 |
180 | Please read our [contribution guidelines](https://github.com/madrobby/zepto/blob/master/CONTRIBUTING.md)
181 | for information on how to contribute.
182 |
183 | Get in touch:
184 |
185 | * @[zeptojs](http://twitter.com/zeptojs)
186 |
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][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 |
197 | ### Report a bug
198 |
199 | 1. Check if the bug is already fixed in the master branch since the last release.
200 | 2. Check [existing issues][issues]. Open a new one, including exact browser &
201 | platform information. For better formatting of your report, see
202 | [GitHub-flavored Markdown][mkd].
203 |
204 | ### Running tests
205 |
206 | You will need to install [PhantomJS][phantomjs]. On OS X, that's easy:
207 |
208 | ~~~ sh
209 | $ brew install phantomjs
210 | ~~~
211 |
212 | To run the automated tests:
213 |
214 | ~~~ sh
215 | $ npm test
216 | ~~~
217 |
218 | To run a test server, which you can hit with your browsers and devices:
219 |
220 | ~~~ sh
221 | $ npm start
222 | ~~~
223 |
224 | Go to `http://your-ip-address:3000/` on your browser and follow the
225 | instructions. For your convenience test failures and exceptions will be
226 | reported to the the console you started the test server in (as well as
227 | the browser console if available).
228 |
229 | [zeptojs.com]: http://zeptojs.com
230 | [issues]: https://github.com/madrobby/zepto/issues
231 | [docs]: https://github.com/madrobby/zepto/tree/gh-pages#readme
232 | [mkd]: https://help.github.com/articles/creating-and-highlighting-code-blocks/
233 | [evidence.js]: https://github.com/tobie/Evidence
234 | [phantomjs]: http://phantomjs.org/download.html
235 |
--------------------------------------------------------------------------------
/examples/anim.html:
--------------------------------------------------------------------------------
1 |