jquery-turbolinks 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWZlNDExMDMwMjVjZTAzN2EwYTVhMWFjNzIxM2FjNjk0N2JkZDYzNQ==
4
+ NDE3OWQ1OGI0OWQ3N2UzMmIzZjZhZTQxMzAwZjYwMTQ0MDRhZjA3Mg==
5
5
  data.tar.gz: !binary |-
6
- ZDgzMzg4YmJiMGI2NGE1ODBhNjYzMDRiZjE5MWYzMGRmNmE4M2UwZQ==
6
+ NmI2MDgxMjYxNzEzZmZlYTBhMDRmMGE5ZjA2MGQ0ZDAxM2FhOWE0NQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDg3N2QzYmI2Y2I5MjBmNzEyMjAyNzgyZTg4NGRmN2E2NjU3MGIyYmUwNjk4
10
- NzA0ZjQ0ZmQ3ODEwZTcyNWJjYTlhZTkzNWIyNGE1MjA5MDg5MTdkOTgxMjk0
11
- NzFlNGQzZGY1MTQ5ZjQ5Y2MyODZhZDA3OTE1Y2RjNGQ0MDBlNzI=
9
+ NDlkZjA0ZDViMmFjMzkyZmVjNGZlMzNhMmI4ZjBmMjAwZWUwM2E2YzQ0YWU0
10
+ ZjMwNWE2NTk1NmQyOGM5Y2FjY2RlZjcyODc5ZTBkZDQwNmY3ZGFhYmQ2NGU4
11
+ MmYwNWQ3MmJjMzFiNDAzNDJhYTMxMDlkYzlmYzhkZWEzNmYwMjI=
12
12
  data.tar.gz: !binary |-
13
- MDk0NjQwZDk1NDgzODljMmRhYzJhNDNlMmQ3N2QwNDA0ODM1OWM5OTE5NzYz
14
- MGJhZDQ5NzE2NGRhNTAwMzA0ZDQ4YjdiNmViMmQwMzc1MDkwZDkzNmJjNDhh
15
- OGQ5MTg0YzYyODVhZDQxMDIyNzU0NzIyNTIzNDZmYzFkMWI4MTg=
13
+ OGFmMmU2MGJhNTI1MDQwNDM3YzJlNjk1OTQzY2Q1MDBjYWU3NmViYzMzNjYz
14
+ NWJlY2U4MjI3ZDNmZWQxZmNiMjY0NmViM2IwNWJkYjlhNmIyZGRhNDkzYzUz
15
+ ZjVhMDFmZDI3MzBlYTllYTlmNWI4YzhjM2ZkZmY2Y2E5N2M5NDI=
data/.travis.yml CHANGED
@@ -1,4 +1,2 @@
1
1
  language: node_js
2
- node_js:
3
- - 0.4
4
- - 0.6
2
+ node_js: ["0.10"]
data/README.md CHANGED
@@ -14,8 +14,8 @@ This project is a member of the [OSS Manifesto](http://ossmanifesto.org/).
14
14
 
15
15
  ## Important
16
16
 
17
- This readme points to the `master` version (v2.0.0) of jQuery Turbolinks. For
18
- older versions, see [v1.0.0rc2 README][oldreadme].
17
+ This readme points to the latest version (v2.x) of jQuery Turbolinks, which
18
+ features new 2.0 API. For older versions, see [v1.0.0rc2 README][oldreadme].
19
19
 
20
20
  ## Usage
21
21
 
@@ -78,43 +78,7 @@ $(document).on('click', 'button', function() { ... })
78
78
 
79
79
  This project uses [Semantic Versioning](http://semver.org/) for release numbering.
80
80
 
81
- ### 2.0.0 (unreleased - master)
82
-
83
- * Rewritten, smaller, with a completely new API. This deprecates the old
84
- `$.setFetchEvent` and `$.setReadyEvent` API.
85
-
86
- ### 1.0.0 (April 5, 2013)
87
-
88
- * Add uglified version.
89
-
90
- ### 1.0.0-rc2 (January 31, 2013)
91
-
92
- * Fix problem with 3rd-party libraries [#12](https://github.com/kossnocorp/jquery.turbolinks/issues/12), [#15](https://github.com/kossnocorp/jquery.turbolinks/issues/15) (kudos to [@rstacruz](https://github.com/rstacruz));
93
- * Reopen [#8](https://github.com/kossnocorp/jquery.turbolinks/issues/8).
94
-
95
- ### 1.0.0-rc1 (November 28, 2012)
96
-
97
- * Set $.isReady to false after `page:fetch` [#6](https://github.com/kossnocorp/jquery.turbolinks/issues/6);
98
- * add `$.setFetchEvent` function;
99
- * remove all delegated events after trigger fetch event [#8](https://github.com/kossnocorp/jquery.turbolinks/issues/8).
100
-
101
- ### 1.0.0-rc (November 8, 2012)
102
-
103
- * Add turbolinks as dependency (kudos to [@gbchaosmaster](https://github.com/gbchaosmaster));
104
- * run callback after adding to waiting list if `$.isReady` [#6](https://github.com/kossnocorp/jquery.turbolinks/issues/6).
105
-
106
- ### 0.2.1 (October 15, 2012)
107
-
108
- * Pass jQuery object to each callback [#4](https://github.com/kossnocorp/jquery.turbolinks/issues/4)
109
-
110
- ### 0.2.0 (October 10, 2012)
111
-
112
- * Change event: `page:change` -> `page:load` (kudos to [@davydotcom](https://github.com/davydotcom));
113
- * added ability to change ready event via `$.setReadyEvent`
114
-
115
- ### 0.1.0 (October 3, 2012)
116
-
117
- * First, initial release
81
+ For changelog notes, checkout [releases page](https://github.com/kossnocorp/jquery.turbolinks/releases).
118
82
 
119
83
  ## Contributors
120
84
 
@@ -1,3 +1,3 @@
1
1
  module JqueryTurbolinks
2
- VERSION = '2.0.0'
2
+ VERSION = '2.0.1'
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jquery.turbolinks",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "author": "Sasha Koss <kossnocorp@gmail.com>",
5
5
  "description": "jQuery plugin for drop-in fix binded events problem caused by Turbolinks",
6
6
 
@@ -21,11 +21,15 @@ describe '$ Turbolinks', ->
21
21
 
22
22
  callback1 = callback2 = null
23
23
 
24
+ # Simulate a reset.
25
+ beforeEach ->
26
+ $.turbo.isReady = false
27
+ $.turbo.use 'page:load', 'page:fetch'
28
+ $(document).off('turbo:ready')
29
+
24
30
  describe "DOM isn't ready", ->
25
31
 
26
32
  beforeEach ->
27
- $.turbo.isReady = false
28
-
29
33
  $(callback1 = sinon.spy())
30
34
  $(callback2 = sinon.spy())
31
35
 
@@ -39,6 +43,13 @@ describe '$ Turbolinks', ->
39
43
  callback1.should.have.been.calledOnce
40
44
  callback2.should.have.been.calledOnce
41
45
 
46
+ it 'should pass $ as the first argument to callbacks', (done) ->
47
+ $ ($$) ->
48
+ $$.fn.should.be.an.object
49
+ done()
50
+
51
+ $(document).trigger 'page:load'
52
+
42
53
  describe '$.turbo.use', ->
43
54
  beforeEach ->
44
55
  $.turbo.use('page:load', 'page:fetch')
@@ -93,3 +104,8 @@ describe '$ Turbolinks', ->
93
104
  $(document).trigger('page:load')
94
105
  $(callback2 = sinon.spy())
95
106
  callback2.should.have.been.calledOnce
107
+
108
+ it 'should pass $ as the first argument to callbacks', (done) ->
109
+ $ ($$) ->
110
+ $$.fn.should.be.an.object
111
+ done()
@@ -10,7 +10,7 @@ $ = window.jQuery or require?('jquery')
10
10
  $document = $(document)
11
11
 
12
12
  $.turbo =
13
- version: '2.0.0'
13
+ version: '2.0.1'
14
14
 
15
15
  isReady: false
16
16
 
@@ -22,8 +22,10 @@ $.turbo =
22
22
  .on("#{fetch}.turbo", @onFetch)
23
23
 
24
24
  addCallback: (callback) ->
25
- $document.on('turbo:ready', callback)
26
- callback($) if $.turbo.isReady
25
+ if $.turbo.isReady
26
+ callback($)
27
+ else
28
+ $document.on 'turbo:ready', -> callback($)
27
29
 
28
30
  onLoad: ->
29
31
  $.turbo.isReady = true
@@ -22,9 +22,12 @@ Copyright (c) 2012-2013 Sasha Koss & Rico Sta. Cruz
22
22
  return $document.off('.turbo').on("" + load + ".turbo", this.onLoad).on("" + fetch + ".turbo", this.onFetch);
23
23
  },
24
24
  addCallback: function(callback) {
25
- $document.on('turbo:ready', callback);
26
25
  if ($.turbo.isReady) {
27
26
  return callback($);
27
+ } else {
28
+ return $document.on('turbo:ready', function() {
29
+ return callback($);
30
+ });
28
31
  }
29
32
  },
30
33
  onLoad: function() {
@@ -1 +1 @@
1
- !function(){var r,o;r=window.jQuery||("function"==typeof require?require("jquery"):void 0),o=r(document),r.turbo={version:"2.0.0",isReady:!1,use:function(r,t){return o.off(".turbo").on(""+r+".turbo",this.onLoad).on(""+t+".turbo",this.onFetch)},addCallback:function(t){return o.on("turbo:ready",t),r.turbo.isReady?t(r):void 0},onLoad:function(){return r.turbo.isReady=!0,o.trigger("turbo:ready")},onFetch:function(){return r.turbo.isReady=!1},register:function(){return r(this.onLoad),r.fn.ready=this.addCallback}},r.turbo.register(),r.turbo.use("page:load","page:fetch")}.call(this);
1
+ !function(){var r,t;r=window.jQuery||("function"==typeof require?require("jquery"):void 0),t=r(document),r.turbo={version:"2.0.0",isReady:!1,use:function(r,o){return t.off(".turbo").on(""+r+".turbo",this.onLoad).on(""+o+".turbo",this.onFetch)},addCallback:function(o){return r.turbo.isReady?o(r):t.on("turbo:ready",function(){return o(r)})},onLoad:function(){return r.turbo.isReady=!0,t.trigger("turbo:ready")},onFetch:function(){return r.turbo.isReady=!1},register:function(){return r(this.onLoad),r.fn.ready=this.addCallback}},r.turbo.register(),r.turbo.use("page:load","page:fetch")}.call(this);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-turbolinks
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sasha Koss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-21 00:00:00.000000000 Z
11
+ date: 2013-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  prerelease: false