compass-jquery-plugin 0.3.0.beta.21 → 0.3.0.beta.22
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +212 -211
- data/VERSION.yml +5 -5
- data/compass-jquery-plugin.gemspec +25 -2
- data/gem_tasks/jqtouch.rake +221 -201
- data/gem_tasks/jrails.rake +322 -311
- data/lib/compiler.jar +0 -0
- data/lib/jquery/flash_messages.rb +45 -45
- data/lib/jquery/gridify/grid.rb +147 -147
- data/lib/jquery/gridify/grid_column.rb +134 -134
- data/lib/jquery/gridify/grid_finder.rb +223 -211
- data/lib/jquery/gridify/grid_options.rb +279 -279
- data/lib/jquery/gridify/grid_view.rb +435 -436
- data/lib/jquery/gridify.rb +42 -42
- data/templates/dynatree/jquery.dynatree.min.js +1 -1
- data/templates/jqgrid/i18n/jqgrid/locale-bg.min.js +6 -15
- data/templates/jqgrid/i18n/jqgrid/locale-bg1251.min.js +6 -15
- data/templates/jqgrid/i18n/jqgrid/locale-cat.min.js +5 -6
- data/templates/jqgrid/i18n/jqgrid/locale-cn.min.js +5 -8
- data/templates/jqgrid/i18n/jqgrid/locale-cs.min.js +6 -8
- data/templates/jqgrid/i18n/jqgrid/locale-da.min.js +6 -6
- data/templates/jqgrid/i18n/jqgrid/locale-de.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-el.min.js +7 -13
- data/templates/jqgrid/i18n/jqgrid/locale-es.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-fa.min.js +6 -12
- data/templates/jqgrid/i18n/jqgrid/locale-fr.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-gl.min.js +7 -7
- data/templates/jqgrid/i18n/jqgrid/locale-he.min.js +6 -13
- data/templates/jqgrid/i18n/jqgrid/locale-hu.min.js +6 -8
- data/templates/jqgrid/i18n/jqgrid/locale-is.min.js +6 -7
- data/templates/jqgrid/i18n/jqgrid/locale-it.min.js +4 -4
- data/templates/jqgrid/i18n/jqgrid/locale-ja.min.js +5 -10
- data/templates/jqgrid/i18n/jqgrid/locale-no.min.js +6 -6
- data/templates/jqgrid/i18n/jqgrid/locale-pl.min.js +6 -7
- data/templates/jqgrid/i18n/jqgrid/locale-pt-br.min.js +6 -7
- data/templates/jqgrid/i18n/jqgrid/locale-pt.min.js +4 -5
- data/templates/jqgrid/i18n/jqgrid/locale-ro.min.js +7 -8
- data/templates/jqgrid/i18n/jqgrid/locale-ru.min.js +7 -16
- data/templates/jqgrid/i18n/jqgrid/locale-sk.min.js +6 -8
- data/templates/jqgrid/i18n/jqgrid/locale-sv.min.js +6 -7
- data/templates/jqgrid/i18n/jqgrid/locale-tr.min.js +6 -7
- data/templates/jqgrid/i18n/jqgrid/locale-ua.min.js +7 -16
- data/templates/jqgrid/jquery.jqGrid.js +11567 -11565
- data/templates/jqgrid/jquery.jqGrid.min.js +472 -472
- data/templates/jqical/jquery.jqical.js +5 -9
- data/templates/jqical/jquery.jqical.min.js +44 -44
- data/templates/jqical/jquery.ui/jqical.scss +1 -1
- data/templates/jqtouch/config/initializers/jqtouch.rb +5 -4
- data/templates/jqtouch/jqtouch/apple/activeButton.png +0 -0
- data/templates/jqtouch/jqtouch/default/backButton.png +0 -0
- data/templates/jqtouch/jqtouch/default/backButtonActive.png +0 -0
- data/templates/jqtouch/jqtouch/default/bigButton.png +0 -0
- data/templates/jqtouch/jqtouch/default/bigButtonActive.png +0 -0
- data/templates/jqtouch/jqtouch/default/button.png +0 -0
- data/templates/jqtouch/jqtouch/default/buttonActive.png +0 -0
- data/templates/jqtouch/jqtouch/default/chevron.png +0 -0
- data/templates/jqtouch/jqtouch/default/chevronActive.png +0 -0
- data/templates/jqtouch/jqtouch/default/chevronCircle.png +0 -0
- data/templates/jqtouch/jqtouch/default/chevronCircleActive.png +0 -0
- data/templates/jqtouch/jqtouch/default/loading.gif +0 -0
- data/templates/jqtouch/jqtouch/default/toggleSwitch.png +0 -0
- data/templates/jqtouch/jqtouch/default/toolbarBackground.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/back_button_clicked.png +0 -0
- data/templates/jqtouch/jqtouch/jqt.apple.scss +24 -11
- data/templates/jqtouch/jqtouch/jqt.default.scss +537 -0
- data/templates/jqtouch/jqtouch/jqt.jqt.scss +20 -6
- data/templates/jqtouch/jqtouch/jqtouch.scss +173 -1
- data/templates/jqtouch/jqtouch/photo/btnBack.png +0 -0
- data/templates/jqtouch/jqtouch/photo/loading.gif +0 -0
- data/templates/jqtouch/jqtouch/photo/navNext.png +0 -0
- data/templates/jqtouch/jqtouch/photo/navPause.png +0 -0
- data/templates/jqtouch/jqtouch/photo/navPlay.png +0 -0
- data/templates/jqtouch/jqtouch/photo/navPrev.png +0 -0
- data/templates/jqtouch/jqtouch/photo/toolbar.png +0 -0
- data/templates/jqtouch/jquery.jqtouch.js +8219 -632
- data/templates/jqtouch/jquery.jqtouch.min.js +60 -1
- data/templates/jqtouch/manifest.rb +21 -0
- data/templates/jrails/config/initializers/jrails.rb +1 -0
- data/templates/jrails/haml.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-ar.min.js +2 -4
- data/templates/jrails/i18n/jquery.ui/datepicker-az.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-bg.min.js +2 -4
- data/templates/jrails/i18n/jquery.ui/datepicker-bs.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-cs.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-da.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-de.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-el.min.js +2 -4
- data/templates/jrails/i18n/jquery.ui/datepicker-eo.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-et.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-fa.min.js +2 -3
- data/templates/jrails/i18n/jquery.ui/datepicker-fo.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-fr-CH.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-fr.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-he.min.js +2 -3
- data/templates/jrails/i18n/jquery.ui/datepicker-hr.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-hu.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-hy.min.js +2 -4
- data/templates/jrails/i18n/jquery.ui/datepicker-ja.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-ko.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-kz.min.js +2 -4
- data/templates/jrails/i18n/jquery.ui/datepicker-lt.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-lv.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-nl.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-no.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-pl.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-ro.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-ru.min.js +2 -4
- data/templates/jrails/i18n/jquery.ui/datepicker-sk.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-sq.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-sr-SR.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-sr.min.js +2 -4
- data/templates/jrails/i18n/jquery.ui/datepicker-sv.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-ta.min.js +2 -4
- data/templates/jrails/i18n/jquery.ui/datepicker-th.min.js +2 -4
- data/templates/jrails/i18n/jquery.ui/datepicker-tr.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-uk.min.js +2 -4
- data/templates/jrails/i18n/jquery.ui/datepicker-vi.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-zh-CN.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-zh-HK.min.js +2 -2
- data/templates/jrails/i18n/jquery.ui/datepicker-zh-TW.min.js +2 -2
- data/templates/jrails/jquery-1.4.2.min.js +156 -156
- data/templates/jrails/jquery-ui-1.8.5.js +23753 -23341
- data/templates/jrails/jquery-ui-1.8.5.min.js +823 -808
- data/templates/jrails/jquery.contextMenu.min.js +1 -1
- data/templates/jrails/jquery.sparkline.js +1050 -0
- data/templates/jrails/jquery.sparkline.min.js +31 -0
- data/templates/jrails/jquery.ui/_theme.scss +1699 -1634
- data/templates/jrails/manifest.rb +13 -11
- data/templates/jstree/jquery.jstree.min.js +10 -10
- data/templates/ribbon/jquery.ribbon.min.js +6 -6
- metadata +27 -4
data/gem_tasks/jrails.rake
CHANGED
@@ -1,312 +1,323 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
require 'lib/handle_js_files'
|
3
|
-
require 'lib/jquery.ui'
|
4
|
-
|
5
|
-
# Compass generator for jrails 0.1+
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
end
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
manifest.print "
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
'
|
210
|
-
'
|
211
|
-
'
|
212
|
-
'
|
213
|
-
'
|
214
|
-
'
|
215
|
-
'
|
216
|
-
'
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
f.print(
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
end
|
310
|
-
end
|
311
|
-
end
|
1
|
+
require 'fileutils'
|
2
|
+
require 'lib/handle_js_files'
|
3
|
+
require 'lib/jquery.ui'
|
4
|
+
|
5
|
+
# Compass generator for jrails 0.1+
|
6
|
+
SRC_JRAILS = File.join(GEM_ROOT, 'src', 'jrails', 'jrails.1.4.2')
|
7
|
+
SRC_JRAILS_SCRIPTS = SRC_JRAILS + "/*.js"
|
8
|
+
SRC_JQUERY = File.join(GEM_ROOT, 'src', 'jrails', 'jquery.1.4.2')
|
9
|
+
SRC_JQUERY_SCRIPTS = SRC_JQUERY + "/*.js"
|
10
|
+
SRC_JQUERY_UI = File.join(GEM_ROOT, 'src', 'jrails', 'jquery.ui.1.8.5')
|
11
|
+
SRC_JQUERY_UI_SCRIPTS = File.join(SRC_JQUERY_UI, 'js') + "/*.js"
|
12
|
+
SRC_JQUERY_UI_THEMES = File.join(SRC_JQUERY_UI, 'themes')
|
13
|
+
SRC_JQUERY_UI_TRANSLATIONS = File.join(SRC_JQUERY_UI, 'js', 'i18n') #+ "/*.js"
|
14
|
+
SRC_SPARKLINES_SCRIPTS = File.join(GEM_ROOT, 'src', 'jrails', 'sparklines') + "/*.js"
|
15
|
+
SRC_JHAML_SCRIPTS = File.join(GEM_ROOT, 'src', 'jrails', 'jquery-haml') + "/*.js"
|
16
|
+
SRC_HAML_JS_SCRIPTS = File.join(GEM_ROOT, 'src', 'jrails', 'haml-js') + "/*.js"
|
17
|
+
SRC_FLASH = File.join(GEM_ROOT, 'src', 'jrails', 'flash_messages')
|
18
|
+
SRC_FLASH_IMAGES = File.join(SRC_FLASH, 'images')
|
19
|
+
|
20
|
+
DEST_JRAILS_TEMPLATES = File.join(GEM_ROOT, 'templates', 'jrails')
|
21
|
+
DEST_JRAILS_TRANSLATIONS = File.join(DEST_JRAILS_TEMPLATES, 'i18n', 'jquery.ui')
|
22
|
+
DEST_JRAILS_THEMES = File.join(DEST_JRAILS_TEMPLATES, 'jquery.ui')
|
23
|
+
DEST_JRAILS_IMAGES = File.join(DEST_JRAILS_TEMPLATES, 'jquery.ui')
|
24
|
+
DEST_FLASH_STYLESHEETS = File.join(DEST_JRAILS_TEMPLATES, 'partials')
|
25
|
+
DEST_FLASH_IMAGES = File.join(DEST_JRAILS_IMAGES, 'flash_messages')
|
26
|
+
|
27
|
+
namespace :build do
|
28
|
+
desc 'Build the stylesheets and templates for jRails.'
|
29
|
+
task :jrails do
|
30
|
+
|
31
|
+
FileUtils.remove_dir DEST_JRAILS_TEMPLATES if File.exists? DEST_JRAILS_TEMPLATES
|
32
|
+
FileUtils.mkdir_p(File.join(DEST_JRAILS_TEMPLATES, 'config', 'initializers'))
|
33
|
+
FileUtils.mkdir_p(File.join(DEST_JRAILS_THEMES))
|
34
|
+
|
35
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'manifest.rb'), 'w' do |manifest|
|
36
|
+
|
37
|
+
# jRails
|
38
|
+
|
39
|
+
manifest.print JRAILS_MESSAGE1
|
40
|
+
|
41
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'config', 'initializers', 'jrails.rb'), 'w' do |f|
|
42
|
+
f.print(File.read(File.join(SRC_JRAILS, 'config', 'initializers', 'jrails.rb')))
|
43
|
+
end
|
44
|
+
manifest.print "file 'config/initializers/jrails.rb'\n"
|
45
|
+
|
46
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'jrails.js'), 'w' do |f|
|
47
|
+
f.print concat_files(all_files(SRC_JRAILS_SCRIPTS))
|
48
|
+
end
|
49
|
+
manifest.print "javascript 'jrails.js'\n"
|
50
|
+
|
51
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'jrails.min.js'), 'w' do |f|
|
52
|
+
f.print compress_js(all_files(SRC_JRAILS_SCRIPTS), "google")
|
53
|
+
end
|
54
|
+
manifest.print "javascript 'jrails.min.js'\n"
|
55
|
+
|
56
|
+
# jQuery 1.4
|
57
|
+
|
58
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'jquery-1.4.2.js'), 'w' do |f|
|
59
|
+
f.print concat_files(all_files(SRC_JQUERY_SCRIPTS))
|
60
|
+
end
|
61
|
+
manifest.print "javascript 'jquery-1.4.2.js'\n"
|
62
|
+
|
63
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'jquery-1.4.2.min.js'), 'w' do |f|
|
64
|
+
f.print compress_js(all_files(SRC_JQUERY_SCRIPTS), "google")
|
65
|
+
end
|
66
|
+
manifest.print "javascript 'jquery-1.4.2.min.js'\n"
|
67
|
+
|
68
|
+
# jQuery 1.4 Compat 1.3
|
69
|
+
|
70
|
+
['compat-1.3'].each do |path|
|
71
|
+
Dir.foreach File.join(SRC_JQUERY, path) do |file|
|
72
|
+
next unless /\.js$/ =~ file
|
73
|
+
js = File.read File.join(SRC_JQUERY, path, file)
|
74
|
+
manifest.print "javascript '#{file}'\n"
|
75
|
+
open File.join(DEST_JRAILS_TEMPLATES, file), 'w' do |f|
|
76
|
+
f.write js
|
77
|
+
end
|
78
|
+
file.gsub!(/\.js$/, '.min.js')
|
79
|
+
manifest.print "javascript '#{file}'\n"
|
80
|
+
open File.join(DEST_JRAILS_TEMPLATES, file), 'w' do |f|
|
81
|
+
f.write compress_js(js, "google")
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# jQuery 1.4 Plugins
|
87
|
+
|
88
|
+
['plugins'].each do |path|
|
89
|
+
Dir.foreach File.join(SRC_JQUERY, path) do |file|
|
90
|
+
|
91
|
+
if /\.css$/ =~ file
|
92
|
+
css = File.read File.join(SRC_JQUERY, path, file)
|
93
|
+
sass = ''
|
94
|
+
IO.popen("sass-convert -F css -T scss", 'r+') { |f| f.print(css); f.close_write; sass = f.read }
|
95
|
+
file.gsub!(/^jquery\./,'').gsub!(/\.css$/, '.scss')
|
96
|
+
open File.join(DEST_JRAILS_THEMES, file), 'w' do |f|
|
97
|
+
f.write sass
|
98
|
+
end
|
99
|
+
manifest.print "stylesheet 'jquery.ui/#{file}', :media => 'screen, projection'\n"
|
100
|
+
end
|
101
|
+
|
102
|
+
next unless /\.js$/ =~ file
|
103
|
+
js = File.read File.join(SRC_JQUERY, path, file)
|
104
|
+
manifest.print "javascript '#{file}'\n"
|
105
|
+
open File.join(DEST_JRAILS_TEMPLATES, file), 'w' do |f|
|
106
|
+
f.write js
|
107
|
+
end
|
108
|
+
file.gsub!(/\.js$/, '.min.js')
|
109
|
+
manifest.print "javascript '#{file}'\n"
|
110
|
+
open File.join(DEST_JRAILS_TEMPLATES, file), 'w' do |f|
|
111
|
+
f.write compress_js(js, "google")
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
Dir.foreach File.join(SRC_JQUERY, 'plugins', 'images') do |plugin|
|
117
|
+
next if /^\./ =~ plugin
|
118
|
+
|
119
|
+
# Copy the theme images directory
|
120
|
+
src_dir = File.join(SRC_JQUERY, 'plugins', 'images', plugin)
|
121
|
+
dest_dir = File.join(DEST_JRAILS_IMAGES, plugin)
|
122
|
+
FileUtils.mkdir_p dest_dir
|
123
|
+
|
124
|
+
Dir.foreach(src_dir) do |image|
|
125
|
+
next if /^\./ =~ image
|
126
|
+
FileUtils.cp(File.join(src_dir, image), dest_dir)
|
127
|
+
manifest.print "image 'jquery.ui/#{plugin}/#{image}'\n"
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
# jQuery.UI 1.8.5
|
132
|
+
|
133
|
+
# Scripts
|
134
|
+
|
135
|
+
all_jquery_ui_scripts = [
|
136
|
+
'jquery-ui.js',
|
137
|
+
'jquery.effects.blind.js',
|
138
|
+
'jquery.effects.bounce.js',
|
139
|
+
'jquery.effects.clip.js',
|
140
|
+
'jquery.effects.core.js',
|
141
|
+
'jquery.effects.drop.js',
|
142
|
+
'jquery.effects.explode.js',
|
143
|
+
'jquery.effects.fade.js',
|
144
|
+
'jquery.effects.fold.js',
|
145
|
+
'jquery.effects.highlight.js',
|
146
|
+
'jquery.effects.pulsate.js',
|
147
|
+
'jquery.effects.scale.js',
|
148
|
+
'jquery.effects.shake.js',
|
149
|
+
'jquery.effects.slide.js',
|
150
|
+
'jquery.effects.transfer.js',
|
151
|
+
'jquery.ui.accordion.js',
|
152
|
+
'jquery.ui.autocomplete.js',
|
153
|
+
'jquery.ui.button.js',
|
154
|
+
'jquery.ui.core.js',
|
155
|
+
'jquery.ui.datepicker.js',
|
156
|
+
'jquery.ui.dialog.js',
|
157
|
+
'jquery.ui.draggable.js',
|
158
|
+
'jquery.ui.droppable.js',
|
159
|
+
'jquery.ui.mouse.js',
|
160
|
+
'jquery.ui.panel.js',
|
161
|
+
'jquery.ui.position.js',
|
162
|
+
'jquery.ui.progressbar.js',
|
163
|
+
'jquery.ui.resizable.js',
|
164
|
+
'jquery.ui.selectable.js',
|
165
|
+
'jquery.ui.selectmenu.js',
|
166
|
+
'jquery.ui.slider.js',
|
167
|
+
'jquery.ui.sortable.js',
|
168
|
+
'jquery.ui.tabs.js',
|
169
|
+
'jquery.ui.widget.js'
|
170
|
+
].collect {|filename| File.read(File.join(SRC_JQUERY_UI, 'js', filename))}.join "\n\n"
|
171
|
+
|
172
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'jquery-ui-1.8.5.js'), 'w' do |f|
|
173
|
+
f.print concat_files(all_jquery_ui_scripts)
|
174
|
+
end
|
175
|
+
manifest.print "javascript 'jquery-ui-1.8.5.js'\n"
|
176
|
+
|
177
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'jquery-ui-1.8.5.min.js'), 'w' do |f|
|
178
|
+
f.print compress_js(all_jquery_ui_scripts, "google")
|
179
|
+
end
|
180
|
+
manifest.print "javascript 'jquery-ui-1.8.5.min.js'\n"
|
181
|
+
|
182
|
+
# jQuery UI locales
|
183
|
+
|
184
|
+
['i18n'].each do |path|
|
185
|
+
FileUtils.mkdir_p(DEST_JRAILS_TRANSLATIONS)
|
186
|
+
Dir.foreach SRC_JQUERY_UI_TRANSLATIONS do |file|
|
187
|
+
next unless /^jquery.ui\.datepicker-(.+)\.js$/ =~ file
|
188
|
+
lang = file
|
189
|
+
js = File.read File.join(SRC_JQUERY_UI_TRANSLATIONS, file)
|
190
|
+
file.gsub!(/^jquery.ui\./,'')
|
191
|
+
manifest.print "javascript '#{File.join(path, 'jquery.ui', file)}'\n"
|
192
|
+
open File.join(DEST_JRAILS_TRANSLATIONS, file), 'w' do |f|
|
193
|
+
f.write js
|
194
|
+
end
|
195
|
+
file.gsub!(/\.js$/, '.min.js')
|
196
|
+
manifest.print "javascript '#{File.join(path, 'jquery.ui', file)}'\n"
|
197
|
+
open File.join(DEST_JRAILS_TRANSLATIONS, file), 'w' do |f|
|
198
|
+
f.write compress_js(js, "google")
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
# jQuery UI Themes
|
204
|
+
|
205
|
+
ui = JqueryUiTheme.new(File.join(SRC_JQUERY_UI_THEMES, 'base'))
|
206
|
+
ui.convert_css(File.join(DEST_JRAILS_THEMES, '_partials'))
|
207
|
+
|
208
|
+
all_jquery_ui_stylesheets = [
|
209
|
+
'_core.scss',
|
210
|
+
'_accordion.scss',
|
211
|
+
'_autocomplete.scss',
|
212
|
+
'_button.scss',
|
213
|
+
'_datepicker.scss',
|
214
|
+
'_dialog.scss',
|
215
|
+
'_panel.scss',
|
216
|
+
'_progressbar.scss',
|
217
|
+
'_resizable.scss',
|
218
|
+
'_selectable.scss',
|
219
|
+
'_selectmenu.scss',
|
220
|
+
'_slider.scss',
|
221
|
+
'_tabs.scss',
|
222
|
+
'_theme.scss'
|
223
|
+
].collect {|filename| File.read(File.join(DEST_JRAILS_THEMES, '_partials', filename))}.join "\n\n"
|
224
|
+
|
225
|
+
open File.join(DEST_JRAILS_THEMES, '_theme.scss'), 'w' do |f|
|
226
|
+
sass = JRAILS_MESSAGE2
|
227
|
+
f.print(all_jquery_ui_stylesheets)
|
228
|
+
f.print sass
|
229
|
+
FileUtils.rm_r(File.join(DEST_JRAILS_THEMES, '_partials'))
|
230
|
+
end
|
231
|
+
|
232
|
+
manifest.print "stylesheet 'jquery.ui/_theme.scss', :media => 'screen, projection'\n"
|
233
|
+
|
234
|
+
Dir.foreach SRC_JQUERY_UI_THEMES do |theme|
|
235
|
+
next if /^\./ =~ theme
|
236
|
+
|
237
|
+
# Convert the stylesheet
|
238
|
+
manifest.print "stylesheet 'jquery.ui/#{theme}.scss', :media => 'screen, projection'\n"
|
239
|
+
ui.convert_theme(theme, File.join(SRC_JQUERY_UI_THEMES, theme), File.join(DEST_JRAILS_THEMES))
|
240
|
+
|
241
|
+
# Copy the theme images directory
|
242
|
+
src_dir = File.join(SRC_JQUERY_UI_THEMES, theme, 'images')
|
243
|
+
dest_dir = File.join(DEST_JRAILS_IMAGES, theme)
|
244
|
+
FileUtils.mkdir_p dest_dir
|
245
|
+
|
246
|
+
Dir.foreach(src_dir) do |image|
|
247
|
+
next if /^\./ =~ image
|
248
|
+
FileUtils.cp(File.join(src_dir, image), dest_dir)
|
249
|
+
manifest.print "image 'jquery.ui/#{theme}/#{image}'\n"
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
# jQuery Sparklines
|
254
|
+
|
255
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'jquery.sparkline.js'), 'w' do |f|
|
256
|
+
f.print concat_files(all_files(SRC_SPARKLINES_SCRIPTS))
|
257
|
+
end
|
258
|
+
manifest.print "javascript 'jquery.sparkline.js'\n"
|
259
|
+
|
260
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'jquery.sparkline.min.js'), 'w' do |f|
|
261
|
+
f.print compress_js(all_files(SRC_SPARKLINES_SCRIPTS), "google")
|
262
|
+
end
|
263
|
+
manifest.print "javascript 'jquery.sparkline.min.js'\n"
|
264
|
+
|
265
|
+
# jQuery haml
|
266
|
+
|
267
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'jquery.haml.js'), 'w' do |f|
|
268
|
+
f.print concat_files(all_files(SRC_JHAML_SCRIPTS))
|
269
|
+
end
|
270
|
+
manifest.print "javascript 'jquery.haml.js'\n"
|
271
|
+
|
272
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'jquery.haml.min.js'), 'w' do |f|
|
273
|
+
f.print compress_js(all_files(SRC_JHAML_SCRIPTS), "google")
|
274
|
+
end
|
275
|
+
manifest.print "javascript 'jquery.haml.min.js'\n"
|
276
|
+
|
277
|
+
# HAML Js
|
278
|
+
|
279
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'haml.js'), 'w' do |f|
|
280
|
+
f.print concat_files(all_files(SRC_HAML_JS_SCRIPTS))
|
281
|
+
end
|
282
|
+
manifest.print "javascript 'haml.js'\n"
|
283
|
+
|
284
|
+
open File.join(DEST_JRAILS_TEMPLATES, 'haml.min.js'), 'w' do |f|
|
285
|
+
f.print compress_js(all_files(SRC_JHAML_SCRIPTS), "google")
|
286
|
+
end
|
287
|
+
manifest.print "javascript 'haml.min.js'\n"
|
288
|
+
|
289
|
+
#Flash Messages
|
290
|
+
FileUtils.mkdir_p(File.join(DEST_FLASH_STYLESHEETS))
|
291
|
+
css = File.read File.join(SRC_FLASH, 'flash_messages.css')
|
292
|
+
sass = ''
|
293
|
+
IO.popen("sass-convert -F css -T scss", 'r+') { |f| f.print(css); f.close_write; sass = f.read }
|
294
|
+
open File.join(DEST_FLASH_STYLESHEETS, '_flash_messages.scss'), 'w' do |f|
|
295
|
+
f.write sass
|
296
|
+
end
|
297
|
+
manifest.print "stylesheet 'partials/_flash_messages.scss', :media => 'screen, projection'\n"
|
298
|
+
|
299
|
+
# Copy the images directory
|
300
|
+
FileUtils.mkdir_p File.join(DEST_FLASH_IMAGES)
|
301
|
+
src_dir = SRC_FLASH_IMAGES
|
302
|
+
dest_dir = DEST_FLASH_IMAGES
|
303
|
+
|
304
|
+
Dir.foreach(src_dir) do |image|
|
305
|
+
next unless /\.png$/ =~ image
|
306
|
+
FileUtils.cp(File.join(src_dir, image), dest_dir)
|
307
|
+
manifest.print "image 'jquery.ui/flash_messages/#{image}'\n"
|
308
|
+
end
|
309
|
+
end
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
namespace :jrails do
|
314
|
+
desc 'Remove the prototype / script.aculo.us javascript files'
|
315
|
+
task :scrub_default_js do
|
316
|
+
files = %W[controls.js dragdrop.js effects.js prototype.js]
|
317
|
+
project_dir = File.join(RAILS_ROOT, 'public', 'javascripts')
|
318
|
+
files.each do |fname|
|
319
|
+
FileUtils.rm File.join(project_dir, fname)
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|
312
323
|
|