Repository: madrobby/zepto
Branch: main
Commit: e1ecb3d70b2a
Files: 68
Total size: 442.4 KB
Directory structure:
gitextract_k6qzt7fr/
├── .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.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
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.DS_Store
dist/
dist/zepto.min.js
dist/zepto.js
pkg
*.swp
docs/*
.jhw-cache
.rbenv-version
public
node_modules
temp/
npm-debug.log
================================================
FILE: .npmignore
================================================
*
!README.md
!MIT-LICENSE
!dist/zepto.js
!dist/zepto.min.js
!src/*.js
src/amd_layout.js
================================================
FILE: .travis.yml
================================================
language: node_js
node_js: '0.10'
sudo: false
script: script/test
notifications:
campfire:
template: '%{message} [%{branch}] %{repository}/%{commit} %{author} %{build_url}'
rooms:
secure: VR6rWk0YhezBWnD8jPjSD8h/Q83S3NT0F34Au1vswt+/+Ku19S8X44vGVUG+NYdYyhg7uOqUaPN1Jr3KCpdcXgHEpUYiyBGJ8ebltavcjeHYWqK6ghcqgSnbDkifuC7Eu/9LcrOMOXgt+zkXjiVXW3+zyGVDcrs4cQ2vGY2DTYA=
================================================
FILE: CONTRIBUTING.md
================================================
## Contributing to Zepto
**Thanks for helping out!**
In order for your code to make it in, several conditions must be met:
* It's more likely your pull request will make it in if you adhere to **Zepto's
project goals**. Be sure to read the README in its entirety before setting out
to code.
* Please talk to the maintainers (@madrobby and @mislav) first if you want
to write a plugin, those are better kept in their own repositories.
* Fix only ONE thing or have only ONE feature in your pull request.
If you have multiple unrelated code updates, please submit a separate pull request for each one.
* **Your pull request must be written in English and be accompanied by a
detailed description**, ideally something we can use as documentation.
If you're not fluent in English, try your best and let us know so we'll help!
* Changes to jQuery-based API methods **must match their jQuery counterparts**.
* Please **do not just copy code from jQuery**. Zepto strives for API compatibility,
but has different goals for code style and size and target platforms.
In case you do copy code, you must clearly indicate the origin of the code, and
which license applies to it. However, it is likely your patch will be denied.
* **All code must have tests, and all tests must pass.** See the README on running the test suite.
* Please **also test manually** on as many target platforms you have access to,
but at least on latest Chrome (desktop) and Firefox (desktop).
See http://zeptojs.com for a full list of platforms.
* It's required that you follow Zepto's **code style guidelines** (see below)
Whew, now that we have that out of the way thanks again!
## Code style guidelines
* Two spaces "soft tabs" indentation
* Remove any trailing whitespace from the end of lines
* `function name() { }` for named functions
* `function(){ }` for anonymous functions
* No curly braces for single-line control flow statements such as `if` & friends
* Don't write [semicolons that are optional][optional]
* Put a single semicolon _before_ statements that start with `(` or `[`
(see above article as for why it's needed)
* Use long, descriptive variable and method names
* Use blank lines to separate "paragraphs" of code for readability
* Use comments to describe non-obvious code behavior
[optional]: http://mislav.uniqpath.com/2010/05/semicolons/
================================================
FILE: MIT-LICENSE
================================================
Copyright (c) 2010-2025 Thomas Fuchs
http://zeptojs.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
# Zepto.js – a minimalist JavaScript library
Zepto is a minimalist JavaScript library for modern browsers with a
largely jQuery-compatible API. If you use jQuery, you already know how to use Zepto.
See [zeptojs.com][] for an extended introduction, downloads
and documentation.
Zepto.js is licensed under the terms of the MIT License.
Want to give us money or a tip? Don't.
Instead please donate to [charity: water](http://charitywater.org/).
## Building
[](http://travis-ci.org/madrobby/zepto)
The official site offers a download of the default distribution of Zepto. This
is good for starting out. However, at some point you might want to add some
optional modules and remove some of the default ones you don't need, to keep the
size at a minimum. That's when you need to check out Zepto's source code and use
the build commands.
You will need Node.js installed on your system.
~~~ sh
$ npm install
$ npm run-script dist
# do a custom build
$ MODULES="zepto event data" npm run-script dist
# on Windows
c:\zepto> SET MODULES=zepto event data
c:\zepto> npm run-script dist
~~~
The resulting files are:
1. `dist/zepto.js`
2. `dist/zepto.min.js`
If you install CoffeeScript globally, you can run `make` directly:
~~~ sh
# one-time operation
$ npm install coffee-script --global
$ coffee make dist
$ MODULES="zepto event data ..." ./make dist
# on Windows
c:\zepto> SET MODULES=zepto event data
c:\zepto> coffee make dist
~~~
## Zepto modules
Zepto modules are individual files in the "src/" directory.
String.prototype.trim and Array.prototype.reduce methods
(if they are missing) for compatibility with iOS 3.x.
## Contributing
Please read our [contribution guidelines](https://github.com/madrobby/zepto/blob/master/CONTRIBUTING.md)
for information on how to contribute.
Get in touch:
* @[zeptojs](http://twitter.com/zeptojs)
### Write documentation
Zepto docs are written in Markdown and live in the ["gh-pages" branch][docs].
They are published on [zeptojs.com][zeptojs.com].
You can use GitHub's web interface to make quick changes to documentation for
specific Zepto features
([example: ajaxSettings](https://github.com/madrobby/zepto/blob/gh-pages/ajax/_posts/1900-01-01-Z-ajaxSettings.md)).
This will submit a pull request to us that we can review.
### Report a bug
1. Check if the bug is already fixed in the master branch since the last release.
2. Check [existing issues][issues]. Open a new one, including exact browser &
platform information. For better formatting of your report, see
[GitHub-flavored Markdown][mkd].
### Running tests
You will need to install [PhantomJS][phantomjs]. On OS X, that's easy:
~~~ sh
$ brew install phantomjs
~~~
To run the automated tests:
~~~ sh
$ npm test
~~~
To run a test server, which you can hit with your browsers and devices:
~~~ sh
$ npm start
~~~
Go to `http://your-ip-address:3000/` on your browser and follow the
instructions. For your convenience test failures and exceptions will be
reported to the the console you started the test server in (as well as
the browser console if available).
[zeptojs.com]: http://zeptojs.com
[issues]: https://github.com/madrobby/zepto/issues
[docs]: https://github.com/madrobby/zepto/tree/gh-pages#readme
[mkd]: https://help.github.com/articles/creating-and-highlighting-code-blocks/
[evidence.js]: https://github.com/tobie/Evidence
[phantomjs]: http://phantomjs.org/download.html
================================================
FILE: examples/anim.html
================================================
================================================
FILE: examples/snow/index.html
================================================
Let it snow with Zepto.jsTweet
================================================
FILE: examples/touch_events.html
================================================