sn-jquery-ui-rails 6.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +2 -0
  5. data/Gemfile +3 -0
  6. data/History.md +168 -0
  7. data/License.txt +2 -0
  8. data/README.md +311 -0
  9. data/Rakefile +258 -0
  10. data/VERSIONS.md +39 -0
  11. data/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  12. data/app/assets/images/jquery-ui/ui-icons_444444_256x240.png +0 -0
  13. data/app/assets/images/jquery-ui/ui-icons_555555_256x240.png +0 -0
  14. data/app/assets/images/jquery-ui/ui-icons_777620_256x240.png +0 -0
  15. data/app/assets/images/jquery-ui/ui-icons_777777_256x240.png +0 -0
  16. data/app/assets/images/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
  17. data/app/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
  18. data/app/assets/javascripts/jquery-ui/core.js +15 -0
  19. data/app/assets/javascripts/jquery-ui/data.js +41 -0
  20. data/app/assets/javascripts/jquery-ui/disable-selection.js +48 -0
  21. data/app/assets/javascripts/jquery-ui/effect.all.js +15 -0
  22. data/app/assets/javascripts/jquery-ui/effect.js +1637 -0
  23. data/app/assets/javascripts/jquery-ui/effects/effect-blind.js +73 -0
  24. data/app/assets/javascripts/jquery-ui/effects/effect-bounce.js +113 -0
  25. data/app/assets/javascripts/jquery-ui/effects/effect-clip.js +68 -0
  26. data/app/assets/javascripts/jquery-ui/effects/effect-drop.js +72 -0
  27. data/app/assets/javascripts/jquery-ui/effects/effect-explode.js +114 -0
  28. data/app/assets/javascripts/jquery-ui/effects/effect-fade.js +50 -0
  29. data/app/assets/javascripts/jquery-ui/effects/effect-fold.js +92 -0
  30. data/app/assets/javascripts/jquery-ui/effects/effect-highlight.js +60 -0
  31. data/app/assets/javascripts/jquery-ui/effects/effect-puff.js +46 -0
  32. data/app/assets/javascripts/jquery-ui/effects/effect-pulsate.js +67 -0
  33. data/app/assets/javascripts/jquery-ui/effects/effect-scale.js +60 -0
  34. data/app/assets/javascripts/jquery-ui/effects/effect-shake.js +77 -0
  35. data/app/assets/javascripts/jquery-ui/effects/effect-size.js +194 -0
  36. data/app/assets/javascripts/jquery-ui/effects/effect-slide.js +79 -0
  37. data/app/assets/javascripts/jquery-ui/effects/effect-transfer.js +43 -0
  38. data/app/assets/javascripts/jquery-ui/escape-selector.js +23 -0
  39. data/app/assets/javascripts/jquery-ui/focusable.js +86 -0
  40. data/app/assets/javascripts/jquery-ui/form-reset-mixin.js +80 -0
  41. data/app/assets/javascripts/jquery-ui/form.js +22 -0
  42. data/app/assets/javascripts/jquery-ui/i18n/datepicker-af.js +37 -0
  43. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar-DZ.js +39 -0
  44. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar.js +39 -0
  45. data/app/assets/javascripts/jquery-ui/i18n/datepicker-az.js +37 -0
  46. data/app/assets/javascripts/jquery-ui/i18n/datepicker-be.js +37 -0
  47. data/app/assets/javascripts/jquery-ui/i18n/datepicker-bg.js +38 -0
  48. data/app/assets/javascripts/jquery-ui/i18n/datepicker-bs.js +37 -0
  49. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ca.js +37 -0
  50. data/app/assets/javascripts/jquery-ui/i18n/datepicker-cs.js +37 -0
  51. data/app/assets/javascripts/jquery-ui/i18n/datepicker-cy-GB.js +45 -0
  52. data/app/assets/javascripts/jquery-ui/i18n/datepicker-da.js +37 -0
  53. data/app/assets/javascripts/jquery-ui/i18n/datepicker-de.js +37 -0
  54. data/app/assets/javascripts/jquery-ui/i18n/datepicker-el.js +37 -0
  55. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-AU.js +37 -0
  56. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-GB.js +37 -0
  57. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-NZ.js +37 -0
  58. data/app/assets/javascripts/jquery-ui/i18n/datepicker-eo.js +37 -0
  59. data/app/assets/javascripts/jquery-ui/i18n/datepicker-es.js +37 -0
  60. data/app/assets/javascripts/jquery-ui/i18n/datepicker-et.js +45 -0
  61. data/app/assets/javascripts/jquery-ui/i18n/datepicker-eu.js +36 -0
  62. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fa.js +73 -0
  63. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fi.js +37 -0
  64. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fo.js +45 -0
  65. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CA.js +37 -0
  66. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CH.js +37 -0
  67. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr.js +39 -0
  68. data/app/assets/javascripts/jquery-ui/i18n/datepicker-gl.js +37 -0
  69. data/app/assets/javascripts/jquery-ui/i18n/datepicker-he.js +37 -0
  70. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hi.js +37 -0
  71. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hr.js +37 -0
  72. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hu.js +36 -0
  73. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hy.js +37 -0
  74. data/app/assets/javascripts/jquery-ui/i18n/datepicker-id.js +37 -0
  75. data/app/assets/javascripts/jquery-ui/i18n/datepicker-is.js +45 -0
  76. data/app/assets/javascripts/jquery-ui/i18n/datepicker-it-CH.js +37 -0
  77. data/app/assets/javascripts/jquery-ui/i18n/datepicker-it.js +37 -0
  78. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ja.js +37 -0
  79. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ka.js +48 -0
  80. data/app/assets/javascripts/jquery-ui/i18n/datepicker-kk.js +37 -0
  81. data/app/assets/javascripts/jquery-ui/i18n/datepicker-km.js +37 -0
  82. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ko.js +37 -0
  83. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ky.js +38 -0
  84. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lb.js +45 -0
  85. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lt.js +45 -0
  86. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lv.js +45 -0
  87. data/app/assets/javascripts/jquery-ui/i18n/datepicker-mk.js +37 -0
  88. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ml.js +37 -0
  89. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ms.js +37 -0
  90. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nb.js +49 -0
  91. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl-BE.js +37 -0
  92. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl.js +37 -0
  93. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nn.js +49 -0
  94. data/app/assets/javascripts/jquery-ui/i18n/datepicker-no.js +50 -0
  95. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pl.js +37 -0
  96. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt-BR.js +45 -0
  97. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt.js +44 -0
  98. data/app/assets/javascripts/jquery-ui/i18n/datepicker-rm.js +61 -0
  99. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ro.js +40 -0
  100. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ru.js +37 -0
  101. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sk.js +37 -0
  102. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sl.js +38 -0
  103. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sq.js +37 -0
  104. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr-SR.js +37 -0
  105. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr.js +37 -0
  106. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sv.js +37 -0
  107. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ta.js +53 -0
  108. data/app/assets/javascripts/jquery-ui/i18n/datepicker-th.js +37 -0
  109. data/app/assets/javascripts/jquery-ui/i18n/datepicker-tj.js +37 -0
  110. data/app/assets/javascripts/jquery-ui/i18n/datepicker-tr.js +37 -0
  111. data/app/assets/javascripts/jquery-ui/i18n/datepicker-uk.js +38 -0
  112. data/app/assets/javascripts/jquery-ui/i18n/datepicker-vi.js +37 -0
  113. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-CN.js +37 -0
  114. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-HK.js +37 -0
  115. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-TW.js +37 -0
  116. data/app/assets/javascripts/jquery-ui/ie.js +17 -0
  117. data/app/assets/javascripts/jquery-ui/jquery-1-7.js +91 -0
  118. data/app/assets/javascripts/jquery-ui/keycode.js +47 -0
  119. data/app/assets/javascripts/jquery-ui/labels.js +65 -0
  120. data/app/assets/javascripts/jquery-ui/plugin.js +46 -0
  121. data/app/assets/javascripts/jquery-ui/position.js +500 -0
  122. data/app/assets/javascripts/jquery-ui/safe-active-element.js +42 -0
  123. data/app/assets/javascripts/jquery-ui/safe-blur.js +23 -0
  124. data/app/assets/javascripts/jquery-ui/scroll-parent.js +47 -0
  125. data/app/assets/javascripts/jquery-ui/tabbable.js +38 -0
  126. data/app/assets/javascripts/jquery-ui/unique-id.js +51 -0
  127. data/app/assets/javascripts/jquery-ui/version.js +17 -0
  128. data/app/assets/javascripts/jquery-ui/widget.js +735 -0
  129. data/app/assets/javascripts/jquery-ui/widgets/accordion.js +618 -0
  130. data/app/assets/javascripts/jquery-ui/widgets/autocomplete.js +689 -0
  131. data/app/assets/javascripts/jquery-ui/widgets/button.js +391 -0
  132. data/app/assets/javascripts/jquery-ui/widgets/checkboxradio.js +291 -0
  133. data/app/assets/javascripts/jquery-ui/widgets/controlgroup.js +300 -0
  134. data/app/assets/javascripts/jquery-ui/widgets/datepicker.js +2123 -0
  135. data/app/assets/javascripts/jquery-ui/widgets/dialog.js +954 -0
  136. data/app/assets/javascripts/jquery-ui/widgets/draggable.js +1259 -0
  137. data/app/assets/javascripts/jquery-ui/widgets/droppable.js +502 -0
  138. data/app/assets/javascripts/jquery-ui/widgets/menu.js +680 -0
  139. data/app/assets/javascripts/jquery-ui/widgets/mouse.js +230 -0
  140. data/app/assets/javascripts/jquery-ui/widgets/progressbar.js +181 -0
  141. data/app/assets/javascripts/jquery-ui/widgets/resizable.js +1207 -0
  142. data/app/assets/javascripts/jquery-ui/widgets/selectable.js +314 -0
  143. data/app/assets/javascripts/jquery-ui/widgets/selectmenu.js +697 -0
  144. data/app/assets/javascripts/jquery-ui/widgets/slider.js +757 -0
  145. data/app/assets/javascripts/jquery-ui/widgets/sortable.js +1561 -0
  146. data/app/assets/javascripts/jquery-ui/widgets/spinner.js +581 -0
  147. data/app/assets/javascripts/jquery-ui/widgets/tabs.js +931 -0
  148. data/app/assets/javascripts/jquery-ui/widgets/tooltip.js +526 -0
  149. data/app/assets/javascripts/jquery-ui.js +56 -0
  150. data/app/assets/stylesheets/jquery-ui/accordion.css +26 -0
  151. data/app/assets/stylesheets/jquery-ui/all.css +14 -0
  152. data/app/assets/stylesheets/jquery-ui/autocomplete.css +19 -0
  153. data/app/assets/stylesheets/jquery-ui/base.css +32 -0
  154. data/app/assets/stylesheets/jquery-ui/button.css +85 -0
  155. data/app/assets/stylesheets/jquery-ui/checkboxradio.css +37 -0
  156. data/app/assets/stylesheets/jquery-ui/controlgroup.css +68 -0
  157. data/app/assets/stylesheets/jquery-ui/core.css +100 -0
  158. data/app/assets/stylesheets/jquery-ui/datepicker.css +188 -0
  159. data/app/assets/stylesheets/jquery-ui/dialog.css +104 -0
  160. data/app/assets/stylesheets/jquery-ui/draggable.css +15 -0
  161. data/app/assets/stylesheets/jquery-ui/menu.css +67 -0
  162. data/app/assets/stylesheets/jquery-ui/progressbar.css +31 -0
  163. data/app/assets/stylesheets/jquery-ui/resizable.css +81 -0
  164. data/app/assets/stylesheets/jquery-ui/selectable.css +20 -0
  165. data/app/assets/stylesheets/jquery-ui/selectmenu.css +53 -0
  166. data/app/assets/stylesheets/jquery-ui/slider.css +78 -0
  167. data/app/assets/stylesheets/jquery-ui/sortable.css +15 -0
  168. data/app/assets/stylesheets/jquery-ui/spinner.css +55 -0
  169. data/app/assets/stylesheets/jquery-ui/tabs.css +54 -0
  170. data/app/assets/stylesheets/jquery-ui/theme.css.erb +453 -0
  171. data/app/assets/stylesheets/jquery-ui/tooltip.css +22 -0
  172. data/app/assets/stylesheets/jquery-ui.css +1 -0
  173. data/lib/jquery/ui/rails/engine.rb +8 -0
  174. data/lib/jquery/ui/rails/version.rb +8 -0
  175. data/lib/jquery/ui/rails.rb +2 -0
  176. data/lib/jquery-ui-rails.rb +1 -0
  177. metadata +248 -0
data/Rakefile ADDED
@@ -0,0 +1,258 @@
1
+ Encoding.default_external = "UTF-8" if defined?(Encoding)
2
+ require 'json'
3
+ require 'bundler/gem_tasks'
4
+
5
+ # returns the source filename for a named file in the 'dependencies'
6
+ # array of a JSON build file
7
+ # (e.g., if the JSON build file contains
8
+ #
9
+ # "dependencies": {
10
+ # "jquery": ">=1.6",
11
+ # "ui.core": "1.9.2",
12
+ # "ui.widget": "1.9.2"
13
+ # },
14
+ #
15
+ # then "ui.widget" returns "widget.js")
16
+ #
17
+ # The only exception is "jquery", which doesn't follow the
18
+ # same naming conventions so it's a special case.
19
+ def source_file_for_dependency_entry(caller, dep_entry)
20
+ p = Pathname.new caller
21
+ parent_path = p.parent
22
+ parent_path.join(dep_entry + '.js').to_s
23
+ end
24
+
25
+ # return a Hash of dependency info, whose keys are jquery-ui
26
+ # source files and values are Arrays containing the source files
27
+ # they depend on
28
+ def map_dependencies
29
+ dependencies = {}
30
+ Dir.glob("jquery-ui/ui/**/*.js").each do |path|
31
+ basename = File.basename path
32
+ file = File.read path
33
+
34
+ matchdata = file.match(/define\(\s*\[\s*([\"\.\/\,\w\s-\:]+)\]/m)
35
+
36
+ next if matchdata.nil?
37
+
38
+ deps = matchdata[1]
39
+
40
+ # remove lines with comments
41
+ deps = deps.gsub(/\/\/.+\s/, "")
42
+
43
+ # remove all non-path symbols
44
+ deps = deps.gsub(/[\r\n\t\"\[\]\s]/, "")
45
+
46
+ deps_paths = deps.split(',')
47
+
48
+ deps_paths.map!(&method(:remove_js_extension))
49
+
50
+ # None of jquery.ui files should depend on jquery.js,
51
+ # so we remove 'jquery' from the list of dependencies for all files
52
+ deps_paths.reject! {|d| d == "jquery" }
53
+
54
+ deps_paths.map! {|d| source_file_for_dependency_entry path, d }
55
+
56
+ dependencies[basename] = deps_paths
57
+ end
58
+ dependencies
59
+ end
60
+
61
+ def dependency_hash
62
+ @dependency_hash ||= map_dependencies
63
+ end
64
+
65
+ def version
66
+ JSON.load(File.read('jquery-ui/package.json'))['version']
67
+ end
68
+
69
+ task :submodule do
70
+ sh 'git submodule update --init' unless File.exist?('jquery-ui/README.md')
71
+ end
72
+
73
+ def get_js_dependencies(basename)
74
+ dependencies = dependency_hash[basename]
75
+ if dependencies.nil?
76
+ puts "Warning: No dependencies found for #{basename}"
77
+ dependencies = []
78
+ end
79
+ # Make sure we do not package assets with broken dependencies
80
+ dependencies.each do |dep|
81
+ unless File.exist?("#{dep}")
82
+ fail "#{basename}: missing #{dep}"
83
+ end
84
+ end
85
+ dependencies
86
+ end
87
+
88
+ def remove_js_extension(path)
89
+ path.chomp(".js")
90
+ end
91
+
92
+ def protect_copyright_notice(source_code)
93
+ # YUI does not minify comments starting with "/*!"
94
+ # The i18n files start with non-copyright comments, so we require a newline
95
+ # to avoid protecting those
96
+ source_code.gsub!(/\A\s*\/\*\r?\n/, "/*!\n")
97
+ end
98
+
99
+ def build_image_dependencies(source_code)
100
+ image_dependencies = Set.new source_code.scan(/url\("?images\/([-_.a-zA-Z0-9]+)"?\)/).map(&:first)
101
+ code = image_dependencies.inject("") do |acc, img|
102
+ acc += " *= depend_on_asset \"jquery-ui/#{img}\"\n"
103
+ end
104
+ end
105
+
106
+ desc "Remove the app directory"
107
+ task :clean do
108
+ rm_rf 'app'
109
+ end
110
+
111
+ desc "Generate the JavaScript assets"
112
+ task :javascripts => :submodule do
113
+ Rake.rake_output_message 'Generating javascripts'
114
+
115
+ target_dir = "app/assets/javascripts"
116
+ target_ui_dir = "#{target_dir}/jquery-ui"
117
+ mkdir_p target_ui_dir
118
+ mkdir_p target_ui_dir + '/effects'
119
+ mkdir_p target_ui_dir + '/widgets'
120
+ mkdir_p target_ui_dir + '/i18n'
121
+
122
+ Dir.glob("jquery-ui/ui/**/*.js").each do |path|
123
+ basename = File.basename(path)
124
+ clean_path = path.gsub('/ui', '')
125
+ dep_modules = get_js_dependencies(basename).map(&method(:remove_js_extension))
126
+ File.open("#{target_dir}/#{clean_path}", "w") do |out|
127
+ dep_modules.each do |mod|
128
+ mod.gsub!('/ui', '')
129
+ out.write("//= require #{mod}\n")
130
+ end
131
+ # core.js is deprecated and uses define function which is usually unavailable
132
+ # so we need only dependency loading there with no file contents
133
+ next if clean_path == 'jquery-ui/core.js'
134
+ out.write("\n") unless dep_modules.empty?
135
+ source_code = File.read(path)
136
+ source_code.gsub!('@VERSION', version)
137
+ protect_copyright_notice(source_code)
138
+ out.write(source_code)
139
+ end
140
+ end
141
+
142
+ # process the i18n files separately for performance, since they will not have dependencies
143
+ # https://github.com/jquery-ui-rails/jquery-ui-rails/issues/9
144
+ Dir.glob("jquery-ui/ui/i18n/*.js").each do |path|
145
+ basename = File.basename(path)
146
+ File.open("#{target_ui_dir}/i18n/#{basename}", "w") do |out|
147
+ source_code = File.read(path)
148
+ source_code.gsub!('@VERSION', version)
149
+ protect_copyright_notice(source_code)
150
+ out.write(source_code)
151
+ end
152
+ end
153
+
154
+ File.open("#{target_ui_dir}/effect.all.js", "w") do |out|
155
+ Dir.glob("jquery-ui/ui/effects/*.js").sort.each do |path|
156
+ clean_path = remove_js_extension(path).gsub('/ui', '')
157
+ out.write("//= require #{clean_path}\n")
158
+ end
159
+ end
160
+ File.open("#{target_dir}/jquery-ui.js", "w") do |out|
161
+ Dir.glob("jquery-ui/ui/*.js").sort.each do |path|
162
+ clean_path = remove_js_extension(path).gsub('/ui', '')
163
+ out.write("//= require #{clean_path}\n")
164
+ end
165
+ Dir.glob("jquery-ui/ui/effects/*.js").sort.each do |path|
166
+ clean_path = remove_js_extension(path).gsub('/ui', '')
167
+ out.write("//= require #{clean_path}\n")
168
+ end
169
+ Dir.glob("jquery-ui/ui/widgets/*.js").sort.each do |path|
170
+ clean_path = remove_js_extension(path).gsub('/ui', '')
171
+ out.write("//= require #{clean_path}\n")
172
+ end
173
+ end
174
+ end
175
+
176
+ desc "Generate the CSS assets"
177
+ task :stylesheets => :submodule do
178
+ Rake.rake_output_message 'Generating stylesheets'
179
+
180
+ target_dir = "app/assets/stylesheets"
181
+ target_ui_dir = "#{target_dir}/jquery-ui"
182
+ mkdir_p target_ui_dir
183
+
184
+ File.open("#{target_dir}/jquery-ui.css", "w") do |out|
185
+ out.write("//= require jquery-ui/all\n")
186
+ end
187
+
188
+ css_dir = "jquery-ui/themes/base"
189
+ Dir.glob("#{css_dir}/*.css").each do |path|
190
+ basename = File.basename(path)
191
+ source_code = File.read(path)
192
+ source_code.gsub!('@VERSION', version)
193
+ protect_copyright_notice(source_code)
194
+ extra_dependencies = []
195
+ # Is "theme" listed among the dependencies for the matching JS file?
196
+ unless basename =~ /\.(all|base|core)\./
197
+ if dependencies = dependency_hash[basename.sub(/\.css/, '.js')]
198
+ dependencies.each do |dependency|
199
+ dependency = dependency.sub(/\.js$/, '')
200
+ dependent_stylesheet = "#{dependency}.css"
201
+ extra_dependencies << dependency if File.exists?("#{css_dir}/#{dependent_stylesheet}")
202
+ end
203
+ extra_dependencies << 'theme'
204
+ end
205
+ end
206
+ extra_dependencies.reverse.each do |dep|
207
+ # Add after first comment block
208
+ source_code = source_code.sub(/\A((.*?\*\/\n)?)/m, "\\1/*\n *= require jquery-ui/#{dep}\n */\n")
209
+ end
210
+ # Use "require" instead of @import
211
+ source_code.gsub!(/^@import (.*)$/) { |s|
212
+ m = s.match(/^@import (url\()?"(?<module>[-_.a-zA-Z]+)\.css"\)?;/) \
213
+ or fail "Cannot parse import: #{s}"
214
+ "/*\n *= require jquery-ui/#{m['module']}\n */"
215
+ }
216
+ # Be cute: collapse multiple require comment blocks into one
217
+ source_code.gsub!(/^( \*= require .*)\n \*\/(\n+)\/\*\n(?= \*= require )/, '\1\2')
218
+ source_code.gsub!(/\A(\/\*!.+?\*\/\s)/m, "\\1\n/*\n#{build_image_dependencies(source_code)} */\n\n") unless build_image_dependencies(source_code).empty?
219
+ # Replace hard-coded image URLs with asset path helpers
220
+ image_re = /url\("?images\/([-_.a-zA-Z0-9]+)"?\)/
221
+ extname = source_code =~ image_re ? ".erb" : ""
222
+ source_code.gsub!(image_re, 'url(<%= image_path("jquery-ui/\1") %>)')
223
+ File.open("#{target_ui_dir}/#{basename}#{extname}", "w") do |out|
224
+ out.write(source_code)
225
+ end
226
+ end
227
+ end
228
+
229
+ desc "Generate the image assets"
230
+ task :images => :submodule do
231
+ Rake.rake_output_message 'Copying images'
232
+
233
+ target_dir = "app/assets/images/jquery-ui"
234
+ mkdir_p target_dir
235
+
236
+ FileUtils.cp(Dir.glob("jquery-ui/themes/base/images/*"), target_dir)
237
+ end
238
+
239
+ desc "Update Jquery::Ui::Rails::JQUERY_UI_VERSION"
240
+ task :version => :submodule do
241
+ Rake.rake_output_message "Setting Jquery::Ui::Rails::JQUERY_UI_VERSION = \"#{version}\""
242
+
243
+ versionRb = 'lib/jquery/ui/rails/version.rb'
244
+ versionRbSource = File.read(versionRb)
245
+ versionDefinition = "JQUERY_UI_VERSION = \"#{version}\""
246
+ versionRbSource.sub! /JQUERY_UI_VERSION = "[^"]*"/, versionDefinition \
247
+ or fail "Could not find JQUERY_UI_VERSION in #{versionRb}"
248
+ File.open(versionRb, 'w') do |out|
249
+ out.write(versionRbSource)
250
+ end
251
+ end
252
+
253
+ desc "Clean and then generate everything (default)"
254
+ task :assets => [:clean, :javascripts, :stylesheets, :images, :version]
255
+
256
+ task :build => :assets
257
+
258
+ task :default => :assets
data/VERSIONS.md ADDED
@@ -0,0 +1,39 @@
1
+ # Bundled Versions
2
+
3
+ | Gem | jQuery UI |
4
+ |--------|-----------|
5
+ | 6.0.1 | 1.12.1 |
6
+ | 6.0.0 | 1.12.1 |
7
+ | 5.0.5 | 1.11.4 |
8
+ | 5.0.4 | 1.11.3 |
9
+ | 5.0.3 | 1.11.2 |
10
+ | 5.0.2 | 1.11.2 |
11
+ | 5.0.1 | 1.11.1 |
12
+ | 5.0.0 | 1.11.0 |
13
+ | 4.2.1 | 1.10.4 |
14
+ | 4.2.0 | 1.10.3 |
15
+ | 4.1.2 | 1.10.3 |
16
+ | 4.1.1 | 1.10.3 |
17
+ | 4.1.0 | 1.10.3 |
18
+ | 4.0.5 | 1.10.3 |
19
+ | 4.0.4 | 1.10.3 |
20
+ | 4.0.3 | 1.10.3 |
21
+ | 4.0.2 | 1.10.0 |
22
+ | 4.0.1 | 1.10.0 |
23
+ | 4.0.0 | 1.10.0 |
24
+ | 3.0.1 | 1.9.2 |
25
+ | 3.0.0 | 1.9.2 |
26
+ | 2.0.2 | 1.8.24 |
27
+ | 2.0.1 | 1.8.23 |
28
+ | 2.0.0 | 1.8.23 |
29
+ | 1.1.1 | 1.8.23 |
30
+ | 1.1.0 | 1.8.22 |
31
+ | 1.0.0 | 1.8.21 |
32
+ | 0.5.0 | 1.8.21 |
33
+ | 0.4.1 | 1.8.20 |
34
+ | 0.4.0 | 1.8.20 |
35
+ | 0.3.0 | 1.8.19 |
36
+ | 0.2.2 | 1.8.18 |
37
+ | 0.2.1 | 1.8.18 |
38
+ | 0.2.0 | 1.8.17 |
39
+ | 0.1.0 | 1.8.16 |
@@ -0,0 +1,15 @@
1
+ //= require jquery-ui/data
2
+ //= require jquery-ui/disable-selection
3
+ //= require jquery-ui/focusable
4
+ //= require jquery-ui/form
5
+ //= require jquery-ui/ie
6
+ //= require jquery-ui/keycode
7
+ //= require jquery-ui/labels
8
+ //= require jquery-ui/jquery-1-7
9
+ //= require jquery-ui/plugin
10
+ //= require jquery-ui/safe-active-element
11
+ //= require jquery-ui/safe-blur
12
+ //= require jquery-ui/scroll-parent
13
+ //= require jquery-ui/tabbable
14
+ //= require jquery-ui/unique-id
15
+ //= require jquery-ui/version
@@ -0,0 +1,41 @@
1
+ //= require jquery-ui/version
2
+
3
+ /*!
4
+ * jQuery UI :data 1.12.1
5
+ * http://jqueryui.com
6
+ *
7
+ * Copyright jQuery Foundation and other contributors
8
+ * Released under the MIT license.
9
+ * http://jquery.org/license
10
+ */
11
+
12
+ //>>label: :data Selector
13
+ //>>group: Core
14
+ //>>description: Selects elements which have data stored under the specified key.
15
+ //>>docs: http://api.jqueryui.com/data-selector/
16
+
17
+ ( function( factory ) {
18
+ if ( typeof define === "function" && define.amd ) {
19
+
20
+ // AMD. Register as an anonymous module.
21
+ define( [ "jquery", "./version" ], factory );
22
+ } else {
23
+
24
+ // Browser globals
25
+ factory( jQuery );
26
+ }
27
+ } ( function( $ ) {
28
+ return $.extend( $.expr[ ":" ], {
29
+ data: $.expr.createPseudo ?
30
+ $.expr.createPseudo( function( dataName ) {
31
+ return function( elem ) {
32
+ return !!$.data( elem, dataName );
33
+ };
34
+ } ) :
35
+
36
+ // Support: jQuery <1.8
37
+ function( elem, i, match ) {
38
+ return !!$.data( elem, match[ 3 ] );
39
+ }
40
+ } );
41
+ } ) );
@@ -0,0 +1,48 @@
1
+ //= require jquery-ui/version
2
+
3
+ /*!
4
+ * jQuery UI Disable Selection 1.12.1
5
+ * http://jqueryui.com
6
+ *
7
+ * Copyright jQuery Foundation and other contributors
8
+ * Released under the MIT license.
9
+ * http://jquery.org/license
10
+ */
11
+
12
+ //>>label: disableSelection
13
+ //>>group: Core
14
+ //>>description: Disable selection of text content within the set of matched elements.
15
+ //>>docs: http://api.jqueryui.com/disableSelection/
16
+
17
+ // This file is deprecated
18
+ ( function( factory ) {
19
+ if ( typeof define === "function" && define.amd ) {
20
+
21
+ // AMD. Register as an anonymous module.
22
+ define( [ "jquery", "./version" ], factory );
23
+ } else {
24
+
25
+ // Browser globals
26
+ factory( jQuery );
27
+ }
28
+ } ( function( $ ) {
29
+
30
+ return $.fn.extend( {
31
+ disableSelection: ( function() {
32
+ var eventType = "onselectstart" in document.createElement( "div" ) ?
33
+ "selectstart" :
34
+ "mousedown";
35
+
36
+ return function() {
37
+ return this.on( eventType + ".ui-disableSelection", function( event ) {
38
+ event.preventDefault();
39
+ } );
40
+ };
41
+ } )(),
42
+
43
+ enableSelection: function() {
44
+ return this.off( ".ui-disableSelection" );
45
+ }
46
+ } );
47
+
48
+ } ) );
@@ -0,0 +1,15 @@
1
+ //= require jquery-ui/effects/effect-blind
2
+ //= require jquery-ui/effects/effect-bounce
3
+ //= require jquery-ui/effects/effect-clip
4
+ //= require jquery-ui/effects/effect-drop
5
+ //= require jquery-ui/effects/effect-explode
6
+ //= require jquery-ui/effects/effect-fade
7
+ //= require jquery-ui/effects/effect-fold
8
+ //= require jquery-ui/effects/effect-highlight
9
+ //= require jquery-ui/effects/effect-puff
10
+ //= require jquery-ui/effects/effect-pulsate
11
+ //= require jquery-ui/effects/effect-scale
12
+ //= require jquery-ui/effects/effect-shake
13
+ //= require jquery-ui/effects/effect-size
14
+ //= require jquery-ui/effects/effect-slide
15
+ //= require jquery-ui/effects/effect-transfer