Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: madrobby/zepto
...
head fork: madrobby/zepto
Checking mergeability… Don't worry, you can still create the pull request.
Commits on Aug 03, 2011
@mislav mislav fix filter() and is() for elements without parentNode d24e26a
@mislav mislav fix anim() callback being executed in the context of element
fixes #250
dc5157e
Commits on Aug 05, 2011
@kossnocorp kossnocorp Added failing assertion for issue #209 b19bb98
@kossnocorp kossnocorp Allow to set timeout for ajax request (closes #209) 562d79d
@kossnocorp kossnocorp More assertions for #209 6ef94c0
@kossnocorp kossnocorp Added more info to $.ajax docs ecf9ff0
Commits on Aug 08, 2011
@kossnocorp kossnocorp Added failing assertion to keyframe animation start via $.fn.anim c2b3ea1
@kossnocorp kossnocorp Added ability to run keyframe animations via $.fn.anim 8e8f2ca
@zoz zoz trim whitespace from html fragment when using $("<xxx>...</xxx>") to …
…create dom element
b9ea32f
Commits on Aug 09, 2011
@kossnocorp kossnocorp Merge pull request #252 from zoz/master
Trim whitespace from html fragment when using $("<xxx>...</xxx>") to create dom element
c0f48ec
Commits on Aug 11, 2011
@kossnocorp kossnocorp Bundle Jasmine gem 14071a2
@kossnocorp kossnocorp Setup rake with bundler 41c24ee
@kossnocorp kossnocorp Bundle rake ebafc9d
@kossnocorp kossnocorp Init Jasmine a50f962
@kossnocorp kossnocorp Write example spec for ajax.js b3f6cfe
@kossnocorp kossnocorp Remove example jasmine's files 197a072
@kossnocorp kossnocorp Install mock-ajax.js 2e61314
@kossnocorp kossnocorp Write adaptation for Zepto in mock-ajax.js 47e7a7f
@kossnocorp kossnocorp Allow to specify xhr transport fd81b81
@kossnocorp kossnocorp Fix typo in mock-ajax helper 0cee6ae
@kossnocorp kossnocorp Make mock-ajax for Zepto finally works 21976ef
@kossnocorp kossnocorp Allow to specify xhr transport 9162a1d
Commits on Aug 12, 2011
@kossnocorp kossnocorp Basic examples for all ajax functions 04af6bc
Commits on Aug 15, 2011
Ross Hale Fixing rails compatibility in ajax requests with mimetype 'applicatio…
…n/json' that return an empty body (as in "head :ok")
a822d60
@kossnocorp kossnocorp Use proper animation end event f683448
@madrobby Merge pull request #256 from SocialStay/zepto
---

In Rails, specifying "head :ok" or "render => :nothing" returns a single space instead of an empty string in the response body.  This commit checks xhr.responseText against the single space case.  Tests included!
9709c35
@madrobby merge #256 and adapt test condition 28a9087
Commits on Aug 17, 2011
@kossnocorp kossnocorp Failing assertion for #258 c354f88
@kossnocorp kossnocorp Fix issue #258 0362528
@kossnocorp kossnocorp Added failing assertions for pull request #257 d4128b8
@arextar arextar Added special initialization of mouse events 406bd31
@kossnocorp kossnocorp Rename special_events to specialEvents fba76a0
@kossnocorp kossnocorp Fixed assertion for #257 594f22a
@kossnocorp kossnocorp Fix code style of specialEvents defenition e0fd490
Commits on Sep 01, 2011
@mislav mislav fix `return false` cancels event even in delegated handlers 2a7af98
@mislav mislav refactor $.param() so it also accepts data from serializeArray() 9e42ee4
@mislav mislav enable checking `event.defaultPrevented` after trigger()
This enables us to create a custom event object, trigger it and check
if any of its handlers cancelled it. Essential stuff.

WebKit implements `defaultPrevented` but in Firefox it's missing.
45e3271
Commits on Sep 02, 2011
@mislav mislav refactor attr() to support empty attributes and more input field types
Changes:
 - for empty attributes (e.g. `<div data-empty>`) it now returns an empty string
 - for non-existent attributes it now returns null instead of undefined
 - attr('value') now uses the `value` property directly for all input
   types, not just `<input type="text">`
ca85920
@mislav mislav val(value) now accepts a function argument 1f90bcb
@romac romac add-on with a new $.fn.data() method which can store non-scalar values 285471b
@mislav mislav simplify Readme docs for the basic data() method 2cfd0f0
@mislav mislav improve extended data() functionality
Changes:
 - original data() method isn't publicly accessible as dataAttr() anymore
 - the setter method never writes to the "data-*" DOM attribute,
   not even for scalar values
 - the setter method now affects every element in the collection
 - the setter method now accepts function argument for value
 - fixes the getter method in case of empty collection
0085682
@mislav mislav fix data() setter; data() getter w/out arguments returns all data 4305a2d
@mislav mislav `rake concat` now accepts arguments to modify which components get in…
…cluded

Arguments are a colon-separated list of component names. If a name
starts with a minus sign ("-"), that component will be excluded.

Example use:

  rake concat                # default distribution
  rake concat[data:gesture]  # include "data" and "gesture" components
  rake concat[assets:-fx]    # include "assets" but exclude "fx"
5786e6e
Commits on Sep 03, 2011
@arextar arextar Implemented .andSelf cec28ca
@kossnocorp kossnocorp Added failing assertion for #262 6cd3cbf
@kossnocorp kossnocorp Merge branch 'arexkun-master' e85cb7e
@kossnocorp kossnocorp Added $.ajaxSettings specs a51f876
@kossnocorp kossnocorp Added basic $.ajax specs a8cc48f
@kossnocorp kossnocorp Specs for $.ajax callbacks 777126b
@kossnocorp kossnocorp Added specs for $.get aeb6680
@kossnocorp kossnocorp Bundle jasmine-headless-webkit gem bbf0c2f
@kossnocorp kossnocorp jasmine-headless-webkit won't work without setting options in jasmine…
….yml
a330528
@kossnocorp kossnocorp Clean up jasmine.yml file 4edac6f
@kossnocorp kossnocorp Specs now works in browser and headless-webkit f47e446
@kossnocorp kossnocorp Fix bug in minified version, thanks for @ranbena (closes #164) a6bf149
Commits on Sep 04, 2011
@cmelion cmelion correct Ajax timeout behavior
Before the Ajax timeout behavior was this:
 - wait "timeout" ms;
 - check the results of the beforeSend method;
 - abort if the result is false, otherwise send.

The end result was that the request is simply delayed for "timeout" ms.
This is behavior is useless.

Now the timeout behavior is:
  - send the Ajax request right away;
  - if it finishes before timeout, nothing special happens;
  - if "timeout" ms passes before the request has finished,
    cancel the request, call the "error" handler and ensure
    that no further ajax callbacks get called.

Properly fixes #209, closes #253
41e6999
@mislav mislav refactor Ajax sending with regard to timeout f1ef348
@mislav mislav improve $.param(), add support for "traditional" (shallow) mode
The second argument to $.param() is now a boolean that activates
"traditional" serialization, i.e. without brackets for array keys:

  $.param({ a:[1,2,3] }, true)  //=> "a=1&a=2&a=3"

The refactored method now also supports objects nested inside arrays
when in normal (recursive) serialization mode.

Closes #208
1812477
@ranbena ranbena add abort() functionality for $.ajaxJSONP db82675
@mislav mislav ensure $.get(), $.post(), $.getJSON() all return xhr objects e7bc9fe
@mislav mislav test ajax timeout behavior 6b7f9ad
@mislav mislav refactor JSONP fetching; ensure that <script> elements are cleaned up 0b183b2
@mislav mislav support "timeout" setting for JSONP b53c104
Commits on Sep 05, 2011
@mislav mislav fix functionality of slightly outdated examples 87bd885
@LinusU LinusU add "context" option to $.ajax
"context" is the scope in which all Ajax callbacks will be executed.
The default is null, which means default context is the window object.
9b55901
Commits on Sep 08, 2011
@fauxparse fauxparse fix 2nd argument to toggleClass(name, bool)
The boolean parameter indicates whether the class should be added or removed.
3796abf
@mislav mislav performance boost for $.qsa(), Zepto's main query function
Uses regexes to test whether one of the following is more appropriate:
 - getElementById
 - getElementsByTagName
 - getElementsByClassName

Performance was tested doing various queries on a page with a large
number of nested elements.

Measured overall performance improvement:
 - iOS (iPhone 3Gs): 17%
 - Safari:           33%
 - Chrome:           38%
 - Firefox:          96%

Closes #180
85d9238
Commits on Sep 10, 2011
@mislav mislav fix delegate(), one() handlers receiving multiple data arguments
Refactor delegate() & one() to fix how they forward data arguments to
the event handler they are wrapping.

Also fixes `return false` in one().
9610403
@mislav mislav ensure that event test handlers are unbinded after each test
This required grouping events test together in a separate test case,
resulting in a massive diff.
835a194
@mislav mislav event methods now support event names & handlers passed as an object
Example:
  $(document.body).bind({
    click: function(e) { ... },
    keypress: function(e) { ... }
  })

Closes #199
06609ad
Commits on Sep 11, 2011
@mislav mislav retouch test suites, display the test run outcome on the page
Also looks decent on mobile
1292b3e
@mislav mislav fix accidental globals d961e2c
Commits on Sep 13, 2011
@mislav mislav fix $.Event(type, {bubbles:false}) cross-browser
Opera doesn't allow event.bubbles to be set directly as a property.
556b401
@mislav mislav fix checking of leaked globals in Opera
In Opera, every DOM element with an ID has window[id] pointing to id.
Ignore this; don't treat them as global variables.
e6ecfbb
@mislav mislav tweak detect.js implementation and improve tests d76c4ae
@aglemann aglemann add $.fn.insertBefore() & insertAfter()
insertBefore and insertAfter are inverse operators of before() and
after()
55ace7b
@aglemann aglemann slim down replaceWith() 4b85e47
Commits on Sep 19, 2011
@mislav mislav improve $.fn.width() & height() to work on window & document objects 1edbad5
@mislav mislav enable $.fn.anim() in Firefox, Opera, and IE 069569b
Commits on Sep 20, 2011
@mislav mislav implemented animated show(), hide(), fadeIn/Out methods in an add-on
Overloads show(), hide() and toggle() to be optionally animated.
Adds fadeIn(), fadeOut(), fadeToggle() and fadeTo() methods.

Uses scale3d transform on browsers that support it.

Closes #264
461a62c
@mislav mislav fadeOut() sets "display:none" on element upon completion 23907bb
@mislav mislav fix `return false` in delegate event handlers
This was a regression in 9610403
95d2748
@mislav mislav improve $(document).ready(), pass Zepto as 1st argument to handlers
Now it also fires immediately during "interactive" state.

Closes #159, closes #278
089f788
Commits on Oct 09, 2011
@kertal kertal remove duplicate ID in iphone example 10ff6a7
Ross Hale replaceWith, wrap, before, after: make all of them noop on fragments
Nodes in a fragment have no parent so these operations aren't possible.
Making them a noop ensures they don't error out.
3b280fd
@mislav mislav add tests for before() & after() behavior on fragments 96681a7
@mislav mislav unified event handling with fn.on() & off()
Usage:
  $('el').on(event, handler)
  $(document).on(event, selector, handler)

Matches jQuery 1.7 API.

Closes #286
e8d04b9
Commits on Oct 15, 2011
@Messiahs Messiahs Change viewport (from seperator ; to ,) 640b321
@madrobby Merge pull request #290 from Messiahs/patch-1
Change viewport (from seperator ; to ,)
a1f0dad
Commits on Oct 17, 2011
@fgnass fgnass Fix: Support insertion of CharacterData nodes
The original test for arrays yields false positives, since CharacterData elements also have a length property. Hence $('body').append(document.createTextNode('foo')) throws a TypeError.
89c03de
Commits on Oct 20, 2011
@arextar arextar Modify adjacency operators so the content of a script node is evaluat…
…ed only if it has no type attribute or the type attribute is 'text/javascript'
7e3a2f0
@arextar arextar Add tests for preventing the evaluation of non-javascript script elem…
…ents
7a85952
Commits on Oct 25, 2011
@kossnocorp kossnocorp Merge branch 'master' into jasmine
Conflicts:
	src/ajax.js
b5a7371
@kossnocorp kossnocorp Rewrite README in markdown (source now highlighted) 29173b0
@kossnocorp kossnocorp Merge branch 'jasmine' 9776d8b
@jocafa jocafa Added 'name' variable to line 9 to prevent global variable leak on li…
…ne 198: "for (name in settings.headers)..."
e960ae0
Commits on Oct 26, 2011
@kossnocorp kossnocorp Merge pull request #296 from jocafa/master
The variable "name" is being leaked into the global scope.
9e97371
@kossnocorp kossnocorp Merge pull request #294 from arexkun/master
Fix for #293
60f87bf
@kossnocorp kossnocorp Merge pull request #291 from fgnass/fix_insert_text_nodes
Fix: Support insertion of CharacterData nodes
9c68344
Commits on Oct 27, 2011
@kossnocorp kossnocorp Export Zepto variable to global scope (closes #297) ef686f3
Commits on Oct 30, 2011
@mislav mislav add "global" Ajax events as well as an extra "ajaxBeforeSend" event
"Global" events aren't really global because Zepto doesn't support them
yet. Instead they are simply fired on `document`.

Ajax lifecycle is now:
  1. ajaxStart (global) – only fired if there are no active requests
  2. beforeSend callback (cancellable)
  3. ajaxBeforeSend (global, cancellable)
  4. ajaxSend (global)
  5. success/error callback
  6. ajaxSuccess/ajaxError (global)
  7. complete callback
  8. ajaxComplete (global)
  9. ajaxStop (global) – only fired if this is the last active request

Also added:
  - $.active (0) – number of active requests
  - $.ajaxSettings.global (true) – whether global events will fire

If Ajax "context" element is given, "global" events are fired on this
element instead of `document` and they bubble.
c22ca59
@mislav mislav fix jasmine YAML config 6cfd096
@mislav mislav fix jasmine Ajax spec 71f0130
Commits on Oct 31, 2011
@mislav mislav `rake test` runs existing browser tests in headless WebKit b5fe339
@mislav mislav make `rake test` also run jasmine specs 376c519
@mislav mislav improve form serialization
Changes:
 - ignore disabled elements
 - ignore buttons ("submit", "reset", "button")
90b5ec3
@mislav mislav don't force jasmine-headless-webkit on everyone d284ed0
@mislav mislav shorter default timeout for tests run in headless webkit 3dcdb20
@mislav mislav downgrade some test runner info statements to debug level a9d554d
@mislav mislav more solid async Ajax tests
Be careful that callbacks/events for one Ajax request don't occur after
the test case where it originated already finished.
49af32b
@mislav mislav don't set X-Requested-With header for cross-domain Ajax
Closes #300
af24a70
@mislav mislav fix turning off global Ajax events 0e0245f
Commits on Nov 03, 2011
@mislav mislav make first() & last() useful for non-DOM collections
Example:
  $(['a', 'b']).last()  //=> 'b'

Closes #298
9a4be0d
@mislav mislav treat status=0 as Ajax error unless over "file:" protocol
Closes #283
75a759d
宇蠢Yuest use window.pageXOffset/pageYOffset instead of body.scrollLeft/scrollTop
iPhone 3 with iOS 4.1 support
eb83019
@tstachl tstachl assets.js remove() override: check if node has a parent 7fe2438
@mislav mislav remove unnecessary $(document).ready() in gesture.js
References #303
c255813
@mislav mislav $.fx.off is automatically true when no CSS transitions support 6e26ef1
@mislav mislav change default transition duration from 0.5s to 0.4s 699ab98
@mislav mislav add a compatible $.fn.animate() method
Difference between animate() and anim():
 - animate() receives duration in milliseconds instead of seconds
 - animate() can receive an parameter hash as 2nd argument with keys:
   "duration", "easing", "complete"

anim() is now informally deprecated.
dabc5af
@mislav mislav add note about supported browsers in README 08d2ecf
@mislav mislav minor README tweaks af5410c
@mislav mislav fix package task 6eba304
@mislav mislav release v0.8 984dcfe