rails_admin 2.2.1 → 3.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (328) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -11
  3. data/README.md +37 -31
  4. data/Rakefile +2 -2
  5. data/app/assets/javascripts/rails_admin.js +21 -0
  6. data/app/assets/stylesheets/rails_admin/custom/mixins.scss +1 -1
  7. data/app/assets/stylesheets/rails_admin/custom/variables.scss +1 -1
  8. data/app/assets/stylesheets/rails_admin.scss.erb +76 -0
  9. data/app/controllers/rails_admin/application_controller.rb +4 -3
  10. data/app/controllers/rails_admin/main_controller.rb +43 -24
  11. data/app/helpers/rails_admin/application_helper.rb +69 -52
  12. data/app/helpers/rails_admin/form_builder.rb +5 -4
  13. data/app/helpers/rails_admin/main_helper.rb +27 -43
  14. data/app/views/kaminari/ra-twitter-bootstrap/_gap.html.erb +5 -0
  15. data/app/views/kaminari/ra-twitter-bootstrap/_next_page.html.erb +9 -0
  16. data/app/views/kaminari/ra-twitter-bootstrap/_page.html.erb +9 -0
  17. data/app/views/kaminari/ra-twitter-bootstrap/_paginator.html.erb +13 -0
  18. data/app/views/kaminari/ra-twitter-bootstrap/_prev_page.html.erb +9 -0
  19. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.erb +9 -0
  20. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.erb +6 -0
  21. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.erb +9 -0
  22. data/app/views/layouts/rails_admin/_head.html.erb +17 -0
  23. data/app/views/layouts/rails_admin/_navigation.html.erb +21 -0
  24. data/app/views/layouts/rails_admin/_secondary_navigation.html.erb +24 -0
  25. data/app/views/layouts/rails_admin/_sidebar_navigation.html.erb +9 -0
  26. data/app/views/layouts/rails_admin/application.html.erb +27 -0
  27. data/app/views/layouts/rails_admin/modal.js.erb +7 -0
  28. data/app/views/layouts/rails_admin/pjax.html.erb +20 -0
  29. data/app/views/rails_admin/main/_dashboard_history.html.erb +45 -0
  30. data/app/views/rails_admin/main/_delete_notice.html.erb +35 -0
  31. data/app/views/rails_admin/main/_form_action_text.html.erb +7 -0
  32. data/app/views/rails_admin/main/_form_boolean.html.erb +16 -0
  33. data/app/views/rails_admin/main/{_form_ck_editor.html.haml → _form_ck_editor.html.erb} +3 -3
  34. data/app/views/rails_admin/main/_form_code_mirror.html.erb +9 -0
  35. data/app/views/rails_admin/main/_form_colorpicker.html.erb +1 -0
  36. data/app/views/rails_admin/main/_form_datetime.html.erb +9 -0
  37. data/app/views/rails_admin/main/_form_enumeration.html.erb +21 -0
  38. data/app/views/rails_admin/main/_form_field.html.erb +1 -0
  39. data/app/views/rails_admin/main/_form_file_upload.html.erb +17 -0
  40. data/app/views/rails_admin/main/{_form_filtering_multiselect.html.haml → _form_filtering_multiselect.html.erb} +11 -11
  41. data/app/views/rails_admin/main/{_form_filtering_select.html.haml → _form_filtering_select.html.erb} +13 -12
  42. data/app/views/rails_admin/main/_form_froala.html.erb +8 -0
  43. data/app/views/rails_admin/main/_form_multiple_file_upload.html.erb +20 -0
  44. data/app/views/rails_admin/main/_form_nested_many.html.erb +21 -0
  45. data/app/views/rails_admin/main/_form_nested_one.html.erb +21 -0
  46. data/app/views/rails_admin/main/_form_polymorphic_association.html.erb +27 -0
  47. data/app/views/rails_admin/main/_form_simple_mde.html.erb +8 -0
  48. data/app/views/rails_admin/main/_form_text.html.erb +1 -0
  49. data/app/views/rails_admin/main/_form_wysihtml5.html.erb +8 -0
  50. data/app/views/rails_admin/main/_submit_buttons.html.erb +25 -0
  51. data/app/views/rails_admin/main/bulk_delete.html.erb +19 -0
  52. data/app/views/rails_admin/main/dashboard.html.erb +64 -0
  53. data/app/views/rails_admin/main/delete.html.erb +21 -0
  54. data/app/views/rails_admin/main/edit.html.erb +3 -0
  55. data/app/views/rails_admin/main/export.html.erb +146 -0
  56. data/app/views/rails_admin/main/history.html.erb +78 -0
  57. data/app/views/rails_admin/main/index.html.erb +193 -0
  58. data/app/views/rails_admin/main/new.html.erb +3 -0
  59. data/app/views/rails_admin/main/show.html.erb +28 -0
  60. data/config/initializers/active_record_extensions.rb +3 -1
  61. data/config/initializers/mongoid_extensions.rb +1 -1
  62. data/config/locales/rails_admin.en.yml +6 -1
  63. data/lib/generators/rails_admin/install_generator.rb +51 -3
  64. data/lib/generators/rails_admin/templates/environment.js +6 -0
  65. data/lib/generators/rails_admin/templates/initializer.erb +2 -1
  66. data/lib/generators/rails_admin/templates/rails_admin.js.erb +2 -0
  67. data/lib/generators/rails_admin/templates/rails_admin.scss +1 -0
  68. data/lib/generators/rails_admin/templates/webpack.config.js +32 -0
  69. data/lib/rails_admin/abstract_model.rb +24 -10
  70. data/lib/rails_admin/adapters/active_record/association.rb +20 -1
  71. data/lib/rails_admin/adapters/active_record/object_extension.rb +29 -0
  72. data/lib/rails_admin/adapters/active_record/property.rb +1 -1
  73. data/lib/rails_admin/adapters/active_record.rb +27 -23
  74. data/lib/rails_admin/adapters/mongoid/association.rb +38 -9
  75. data/lib/rails_admin/adapters/mongoid/bson.rb +4 -5
  76. data/lib/rails_admin/adapters/mongoid/extension.rb +3 -1
  77. data/lib/rails_admin/adapters/mongoid/object_extension.rb +32 -0
  78. data/lib/rails_admin/adapters/mongoid/property.rb +2 -2
  79. data/lib/rails_admin/adapters/mongoid.rb +27 -19
  80. data/lib/rails_admin/config/actions/base.rb +7 -2
  81. data/lib/rails_admin/config/actions/bulk_delete.rb +2 -2
  82. data/lib/rails_admin/config/actions/dashboard.rb +4 -3
  83. data/lib/rails_admin/config/actions/delete.rb +5 -9
  84. data/lib/rails_admin/config/actions/edit.rb +7 -7
  85. data/lib/rails_admin/config/actions/export.rb +2 -2
  86. data/lib/rails_admin/config/actions/history_index.rb +2 -2
  87. data/lib/rails_admin/config/actions/history_show.rb +2 -2
  88. data/lib/rails_admin/config/actions/index.rb +5 -7
  89. data/lib/rails_admin/config/actions/new.rb +9 -9
  90. data/lib/rails_admin/config/actions/show.rb +1 -1
  91. data/lib/rails_admin/config/actions/show_in_app.rb +6 -2
  92. data/lib/rails_admin/config/actions.rb +4 -4
  93. data/lib/rails_admin/config/configurable.rb +2 -2
  94. data/lib/rails_admin/config/fields/association.rb +15 -12
  95. data/lib/rails_admin/config/fields/base.rb +44 -24
  96. data/lib/rails_admin/config/fields/factories/active_storage.rb +1 -0
  97. data/lib/rails_admin/config/fields/factories/association.rb +6 -8
  98. data/lib/rails_admin/config/fields/factories/carrierwave.rb +2 -1
  99. data/lib/rails_admin/config/fields/factories/devise.rb +2 -1
  100. data/lib/rails_admin/config/fields/factories/dragonfly.rb +2 -1
  101. data/lib/rails_admin/config/fields/factories/paperclip.rb +2 -1
  102. data/lib/rails_admin/config/fields/factories/shrine.rb +1 -1
  103. data/lib/rails_admin/config/fields/group.rb +1 -2
  104. data/lib/rails_admin/config/fields/types/active_record_enum.rb +2 -0
  105. data/lib/rails_admin/config/fields/types/active_storage.rb +9 -7
  106. data/lib/rails_admin/config/fields/types/all.rb +1 -0
  107. data/lib/rails_admin/config/fields/types/belongs_to_association.rb +4 -12
  108. data/lib/rails_admin/config/fields/types/boolean.rb +32 -8
  109. data/lib/rails_admin/config/fields/types/carrierwave.rb +1 -0
  110. data/lib/rails_admin/config/fields/types/citext.rb +13 -0
  111. data/lib/rails_admin/config/fields/types/color.rb +6 -2
  112. data/lib/rails_admin/config/fields/types/date.rb +5 -8
  113. data/lib/rails_admin/config/fields/types/datetime.rb +18 -21
  114. data/lib/rails_admin/config/fields/types/decimal.rb +9 -2
  115. data/lib/rails_admin/config/fields/types/dragonfly.rb +3 -1
  116. data/lib/rails_admin/config/fields/types/enum.rb +1 -1
  117. data/lib/rails_admin/config/fields/types/file_upload.rb +4 -3
  118. data/lib/rails_admin/config/fields/types/float.rb +9 -2
  119. data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -5
  120. data/lib/rails_admin/config/fields/types/has_one_association.rb +1 -13
  121. data/lib/rails_admin/config/fields/types/integer.rb +2 -6
  122. data/lib/rails_admin/config/fields/types/multiple_active_storage.rb +8 -6
  123. data/lib/rails_admin/config/fields/types/multiple_carrierwave.rb +1 -0
  124. data/lib/rails_admin/config/fields/types/multiple_file_upload.rb +4 -3
  125. data/lib/rails_admin/config/fields/types/numeric.rb +18 -0
  126. data/lib/rails_admin/config/fields/types/polymorphic_association.rb +3 -2
  127. data/lib/rails_admin/config/fields/types/string.rb +1 -1
  128. data/lib/rails_admin/config/fields/types/time.rb +1 -4
  129. data/lib/rails_admin/config/fields/types/timestamp.rb +0 -4
  130. data/lib/rails_admin/config/fields/types.rb +1 -1
  131. data/lib/rails_admin/config/fields.rb +3 -1
  132. data/lib/rails_admin/config/has_fields.rb +5 -6
  133. data/lib/rails_admin/config/hideable.rb +1 -1
  134. data/lib/rails_admin/config/inspectable.rb +1 -3
  135. data/lib/rails_admin/config/model.rb +10 -10
  136. data/lib/rails_admin/config/sections/base.rb +2 -3
  137. data/lib/rails_admin/config/sections/list.rb +4 -15
  138. data/lib/rails_admin/config/sections.rb +1 -1
  139. data/lib/rails_admin/config.rb +73 -38
  140. data/lib/rails_admin/engine.rb +36 -23
  141. data/lib/rails_admin/extension.rb +6 -14
  142. data/lib/rails_admin/extensions/cancancan/authorization_adapter.rb +4 -2
  143. data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +12 -7
  144. data/lib/rails_admin/extensions/pundit/authorization_adapter.rb +6 -7
  145. data/lib/rails_admin/support/csv_converter.rb +12 -13
  146. data/lib/rails_admin/support/datetime.rb +40 -74
  147. data/lib/rails_admin/support/esmodule_preprocessor.rb +32 -0
  148. data/lib/rails_admin/support/hash_helper.rb +6 -5
  149. data/lib/rails_admin/version.rb +8 -4
  150. data/lib/rails_admin.rb +1 -4
  151. data/lib/tasks/rails_admin.rake +3 -3
  152. data/package.json +28 -0
  153. data/src/rails_admin/base.js +21 -0
  154. data/src/rails_admin/filter-box.js +405 -0
  155. data/src/rails_admin/filtering-multiselect.js +394 -0
  156. data/src/rails_admin/filtering-select.js +302 -0
  157. data/src/rails_admin/i18n.js +19 -0
  158. data/src/rails_admin/nested-form-hooks.js +100 -0
  159. data/src/rails_admin/remote-form.js +190 -0
  160. data/src/rails_admin/sidescroll.js +20 -0
  161. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/README.txt +0 -0
  162. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/mixins.scss +0 -0
  163. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/theming.scss +93 -34
  164. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/variables.scss +0 -0
  165. data/src/rails_admin/styles/base.scss +64 -0
  166. data/src/rails_admin/styles/filtering-multiselect.scss +53 -0
  167. data/src/rails_admin/styles/filtering-select.scss +70 -0
  168. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/cerulean/mixins.scss +0 -0
  169. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/cerulean/theming.scss +23 -21
  170. data/src/rails_admin/styles/themes/cerulean/variables.scss +830 -0
  171. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/mixins.scss +1 -1
  172. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/theming.scss +0 -0
  173. data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/variables.scss +1 -1
  174. data/src/rails_admin/styles/widgets.scss +35 -0
  175. data/src/rails_admin/ui.js +172 -0
  176. data/src/rails_admin/vendor/jquery.pjax.js +899 -0
  177. data/src/rails_admin/vendor/jquery_nested_form.js +122 -0
  178. data/src/rails_admin/widgets.js +512 -0
  179. data/vendor/assets/fonts/rails_admin/fa-solid-900.eot +0 -0
  180. data/vendor/assets/fonts/rails_admin/fa-solid-900.svg +5034 -0
  181. data/vendor/assets/fonts/rails_admin/fa-solid-900.ttf +0 -0
  182. data/vendor/assets/fonts/rails_admin/fa-solid-900.woff +0 -0
  183. data/vendor/assets/fonts/rails_admin/fa-solid-900.woff2 +0 -0
  184. data/vendor/assets/javascripts/rails_admin/jquery-ui/data.js +41 -0
  185. data/vendor/assets/javascripts/rails_admin/jquery-ui/effect.js +1637 -0
  186. data/vendor/assets/javascripts/rails_admin/jquery-ui/ie.js +17 -0
  187. data/vendor/assets/javascripts/rails_admin/jquery-ui/keycode.js +47 -0
  188. data/vendor/assets/javascripts/rails_admin/jquery-ui/position.js +500 -0
  189. data/vendor/assets/javascripts/rails_admin/jquery-ui/safe-active-element.js +42 -0
  190. data/vendor/assets/javascripts/rails_admin/jquery-ui/scroll-parent.js +47 -0
  191. data/vendor/assets/javascripts/rails_admin/jquery-ui/unique-id.js +51 -0
  192. data/vendor/assets/javascripts/rails_admin/jquery-ui/version.js +17 -0
  193. data/vendor/assets/javascripts/rails_admin/jquery-ui/widget.js +735 -0
  194. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/autocomplete.js +689 -0
  195. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/menu.js +680 -0
  196. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/mouse.js +230 -0
  197. data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/sortable.js +1561 -0
  198. data/vendor/assets/javascripts/rails_admin/jquery3.js +10872 -0
  199. data/vendor/assets/stylesheets/rails_admin/font-awesome.scss +4476 -2216
  200. metadata +118 -262
  201. data/app/assets/images/rails_admin/aristo/images/bg_fallback.png +0 -0
  202. data/app/assets/images/rails_admin/aristo/images/icon_sprite.png +0 -0
  203. data/app/assets/images/rails_admin/aristo/images/progress_bar.gif +0 -0
  204. data/app/assets/images/rails_admin/aristo/images/slider_handles.png +0 -0
  205. data/app/assets/images/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
  206. data/app/assets/images/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
  207. data/app/assets/images/rails_admin/bullet_black.png +0 -0
  208. data/app/assets/images/rails_admin/bullet_white.png +0 -0
  209. data/app/assets/images/rails_admin/calendar.png +0 -0
  210. data/app/assets/images/rails_admin/clock.png +0 -0
  211. data/app/assets/images/rails_admin/logo.png +0 -0
  212. data/app/assets/images/rails_admin/magnifier.png +0 -0
  213. data/app/assets/images/rails_admin/multiselect/icon_sprite.png +0 -0
  214. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-dark.png +0 -0
  215. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-light.png +0 -0
  216. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-dark.png +0 -0
  217. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-light.png +0 -0
  218. data/app/assets/javascripts/rails_admin/jquery-ui.js.erb +0 -8
  219. data/app/assets/javascripts/rails_admin/jquery.migrate.js +0 -3
  220. data/app/assets/javascripts/rails_admin/ra.filter-box.js +0 -246
  221. data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +0 -331
  222. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +0 -294
  223. data/app/assets/javascripts/rails_admin/ra.i18n.js +0 -28
  224. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.js +0 -59
  225. data/app/assets/javascripts/rails_admin/ra.remote-form.js +0 -155
  226. data/app/assets/javascripts/rails_admin/ra.sidescroll.js +0 -31
  227. data/app/assets/javascripts/rails_admin/ra.widgets.js +0 -379
  228. data/app/assets/javascripts/rails_admin/rails_admin.js +0 -21
  229. data/app/assets/javascripts/rails_admin/ui.js +0 -135
  230. data/app/assets/stylesheets/rails_admin/aristo/images/bg_fallback.png +0 -0
  231. data/app/assets/stylesheets/rails_admin/aristo/images/icon_sprite.png +0 -0
  232. data/app/assets/stylesheets/rails_admin/aristo/images/progress_bar.gif +0 -0
  233. data/app/assets/stylesheets/rails_admin/aristo/images/slider_handles.png +0 -0
  234. data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
  235. data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
  236. data/app/assets/stylesheets/rails_admin/aristo/jquery-ui-1.8.7.custom.scss +0 -733
  237. data/app/assets/stylesheets/rails_admin/base/font-awesome-4-compability.scss +0 -153
  238. data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.scss +0 -88
  239. data/app/assets/stylesheets/rails_admin/ra.sidescroll.scss +0 -29
  240. data/app/assets/stylesheets/rails_admin/ra.widgets.scss +0 -17
  241. data/app/assets/stylesheets/rails_admin/rails_admin.scss.erb +0 -110
  242. data/app/assets/stylesheets/rails_admin/themes/cerulean/variables.scss +0 -857
  243. data/app/views/kaminari/ra-twitter-bootstrap/_gap.html.haml +0 -2
  244. data/app/views/kaminari/ra-twitter-bootstrap/_next_page.html.haml +0 -4
  245. data/app/views/kaminari/ra-twitter-bootstrap/_page.html.haml +0 -4
  246. data/app/views/kaminari/ra-twitter-bootstrap/_paginator.html.haml +0 -9
  247. data/app/views/kaminari/ra-twitter-bootstrap/_prev_page.html.haml +0 -4
  248. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.haml +0 -4
  249. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.haml +0 -4
  250. data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.haml +0 -4
  251. data/app/views/layouts/rails_admin/_head.html.haml +0 -7
  252. data/app/views/layouts/rails_admin/_navigation.html.haml +0 -12
  253. data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +0 -10
  254. data/app/views/layouts/rails_admin/_sidebar_navigation.html.haml +0 -3
  255. data/app/views/layouts/rails_admin/application.html.haml +0 -16
  256. data/app/views/layouts/rails_admin/pjax.html.haml +0 -12
  257. data/app/views/rails_admin/main/_dashboard_history.html.haml +0 -21
  258. data/app/views/rails_admin/main/_delete_notice.html.haml +0 -24
  259. data/app/views/rails_admin/main/_form_action_text.html.haml +0 -7
  260. data/app/views/rails_admin/main/_form_boolean.html.haml +0 -3
  261. data/app/views/rails_admin/main/_form_code_mirror.html.haml +0 -9
  262. data/app/views/rails_admin/main/_form_colorpicker.html.haml +0 -1
  263. data/app/views/rails_admin/main/_form_datetime.html.haml +0 -5
  264. data/app/views/rails_admin/main/_form_enumeration.html.haml +0 -19
  265. data/app/views/rails_admin/main/_form_field.html.haml +0 -1
  266. data/app/views/rails_admin/main/_form_file_upload.html.haml +0 -17
  267. data/app/views/rails_admin/main/_form_froala.html.haml +0 -8
  268. data/app/views/rails_admin/main/_form_multiple_file_upload.html.haml +0 -16
  269. data/app/views/rails_admin/main/_form_nested_many.html.haml +0 -15
  270. data/app/views/rails_admin/main/_form_nested_one.html.haml +0 -17
  271. data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +0 -26
  272. data/app/views/rails_admin/main/_form_simple_mde.haml +0 -8
  273. data/app/views/rails_admin/main/_form_text.html.haml +0 -1
  274. data/app/views/rails_admin/main/_form_wysihtml5.html.haml +0 -8
  275. data/app/views/rails_admin/main/_submit_buttons.html.haml +0 -16
  276. data/app/views/rails_admin/main/bulk_delete.html.haml +0 -11
  277. data/app/views/rails_admin/main/dashboard.html.haml +0 -34
  278. data/app/views/rails_admin/main/delete.html.haml +0 -18
  279. data/app/views/rails_admin/main/edit.html.haml +0 -2
  280. data/app/views/rails_admin/main/export.html.haml +0 -92
  281. data/app/views/rails_admin/main/history.html.haml +0 -51
  282. data/app/views/rails_admin/main/index.html.haml +0 -126
  283. data/app/views/rails_admin/main/new.html.haml +0 -2
  284. data/app/views/rails_admin/main/show.html.haml +0 -15
  285. data/config/initializers/haml.rb +0 -5
  286. data/lib/rails_admin/adapters/active_record/abstract_object.rb +0 -38
  287. data/lib/rails_admin/adapters/mongoid/abstract_object.rb +0 -42
  288. data/lib/rails_admin/bootstrap-sass/compass_functions.rb +0 -28
  289. data/lib/rails_admin/bootstrap-sass/sass_functions.rb +0 -16
  290. data/lib/rails_admin/bootstrap-sass.rb +0 -49
  291. data/lib/rails_admin/config/lazy_model.rb +0 -68
  292. data/lib/rails_admin/extensions/history/auditing_adapter.rb +0 -37
  293. data/lib/rails_admin/extensions/history/history.rb +0 -44
  294. data/lib/rails_admin/extensions/history.rb +0 -3
  295. data/lib/rails_admin/support/i18n.rb +0 -43
  296. data/vendor/assets/fonts/rails_admin/FontAwesome.otf +0 -0
  297. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.eot +0 -0
  298. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.svg +0 -2671
  299. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.ttf +0 -0
  300. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff +0 -0
  301. data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff2 +0 -0
  302. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
  303. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
  304. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
  305. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
  306. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
  307. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
  308. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
  309. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
  310. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
  311. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_r.png +0 -0
  312. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_select.gif +0 -0
  313. data/vendor/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
  314. data/vendor/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
  315. data/vendor/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
  316. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
  317. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
  318. data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
  319. data/vendor/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
  320. data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_b.png +0 -0
  321. data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_g.png +0 -0
  322. data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_r.png +0 -0
  323. data/vendor/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
  324. data/vendor/assets/images/rails_admin/colorpicker/select.png +0 -0
  325. data/vendor/assets/images/rails_admin/colorpicker/select2.png +0 -0
  326. data/vendor/assets/images/rails_admin/colorpicker/slider.png +0 -0
  327. data/vendor/assets/javascripts/rails_admin/jquery.colorpicker.js +0 -484
  328. data/vendor/assets/stylesheets/rails_admin/jquery.colorpicker.scss +0 -182
@@ -0,0 +1,1637 @@
1
+ //= require rails_admin/jquery-ui/version
2
+
3
+ /*!
4
+ * jQuery UI Effects 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: Effects Core
13
+ //>>group: Effects
14
+ // jscs:disable maximumLineLength
15
+ //>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.
16
+ // jscs:enable maximumLineLength
17
+ //>>docs: http://api.jqueryui.com/category/effects-core/
18
+ //>>demos: http://jqueryui.com/effect/
19
+
20
+ ( function( factory ) {
21
+ if ( typeof define === "function" && define.amd ) {
22
+
23
+ // AMD. Register as an anonymous module.
24
+ define( [ "jquery", "./version" ], factory );
25
+ } else {
26
+
27
+ // Browser globals
28
+ factory( jQuery );
29
+ }
30
+ }( function( $ ) {
31
+
32
+ var dataSpace = "ui-effects-",
33
+ dataSpaceStyle = "ui-effects-style",
34
+ dataSpaceAnimated = "ui-effects-animated",
35
+
36
+ // Create a local jQuery because jQuery Color relies on it and the
37
+ // global may not exist with AMD and a custom build (#10199)
38
+ jQuery = $;
39
+
40
+ $.effects = {
41
+ effect: {}
42
+ };
43
+
44
+ /*!
45
+ * jQuery Color Animations v2.1.2
46
+ * https://github.com/jquery/jquery-color
47
+ *
48
+ * Copyright 2014 jQuery Foundation and other contributors
49
+ * Released under the MIT license.
50
+ * http://jquery.org/license
51
+ *
52
+ * Date: Wed Jan 16 08:47:09 2013 -0600
53
+ */
54
+ ( function( jQuery, undefined ) {
55
+
56
+ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " +
57
+ "borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
58
+
59
+ // Plusequals test for += 100 -= 100
60
+ rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
61
+
62
+ // A set of RE's that can match strings and generate color tuples.
63
+ stringParsers = [ {
64
+ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
65
+ parse: function( execResult ) {
66
+ return [
67
+ execResult[ 1 ],
68
+ execResult[ 2 ],
69
+ execResult[ 3 ],
70
+ execResult[ 4 ]
71
+ ];
72
+ }
73
+ }, {
74
+ re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
75
+ parse: function( execResult ) {
76
+ return [
77
+ execResult[ 1 ] * 2.55,
78
+ execResult[ 2 ] * 2.55,
79
+ execResult[ 3 ] * 2.55,
80
+ execResult[ 4 ]
81
+ ];
82
+ }
83
+ }, {
84
+
85
+ // This regex ignores A-F because it's compared against an already lowercased string
86
+ re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
87
+ parse: function( execResult ) {
88
+ return [
89
+ parseInt( execResult[ 1 ], 16 ),
90
+ parseInt( execResult[ 2 ], 16 ),
91
+ parseInt( execResult[ 3 ], 16 )
92
+ ];
93
+ }
94
+ }, {
95
+
96
+ // This regex ignores A-F because it's compared against an already lowercased string
97
+ re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
98
+ parse: function( execResult ) {
99
+ return [
100
+ parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
101
+ parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
102
+ parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
103
+ ];
104
+ }
105
+ }, {
106
+ re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
107
+ space: "hsla",
108
+ parse: function( execResult ) {
109
+ return [
110
+ execResult[ 1 ],
111
+ execResult[ 2 ] / 100,
112
+ execResult[ 3 ] / 100,
113
+ execResult[ 4 ]
114
+ ];
115
+ }
116
+ } ],
117
+
118
+ // JQuery.Color( )
119
+ color = jQuery.Color = function( color, green, blue, alpha ) {
120
+ return new jQuery.Color.fn.parse( color, green, blue, alpha );
121
+ },
122
+ spaces = {
123
+ rgba: {
124
+ props: {
125
+ red: {
126
+ idx: 0,
127
+ type: "byte"
128
+ },
129
+ green: {
130
+ idx: 1,
131
+ type: "byte"
132
+ },
133
+ blue: {
134
+ idx: 2,
135
+ type: "byte"
136
+ }
137
+ }
138
+ },
139
+
140
+ hsla: {
141
+ props: {
142
+ hue: {
143
+ idx: 0,
144
+ type: "degrees"
145
+ },
146
+ saturation: {
147
+ idx: 1,
148
+ type: "percent"
149
+ },
150
+ lightness: {
151
+ idx: 2,
152
+ type: "percent"
153
+ }
154
+ }
155
+ }
156
+ },
157
+ propTypes = {
158
+ "byte": {
159
+ floor: true,
160
+ max: 255
161
+ },
162
+ "percent": {
163
+ max: 1
164
+ },
165
+ "degrees": {
166
+ mod: 360,
167
+ floor: true
168
+ }
169
+ },
170
+ support = color.support = {},
171
+
172
+ // Element for support tests
173
+ supportElem = jQuery( "<p>" )[ 0 ],
174
+
175
+ // Colors = jQuery.Color.names
176
+ colors,
177
+
178
+ // Local aliases of functions called often
179
+ each = jQuery.each;
180
+
181
+ // Determine rgba support immediately
182
+ supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
183
+ support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
184
+
185
+ // Define cache name and alpha properties
186
+ // for rgba and hsla spaces
187
+ each( spaces, function( spaceName, space ) {
188
+ space.cache = "_" + spaceName;
189
+ space.props.alpha = {
190
+ idx: 3,
191
+ type: "percent",
192
+ def: 1
193
+ };
194
+ } );
195
+
196
+ function clamp( value, prop, allowEmpty ) {
197
+ var type = propTypes[ prop.type ] || {};
198
+
199
+ if ( value == null ) {
200
+ return ( allowEmpty || !prop.def ) ? null : prop.def;
201
+ }
202
+
203
+ // ~~ is an short way of doing floor for positive numbers
204
+ value = type.floor ? ~~value : parseFloat( value );
205
+
206
+ // IE will pass in empty strings as value for alpha,
207
+ // which will hit this case
208
+ if ( isNaN( value ) ) {
209
+ return prop.def;
210
+ }
211
+
212
+ if ( type.mod ) {
213
+
214
+ // We add mod before modding to make sure that negatives values
215
+ // get converted properly: -10 -> 350
216
+ return ( value + type.mod ) % type.mod;
217
+ }
218
+
219
+ // For now all property types without mod have min and max
220
+ return 0 > value ? 0 : type.max < value ? type.max : value;
221
+ }
222
+
223
+ function stringParse( string ) {
224
+ var inst = color(),
225
+ rgba = inst._rgba = [];
226
+
227
+ string = string.toLowerCase();
228
+
229
+ each( stringParsers, function( i, parser ) {
230
+ var parsed,
231
+ match = parser.re.exec( string ),
232
+ values = match && parser.parse( match ),
233
+ spaceName = parser.space || "rgba";
234
+
235
+ if ( values ) {
236
+ parsed = inst[ spaceName ]( values );
237
+
238
+ // If this was an rgba parse the assignment might happen twice
239
+ // oh well....
240
+ inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
241
+ rgba = inst._rgba = parsed._rgba;
242
+
243
+ // Exit each( stringParsers ) here because we matched
244
+ return false;
245
+ }
246
+ } );
247
+
248
+ // Found a stringParser that handled it
249
+ if ( rgba.length ) {
250
+
251
+ // If this came from a parsed string, force "transparent" when alpha is 0
252
+ // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
253
+ if ( rgba.join() === "0,0,0,0" ) {
254
+ jQuery.extend( rgba, colors.transparent );
255
+ }
256
+ return inst;
257
+ }
258
+
259
+ // Named colors
260
+ return colors[ string ];
261
+ }
262
+
263
+ color.fn = jQuery.extend( color.prototype, {
264
+ parse: function( red, green, blue, alpha ) {
265
+ if ( red === undefined ) {
266
+ this._rgba = [ null, null, null, null ];
267
+ return this;
268
+ }
269
+ if ( red.jquery || red.nodeType ) {
270
+ red = jQuery( red ).css( green );
271
+ green = undefined;
272
+ }
273
+
274
+ var inst = this,
275
+ type = jQuery.type( red ),
276
+ rgba = this._rgba = [];
277
+
278
+ // More than 1 argument specified - assume ( red, green, blue, alpha )
279
+ if ( green !== undefined ) {
280
+ red = [ red, green, blue, alpha ];
281
+ type = "array";
282
+ }
283
+
284
+ if ( type === "string" ) {
285
+ return this.parse( stringParse( red ) || colors._default );
286
+ }
287
+
288
+ if ( type === "array" ) {
289
+ each( spaces.rgba.props, function( key, prop ) {
290
+ rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
291
+ } );
292
+ return this;
293
+ }
294
+
295
+ if ( type === "object" ) {
296
+ if ( red instanceof color ) {
297
+ each( spaces, function( spaceName, space ) {
298
+ if ( red[ space.cache ] ) {
299
+ inst[ space.cache ] = red[ space.cache ].slice();
300
+ }
301
+ } );
302
+ } else {
303
+ each( spaces, function( spaceName, space ) {
304
+ var cache = space.cache;
305
+ each( space.props, function( key, prop ) {
306
+
307
+ // If the cache doesn't exist, and we know how to convert
308
+ if ( !inst[ cache ] && space.to ) {
309
+
310
+ // If the value was null, we don't need to copy it
311
+ // if the key was alpha, we don't need to copy it either
312
+ if ( key === "alpha" || red[ key ] == null ) {
313
+ return;
314
+ }
315
+ inst[ cache ] = space.to( inst._rgba );
316
+ }
317
+
318
+ // This is the only case where we allow nulls for ALL properties.
319
+ // call clamp with alwaysAllowEmpty
320
+ inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
321
+ } );
322
+
323
+ // Everything defined but alpha?
324
+ if ( inst[ cache ] &&
325
+ jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
326
+
327
+ // Use the default of 1
328
+ inst[ cache ][ 3 ] = 1;
329
+ if ( space.from ) {
330
+ inst._rgba = space.from( inst[ cache ] );
331
+ }
332
+ }
333
+ } );
334
+ }
335
+ return this;
336
+ }
337
+ },
338
+ is: function( compare ) {
339
+ var is = color( compare ),
340
+ same = true,
341
+ inst = this;
342
+
343
+ each( spaces, function( _, space ) {
344
+ var localCache,
345
+ isCache = is[ space.cache ];
346
+ if ( isCache ) {
347
+ localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
348
+ each( space.props, function( _, prop ) {
349
+ if ( isCache[ prop.idx ] != null ) {
350
+ same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
351
+ return same;
352
+ }
353
+ } );
354
+ }
355
+ return same;
356
+ } );
357
+ return same;
358
+ },
359
+ _space: function() {
360
+ var used = [],
361
+ inst = this;
362
+ each( spaces, function( spaceName, space ) {
363
+ if ( inst[ space.cache ] ) {
364
+ used.push( spaceName );
365
+ }
366
+ } );
367
+ return used.pop();
368
+ },
369
+ transition: function( other, distance ) {
370
+ var end = color( other ),
371
+ spaceName = end._space(),
372
+ space = spaces[ spaceName ],
373
+ startColor = this.alpha() === 0 ? color( "transparent" ) : this,
374
+ start = startColor[ space.cache ] || space.to( startColor._rgba ),
375
+ result = start.slice();
376
+
377
+ end = end[ space.cache ];
378
+ each( space.props, function( key, prop ) {
379
+ var index = prop.idx,
380
+ startValue = start[ index ],
381
+ endValue = end[ index ],
382
+ type = propTypes[ prop.type ] || {};
383
+
384
+ // If null, don't override start value
385
+ if ( endValue === null ) {
386
+ return;
387
+ }
388
+
389
+ // If null - use end
390
+ if ( startValue === null ) {
391
+ result[ index ] = endValue;
392
+ } else {
393
+ if ( type.mod ) {
394
+ if ( endValue - startValue > type.mod / 2 ) {
395
+ startValue += type.mod;
396
+ } else if ( startValue - endValue > type.mod / 2 ) {
397
+ startValue -= type.mod;
398
+ }
399
+ }
400
+ result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
401
+ }
402
+ } );
403
+ return this[ spaceName ]( result );
404
+ },
405
+ blend: function( opaque ) {
406
+
407
+ // If we are already opaque - return ourself
408
+ if ( this._rgba[ 3 ] === 1 ) {
409
+ return this;
410
+ }
411
+
412
+ var rgb = this._rgba.slice(),
413
+ a = rgb.pop(),
414
+ blend = color( opaque )._rgba;
415
+
416
+ return color( jQuery.map( rgb, function( v, i ) {
417
+ return ( 1 - a ) * blend[ i ] + a * v;
418
+ } ) );
419
+ },
420
+ toRgbaString: function() {
421
+ var prefix = "rgba(",
422
+ rgba = jQuery.map( this._rgba, function( v, i ) {
423
+ return v == null ? ( i > 2 ? 1 : 0 ) : v;
424
+ } );
425
+
426
+ if ( rgba[ 3 ] === 1 ) {
427
+ rgba.pop();
428
+ prefix = "rgb(";
429
+ }
430
+
431
+ return prefix + rgba.join() + ")";
432
+ },
433
+ toHslaString: function() {
434
+ var prefix = "hsla(",
435
+ hsla = jQuery.map( this.hsla(), function( v, i ) {
436
+ if ( v == null ) {
437
+ v = i > 2 ? 1 : 0;
438
+ }
439
+
440
+ // Catch 1 and 2
441
+ if ( i && i < 3 ) {
442
+ v = Math.round( v * 100 ) + "%";
443
+ }
444
+ return v;
445
+ } );
446
+
447
+ if ( hsla[ 3 ] === 1 ) {
448
+ hsla.pop();
449
+ prefix = "hsl(";
450
+ }
451
+ return prefix + hsla.join() + ")";
452
+ },
453
+ toHexString: function( includeAlpha ) {
454
+ var rgba = this._rgba.slice(),
455
+ alpha = rgba.pop();
456
+
457
+ if ( includeAlpha ) {
458
+ rgba.push( ~~( alpha * 255 ) );
459
+ }
460
+
461
+ return "#" + jQuery.map( rgba, function( v ) {
462
+
463
+ // Default to 0 when nulls exist
464
+ v = ( v || 0 ).toString( 16 );
465
+ return v.length === 1 ? "0" + v : v;
466
+ } ).join( "" );
467
+ },
468
+ toString: function() {
469
+ return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
470
+ }
471
+ } );
472
+ color.fn.parse.prototype = color.fn;
473
+
474
+ // Hsla conversions adapted from:
475
+ // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
476
+
477
+ function hue2rgb( p, q, h ) {
478
+ h = ( h + 1 ) % 1;
479
+ if ( h * 6 < 1 ) {
480
+ return p + ( q - p ) * h * 6;
481
+ }
482
+ if ( h * 2 < 1 ) {
483
+ return q;
484
+ }
485
+ if ( h * 3 < 2 ) {
486
+ return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
487
+ }
488
+ return p;
489
+ }
490
+
491
+ spaces.hsla.to = function( rgba ) {
492
+ if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
493
+ return [ null, null, null, rgba[ 3 ] ];
494
+ }
495
+ var r = rgba[ 0 ] / 255,
496
+ g = rgba[ 1 ] / 255,
497
+ b = rgba[ 2 ] / 255,
498
+ a = rgba[ 3 ],
499
+ max = Math.max( r, g, b ),
500
+ min = Math.min( r, g, b ),
501
+ diff = max - min,
502
+ add = max + min,
503
+ l = add * 0.5,
504
+ h, s;
505
+
506
+ if ( min === max ) {
507
+ h = 0;
508
+ } else if ( r === max ) {
509
+ h = ( 60 * ( g - b ) / diff ) + 360;
510
+ } else if ( g === max ) {
511
+ h = ( 60 * ( b - r ) / diff ) + 120;
512
+ } else {
513
+ h = ( 60 * ( r - g ) / diff ) + 240;
514
+ }
515
+
516
+ // Chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
517
+ // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
518
+ if ( diff === 0 ) {
519
+ s = 0;
520
+ } else if ( l <= 0.5 ) {
521
+ s = diff / add;
522
+ } else {
523
+ s = diff / ( 2 - add );
524
+ }
525
+ return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ];
526
+ };
527
+
528
+ spaces.hsla.from = function( hsla ) {
529
+ if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
530
+ return [ null, null, null, hsla[ 3 ] ];
531
+ }
532
+ var h = hsla[ 0 ] / 360,
533
+ s = hsla[ 1 ],
534
+ l = hsla[ 2 ],
535
+ a = hsla[ 3 ],
536
+ q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
537
+ p = 2 * l - q;
538
+
539
+ return [
540
+ Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
541
+ Math.round( hue2rgb( p, q, h ) * 255 ),
542
+ Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
543
+ a
544
+ ];
545
+ };
546
+
547
+ each( spaces, function( spaceName, space ) {
548
+ var props = space.props,
549
+ cache = space.cache,
550
+ to = space.to,
551
+ from = space.from;
552
+
553
+ // Makes rgba() and hsla()
554
+ color.fn[ spaceName ] = function( value ) {
555
+
556
+ // Generate a cache for this space if it doesn't exist
557
+ if ( to && !this[ cache ] ) {
558
+ this[ cache ] = to( this._rgba );
559
+ }
560
+ if ( value === undefined ) {
561
+ return this[ cache ].slice();
562
+ }
563
+
564
+ var ret,
565
+ type = jQuery.type( value ),
566
+ arr = ( type === "array" || type === "object" ) ? value : arguments,
567
+ local = this[ cache ].slice();
568
+
569
+ each( props, function( key, prop ) {
570
+ var val = arr[ type === "object" ? key : prop.idx ];
571
+ if ( val == null ) {
572
+ val = local[ prop.idx ];
573
+ }
574
+ local[ prop.idx ] = clamp( val, prop );
575
+ } );
576
+
577
+ if ( from ) {
578
+ ret = color( from( local ) );
579
+ ret[ cache ] = local;
580
+ return ret;
581
+ } else {
582
+ return color( local );
583
+ }
584
+ };
585
+
586
+ // Makes red() green() blue() alpha() hue() saturation() lightness()
587
+ each( props, function( key, prop ) {
588
+
589
+ // Alpha is included in more than one space
590
+ if ( color.fn[ key ] ) {
591
+ return;
592
+ }
593
+ color.fn[ key ] = function( value ) {
594
+ var vtype = jQuery.type( value ),
595
+ fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
596
+ local = this[ fn ](),
597
+ cur = local[ prop.idx ],
598
+ match;
599
+
600
+ if ( vtype === "undefined" ) {
601
+ return cur;
602
+ }
603
+
604
+ if ( vtype === "function" ) {
605
+ value = value.call( this, cur );
606
+ vtype = jQuery.type( value );
607
+ }
608
+ if ( value == null && prop.empty ) {
609
+ return this;
610
+ }
611
+ if ( vtype === "string" ) {
612
+ match = rplusequals.exec( value );
613
+ if ( match ) {
614
+ value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
615
+ }
616
+ }
617
+ local[ prop.idx ] = value;
618
+ return this[ fn ]( local );
619
+ };
620
+ } );
621
+ } );
622
+
623
+ // Add cssHook and .fx.step function for each named hook.
624
+ // accept a space separated string of properties
625
+ color.hook = function( hook ) {
626
+ var hooks = hook.split( " " );
627
+ each( hooks, function( i, hook ) {
628
+ jQuery.cssHooks[ hook ] = {
629
+ set: function( elem, value ) {
630
+ var parsed, curElem,
631
+ backgroundColor = "";
632
+
633
+ if ( value !== "transparent" && ( jQuery.type( value ) !== "string" ||
634
+ ( parsed = stringParse( value ) ) ) ) {
635
+ value = color( parsed || value );
636
+ if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
637
+ curElem = hook === "backgroundColor" ? elem.parentNode : elem;
638
+ while (
639
+ ( backgroundColor === "" || backgroundColor === "transparent" ) &&
640
+ curElem && curElem.style
641
+ ) {
642
+ try {
643
+ backgroundColor = jQuery.css( curElem, "backgroundColor" );
644
+ curElem = curElem.parentNode;
645
+ } catch ( e ) {
646
+ }
647
+ }
648
+
649
+ value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
650
+ backgroundColor :
651
+ "_default" );
652
+ }
653
+
654
+ value = value.toRgbaString();
655
+ }
656
+ try {
657
+ elem.style[ hook ] = value;
658
+ } catch ( e ) {
659
+
660
+ // Wrapped to prevent IE from throwing errors on "invalid" values like
661
+ // 'auto' or 'inherit'
662
+ }
663
+ }
664
+ };
665
+ jQuery.fx.step[ hook ] = function( fx ) {
666
+ if ( !fx.colorInit ) {
667
+ fx.start = color( fx.elem, hook );
668
+ fx.end = color( fx.end );
669
+ fx.colorInit = true;
670
+ }
671
+ jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
672
+ };
673
+ } );
674
+
675
+ };
676
+
677
+ color.hook( stepHooks );
678
+
679
+ jQuery.cssHooks.borderColor = {
680
+ expand: function( value ) {
681
+ var expanded = {};
682
+
683
+ each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
684
+ expanded[ "border" + part + "Color" ] = value;
685
+ } );
686
+ return expanded;
687
+ }
688
+ };
689
+
690
+ // Basic color names only.
691
+ // Usage of any of the other color names requires adding yourself or including
692
+ // jquery.color.svg-names.js.
693
+ colors = jQuery.Color.names = {
694
+
695
+ // 4.1. Basic color keywords
696
+ aqua: "#00ffff",
697
+ black: "#000000",
698
+ blue: "#0000ff",
699
+ fuchsia: "#ff00ff",
700
+ gray: "#808080",
701
+ green: "#008000",
702
+ lime: "#00ff00",
703
+ maroon: "#800000",
704
+ navy: "#000080",
705
+ olive: "#808000",
706
+ purple: "#800080",
707
+ red: "#ff0000",
708
+ silver: "#c0c0c0",
709
+ teal: "#008080",
710
+ white: "#ffffff",
711
+ yellow: "#ffff00",
712
+
713
+ // 4.2.3. "transparent" color keyword
714
+ transparent: [ null, null, null, 0 ],
715
+
716
+ _default: "#ffffff"
717
+ };
718
+
719
+ } )( jQuery );
720
+
721
+ /******************************************************************************/
722
+ /****************************** CLASS ANIMATIONS ******************************/
723
+ /******************************************************************************/
724
+ ( function() {
725
+
726
+ var classAnimationActions = [ "add", "remove", "toggle" ],
727
+ shorthandStyles = {
728
+ border: 1,
729
+ borderBottom: 1,
730
+ borderColor: 1,
731
+ borderLeft: 1,
732
+ borderRight: 1,
733
+ borderTop: 1,
734
+ borderWidth: 1,
735
+ margin: 1,
736
+ padding: 1
737
+ };
738
+
739
+ $.each(
740
+ [ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ],
741
+ function( _, prop ) {
742
+ $.fx.step[ prop ] = function( fx ) {
743
+ if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
744
+ jQuery.style( fx.elem, prop, fx.end );
745
+ fx.setAttr = true;
746
+ }
747
+ };
748
+ }
749
+ );
750
+
751
+ function getElementStyles( elem ) {
752
+ var key, len,
753
+ style = elem.ownerDocument.defaultView ?
754
+ elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
755
+ elem.currentStyle,
756
+ styles = {};
757
+
758
+ if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
759
+ len = style.length;
760
+ while ( len-- ) {
761
+ key = style[ len ];
762
+ if ( typeof style[ key ] === "string" ) {
763
+ styles[ $.camelCase( key ) ] = style[ key ];
764
+ }
765
+ }
766
+
767
+ // Support: Opera, IE <9
768
+ } else {
769
+ for ( key in style ) {
770
+ if ( typeof style[ key ] === "string" ) {
771
+ styles[ key ] = style[ key ];
772
+ }
773
+ }
774
+ }
775
+
776
+ return styles;
777
+ }
778
+
779
+ function styleDifference( oldStyle, newStyle ) {
780
+ var diff = {},
781
+ name, value;
782
+
783
+ for ( name in newStyle ) {
784
+ value = newStyle[ name ];
785
+ if ( oldStyle[ name ] !== value ) {
786
+ if ( !shorthandStyles[ name ] ) {
787
+ if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
788
+ diff[ name ] = value;
789
+ }
790
+ }
791
+ }
792
+ }
793
+
794
+ return diff;
795
+ }
796
+
797
+ // Support: jQuery <1.8
798
+ if ( !$.fn.addBack ) {
799
+ $.fn.addBack = function( selector ) {
800
+ return this.add( selector == null ?
801
+ this.prevObject : this.prevObject.filter( selector )
802
+ );
803
+ };
804
+ }
805
+
806
+ $.effects.animateClass = function( value, duration, easing, callback ) {
807
+ var o = $.speed( duration, easing, callback );
808
+
809
+ return this.queue( function() {
810
+ var animated = $( this ),
811
+ baseClass = animated.attr( "class" ) || "",
812
+ applyClassChange,
813
+ allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
814
+
815
+ // Map the animated objects to store the original styles.
816
+ allAnimations = allAnimations.map( function() {
817
+ var el = $( this );
818
+ return {
819
+ el: el,
820
+ start: getElementStyles( this )
821
+ };
822
+ } );
823
+
824
+ // Apply class change
825
+ applyClassChange = function() {
826
+ $.each( classAnimationActions, function( i, action ) {
827
+ if ( value[ action ] ) {
828
+ animated[ action + "Class" ]( value[ action ] );
829
+ }
830
+ } );
831
+ };
832
+ applyClassChange();
833
+
834
+ // Map all animated objects again - calculate new styles and diff
835
+ allAnimations = allAnimations.map( function() {
836
+ this.end = getElementStyles( this.el[ 0 ] );
837
+ this.diff = styleDifference( this.start, this.end );
838
+ return this;
839
+ } );
840
+
841
+ // Apply original class
842
+ animated.attr( "class", baseClass );
843
+
844
+ // Map all animated objects again - this time collecting a promise
845
+ allAnimations = allAnimations.map( function() {
846
+ var styleInfo = this,
847
+ dfd = $.Deferred(),
848
+ opts = $.extend( {}, o, {
849
+ queue: false,
850
+ complete: function() {
851
+ dfd.resolve( styleInfo );
852
+ }
853
+ } );
854
+
855
+ this.el.animate( this.diff, opts );
856
+ return dfd.promise();
857
+ } );
858
+
859
+ // Once all animations have completed:
860
+ $.when.apply( $, allAnimations.get() ).done( function() {
861
+
862
+ // Set the final class
863
+ applyClassChange();
864
+
865
+ // For each animated element,
866
+ // clear all css properties that were animated
867
+ $.each( arguments, function() {
868
+ var el = this.el;
869
+ $.each( this.diff, function( key ) {
870
+ el.css( key, "" );
871
+ } );
872
+ } );
873
+
874
+ // This is guarnteed to be there if you use jQuery.speed()
875
+ // it also handles dequeuing the next anim...
876
+ o.complete.call( animated[ 0 ] );
877
+ } );
878
+ } );
879
+ };
880
+
881
+ $.fn.extend( {
882
+ addClass: ( function( orig ) {
883
+ return function( classNames, speed, easing, callback ) {
884
+ return speed ?
885
+ $.effects.animateClass.call( this,
886
+ { add: classNames }, speed, easing, callback ) :
887
+ orig.apply( this, arguments );
888
+ };
889
+ } )( $.fn.addClass ),
890
+
891
+ removeClass: ( function( orig ) {
892
+ return function( classNames, speed, easing, callback ) {
893
+ return arguments.length > 1 ?
894
+ $.effects.animateClass.call( this,
895
+ { remove: classNames }, speed, easing, callback ) :
896
+ orig.apply( this, arguments );
897
+ };
898
+ } )( $.fn.removeClass ),
899
+
900
+ toggleClass: ( function( orig ) {
901
+ return function( classNames, force, speed, easing, callback ) {
902
+ if ( typeof force === "boolean" || force === undefined ) {
903
+ if ( !speed ) {
904
+
905
+ // Without speed parameter
906
+ return orig.apply( this, arguments );
907
+ } else {
908
+ return $.effects.animateClass.call( this,
909
+ ( force ? { add: classNames } : { remove: classNames } ),
910
+ speed, easing, callback );
911
+ }
912
+ } else {
913
+
914
+ // Without force parameter
915
+ return $.effects.animateClass.call( this,
916
+ { toggle: classNames }, force, speed, easing );
917
+ }
918
+ };
919
+ } )( $.fn.toggleClass ),
920
+
921
+ switchClass: function( remove, add, speed, easing, callback ) {
922
+ return $.effects.animateClass.call( this, {
923
+ add: add,
924
+ remove: remove
925
+ }, speed, easing, callback );
926
+ }
927
+ } );
928
+
929
+ } )();
930
+
931
+ /******************************************************************************/
932
+ /*********************************** EFFECTS **********************************/
933
+ /******************************************************************************/
934
+
935
+ ( function() {
936
+
937
+ if ( $.expr && $.expr.filters && $.expr.filters.animated ) {
938
+ $.expr.filters.animated = ( function( orig ) {
939
+ return function( elem ) {
940
+ return !!$( elem ).data( dataSpaceAnimated ) || orig( elem );
941
+ };
942
+ } )( $.expr.filters.animated );
943
+ }
944
+
945
+ if ( $.uiBackCompat !== false ) {
946
+ $.extend( $.effects, {
947
+
948
+ // Saves a set of properties in a data storage
949
+ save: function( element, set ) {
950
+ var i = 0, length = set.length;
951
+ for ( ; i < length; i++ ) {
952
+ if ( set[ i ] !== null ) {
953
+ element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
954
+ }
955
+ }
956
+ },
957
+
958
+ // Restores a set of previously saved properties from a data storage
959
+ restore: function( element, set ) {
960
+ var val, i = 0, length = set.length;
961
+ for ( ; i < length; i++ ) {
962
+ if ( set[ i ] !== null ) {
963
+ val = element.data( dataSpace + set[ i ] );
964
+ element.css( set[ i ], val );
965
+ }
966
+ }
967
+ },
968
+
969
+ setMode: function( el, mode ) {
970
+ if ( mode === "toggle" ) {
971
+ mode = el.is( ":hidden" ) ? "show" : "hide";
972
+ }
973
+ return mode;
974
+ },
975
+
976
+ // Wraps the element around a wrapper that copies position properties
977
+ createWrapper: function( element ) {
978
+
979
+ // If the element is already wrapped, return it
980
+ if ( element.parent().is( ".ui-effects-wrapper" ) ) {
981
+ return element.parent();
982
+ }
983
+
984
+ // Wrap the element
985
+ var props = {
986
+ width: element.outerWidth( true ),
987
+ height: element.outerHeight( true ),
988
+ "float": element.css( "float" )
989
+ },
990
+ wrapper = $( "<div></div>" )
991
+ .addClass( "ui-effects-wrapper" )
992
+ .css( {
993
+ fontSize: "100%",
994
+ background: "transparent",
995
+ border: "none",
996
+ margin: 0,
997
+ padding: 0
998
+ } ),
999
+
1000
+ // Store the size in case width/height are defined in % - Fixes #5245
1001
+ size = {
1002
+ width: element.width(),
1003
+ height: element.height()
1004
+ },
1005
+ active = document.activeElement;
1006
+
1007
+ // Support: Firefox
1008
+ // Firefox incorrectly exposes anonymous content
1009
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
1010
+ try {
1011
+ active.id;
1012
+ } catch ( e ) {
1013
+ active = document.body;
1014
+ }
1015
+
1016
+ element.wrap( wrapper );
1017
+
1018
+ // Fixes #7595 - Elements lose focus when wrapped.
1019
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
1020
+ $( active ).trigger( "focus" );
1021
+ }
1022
+
1023
+ // Hotfix for jQuery 1.4 since some change in wrap() seems to actually
1024
+ // lose the reference to the wrapped element
1025
+ wrapper = element.parent();
1026
+
1027
+ // Transfer positioning properties to the wrapper
1028
+ if ( element.css( "position" ) === "static" ) {
1029
+ wrapper.css( { position: "relative" } );
1030
+ element.css( { position: "relative" } );
1031
+ } else {
1032
+ $.extend( props, {
1033
+ position: element.css( "position" ),
1034
+ zIndex: element.css( "z-index" )
1035
+ } );
1036
+ $.each( [ "top", "left", "bottom", "right" ], function( i, pos ) {
1037
+ props[ pos ] = element.css( pos );
1038
+ if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
1039
+ props[ pos ] = "auto";
1040
+ }
1041
+ } );
1042
+ element.css( {
1043
+ position: "relative",
1044
+ top: 0,
1045
+ left: 0,
1046
+ right: "auto",
1047
+ bottom: "auto"
1048
+ } );
1049
+ }
1050
+ element.css( size );
1051
+
1052
+ return wrapper.css( props ).show();
1053
+ },
1054
+
1055
+ removeWrapper: function( element ) {
1056
+ var active = document.activeElement;
1057
+
1058
+ if ( element.parent().is( ".ui-effects-wrapper" ) ) {
1059
+ element.parent().replaceWith( element );
1060
+
1061
+ // Fixes #7595 - Elements lose focus when wrapped.
1062
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
1063
+ $( active ).trigger( "focus" );
1064
+ }
1065
+ }
1066
+
1067
+ return element;
1068
+ }
1069
+ } );
1070
+ }
1071
+
1072
+ $.extend( $.effects, {
1073
+ version: "1.12.1",
1074
+
1075
+ define: function( name, mode, effect ) {
1076
+ if ( !effect ) {
1077
+ effect = mode;
1078
+ mode = "effect";
1079
+ }
1080
+
1081
+ $.effects.effect[ name ] = effect;
1082
+ $.effects.effect[ name ].mode = mode;
1083
+
1084
+ return effect;
1085
+ },
1086
+
1087
+ scaledDimensions: function( element, percent, direction ) {
1088
+ if ( percent === 0 ) {
1089
+ return {
1090
+ height: 0,
1091
+ width: 0,
1092
+ outerHeight: 0,
1093
+ outerWidth: 0
1094
+ };
1095
+ }
1096
+
1097
+ var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1,
1098
+ y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1;
1099
+
1100
+ return {
1101
+ height: element.height() * y,
1102
+ width: element.width() * x,
1103
+ outerHeight: element.outerHeight() * y,
1104
+ outerWidth: element.outerWidth() * x
1105
+ };
1106
+
1107
+ },
1108
+
1109
+ clipToBox: function( animation ) {
1110
+ return {
1111
+ width: animation.clip.right - animation.clip.left,
1112
+ height: animation.clip.bottom - animation.clip.top,
1113
+ left: animation.clip.left,
1114
+ top: animation.clip.top
1115
+ };
1116
+ },
1117
+
1118
+ // Injects recently queued functions to be first in line (after "inprogress")
1119
+ unshift: function( element, queueLength, count ) {
1120
+ var queue = element.queue();
1121
+
1122
+ if ( queueLength > 1 ) {
1123
+ queue.splice.apply( queue,
1124
+ [ 1, 0 ].concat( queue.splice( queueLength, count ) ) );
1125
+ }
1126
+ element.dequeue();
1127
+ },
1128
+
1129
+ saveStyle: function( element ) {
1130
+ element.data( dataSpaceStyle, element[ 0 ].style.cssText );
1131
+ },
1132
+
1133
+ restoreStyle: function( element ) {
1134
+ element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || "";
1135
+ element.removeData( dataSpaceStyle );
1136
+ },
1137
+
1138
+ mode: function( element, mode ) {
1139
+ var hidden = element.is( ":hidden" );
1140
+
1141
+ if ( mode === "toggle" ) {
1142
+ mode = hidden ? "show" : "hide";
1143
+ }
1144
+ if ( hidden ? mode === "hide" : mode === "show" ) {
1145
+ mode = "none";
1146
+ }
1147
+ return mode;
1148
+ },
1149
+
1150
+ // Translates a [top,left] array into a baseline value
1151
+ getBaseline: function( origin, original ) {
1152
+ var y, x;
1153
+
1154
+ switch ( origin[ 0 ] ) {
1155
+ case "top":
1156
+ y = 0;
1157
+ break;
1158
+ case "middle":
1159
+ y = 0.5;
1160
+ break;
1161
+ case "bottom":
1162
+ y = 1;
1163
+ break;
1164
+ default:
1165
+ y = origin[ 0 ] / original.height;
1166
+ }
1167
+
1168
+ switch ( origin[ 1 ] ) {
1169
+ case "left":
1170
+ x = 0;
1171
+ break;
1172
+ case "center":
1173
+ x = 0.5;
1174
+ break;
1175
+ case "right":
1176
+ x = 1;
1177
+ break;
1178
+ default:
1179
+ x = origin[ 1 ] / original.width;
1180
+ }
1181
+
1182
+ return {
1183
+ x: x,
1184
+ y: y
1185
+ };
1186
+ },
1187
+
1188
+ // Creates a placeholder element so that the original element can be made absolute
1189
+ createPlaceholder: function( element ) {
1190
+ var placeholder,
1191
+ cssPosition = element.css( "position" ),
1192
+ position = element.position();
1193
+
1194
+ // Lock in margins first to account for form elements, which
1195
+ // will change margin if you explicitly set height
1196
+ // see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
1197
+ // Support: Safari
1198
+ element.css( {
1199
+ marginTop: element.css( "marginTop" ),
1200
+ marginBottom: element.css( "marginBottom" ),
1201
+ marginLeft: element.css( "marginLeft" ),
1202
+ marginRight: element.css( "marginRight" )
1203
+ } )
1204
+ .outerWidth( element.outerWidth() )
1205
+ .outerHeight( element.outerHeight() );
1206
+
1207
+ if ( /^(static|relative)/.test( cssPosition ) ) {
1208
+ cssPosition = "absolute";
1209
+
1210
+ placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( {
1211
+
1212
+ // Convert inline to inline block to account for inline elements
1213
+ // that turn to inline block based on content (like img)
1214
+ display: /^(inline|ruby)/.test( element.css( "display" ) ) ?
1215
+ "inline-block" :
1216
+ "block",
1217
+ visibility: "hidden",
1218
+
1219
+ // Margins need to be set to account for margin collapse
1220
+ marginTop: element.css( "marginTop" ),
1221
+ marginBottom: element.css( "marginBottom" ),
1222
+ marginLeft: element.css( "marginLeft" ),
1223
+ marginRight: element.css( "marginRight" ),
1224
+ "float": element.css( "float" )
1225
+ } )
1226
+ .outerWidth( element.outerWidth() )
1227
+ .outerHeight( element.outerHeight() )
1228
+ .addClass( "ui-effects-placeholder" );
1229
+
1230
+ element.data( dataSpace + "placeholder", placeholder );
1231
+ }
1232
+
1233
+ element.css( {
1234
+ position: cssPosition,
1235
+ left: position.left,
1236
+ top: position.top
1237
+ } );
1238
+
1239
+ return placeholder;
1240
+ },
1241
+
1242
+ removePlaceholder: function( element ) {
1243
+ var dataKey = dataSpace + "placeholder",
1244
+ placeholder = element.data( dataKey );
1245
+
1246
+ if ( placeholder ) {
1247
+ placeholder.remove();
1248
+ element.removeData( dataKey );
1249
+ }
1250
+ },
1251
+
1252
+ // Removes a placeholder if it exists and restores
1253
+ // properties that were modified during placeholder creation
1254
+ cleanUp: function( element ) {
1255
+ $.effects.restoreStyle( element );
1256
+ $.effects.removePlaceholder( element );
1257
+ },
1258
+
1259
+ setTransition: function( element, list, factor, value ) {
1260
+ value = value || {};
1261
+ $.each( list, function( i, x ) {
1262
+ var unit = element.cssUnit( x );
1263
+ if ( unit[ 0 ] > 0 ) {
1264
+ value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
1265
+ }
1266
+ } );
1267
+ return value;
1268
+ }
1269
+ } );
1270
+
1271
+ // Return an effect options object for the given parameters:
1272
+ function _normalizeArguments( effect, options, speed, callback ) {
1273
+
1274
+ // Allow passing all options as the first parameter
1275
+ if ( $.isPlainObject( effect ) ) {
1276
+ options = effect;
1277
+ effect = effect.effect;
1278
+ }
1279
+
1280
+ // Convert to an object
1281
+ effect = { effect: effect };
1282
+
1283
+ // Catch (effect, null, ...)
1284
+ if ( options == null ) {
1285
+ options = {};
1286
+ }
1287
+
1288
+ // Catch (effect, callback)
1289
+ if ( $.isFunction( options ) ) {
1290
+ callback = options;
1291
+ speed = null;
1292
+ options = {};
1293
+ }
1294
+
1295
+ // Catch (effect, speed, ?)
1296
+ if ( typeof options === "number" || $.fx.speeds[ options ] ) {
1297
+ callback = speed;
1298
+ speed = options;
1299
+ options = {};
1300
+ }
1301
+
1302
+ // Catch (effect, options, callback)
1303
+ if ( $.isFunction( speed ) ) {
1304
+ callback = speed;
1305
+ speed = null;
1306
+ }
1307
+
1308
+ // Add options to effect
1309
+ if ( options ) {
1310
+ $.extend( effect, options );
1311
+ }
1312
+
1313
+ speed = speed || options.duration;
1314
+ effect.duration = $.fx.off ? 0 :
1315
+ typeof speed === "number" ? speed :
1316
+ speed in $.fx.speeds ? $.fx.speeds[ speed ] :
1317
+ $.fx.speeds._default;
1318
+
1319
+ effect.complete = callback || options.complete;
1320
+
1321
+ return effect;
1322
+ }
1323
+
1324
+ function standardAnimationOption( option ) {
1325
+
1326
+ // Valid standard speeds (nothing, number, named speed)
1327
+ if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
1328
+ return true;
1329
+ }
1330
+
1331
+ // Invalid strings - treat as "normal" speed
1332
+ if ( typeof option === "string" && !$.effects.effect[ option ] ) {
1333
+ return true;
1334
+ }
1335
+
1336
+ // Complete callback
1337
+ if ( $.isFunction( option ) ) {
1338
+ return true;
1339
+ }
1340
+
1341
+ // Options hash (but not naming an effect)
1342
+ if ( typeof option === "object" && !option.effect ) {
1343
+ return true;
1344
+ }
1345
+
1346
+ // Didn't match any standard API
1347
+ return false;
1348
+ }
1349
+
1350
+ $.fn.extend( {
1351
+ effect: function( /* effect, options, speed, callback */ ) {
1352
+ var args = _normalizeArguments.apply( this, arguments ),
1353
+ effectMethod = $.effects.effect[ args.effect ],
1354
+ defaultMode = effectMethod.mode,
1355
+ queue = args.queue,
1356
+ queueName = queue || "fx",
1357
+ complete = args.complete,
1358
+ mode = args.mode,
1359
+ modes = [],
1360
+ prefilter = function( next ) {
1361
+ var el = $( this ),
1362
+ normalizedMode = $.effects.mode( el, mode ) || defaultMode;
1363
+
1364
+ // Sentinel for duck-punching the :animated psuedo-selector
1365
+ el.data( dataSpaceAnimated, true );
1366
+
1367
+ // Save effect mode for later use,
1368
+ // we can't just call $.effects.mode again later,
1369
+ // as the .show() below destroys the initial state
1370
+ modes.push( normalizedMode );
1371
+
1372
+ // See $.uiBackCompat inside of run() for removal of defaultMode in 1.13
1373
+ if ( defaultMode && ( normalizedMode === "show" ||
1374
+ ( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) {
1375
+ el.show();
1376
+ }
1377
+
1378
+ if ( !defaultMode || normalizedMode !== "none" ) {
1379
+ $.effects.saveStyle( el );
1380
+ }
1381
+
1382
+ if ( $.isFunction( next ) ) {
1383
+ next();
1384
+ }
1385
+ };
1386
+
1387
+ if ( $.fx.off || !effectMethod ) {
1388
+
1389
+ // Delegate to the original method (e.g., .show()) if possible
1390
+ if ( mode ) {
1391
+ return this[ mode ]( args.duration, complete );
1392
+ } else {
1393
+ return this.each( function() {
1394
+ if ( complete ) {
1395
+ complete.call( this );
1396
+ }
1397
+ } );
1398
+ }
1399
+ }
1400
+
1401
+ function run( next ) {
1402
+ var elem = $( this );
1403
+
1404
+ function cleanup() {
1405
+ elem.removeData( dataSpaceAnimated );
1406
+
1407
+ $.effects.cleanUp( elem );
1408
+
1409
+ if ( args.mode === "hide" ) {
1410
+ elem.hide();
1411
+ }
1412
+
1413
+ done();
1414
+ }
1415
+
1416
+ function done() {
1417
+ if ( $.isFunction( complete ) ) {
1418
+ complete.call( elem[ 0 ] );
1419
+ }
1420
+
1421
+ if ( $.isFunction( next ) ) {
1422
+ next();
1423
+ }
1424
+ }
1425
+
1426
+ // Override mode option on a per element basis,
1427
+ // as toggle can be either show or hide depending on element state
1428
+ args.mode = modes.shift();
1429
+
1430
+ if ( $.uiBackCompat !== false && !defaultMode ) {
1431
+ if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
1432
+
1433
+ // Call the core method to track "olddisplay" properly
1434
+ elem[ mode ]();
1435
+ done();
1436
+ } else {
1437
+ effectMethod.call( elem[ 0 ], args, done );
1438
+ }
1439
+ } else {
1440
+ if ( args.mode === "none" ) {
1441
+
1442
+ // Call the core method to track "olddisplay" properly
1443
+ elem[ mode ]();
1444
+ done();
1445
+ } else {
1446
+ effectMethod.call( elem[ 0 ], args, cleanup );
1447
+ }
1448
+ }
1449
+ }
1450
+
1451
+ // Run prefilter on all elements first to ensure that
1452
+ // any showing or hiding happens before placeholder creation,
1453
+ // which ensures that any layout changes are correctly captured.
1454
+ return queue === false ?
1455
+ this.each( prefilter ).each( run ) :
1456
+ this.queue( queueName, prefilter ).queue( queueName, run );
1457
+ },
1458
+
1459
+ show: ( function( orig ) {
1460
+ return function( option ) {
1461
+ if ( standardAnimationOption( option ) ) {
1462
+ return orig.apply( this, arguments );
1463
+ } else {
1464
+ var args = _normalizeArguments.apply( this, arguments );
1465
+ args.mode = "show";
1466
+ return this.effect.call( this, args );
1467
+ }
1468
+ };
1469
+ } )( $.fn.show ),
1470
+
1471
+ hide: ( function( orig ) {
1472
+ return function( option ) {
1473
+ if ( standardAnimationOption( option ) ) {
1474
+ return orig.apply( this, arguments );
1475
+ } else {
1476
+ var args = _normalizeArguments.apply( this, arguments );
1477
+ args.mode = "hide";
1478
+ return this.effect.call( this, args );
1479
+ }
1480
+ };
1481
+ } )( $.fn.hide ),
1482
+
1483
+ toggle: ( function( orig ) {
1484
+ return function( option ) {
1485
+ if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
1486
+ return orig.apply( this, arguments );
1487
+ } else {
1488
+ var args = _normalizeArguments.apply( this, arguments );
1489
+ args.mode = "toggle";
1490
+ return this.effect.call( this, args );
1491
+ }
1492
+ };
1493
+ } )( $.fn.toggle ),
1494
+
1495
+ cssUnit: function( key ) {
1496
+ var style = this.css( key ),
1497
+ val = [];
1498
+
1499
+ $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
1500
+ if ( style.indexOf( unit ) > 0 ) {
1501
+ val = [ parseFloat( style ), unit ];
1502
+ }
1503
+ } );
1504
+ return val;
1505
+ },
1506
+
1507
+ cssClip: function( clipObj ) {
1508
+ if ( clipObj ) {
1509
+ return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " +
1510
+ clipObj.bottom + "px " + clipObj.left + "px)" );
1511
+ }
1512
+ return parseClip( this.css( "clip" ), this );
1513
+ },
1514
+
1515
+ transfer: function( options, done ) {
1516
+ var element = $( this ),
1517
+ target = $( options.to ),
1518
+ targetFixed = target.css( "position" ) === "fixed",
1519
+ body = $( "body" ),
1520
+ fixTop = targetFixed ? body.scrollTop() : 0,
1521
+ fixLeft = targetFixed ? body.scrollLeft() : 0,
1522
+ endPosition = target.offset(),
1523
+ animation = {
1524
+ top: endPosition.top - fixTop,
1525
+ left: endPosition.left - fixLeft,
1526
+ height: target.innerHeight(),
1527
+ width: target.innerWidth()
1528
+ },
1529
+ startPosition = element.offset(),
1530
+ transfer = $( "<div class='ui-effects-transfer'></div>" )
1531
+ .appendTo( "body" )
1532
+ .addClass( options.className )
1533
+ .css( {
1534
+ top: startPosition.top - fixTop,
1535
+ left: startPosition.left - fixLeft,
1536
+ height: element.innerHeight(),
1537
+ width: element.innerWidth(),
1538
+ position: targetFixed ? "fixed" : "absolute"
1539
+ } )
1540
+ .animate( animation, options.duration, options.easing, function() {
1541
+ transfer.remove();
1542
+ if ( $.isFunction( done ) ) {
1543
+ done();
1544
+ }
1545
+ } );
1546
+ }
1547
+ } );
1548
+
1549
+ function parseClip( str, element ) {
1550
+ var outerWidth = element.outerWidth(),
1551
+ outerHeight = element.outerHeight(),
1552
+ clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
1553
+ values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ];
1554
+
1555
+ return {
1556
+ top: parseFloat( values[ 1 ] ) || 0,
1557
+ right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ),
1558
+ bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ),
1559
+ left: parseFloat( values[ 4 ] ) || 0
1560
+ };
1561
+ }
1562
+
1563
+ $.fx.step.clip = function( fx ) {
1564
+ if ( !fx.clipInit ) {
1565
+ fx.start = $( fx.elem ).cssClip();
1566
+ if ( typeof fx.end === "string" ) {
1567
+ fx.end = parseClip( fx.end, fx.elem );
1568
+ }
1569
+ fx.clipInit = true;
1570
+ }
1571
+
1572
+ $( fx.elem ).cssClip( {
1573
+ top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top,
1574
+ right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right,
1575
+ bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom,
1576
+ left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left
1577
+ } );
1578
+ };
1579
+
1580
+ } )();
1581
+
1582
+ /******************************************************************************/
1583
+ /*********************************** EASING ***********************************/
1584
+ /******************************************************************************/
1585
+
1586
+ ( function() {
1587
+
1588
+ // Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
1589
+
1590
+ var baseEasings = {};
1591
+
1592
+ $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
1593
+ baseEasings[ name ] = function( p ) {
1594
+ return Math.pow( p, i + 2 );
1595
+ };
1596
+ } );
1597
+
1598
+ $.extend( baseEasings, {
1599
+ Sine: function( p ) {
1600
+ return 1 - Math.cos( p * Math.PI / 2 );
1601
+ },
1602
+ Circ: function( p ) {
1603
+ return 1 - Math.sqrt( 1 - p * p );
1604
+ },
1605
+ Elastic: function( p ) {
1606
+ return p === 0 || p === 1 ? p :
1607
+ -Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 );
1608
+ },
1609
+ Back: function( p ) {
1610
+ return p * p * ( 3 * p - 2 );
1611
+ },
1612
+ Bounce: function( p ) {
1613
+ var pow2,
1614
+ bounce = 4;
1615
+
1616
+ while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
1617
+ return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
1618
+ }
1619
+ } );
1620
+
1621
+ $.each( baseEasings, function( name, easeIn ) {
1622
+ $.easing[ "easeIn" + name ] = easeIn;
1623
+ $.easing[ "easeOut" + name ] = function( p ) {
1624
+ return 1 - easeIn( 1 - p );
1625
+ };
1626
+ $.easing[ "easeInOut" + name ] = function( p ) {
1627
+ return p < 0.5 ?
1628
+ easeIn( p * 2 ) / 2 :
1629
+ 1 - easeIn( p * -2 + 2 ) / 2;
1630
+ };
1631
+ } );
1632
+
1633
+ } )();
1634
+
1635
+ return $.effects;
1636
+
1637
+ } ) );