jquery-turbolinks 1.0.0.rc2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -0
- data/Gemfile +1 -0
- data/README.md +6 -0
- data/Rakefile +28 -1
- data/lib/jquery-turbolinks/version.rb +1 -1
- data/package.json +2 -3
- data/src/jquery.turbolinks.coffee +1 -1
- data/vendor/assets/javascripts/jquery.turbolinks.js +1 -1
- data/vendor/assets/javascripts/jquery.turbolinks.min.js +1 -0
- metadata +18 -16
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# jQuery Turbolinks
|
2
2
|
|
3
|
+
[![Build Status](https://secure.travis-ci.org/kossnocorp/jquery.turbolinks.png?branch=master)](http://travis-ci.org/kossnocorp/jquery.turbolinks)
|
4
|
+
|
3
5
|
Do you like [Turbolinks](https://github.com/rails/turbolinks)? It's easy and fast way to improve user experience of surfing on your website.
|
4
6
|
|
5
7
|
But if you have a large codebase with lots of `$(el).bind(...)` Turbolinks will surprise you. Most part of your JavaScripts will stop working in usual way. It's because the nodes on which you bind events no longer exist.
|
@@ -70,6 +72,10 @@ $(document).on('click', 'button', function() { ... })
|
|
70
72
|
|
71
73
|
This project uses [Semantic Versioning](http://semver.org/) for release numbering.
|
72
74
|
|
75
|
+
### 1.0.0 (April 5, 2013)
|
76
|
+
|
77
|
+
* Add uglified version.
|
78
|
+
|
73
79
|
### 1.0.0-rc2 (January 31, 2013)
|
74
80
|
|
75
81
|
* 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));
|
data/Rakefile
CHANGED
@@ -22,15 +22,42 @@ namespace :release do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
namespace :js do
|
25
|
+
|
26
|
+
desc 'Build JavaScript from CoffeeScript source code'
|
25
27
|
task :build do
|
26
28
|
command = [
|
27
29
|
'./node_modules/coffee-script/bin/coffee',
|
28
30
|
'--compile',
|
29
31
|
'--output ./vendor/assets/javascripts/',
|
30
|
-
'./src
|
32
|
+
'./src/*.coffee'
|
31
33
|
]
|
32
34
|
system command.join(' ')
|
33
35
|
end
|
36
|
+
|
37
|
+
desc 'Use UglifyJS to compress JavaScript'
|
38
|
+
task :uglify do
|
39
|
+
require 'uglifier'
|
40
|
+
Dir['./vendor/assets/javascripts/*.js']
|
41
|
+
.select { |f| not f.match(/min\.js$/) }
|
42
|
+
.each do |file_name|
|
43
|
+
source = File.read(file_name)
|
44
|
+
compressed = Uglifier.compile(source, copyright: false)
|
45
|
+
min_file_name = file_name.gsub(/\.js$/, '.min.js')
|
46
|
+
|
47
|
+
File.open(min_file_name, 'w') do |f|
|
48
|
+
f.write(compressed)
|
49
|
+
end
|
50
|
+
|
51
|
+
uglify_rate = compressed.length.to_f / source.length
|
52
|
+
gzipped_size = `cat #{min_file_name} | gzip -9f | wc -c`.to_i
|
53
|
+
gzip_rate = gzipped_size.to_f / source.length
|
54
|
+
|
55
|
+
puts "# #{file_name}.js"
|
56
|
+
puts "Original size: #{source.length}b or #{(source.length.to_f / 1024).round(2)}kb"
|
57
|
+
puts "Uglified size: #{compressed.length}b (#{(uglify_rate * 100).round}% from original size)"
|
58
|
+
puts "GZipped size: #{gzipped_size}b or #{(gzipped_size.to_f / 1025).round(2)}kb (#{(gzip_rate * 100).round}% from original size)"
|
59
|
+
end
|
60
|
+
end
|
34
61
|
end
|
35
62
|
|
36
63
|
task :test do
|
data/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "jquery.turbolinks",
|
3
|
-
"version": "1.0.0
|
4
|
-
"author": "Sasha Koss <
|
3
|
+
"version": "1.0.0",
|
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": {
|
@@ -10,7 +10,6 @@
|
|
10
10
|
"chai": "*",
|
11
11
|
"sinon": "*",
|
12
12
|
"sinon-chai": "*",
|
13
|
-
"uglify-js": "*",
|
14
13
|
"jquery": "*",
|
15
14
|
"jsdom": "*"
|
16
15
|
},
|
@@ -1,7 +1,7 @@
|
|
1
1
|
// Generated by CoffeeScript 1.4.0
|
2
2
|
|
3
3
|
/*
|
4
|
-
jquery.turbolinks.js ~ v1.0.0
|
4
|
+
jquery.turbolinks.js ~ v1.0.0 ~ https://github.com/kossnocorp/jquery.turbolinks
|
5
5
|
|
6
6
|
jQuery plugin for drop-in fix binded events problem caused by Turbolinks
|
7
7
|
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(){var e,t,n,r,i;e=window.jQuery||(typeof require=="function"?require("jquery"):void 0),t=[],r=function(){var n,r,i,s;s=[];for(r=0,i=t.length;r<i;r++)n=t[r],s.push(n(e));return s},i=function(){return e.isReady=!0,r()},n=function(){return e.isReady=!1},e(r),e.fn.ready=function(n){t.push(n);if(e.isReady)return n(e)},e.setReadyEvent=function(t){return e(document).off(".turbolinks-ready").on(t+".turbolinks-ready",i)},e.setFetchEvent=function(t){return e(document).off(".turbolinks-fetch").on(t+".turbolinks-fetch",n)},e.setReadyEvent("page:load"),e.setFetchEvent("page:fetch")}).call(this);
|
metadata
CHANGED
@@ -1,48 +1,48 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-turbolinks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 1.0.0
|
4
|
+
prerelease:
|
5
|
+
version: 1.0.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Sasha Koss
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
prerelease: false
|
16
|
-
type: :runtime
|
17
15
|
version_requirements: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
16
|
requirements:
|
20
17
|
- - ! '>='
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 3.1.0
|
20
|
+
none: false
|
23
21
|
name: railties
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
24
|
requirement: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
25
|
requirements:
|
27
26
|
- - ! '>='
|
28
27
|
- !ruby/object:Gem::Version
|
29
28
|
version: 3.1.0
|
29
|
+
none: false
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
prerelease: false
|
32
|
-
type: :runtime
|
33
31
|
version_requirements: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
32
|
requirements:
|
36
33
|
- - ! '>='
|
37
34
|
- !ruby/object:Gem::Version
|
38
35
|
version: '0'
|
36
|
+
none: false
|
39
37
|
name: turbolinks
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
40
|
requirement: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
41
|
requirements:
|
43
42
|
- - ! '>='
|
44
43
|
- !ruby/object:Gem::Version
|
45
44
|
version: '0'
|
45
|
+
none: false
|
46
46
|
description: jQuery plugin for drop-in fix binded events problem caused by Turbolinks
|
47
47
|
email: koss@nocorp.me
|
48
48
|
executables: []
|
@@ -50,6 +50,7 @@ extensions: []
|
|
50
50
|
extra_rdoc_files: []
|
51
51
|
files:
|
52
52
|
- .gitignore
|
53
|
+
- .travis.yml
|
53
54
|
- CONTRIBUTING.md
|
54
55
|
- Gemfile
|
55
56
|
- Guardfile
|
@@ -64,6 +65,7 @@ files:
|
|
64
65
|
- spec/jquery.turbolinks_spec.coffee
|
65
66
|
- src/jquery.turbolinks.coffee
|
66
67
|
- vendor/assets/javascripts/jquery.turbolinks.js
|
68
|
+
- vendor/assets/javascripts/jquery.turbolinks.min.js
|
67
69
|
homepage: https://github.com/kossnocorp/jquery.turbolinks
|
68
70
|
licenses:
|
69
71
|
- MIT
|
@@ -72,20 +74,20 @@ rdoc_options: []
|
|
72
74
|
require_paths:
|
73
75
|
- lib
|
74
76
|
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
-
none: false
|
76
77
|
requirements:
|
77
78
|
- - ! '>='
|
78
79
|
- !ruby/object:Gem::Version
|
79
80
|
version: '0'
|
80
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
81
|
none: false
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
83
|
requirements:
|
83
|
-
- - ! '
|
84
|
+
- - ! '>='
|
84
85
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
86
|
+
version: '0'
|
87
|
+
none: false
|
86
88
|
requirements: []
|
87
89
|
rubyforge_project: jquery-turbolinks
|
88
|
-
rubygems_version: 1.8.
|
90
|
+
rubygems_version: 1.8.23
|
89
91
|
signing_key:
|
90
92
|
specification_version: 3
|
91
93
|
summary: jQuery plugin for drop-in fix binded events problem caused by Turbolinks
|