cloudfoundry-jquery-rails 1.0.19.1
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.
- data/.gitignore +7 -0
- data/CHANGELOG.md +182 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +100 -0
- data/LICENSE +21 -0
- data/README.md +53 -0
- data/Rakefile +10 -0
- data/cloudfoundry-jquery-rails.gemspec +25 -0
- data/lib/cloudfoundry-jquery-rails.rb +1 -0
- data/lib/generators/jquery/install/install_generator.rb +59 -0
- data/lib/jquery/assert_select.rb +99 -0
- data/lib/jquery/rails.rb +12 -0
- data/lib/jquery/rails/engine.rb +12 -0
- data/lib/jquery/rails/railtie.rb +25 -0
- data/lib/jquery/rails/version.rb +8 -0
- data/spec/lib/jquery-rails_spec.rb +3 -0
- data/spec/spec_helper.rb +29 -0
- data/vendor/assets/javascripts/jquery-ui.js +11767 -0
- data/vendor/assets/javascripts/jquery-ui.min.js +791 -0
- data/vendor/assets/javascripts/jquery.js +9266 -0
- data/vendor/assets/javascripts/jquery.min.js +4 -0
- data/vendor/assets/javascripts/jquery_ujs.js +373 -0
- metadata +111 -0
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
## 1.0.19 (26 November 2011)
|
|
2
|
+
|
|
3
|
+
- Updated to jQuery 1.7.1
|
|
4
|
+
- Updated to latest jquery-ujs
|
|
5
|
+
- Fixed disabled links to re-enable when `ajax:before` or
|
|
6
|
+
`ajax:beforeSend` are canceled
|
|
7
|
+
- Switched from deprecated `live` to `delegate`
|
|
8
|
+
|
|
9
|
+
## 1.0.18 (18 November 2011)
|
|
10
|
+
|
|
11
|
+
- Updated to latest jquery-ujs
|
|
12
|
+
- Fixed event parameter for form submit event handlers in IE for
|
|
13
|
+
jQuery 1.6.x
|
|
14
|
+
- Fixed form submit event handlers for jQuery 1.7
|
|
15
|
+
|
|
16
|
+
## 1.0.17 (9 November 2011)
|
|
17
|
+
|
|
18
|
+
- Updated to jQuery 1.7
|
|
19
|
+
- Updated to latest jquery-ujs
|
|
20
|
+
- Moved file comment above function so it won't be included in
|
|
21
|
+
compressed version
|
|
22
|
+
|
|
23
|
+
## 1.0.16 (12 October 2011)
|
|
24
|
+
|
|
25
|
+
- Updated to jQuery 1.6.4
|
|
26
|
+
- Updated to jQuery UI 1.8.16
|
|
27
|
+
|
|
28
|
+
## 1.0.15 (12 October 2011)
|
|
29
|
+
|
|
30
|
+
- Updated to latest jquery-ujs
|
|
31
|
+
- Fixed formInputClickSelector `button[type]` for IE7
|
|
32
|
+
- Copy target attribute to generated form for `a[data-method]` links
|
|
33
|
+
- Return true (abort ajax) for ctrl- and meta-clicks on remote links
|
|
34
|
+
- Use jQuery `.prop()` for disabling/enabling elements
|
|
35
|
+
|
|
36
|
+
## 1.0.14 (08 September 2011)
|
|
37
|
+
|
|
38
|
+
- Updated to latest jquery-ujs
|
|
39
|
+
- Added `disable-with` support for links
|
|
40
|
+
- minor bug fixes
|
|
41
|
+
- Added `data-remote` support for change events of all input types
|
|
42
|
+
- Added install generator for Rails 3.1 with instructional message
|
|
43
|
+
|
|
44
|
+
## 1.0.13 (11 August 2011)
|
|
45
|
+
|
|
46
|
+
- Updated to latest jquery-ujs with `novalidate` support
|
|
47
|
+
- No more support for jquery older than v1.6
|
|
48
|
+
|
|
49
|
+
## 1.0.12 (23 June 2011)
|
|
50
|
+
|
|
51
|
+
- Updated to latest jquery-ujs with 'blank form action' and
|
|
52
|
+
data-remote support for select elements
|
|
53
|
+
|
|
54
|
+
## 1.0.11 (15 June 2011)
|
|
55
|
+
|
|
56
|
+
- Updated to latest jqueyr-ujs with cross-domain support
|
|
57
|
+
|
|
58
|
+
[See jquery-ujs issue 167](https://github.com/rails/jquery-ujs/pull/167) for relevant discussion
|
|
59
|
+
|
|
60
|
+
## 1.0.10 (13 June 2011)
|
|
61
|
+
|
|
62
|
+
- Updated to latest jqueyr-ujs with bug fixes
|
|
63
|
+
|
|
64
|
+
## 1.0.9 (25 May 2011)
|
|
65
|
+
|
|
66
|
+
- Merged with new rails repo (3.1 fix)
|
|
67
|
+
|
|
68
|
+
## 1.0.8 (25 May 2011)
|
|
69
|
+
|
|
70
|
+
- Updated to latest jquery-ujs with `[disabled][required]` fix
|
|
71
|
+
|
|
72
|
+
## 1.0.7 (21 May 2011)
|
|
73
|
+
|
|
74
|
+
- Fix assert_select_jquery's bad call to unescape_rjs
|
|
75
|
+
|
|
76
|
+
## 1.0.6 (21 May 2011)
|
|
77
|
+
|
|
78
|
+
- Updated to latest jquery-ujs with `data-params` support
|
|
79
|
+
|
|
80
|
+
## 1.0.5 (17 May 2011)
|
|
81
|
+
|
|
82
|
+
- Updated to latest jquery-ujs
|
|
83
|
+
- Remove old rails.js in Rails 3.0 generator
|
|
84
|
+
|
|
85
|
+
## 1.0.4 (17 May 2011)
|
|
86
|
+
|
|
87
|
+
- Fix exception in Rails 3.0 generator
|
|
88
|
+
|
|
89
|
+
## 1.0.3 (17 May 2011)
|
|
90
|
+
|
|
91
|
+
- Update to jQuery 1.6.1
|
|
92
|
+
- Remove useless --version generator option
|
|
93
|
+
|
|
94
|
+
## 1.0.2 (12 May 2011)
|
|
95
|
+
|
|
96
|
+
- Fix Rails 3.0 now that rails.js is named jquery_ujs.js
|
|
97
|
+
|
|
98
|
+
## 1.0.1 (10 May 2011)
|
|
99
|
+
|
|
100
|
+
- Stop downloading rails.js from GitHub
|
|
101
|
+
- Vendor jQuery UI for those who want it
|
|
102
|
+
- Fix assert_select_jquery now that Rails 3.1 has no RJS at all
|
|
103
|
+
- Fix rails dependency to just be railties
|
|
104
|
+
|
|
105
|
+
## 1.0.rc (3 May 2011)
|
|
106
|
+
|
|
107
|
+
- Rails 3.1 asset pipeline edition
|
|
108
|
+
- Removes generators and railties
|
|
109
|
+
- Just provides jquery.js and jquery_ujs.js
|
|
110
|
+
- Still compatible with Rails 3.0 via the old generator code
|
|
111
|
+
|
|
112
|
+
## 0.2.7 (5 February 2011)
|
|
113
|
+
|
|
114
|
+
- Updated to use jQuery 1.5 by default
|
|
115
|
+
|
|
116
|
+
## 0.2.6 (1 December 2010)
|
|
117
|
+
|
|
118
|
+
Feature:
|
|
119
|
+
|
|
120
|
+
- Updated to use jQuery 1.4.4 by default
|
|
121
|
+
|
|
122
|
+
## 0.2.5 (4 November 2010)
|
|
123
|
+
|
|
124
|
+
Bugfix:
|
|
125
|
+
|
|
126
|
+
- Download JQuery Rails UJS via HTTPS since Github is now HTTPS only
|
|
127
|
+
|
|
128
|
+
## 0.2.4 (16 October 2010)
|
|
129
|
+
|
|
130
|
+
Features:
|
|
131
|
+
|
|
132
|
+
- Updated to use the new jQuery 1.4.3 by default, with the IE .live() bug fixed
|
|
133
|
+
- Always download the newest 1.x release of jQuery UI
|
|
134
|
+
- Try to install unknown versions of jQuery, with fallback to the default
|
|
135
|
+
- Print informative messages in the correct Generator style
|
|
136
|
+
|
|
137
|
+
## 0.2.3 (13 October 2010)
|
|
138
|
+
|
|
139
|
+
Features:
|
|
140
|
+
|
|
141
|
+
- Support Edge Rails 3.1 by depending on Rails ~>3.0
|
|
142
|
+
- Add Sam Ruby's assert_select_jquery test helper method
|
|
143
|
+
- Use jquery.min only in production (and not in the test env)
|
|
144
|
+
|
|
145
|
+
## 0.2.2 (8 October 2010)
|
|
146
|
+
|
|
147
|
+
Feature:
|
|
148
|
+
|
|
149
|
+
- Depend on Rails >=3.0 && <4.0 for edge Rails compatibility
|
|
150
|
+
|
|
151
|
+
## 0.2.1 (2 October 2010)
|
|
152
|
+
|
|
153
|
+
Bugfix:
|
|
154
|
+
|
|
155
|
+
- Default to jQuery 1.4.1 as recommended by jQuery-ujs
|
|
156
|
+
due to a bug in 1.4.2 (http://jsbin.com/uboxu3/7/)
|
|
157
|
+
|
|
158
|
+
## 0.2 (2 October 2010)
|
|
159
|
+
|
|
160
|
+
Features:
|
|
161
|
+
|
|
162
|
+
- Allow specifying which version of jQuery to install
|
|
163
|
+
- Add generator tests (thanks, Louis T.)
|
|
164
|
+
- Automatically use non-minified JS in development mode
|
|
165
|
+
|
|
166
|
+
## 0.1.3 (16 September 2010)
|
|
167
|
+
|
|
168
|
+
Bugfix:
|
|
169
|
+
|
|
170
|
+
- allow javascript :defaults tag to be overridden
|
|
171
|
+
|
|
172
|
+
## 0.1.2 (18 August 2010)
|
|
173
|
+
|
|
174
|
+
Bugfix:
|
|
175
|
+
|
|
176
|
+
- check for jQueryUI in the right place
|
|
177
|
+
|
|
178
|
+
## 0.1.1 (16 August 2010)
|
|
179
|
+
|
|
180
|
+
Bugfix:
|
|
181
|
+
|
|
182
|
+
- fix generator by resolving namespace conflict between Jquery::Rails and ::Rails
|
data/Gemfile
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
source :gemcutter
|
|
2
|
+
|
|
3
|
+
# Specify your gem's dependencies in jquery-rails.gemspec
|
|
4
|
+
gemspec
|
|
5
|
+
# Rails is already being pulled in through gemspec
|
|
6
|
+
# gem "rails", :git => "git://github.com/rails/rails.git"
|
|
7
|
+
gem "rack", :git => "git://github.com/rack/rack.git"
|
|
8
|
+
gem "sprockets", :git => "git://github.com/sstephenson/sprockets.git"
|
|
9
|
+
gem "i18n", "0.6.0beta1"
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
GIT
|
|
2
|
+
remote: git://github.com/rack/rack.git
|
|
3
|
+
revision: a9beb476b27914794743d0677b327d5bafb5e8a3
|
|
4
|
+
specs:
|
|
5
|
+
rack (1.2.1)
|
|
6
|
+
|
|
7
|
+
GIT
|
|
8
|
+
remote: git://github.com/sstephenson/sprockets.git
|
|
9
|
+
revision: c4800417792744c11eb1fb888bbe9a3a82859952
|
|
10
|
+
specs:
|
|
11
|
+
sprockets (2.0.0.beta.2)
|
|
12
|
+
hike (~> 1.0)
|
|
13
|
+
rack (~> 1.0)
|
|
14
|
+
tilt (~> 1.0)
|
|
15
|
+
|
|
16
|
+
PATH
|
|
17
|
+
remote: .
|
|
18
|
+
specs:
|
|
19
|
+
jquery-rails (1.0.17)
|
|
20
|
+
railties (~> 3.0)
|
|
21
|
+
thor (~> 0.14)
|
|
22
|
+
|
|
23
|
+
GEM
|
|
24
|
+
remote: http://rubygems.org/
|
|
25
|
+
specs:
|
|
26
|
+
abstract (1.0.0)
|
|
27
|
+
actionmailer (3.0.5)
|
|
28
|
+
actionpack (= 3.0.5)
|
|
29
|
+
mail (~> 2.2.15)
|
|
30
|
+
actionpack (3.0.5)
|
|
31
|
+
activemodel (= 3.0.5)
|
|
32
|
+
activesupport (= 3.0.5)
|
|
33
|
+
builder (~> 2.1.2)
|
|
34
|
+
erubis (~> 2.6.6)
|
|
35
|
+
i18n (~> 0.4)
|
|
36
|
+
rack (~> 1.2.1)
|
|
37
|
+
rack-mount (~> 0.6.13)
|
|
38
|
+
rack-test (~> 0.5.7)
|
|
39
|
+
tzinfo (~> 0.3.23)
|
|
40
|
+
activemodel (3.0.5)
|
|
41
|
+
activesupport (= 3.0.5)
|
|
42
|
+
builder (~> 2.1.2)
|
|
43
|
+
i18n (~> 0.4)
|
|
44
|
+
activerecord (3.0.5)
|
|
45
|
+
activemodel (= 3.0.5)
|
|
46
|
+
activesupport (= 3.0.5)
|
|
47
|
+
arel (~> 2.0.2)
|
|
48
|
+
tzinfo (~> 0.3.23)
|
|
49
|
+
activeresource (3.0.5)
|
|
50
|
+
activemodel (= 3.0.5)
|
|
51
|
+
activesupport (= 3.0.5)
|
|
52
|
+
activesupport (3.0.5)
|
|
53
|
+
arel (2.0.10)
|
|
54
|
+
builder (2.1.2)
|
|
55
|
+
erubis (2.6.6)
|
|
56
|
+
abstract (>= 1.0.0)
|
|
57
|
+
hike (1.0.0)
|
|
58
|
+
i18n (0.6.0beta1)
|
|
59
|
+
mail (2.2.19)
|
|
60
|
+
activesupport (>= 2.3.6)
|
|
61
|
+
i18n (>= 0.4.0)
|
|
62
|
+
mime-types (~> 1.16)
|
|
63
|
+
treetop (~> 1.4.8)
|
|
64
|
+
mime-types (1.17.2)
|
|
65
|
+
polyglot (0.3.3)
|
|
66
|
+
rack-mount (0.6.14)
|
|
67
|
+
rack (>= 1.0.0)
|
|
68
|
+
rack-test (0.5.7)
|
|
69
|
+
rack (>= 1.0)
|
|
70
|
+
rails (3.0.5)
|
|
71
|
+
actionmailer (= 3.0.5)
|
|
72
|
+
actionpack (= 3.0.5)
|
|
73
|
+
activerecord (= 3.0.5)
|
|
74
|
+
activeresource (= 3.0.5)
|
|
75
|
+
activesupport (= 3.0.5)
|
|
76
|
+
bundler (~> 1.0)
|
|
77
|
+
railties (= 3.0.5)
|
|
78
|
+
railties (3.0.5)
|
|
79
|
+
actionpack (= 3.0.5)
|
|
80
|
+
activesupport (= 3.0.5)
|
|
81
|
+
rake (>= 0.8.7)
|
|
82
|
+
thor (~> 0.14.4)
|
|
83
|
+
rake (0.9.2.2)
|
|
84
|
+
thor (0.14.6)
|
|
85
|
+
tilt (1.3)
|
|
86
|
+
treetop (1.4.10)
|
|
87
|
+
polyglot
|
|
88
|
+
polyglot (>= 0.3.1)
|
|
89
|
+
tzinfo (0.3.31)
|
|
90
|
+
|
|
91
|
+
PLATFORMS
|
|
92
|
+
ruby
|
|
93
|
+
|
|
94
|
+
DEPENDENCIES
|
|
95
|
+
bundler (~> 1.0.0)
|
|
96
|
+
i18n (= 0.6.0beta1)
|
|
97
|
+
jquery-rails!
|
|
98
|
+
rack!
|
|
99
|
+
rails (~> 3.0)
|
|
100
|
+
sprockets!
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2010 Andre Arko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# cloudfoundry-jquery-rails
|
|
2
|
+
|
|
3
|
+
This gem is a fork of the original jquery-rails gem including a fix to work with Cloud Foundry.
|
|
4
|
+
You only need to change `gem 'jquery-rails'` to `gem 'cloudfoundry-jquery-rails'`.
|
|
5
|
+
|
|
6
|
+
jQuery! For Rails! So great.
|
|
7
|
+
|
|
8
|
+
This gem provides:
|
|
9
|
+
|
|
10
|
+
* jQuery 1.7.1
|
|
11
|
+
* jQuery UI 1.8.16
|
|
12
|
+
* the latest jQuery UJS adapter
|
|
13
|
+
* and Sam Ruby's assert_select_jquery function, which is automatically included for use in tests.
|
|
14
|
+
* a fix for Cloud Foundry
|
|
15
|
+
|
|
16
|
+
## Rails 3.1
|
|
17
|
+
|
|
18
|
+
For Rails 3.1 and greater, the files will be added to the asset pipeline and available for you to use. These two lines will be added to the file `app/assets/javascripts/application.js` by default:
|
|
19
|
+
|
|
20
|
+
//= require jquery
|
|
21
|
+
//= require jquery_ujs
|
|
22
|
+
|
|
23
|
+
If you wish to use jQuery UI as well, you can add this line to `application.js`:
|
|
24
|
+
|
|
25
|
+
//= require jquery-ui
|
|
26
|
+
|
|
27
|
+
In order to use the themed parts of jQuery UI, you will also need to supply your own theme CSS. See [jqueryui.com](http://jqueryui.com) for more information.
|
|
28
|
+
|
|
29
|
+
### Installation
|
|
30
|
+
|
|
31
|
+
New Rails 3.1 apps include jquery-rails in the Gemfile by default. So just make a new app:
|
|
32
|
+
|
|
33
|
+
rails new myapp
|
|
34
|
+
|
|
35
|
+
You're done!
|
|
36
|
+
|
|
37
|
+
## Rails 3.0
|
|
38
|
+
|
|
39
|
+
This gem adds a single generator to Rails 3, jquery:install. Running the generator will remove any Prototype JS files you may happen to have, fetch jQuery and the jQuery-ujs driver for Rails, and (optionally) fetch jQuery UI.
|
|
40
|
+
|
|
41
|
+
The gem will also hook into the Rails configuration process, removing Prototype and adding jQuery to the javascript files included by the `javascript_include_tag(:defaults)` call. While the plugin downloads minified and un-minified versions of jQuery and jQuery UI, only the minified versions are included in :default.
|
|
42
|
+
|
|
43
|
+
### Installation
|
|
44
|
+
|
|
45
|
+
In your Gemfile, add this line:
|
|
46
|
+
|
|
47
|
+
gem "cloudfoundry-jquery-rails"
|
|
48
|
+
|
|
49
|
+
Then, run `bundle install`. To invoke the generator, run:
|
|
50
|
+
|
|
51
|
+
rails generate jquery:install #--ui to enable jQuery UI
|
|
52
|
+
|
|
53
|
+
You're done!
|
data/Rakefile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
require File.expand_path('../lib/jquery/rails/version', __FILE__)
|
|
3
|
+
|
|
4
|
+
Gem::Specification.new do |s|
|
|
5
|
+
s.name = "cloudfoundry-jquery-rails"
|
|
6
|
+
#s.version = Jquery::Rails::VERSION
|
|
7
|
+
s.version = "1.0.19.1"
|
|
8
|
+
s.platform = Gem::Platform::RUBY
|
|
9
|
+
s.authors = ["Andre Arko"]
|
|
10
|
+
s.email = ["andre@arko.net"]
|
|
11
|
+
s.homepage = "http://rubygems.org/gems/cloudfoundry-jquery-rails"
|
|
12
|
+
s.summary = "Use jQuery with Rails 3"
|
|
13
|
+
s.description = "This gem provides jQuery and the jQuery-ujs driver for your Rails 3 application."
|
|
14
|
+
|
|
15
|
+
s.required_rubygems_version = ">= 1.3.6"
|
|
16
|
+
|
|
17
|
+
s.add_dependency "railties", "~> 3.0"
|
|
18
|
+
s.add_dependency "thor", "~> 0.14"
|
|
19
|
+
s.add_development_dependency "bundler", "~> 1.0.0"
|
|
20
|
+
s.add_development_dependency "rails", "~> 3.0"
|
|
21
|
+
|
|
22
|
+
s.files = `git ls-files`.split("\n")
|
|
23
|
+
s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/}
|
|
24
|
+
s.require_path = 'lib'
|
|
25
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'jquery/rails'
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
require 'rails'
|
|
2
|
+
|
|
3
|
+
# Supply generator for Rails 3.0.x or if asset pipeline is not enabled
|
|
4
|
+
if ::Rails.version < "3.1" || !::Rails.application.config.assets.enabled
|
|
5
|
+
module Jquery
|
|
6
|
+
module Generators
|
|
7
|
+
class InstallGenerator < ::Rails::Generators::Base
|
|
8
|
+
|
|
9
|
+
desc "This generator installs jQuery #{Jquery::Rails::JQUERY_VERSION}, jQuery-ujs, and (optionally) jQuery UI #{Jquery::Rails::JQUERY_UI_VERSION}"
|
|
10
|
+
class_option :ui, :type => :boolean, :default => false, :desc => "Include jQueryUI"
|
|
11
|
+
source_root File.expand_path('../../../../../vendor/assets/javascripts', __FILE__)
|
|
12
|
+
|
|
13
|
+
def remove_prototype
|
|
14
|
+
Rails::PROTOTYPE_JS.each do |name|
|
|
15
|
+
remove_file "public/javascripts/#{name}.js"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def copy_jquery
|
|
20
|
+
say_status("copying", "jQuery (#{Jquery::Rails::JQUERY_VERSION})", :green)
|
|
21
|
+
copy_file "jquery.js", "public/javascripts/jquery.js"
|
|
22
|
+
copy_file "jquery.min.js", "public/javascripts/jquery.min.js"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def copy_jquery_ui
|
|
26
|
+
if options.ui?
|
|
27
|
+
say_status("copying", "jQuery UI (#{Jquery::Rails::JQUERY_UI_VERSION})", :green)
|
|
28
|
+
copy_file "jquery-ui.js", "public/javascripts/jquery-ui.js"
|
|
29
|
+
copy_file "jquery-ui.min.js", "public/javascripts/jquery-ui.min.js"
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def copy_ujs_driver
|
|
34
|
+
say_status("copying", "jQuery UJS adapter (#{Jquery::Rails::JQUERY_UJS_VERSION[0..5]})", :green)
|
|
35
|
+
remove_file "public/javascripts/rails.js"
|
|
36
|
+
copy_file "jquery_ujs.js", "public/javascripts/jquery_ujs.js"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
else
|
|
43
|
+
module Jquery
|
|
44
|
+
module Generators
|
|
45
|
+
class InstallGenerator < ::Rails::Generators::Base
|
|
46
|
+
desc "Just show instructions so people will know what to do when mistakenly using generator for Rails 3.1 apps"
|
|
47
|
+
|
|
48
|
+
def do_nothing
|
|
49
|
+
say_status("deprecated", "You are using Rails 3.1 with the asset pipeline enabled, so this generator is not needed.")
|
|
50
|
+
say_status("", "The necessary files are already in your asset pipeline.")
|
|
51
|
+
say_status("", "Just add `//= require jquery` and `//= require jquery_ujs` to your app/assets/javascripts/application.js")
|
|
52
|
+
say_status("", "If you upgraded your app from Rails 3.0 and still have jquery.js, rails.js, or jquery_ujs.js in your javascripts, be sure to remove them.")
|
|
53
|
+
say_status("", "If you do not want the asset pipeline enabled, you may turn it off in application.rb and re-run this generator.")
|
|
54
|
+
# ok, nothing
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|