jquery-turbolinks 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +6 -14
- data/NOTES.md +11 -5
- data/README.md +19 -0
- data/Rakefile +4 -32
- data/lib/jquery-turbolinks/version.rb +1 -1
- data/package.json +3 -3
- data/src/jquery.turbolinks.coffee +1 -1
- data/vendor/assets/javascripts/jquery.turbolinks.js +4 -4
- data/vendor/assets/javascripts/jquery.turbolinks.min.js +1 -1
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
NDlkZjA0ZDViMmFjMzkyZmVjNGZlMzNhMmI4ZjBmMjAwZWUwM2E2YzQ0YWU0
|
10
|
-
ZjMwNWE2NTk1NmQyOGM5Y2FjY2RlZjcyODc5ZTBkZDQwNmY3ZGFhYmQ2NGU4
|
11
|
-
MmYwNWQ3MmJjMzFiNDAzNDJhYTMxMDlkYzlmYzhkZWEzNmYwMjI=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OGFmMmU2MGJhNTI1MDQwNDM3YzJlNjk1OTQzY2Q1MDBjYWU3NmViYzMzNjYz
|
14
|
-
NWJlY2U4MjI3ZDNmZWQxZmNiMjY0NmViM2IwNWJkYjlhNmIyZGRhNDkzYzUz
|
15
|
-
ZjVhMDFmZDI3MzBlYTllYTlmNWI4YzhjM2ZkZmY2Y2E5N2M5NDI=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 884dfb21c89689dab011a84b205bed4f3e10819d
|
4
|
+
data.tar.gz: 20933764a2bd7e355ce3b1427c47277cefa01295
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1e6a33f7177118c27c86d32235fcf4330d5e6590beabe13e37dfbe3acf292b7240b42f8b0536ee03453b9712d030d5c06737aed43af6c0186acbd7a778709417
|
7
|
+
data.tar.gz: 6147215131b2eb1f26020feebc678fdeeaf081253c7370d821de15ef315af093a75f5c956bed083d5b3a054348cef89664ab829327caf2d6a5d6866b7471af76
|
data/NOTES.md
CHANGED
@@ -12,9 +12,10 @@ Edit the following files:
|
|
12
12
|
Updating .js files
|
13
13
|
------------------
|
14
14
|
|
15
|
-
Update the .js files from the source CoffeeScript file using:
|
15
|
+
Update the .js files from the source CoffeeScript file using: (do this before
|
16
|
+
releasing)
|
16
17
|
|
17
|
-
$ rake
|
18
|
+
$ rake build
|
18
19
|
|
19
20
|
Testing
|
20
21
|
-------
|
@@ -28,9 +29,14 @@ Or:
|
|
28
29
|
|
29
30
|
$ rake test
|
30
31
|
|
31
|
-
Releasing
|
32
|
-
|
32
|
+
Releasing new versions
|
33
|
+
----------------------
|
34
|
+
|
35
|
+
* Bump version (see above)
|
36
|
+
* Build .js (`rake build`)
|
37
|
+
* Release into npm and rubygems (`rake release`)
|
38
|
+
* Draft release in https://github.com/kossnocorp/jquery.turbolinks/releases
|
33
39
|
|
34
40
|
Release it into npm/rubygems using:
|
35
41
|
|
36
|
-
$ rake release
|
42
|
+
$ rake release:all
|
data/README.md
CHANGED
@@ -30,6 +30,7 @@ Add it to your JavaScript manifest file, in this order:
|
|
30
30
|
``` js
|
31
31
|
//= require jquery
|
32
32
|
//= require jquery.turbolinks
|
33
|
+
//= require jquery_ujs
|
33
34
|
//
|
34
35
|
// ... your other scripts here ...
|
35
36
|
//
|
@@ -56,6 +57,24 @@ either `true` or `false` depending on whether the page is loading.
|
|
56
57
|
|
57
58
|
## Troubleshooting
|
58
59
|
|
60
|
+
### Zurb Foundation
|
61
|
+
|
62
|
+
The `$(function(){ $(document).foundation(); });` has to come before the
|
63
|
+
turbolinks gem.
|
64
|
+
|
65
|
+
``` js
|
66
|
+
//= require jquery
|
67
|
+
//= require jquery.turbolinks
|
68
|
+
//= require jquery_ujs
|
69
|
+
//
|
70
|
+
// ... your other scripts here ...
|
71
|
+
|
72
|
+
$(function(){ $(document).foundation(); });
|
73
|
+
|
74
|
+
//
|
75
|
+
//= require turbolinks
|
76
|
+
```
|
77
|
+
|
59
78
|
### Events firing twice or more
|
60
79
|
|
61
80
|
If you find that some events are being fired multiple times after using jQuery Turbolinks, you may have been binding your `document` events inside a `$(function())` block. For instance, this example below can be a common occurrence and should be avoided:
|
data/Rakefile
CHANGED
@@ -21,6 +21,9 @@ namespace :release do
|
|
21
21
|
task all: [:gem, :npm]
|
22
22
|
end
|
23
23
|
|
24
|
+
desc 'Rebuilds and compresses'
|
25
|
+
task :build => %w[js:build js:uglify]
|
26
|
+
|
24
27
|
namespace :js do
|
25
28
|
|
26
29
|
desc 'Build JavaScript from CoffeeScript source code'
|
@@ -61,36 +64,5 @@ namespace :js do
|
|
61
64
|
end
|
62
65
|
|
63
66
|
task :test do
|
64
|
-
|
65
|
-
'./node_modules/mocha/bin/mocha ./spec/*_spec.coffee --compilers coffee:coffee-script -R spec -c'
|
66
|
-
|
67
|
-
puts stdout_array = stdout.readlines
|
68
|
-
puts stderr_array = stderr.readlines
|
69
|
-
|
70
|
-
stdout_strings = stdout_array.to_s
|
71
|
-
stderr_strings = stderr_array.to_s
|
72
|
-
|
73
|
-
if stderr_strings and
|
74
|
-
error_match = stderr_strings.match(/(\d+) of (\d+) (test[s]?) failed/)
|
75
|
-
|
76
|
-
failed_count, total_count, tests_failed_str = error_match.captures
|
77
|
-
|
78
|
-
message = "#{failed_count} of #{total_count} #{tests_failed_str} failed"
|
79
|
-
|
80
|
-
elsif stdout_strings_match = stdout_strings.match(/(\d+) (test[s]?) complete/)
|
81
|
-
complete_count, tests_complete_str = stdout_strings_match.captures
|
82
|
-
|
83
|
-
if pending_matches = stdout_strings.match(/(\d+) test[s]? pending/)
|
84
|
-
pending_count, tests_pending_str = pending_matches.captures
|
85
|
-
end
|
86
|
-
|
87
|
-
message = "#{complete_count} #{tests_complete_str} complete"
|
88
|
-
message += ", #{pending_count} #{tests_pending_str} pending" if pending_count
|
89
|
-
|
90
|
-
else
|
91
|
-
message = 'Something wrong, check console output.'
|
92
|
-
end
|
93
|
-
|
94
|
-
`bundle exec terminal-notifier -message '#{message}' -title 'Test results' -remove TEST_RESULTS -group TEST_RESULTS`
|
95
|
-
Talks.say message, detach: true
|
67
|
+
system "npm test"
|
96
68
|
end
|
data/package.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "jquery.turbolinks",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.2",
|
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
|
|
7
7
|
"devDependencies": {
|
8
|
-
"coffee-script": "
|
8
|
+
"coffee-script": "~1.7.1",
|
9
9
|
"mocha": "*",
|
10
10
|
"chai": "*",
|
11
11
|
"sinon": "*",
|
@@ -21,6 +21,6 @@
|
|
21
21
|
},
|
22
22
|
|
23
23
|
"scripts": {
|
24
|
-
"test": "./node_modules/mocha/bin/mocha ./spec/*_spec.coffee --compilers coffee:coffee-script -R spec -c"
|
24
|
+
"test": "./node_modules/mocha/bin/mocha ./spec/*_spec.coffee --compilers coffee:coffee-script/register -R spec -c"
|
25
25
|
}
|
26
26
|
}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
// Generated by CoffeeScript 1.
|
1
|
+
// Generated by CoffeeScript 1.7.1
|
2
|
+
|
2
3
|
/*
|
3
4
|
jQuery.Turbolinks ~ https://github.com/kossnocorp/jquery.turbolinks
|
4
5
|
jQuery plugin for drop-in fix binded events problem caused by Turbolinks
|
5
6
|
|
6
7
|
The MIT License
|
7
8
|
Copyright (c) 2012-2013 Sasha Koss & Rico Sta. Cruz
|
8
|
-
*/
|
9
|
-
|
9
|
+
*/
|
10
10
|
|
11
11
|
(function() {
|
12
12
|
var $, $document;
|
@@ -16,7 +16,7 @@ Copyright (c) 2012-2013 Sasha Koss & Rico Sta. Cruz
|
|
16
16
|
$document = $(document);
|
17
17
|
|
18
18
|
$.turbo = {
|
19
|
-
version: '2.0.
|
19
|
+
version: '2.0.2',
|
20
20
|
isReady: false,
|
21
21
|
use: function(load, fetch) {
|
22
22
|
return $document.off('.turbo').on("" + load + ".turbo", this.onLoad).on("" + fetch + ".turbo", this.onFetch);
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
(function(){var r,t;r=window.jQuery||("function"==typeof require?require("jquery"):void 0),t=r(document),r.turbo={version:"2.0.2",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,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-turbolinks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sasha Koss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
prerelease: false
|
15
14
|
name: railties
|
16
|
-
version_requirements: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ! '>='
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: 3.1.0
|
21
15
|
requirement: !ruby/object:Gem::Requirement
|
22
16
|
requirements:
|
23
|
-
- -
|
17
|
+
- - '>='
|
24
18
|
- !ruby/object:Gem::Version
|
25
19
|
version: 3.1.0
|
26
20
|
type: :runtime
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
21
|
prerelease: false
|
29
|
-
name: turbolinks
|
30
22
|
version_requirements: !ruby/object:Gem::Requirement
|
31
23
|
requirements:
|
32
|
-
- -
|
24
|
+
- - '>='
|
33
25
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
26
|
+
version: 3.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: turbolinks
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- -
|
31
|
+
- - '>='
|
38
32
|
- !ruby/object:Gem::Version
|
39
33
|
version: '0'
|
40
34
|
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
41
|
description: jQuery plugin for drop-in fix binded events problem caused by Turbolinks
|
42
42
|
email: koss@nocorp.me
|
43
43
|
executables: []
|
@@ -72,17 +72,17 @@ require_paths:
|
|
72
72
|
- lib
|
73
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project: jquery-turbolinks
|
85
|
-
rubygems_version: 2.
|
85
|
+
rubygems_version: 2.1.11
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: jQuery plugin for drop-in fix binded events problem caused by Turbolinks
|