worthwhile 0.0.1.alpha → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (316) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.rspec +1 -0
  4. data/.travis.yml +19 -0
  5. data/Gemfile +7 -11
  6. data/README.md +8 -12
  7. data/Rakefile +17 -2
  8. data/app/actors/concerns/worthwhile/manages_embargoes_actor.rb +79 -0
  9. data/app/actors/curation_concern/base_actor.rb +68 -0
  10. data/app/actors/curation_concern/generic_file_actor.rb +40 -0
  11. data/app/actors/curation_concern/generic_work_actor.rb +92 -0
  12. data/app/actors/curation_concern/linked_resource_actor.rb +4 -0
  13. data/app/assets/images/default.png +0 -0
  14. data/app/assets/images/nope.png +0 -0
  15. data/app/assets/javascripts/.gitkeep +0 -0
  16. data/app/assets/javascripts/modernizr.js +3 -0
  17. data/app/assets/javascripts/worthwhile/.gitkeep +0 -0
  18. data/app/assets/javascripts/worthwhile/accept_contributor_agreement.js +15 -0
  19. data/app/assets/javascripts/worthwhile/application.js +18 -0
  20. data/app/assets/javascripts/worthwhile/browse_everything_implement.js +7 -0
  21. data/app/assets/javascripts/worthwhile/embargoes.js +17 -0
  22. data/app/assets/javascripts/worthwhile/facet_mine.js +22 -0
  23. data/app/assets/javascripts/worthwhile/help_modal.js +36 -0
  24. data/app/assets/javascripts/worthwhile/link_groups.js.coffee +123 -0
  25. data/app/assets/javascripts/worthwhile/link_users.js.coffee +126 -0
  26. data/app/assets/javascripts/worthwhile/manage_repeating_fields.js +74 -0
  27. data/app/assets/javascripts/worthwhile/proxy_rights.js.coffee +95 -0
  28. data/app/assets/javascripts/worthwhile/proxy_submission.js +23 -0
  29. data/app/assets/javascripts/worthwhile/select_works.js.coffee +20 -0
  30. data/app/assets/javascripts/worthwhile/worthwhile.js +45 -0
  31. data/app/assets/stylesheets/worthwhile.css.scss +23 -0
  32. data/app/assets/stylesheets/worthwhile/_global-variables.css.scss +5 -0
  33. data/app/assets/stylesheets/worthwhile/_modules.css.scss +14 -0
  34. data/app/assets/stylesheets/worthwhile/_positioning.css.scss +138 -0
  35. data/app/assets/stylesheets/worthwhile/_theme.css.scss +46 -0
  36. data/app/assets/stylesheets/worthwhile/_typography.css.scss +142 -0
  37. data/app/assets/stylesheets/worthwhile/_variables_bootstrap.css.scss +7 -0
  38. data/app/assets/stylesheets/worthwhile/_worthwhile.css.scss +7 -0
  39. data/app/assets/stylesheets/worthwhile/downloads.css.scss +3 -0
  40. data/app/assets/stylesheets/worthwhile/help_requests.css.scss +3 -0
  41. data/app/assets/stylesheets/worthwhile/modules/accessibility.css.scss +50 -0
  42. data/app/assets/stylesheets/worthwhile/modules/accordion.css.scss +33 -0
  43. data/app/assets/stylesheets/worthwhile/modules/attributes.css.scss +26 -0
  44. data/app/assets/stylesheets/worthwhile/modules/classify_work.css.scss +100 -0
  45. data/app/assets/stylesheets/worthwhile/modules/collections.css.scss +42 -0
  46. data/app/assets/stylesheets/worthwhile/modules/embargoes.css.scss +15 -0
  47. data/app/assets/stylesheets/worthwhile/modules/emphatic_action_area.css.scss +14 -0
  48. data/app/assets/stylesheets/worthwhile/modules/forms.css.scss +116 -0
  49. data/app/assets/stylesheets/worthwhile/modules/multi_value_fields.css.scss +52 -0
  50. data/app/assets/stylesheets/worthwhile/modules/pagination.css.scss +4 -0
  51. data/app/assets/stylesheets/worthwhile/modules/search_results.css.scss +55 -0
  52. data/app/assets/stylesheets/worthwhile/modules/site_actions.css.scss +53 -0
  53. data/app/assets/stylesheets/worthwhile/modules/site_search.css.scss +46 -0
  54. data/app/controllers/catalog_controller.rb +3 -0
  55. data/app/controllers/collections_controller.rb +59 -0
  56. data/app/controllers/concerns/worthwhile/application_controller_behavior.rb +23 -0
  57. data/app/controllers/concerns/worthwhile/catalog_controller.rb +347 -0
  58. data/app/controllers/concerns/worthwhile/curation_concern_controller.rb +131 -0
  59. data/app/controllers/concerns/worthwhile/files_controller.rb +149 -0
  60. data/app/controllers/concerns/worthwhile/manages_embargoes.rb +22 -0
  61. data/app/controllers/concerns/worthwhile/parent_container.rb +31 -0
  62. data/app/controllers/concerns/worthwhile/themed_layout_controller.rb +31 -0
  63. data/app/controllers/concerns/worthwhile/without_namespace.rb +15 -0
  64. data/app/controllers/curation_concern/generic_files_controller.rb +6 -0
  65. data/app/controllers/curation_concern/generic_works_controller.rb +6 -0
  66. data/app/controllers/curation_concern/linked_resources_controller.rb +68 -0
  67. data/app/controllers/curation_concern/permissions_controller.rb +19 -0
  68. data/app/controllers/downloads_controller.rb +4 -0
  69. data/app/controllers/embargoes_controller.rb +44 -0
  70. data/app/controllers/leases_controller.rb +34 -0
  71. data/app/controllers/registrations_controller.rb +20 -0
  72. data/app/controllers/sessions_controller.rb +4 -0
  73. data/app/controllers/worthwhile/application_controller.rb +7 -0
  74. data/app/controllers/worthwhile/classify_concerns_controller.rb +35 -0
  75. data/app/datastreams/generic_work_metadata.rb +3 -0
  76. data/app/datastreams/worthwhile/generic_work_rdf_properties.rb +57 -0
  77. data/app/datastreams/worthwhile/properties_datastream.rb +28 -0
  78. data/app/helpers/curate/collections_helper.rb +133 -0
  79. data/app/helpers/worthwhile/ability_helper.rb +46 -0
  80. data/app/helpers/worthwhile/attribute_helper.rb +67 -0
  81. data/app/helpers/worthwhile/catalog_helper.rb +38 -0
  82. data/app/helpers/worthwhile/collections_helper.rb +19 -0
  83. data/app/helpers/worthwhile/embargo_helper.rb +17 -0
  84. data/app/helpers/worthwhile/generic_file_helper.rb +19 -0
  85. data/app/helpers/worthwhile/lease_helper.rb +18 -0
  86. data/app/helpers/worthwhile/main_app_helpers.rb +14 -0
  87. data/app/helpers/worthwhile/render_constraints_helper.rb +42 -0
  88. data/app/helpers/worthwhile/search_paths_helper.rb +13 -0
  89. data/app/helpers/worthwhile/thumbnail_helper.rb +11 -0
  90. data/app/helpers/worthwhile/title_helper.rb +23 -0
  91. data/app/helpers/worthwhile/url_helper.rb +16 -0
  92. data/app/inputs/multi_value_input.rb +72 -0
  93. data/app/models/collection.rb +15 -0
  94. data/app/models/concerns/curation_concern/collection_model.rb +62 -0
  95. data/app/models/concerns/curation_concern/curatable.rb +77 -0
  96. data/app/models/concerns/curation_concern/has_representative.rb +14 -0
  97. data/app/models/concerns/curation_concern/human_readable_type.rb +23 -0
  98. data/app/models/concerns/curation_concern/with_basic_metadata.rb +49 -0
  99. data/app/models/concerns/curation_concern/with_editors.rb +44 -0
  100. data/app/models/concerns/curation_concern/with_generic_files.rb +23 -0
  101. data/app/models/concerns/curation_concern/with_linked_resources.rb +21 -0
  102. data/app/models/concerns/curation_concern/work.rb +24 -0
  103. data/app/models/concerns/worthwhile/ability.rb +34 -0
  104. data/app/models/concerns/worthwhile/generic_file/versioned_content.rb +18 -0
  105. data/app/models/concerns/worthwhile/generic_file_base.rb +64 -0
  106. data/app/models/concerns/worthwhile/solr_document_behavior.rb +140 -0
  107. data/app/models/generic_work.rb +5 -0
  108. data/app/models/worthwhile/classify_concern.rb +47 -0
  109. data/app/models/worthwhile/content_version.rb +23 -0
  110. data/app/models/worthwhile/contributor_agreement.rb +23 -0
  111. data/app/models/worthwhile/generic_file.rb +5 -0
  112. data/app/models/worthwhile/linked_resource.rb +41 -0
  113. data/app/models/worthwhile/quick_classification_query.rb +31 -0
  114. data/app/services/worthwhile/curation_concern.rb +21 -0
  115. data/app/services/worthwhile/embargo_service.rb +26 -0
  116. data/app/services/worthwhile/lease_service.rb +23 -0
  117. data/app/views/catalog/_action_menu_partials/_collection.html.erb +27 -0
  118. data/app/views/catalog/_action_menu_partials/_default.html.erb +27 -0
  119. data/app/views/catalog/_document.html.erb +3 -0
  120. data/app/views/catalog/_document_list.html.erb +5 -0
  121. data/app/views/catalog/_home_text.html.erb +8 -0
  122. data/app/views/catalog/_index_default.html.erb +17 -0
  123. data/app/views/catalog/_index_header_list_default.html.erb +17 -0
  124. data/app/views/catalog/_navbar.html.erb +12 -0
  125. data/app/views/catalog/_show_partials/_default.html.erb +22 -0
  126. data/app/views/catalog/_show_partials/_default_details.html.erb +15 -0
  127. data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
  128. data/app/views/catalog/index.html.erb +48 -0
  129. data/app/views/collections/_batch_edits_actions.html.erb +3 -0
  130. data/app/views/collections/_button_for_creating_empty_collection.html.erb +3 -0
  131. data/app/views/collections/_collection.html.erb +1 -0
  132. data/app/views/collections/_dashboard_document_list.html.erb +6 -0
  133. data/app/views/collections/_document_list.html.erb +7 -0
  134. data/app/views/collections/_edit_actions.html.erb +5 -0
  135. data/app/views/collections/_edit_descriptions.html.erb +20 -0
  136. data/app/views/collections/_form.html.erb +26 -0
  137. data/app/views/collections/_form_for_select_collection.html.erb +34 -0
  138. data/app/views/collections/_form_permission.html.erb +36 -0
  139. data/app/views/collections/_form_required_information.html.erb +11 -0
  140. data/app/views/collections/_identifier_and_action.html.erb +15 -0
  141. data/app/views/collections/_media_display.html.erb +1 -0
  142. data/app/views/collections/_paginate.html.erb +6 -0
  143. data/app/views/collections/_search_collection_dashboard_form.html.erb +10 -0
  144. data/app/views/collections/_show_actions.html.erb +8 -0
  145. data/app/views/collections/_show_descriptions.html.erb +10 -0
  146. data/app/views/collections/_show_fields.html.erb +0 -0
  147. data/app/views/collections/_single_item_action_fields.html.erb +6 -0
  148. data/app/views/collections/_sort_and_per_page.html.erb +29 -0
  149. data/app/views/collections/_view_type_group.html.erb +13 -0
  150. data/app/views/collections/edit.html.erb +22 -0
  151. data/app/views/collections/new.html.erb +15 -0
  152. data/app/views/collections/show.html.erb +24 -0
  153. data/app/views/curate/collections/_add_to_collection_modal.html.erb +15 -0
  154. data/app/views/curate/collections/_button_remove_from_collection.html.erb +6 -0
  155. data/app/views/curate/collections/_form_to_add_member.html.erb +27 -0
  156. data/app/views/curate/collections/add_member_form.html.erb +6 -0
  157. data/app/views/curation_concern/base/_attributes.html.erb +25 -0
  158. data/app/views/curation_concern/base/_collections.html.erb +26 -0
  159. data/app/views/curation_concern/base/_form.html.erb +27 -0
  160. data/app/views/curation_concern/base/_form_additional_information.html.erb +9 -0
  161. data/app/views/curation_concern/base/_form_content_license.html.erb +16 -0
  162. data/app/views/curation_concern/base/_form_contributor_agreement.html.erb +29 -0
  163. data/app/views/curation_concern/base/_form_descriptive_fields.erb +23 -0
  164. data/app/views/curation_concern/base/_form_files_and_links.html.erb +29 -0
  165. data/app/views/curation_concern/base/_form_permission.html.erb +52 -0
  166. data/app/views/curation_concern/base/_form_permission_embargo.html.erb +6 -0
  167. data/app/views/curation_concern/base/_form_permission_lease.html.erb +6 -0
  168. data/app/views/curation_concern/base/_form_permission_under_embargo.html.erb +16 -0
  169. data/app/views/curation_concern/base/_form_permission_under_lease.html.erb +18 -0
  170. data/app/views/curation_concern/base/_form_representative_image.html.erb +13 -0
  171. data/app/views/curation_concern/base/_form_required_information.html.erb +11 -0
  172. data/app/views/curation_concern/base/_form_supplementary_fields.html.erb +15 -0
  173. data/app/views/curation_concern/base/_legally_binding_text.html.erb +33 -0
  174. data/app/views/curation_concern/base/_related_files.html.erb +24 -0
  175. data/app/views/curation_concern/base/_related_resources.html.erb +40 -0
  176. data/app/views/curation_concern/base/_representative_media.html.erb +8 -0
  177. data/app/views/curation_concern/base/edit.html.erb +15 -0
  178. data/app/views/curation_concern/base/new.html.erb +14 -0
  179. data/app/views/curation_concern/base/show.html.erb +32 -0
  180. data/app/views/curation_concern/base/unauthorized.html.erb +3 -0
  181. data/app/views/curation_concern/generic_files/_form.html.erb +35 -0
  182. data/app/views/curation_concern/generic_files/_media_display.html.erb +20 -0
  183. data/app/views/curation_concern/generic_files/edit.html.erb +5 -0
  184. data/app/views/curation_concern/generic_files/show.html.erb +15 -0
  185. data/app/views/curation_concern/generic_works/_generic_work.html.erb +3 -0
  186. data/app/views/curation_concern/linked_resources/_form.html.erb +11 -0
  187. data/app/views/curation_concern/linked_resources/edit.html.erb +5 -0
  188. data/app/views/curation_concern/linked_resources/new.html.erb +5 -0
  189. data/app/views/curation_concern/permissions/confirm.html.erb +13 -0
  190. data/app/views/curation_concern/worthwhile/generic_files/_actions.html.erb +16 -0
  191. data/app/views/curation_concern/worthwhile/generic_files/_generic_file.html.erb +12 -0
  192. data/app/views/embargoes/_embargo_history.html.erb +7 -0
  193. data/app/views/embargoes/_list_active_embargoes.html.erb +16 -0
  194. data/app/views/embargoes/_list_deactivated_embargoes.html.erb +10 -0
  195. data/app/views/embargoes/_list_expired_active_embargoes.html.erb +44 -0
  196. data/app/views/embargoes/edit.html.erb +43 -0
  197. data/app/views/embargoes/index.html.erb +18 -0
  198. data/app/views/layouts/boilerplate.html.erb +22 -0
  199. data/app/views/layouts/common_objects.html.erb +36 -0
  200. data/app/views/layouts/curate_nd.html.erb +33 -0
  201. data/app/views/layouts/curate_nd/1_column.html.erb +22 -0
  202. data/app/views/layouts/curate_nd/2_column.html.erb +26 -0
  203. data/app/views/layouts/curate_nd/catalog.html.erb +38 -0
  204. data/app/views/layouts/curate_nd/dashboard.html.erb +22 -0
  205. data/app/views/leases/_lease_history.html.erb +7 -0
  206. data/app/views/leases/_list_active_leases.html.erb +16 -0
  207. data/app/views/leases/_list_deactivated_leases.html.erb +4 -0
  208. data/app/views/leases/_list_expired_active_leases.html.erb +38 -0
  209. data/app/views/leases/edit.html.erb +43 -0
  210. data/app/views/leases/index.html.erb +18 -0
  211. data/app/views/shared/_add_content.html.erb +32 -0
  212. data/app/views/shared/_brand_bar.html.erb +10 -0
  213. data/app/views/shared/_flash_message.html.erb +17 -0
  214. data/app/views/shared/_footer.html.erb +10 -0
  215. data/app/views/shared/_ga.html.erb +6 -0
  216. data/app/views/shared/_header.html.erb +12 -0
  217. data/app/views/shared/_my_actions.html.erb +21 -0
  218. data/app/views/shared/_site_actions.html.erb +7 -0
  219. data/app/views/shared/_site_search.html.erb +12 -0
  220. data/app/views/shared/_title_bar.html.erb +16 -0
  221. data/app/views/worthwhile/classify_concerns/new.html.erb +27 -0
  222. data/app/workers/visibility_copy_worker.rb +29 -0
  223. data/config/initializers/simple_form.rb +31 -0
  224. data/config/locales/sufia.en.yml +26 -0
  225. data/config/locales/worthwhile.en.yml +68 -0
  226. data/config/routes.rb +4 -0
  227. data/lib/generators/worthwhile/install_generator.rb +74 -0
  228. data/lib/generators/worthwhile/templates/worthwhile.css.scss +3 -0
  229. data/lib/generators/worthwhile/templates/worthwhile.js +1 -0
  230. data/lib/generators/worthwhile/templates/worthwhile_config.rb +3 -0
  231. data/lib/generators/worthwhile/templates/worthwhile_helper.rb +4 -0
  232. data/lib/worthwhile.rb +3 -1
  233. data/lib/worthwhile/configuration.rb +74 -0
  234. data/lib/worthwhile/controller_resource.rb +10 -0
  235. data/lib/worthwhile/engine.rb +20 -0
  236. data/lib/worthwhile/rails/routes.rb +78 -0
  237. data/lib/worthwhile/spec_support.rb +10 -0
  238. data/lib/worthwhile/version.rb +1 -1
  239. data/spec/abilities/generic_file_abilities_spec.rb +62 -0
  240. data/spec/abilities/generic_work_abilities_spec.rb +58 -0
  241. data/spec/actors/curation_concern/generic_work_actor_spec.rb +215 -0
  242. data/spec/actors/curation_concern/linked_resource_actor_spec.rb +36 -0
  243. data/spec/actors/worthwile/manages_embargoes_actor_spec.rb +95 -0
  244. data/spec/controllers/catalog_controller_spec.rb +114 -0
  245. data/spec/controllers/collections_controller_spec.rb +216 -0
  246. data/spec/controllers/curation_concern/generic_files_controller_spec.rb +258 -0
  247. data/spec/controllers/curation_concern/generic_works_controller_spec.rb +171 -0
  248. data/spec/controllers/curation_concern/linked_resources_controller_spec.rb +123 -0
  249. data/spec/controllers/curation_concern/permissions_controller_spec.rb +29 -0
  250. data/spec/controllers/downloads_controller_spec.rb +53 -0
  251. data/spec/controllers/embargoes_controller_spec.rb +107 -0
  252. data/spec/controllers/leases_controller_spec.rb +95 -0
  253. data/spec/controllers/worthwhile/classify_concerns_controller_spec.rb +35 -0
  254. data/spec/factories/collections_factory.rb +21 -0
  255. data/spec/factories/create_curation_concern.rb +3 -0
  256. data/spec/factories/generic_files.rb +18 -0
  257. data/spec/factories/generic_works.rb +37 -0
  258. data/spec/factories/linked_resources_factory.rb +18 -0
  259. data/spec/factories/users.rb +15 -0
  260. data/spec/features/add_external_link_spec.rb +25 -0
  261. data/spec/features/add_file_spec.rb +28 -0
  262. data/spec/features/collection_spec.rb +238 -0
  263. data/spec/features/embargo_spec.rb +45 -0
  264. data/spec/features/lease_spec.rb +43 -0
  265. data/spec/features/update_file_spec.rb +28 -0
  266. data/spec/fixtures/files/image.png +0 -0
  267. data/spec/helpers/catalog_helper_spec.rb +58 -0
  268. data/spec/helpers/configuration_helper_spec.rb +13 -0
  269. data/spec/helpers/render_constraints_helper_spec.rb +19 -0
  270. data/spec/helpers/thumbnail_helper_spec.rb +21 -0
  271. data/spec/helpers/url_helper_spec.rb +19 -0
  272. data/spec/matchers.rb +24 -0
  273. data/spec/matchers/metadata_field_matchers.rb +28 -0
  274. data/spec/models/collection_spec.rb +136 -0
  275. data/spec/models/curation_concern/collection_model_spec.rb +50 -0
  276. data/spec/models/curation_concern/work_spec.rb +30 -0
  277. data/spec/models/generic_work_spec.rb +24 -0
  278. data/spec/models/worthwhile/content_version_spec.rb +27 -0
  279. data/spec/models/worthwhile/generic_file_spec.rb +77 -0
  280. data/spec/models/worthwhile/linked_resource_spec.rb +76 -0
  281. data/spec/routing/worthwhile/routes_spec.rb +23 -0
  282. data/spec/services/embargo_service_spec.rb +38 -0
  283. data/spec/services/lease_service_spec.rb +37 -0
  284. data/spec/spec_helper.rb +30 -5
  285. data/spec/support/controllers/engine_helpers.rb +7 -0
  286. data/spec/support/curation_concern/factory_helpers.rb +14 -0
  287. data/spec/support/features.rb +19 -0
  288. data/spec/support/features/fixture_file_upload.rb +14 -0
  289. data/spec/support/features/session_helpers.rb +41 -0
  290. data/spec/support/shared/shared_examples_has_dc_metadata.rb +17 -0
  291. data/spec/support/shared/shared_examples_is_a_curation_concern_model.rb +40 -0
  292. data/spec/support/shared/shared_examples_is_embargoable.rb +8 -0
  293. data/spec/support/shared/shared_examples_with_access_rights.rb +63 -0
  294. data/spec/test_app_templates/lib/generators/test_app_generator.rb +8 -29
  295. data/spec/views/curation_concern/base/_attributes.html.erb_spec.rb +25 -0
  296. data/spec/views/curation_concern/base/show.html.erb_spec.rb +25 -0
  297. data/spec/views/shared/_add_content.html.erb_spec.rb +42 -0
  298. data/spec/views/shared/_my_actions.html.erb_spec.rb +23 -0
  299. data/spec/workers/visibility_copy_worker_spec.rb +68 -0
  300. data/vendor/assets/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  301. data/vendor/assets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  302. data/vendor/assets/javascripts/handlebars.js +2278 -0
  303. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.autocomplete.js +602 -0
  304. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.core.js +356 -0
  305. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.effect-highlight.js +50 -0
  306. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.effect.js +1276 -0
  307. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.menu.js +610 -0
  308. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.position.js +498 -0
  309. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.widget.js +528 -0
  310. data/vendor/assets/javascripts/jquery.tokeninput.js +1061 -0
  311. data/vendor/assets/stylesheets/jquery-ui-lightness.css +474 -0
  312. data/vendor/assets/stylesheets/token-input-facebook.css +122 -0
  313. data/vendor/assets/stylesheets/token-input-mac.css +204 -0
  314. data/vendor/assets/stylesheets/token-input.css +127 -0
  315. data/worthwhile.gemspec +9 -3
  316. metadata +469 -9
@@ -0,0 +1,356 @@
1
+ /*!
2
+ * jQuery UI Core @VERSION
3
+ * http://jqueryui.com
4
+ *
5
+ * Copyright 2012 jQuery Foundation and other contributors
6
+ * Released under the MIT license.
7
+ * http://jquery.org/license
8
+ *
9
+ * http://api.jqueryui.com/category/ui-core/
10
+ */
11
+ (function( $, undefined ) {
12
+
13
+ var uuid = 0,
14
+ runiqueId = /^ui-id-\d+$/;
15
+
16
+ // prevent duplicate loading
17
+ // this is only a problem because we proxy existing functions
18
+ // and we don't want to double proxy them
19
+ $.ui = $.ui || {};
20
+ if ( $.ui.version ) {
21
+ return;
22
+ }
23
+
24
+ $.extend( $.ui, {
25
+ version: "@VERSION",
26
+
27
+ keyCode: {
28
+ BACKSPACE: 8,
29
+ COMMA: 188,
30
+ DELETE: 46,
31
+ DOWN: 40,
32
+ END: 35,
33
+ ENTER: 13,
34
+ ESCAPE: 27,
35
+ HOME: 36,
36
+ LEFT: 37,
37
+ NUMPAD_ADD: 107,
38
+ NUMPAD_DECIMAL: 110,
39
+ NUMPAD_DIVIDE: 111,
40
+ NUMPAD_ENTER: 108,
41
+ NUMPAD_MULTIPLY: 106,
42
+ NUMPAD_SUBTRACT: 109,
43
+ PAGE_DOWN: 34,
44
+ PAGE_UP: 33,
45
+ PERIOD: 190,
46
+ RIGHT: 39,
47
+ SPACE: 32,
48
+ TAB: 9,
49
+ UP: 38
50
+ }
51
+ });
52
+
53
+ // plugins
54
+ $.fn.extend({
55
+ _focus: $.fn.focus,
56
+ focus: function( delay, fn ) {
57
+ return typeof delay === "number" ?
58
+ this.each(function() {
59
+ var elem = this;
60
+ setTimeout(function() {
61
+ $( elem ).focus();
62
+ if ( fn ) {
63
+ fn.call( elem );
64
+ }
65
+ }, delay );
66
+ }) :
67
+ this._focus.apply( this, arguments );
68
+ },
69
+
70
+ scrollParent: function() {
71
+ var scrollParent;
72
+ if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
73
+ scrollParent = this.parents().filter(function() {
74
+ return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
75
+ }).eq(0);
76
+ } else {
77
+ scrollParent = this.parents().filter(function() {
78
+ return (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
79
+ }).eq(0);
80
+ }
81
+
82
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
83
+ },
84
+
85
+ zIndex: function( zIndex ) {
86
+ if ( zIndex !== undefined ) {
87
+ return this.css( "zIndex", zIndex );
88
+ }
89
+
90
+ if ( this.length ) {
91
+ var elem = $( this[ 0 ] ), position, value;
92
+ while ( elem.length && elem[ 0 ] !== document ) {
93
+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
94
+ // This makes behavior of this function consistent across browsers
95
+ // WebKit always returns auto if the element is positioned
96
+ position = elem.css( "position" );
97
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
98
+ // IE returns 0 when zIndex is not specified
99
+ // other browsers return a string
100
+ // we ignore the case of nested elements with an explicit value of 0
101
+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
102
+ value = parseInt( elem.css( "zIndex" ), 10 );
103
+ if ( !isNaN( value ) && value !== 0 ) {
104
+ return value;
105
+ }
106
+ }
107
+ elem = elem.parent();
108
+ }
109
+ }
110
+
111
+ return 0;
112
+ },
113
+
114
+ uniqueId: function() {
115
+ return this.each(function() {
116
+ if ( !this.id ) {
117
+ this.id = "ui-id-" + (++uuid);
118
+ }
119
+ });
120
+ },
121
+
122
+ removeUniqueId: function() {
123
+ return this.each(function() {
124
+ if ( runiqueId.test( this.id ) ) {
125
+ $( this ).removeAttr( "id" );
126
+ }
127
+ });
128
+ }
129
+ });
130
+
131
+ // selectors
132
+ function focusable( element, isTabIndexNotNaN ) {
133
+ var map, mapName, img,
134
+ nodeName = element.nodeName.toLowerCase();
135
+ if ( "area" === nodeName ) {
136
+ map = element.parentNode;
137
+ mapName = map.name;
138
+ if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
139
+ return false;
140
+ }
141
+ img = $( "img[usemap=#" + mapName + "]" )[0];
142
+ return !!img && visible( img );
143
+ }
144
+ return ( /input|select|textarea|button|object/.test( nodeName ) ?
145
+ !element.disabled :
146
+ "a" === nodeName ?
147
+ element.href || isTabIndexNotNaN :
148
+ isTabIndexNotNaN) &&
149
+ // the element and all of its ancestors must be visible
150
+ visible( element );
151
+ }
152
+
153
+ function visible( element ) {
154
+ return $.expr.filters.visible( element ) &&
155
+ !$( element ).parents().andSelf().filter(function() {
156
+ return $.css( this, "visibility" ) === "hidden";
157
+ }).length;
158
+ }
159
+
160
+ $.extend( $.expr[ ":" ], {
161
+ data: $.expr.createPseudo ?
162
+ $.expr.createPseudo(function( dataName ) {
163
+ return function( elem ) {
164
+ return !!$.data( elem, dataName );
165
+ };
166
+ }) :
167
+ // support: jQuery <1.8
168
+ function( elem, i, match ) {
169
+ return !!$.data( elem, match[ 3 ] );
170
+ },
171
+
172
+ focusable: function( element ) {
173
+ return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
174
+ },
175
+
176
+ tabbable: function( element ) {
177
+ var tabIndex = $.attr( element, "tabindex" ),
178
+ isTabIndexNaN = isNaN( tabIndex );
179
+ return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
180
+ }
181
+ });
182
+
183
+ // support
184
+ $(function() {
185
+ var body = document.body,
186
+ div = body.appendChild( div = document.createElement( "div" ) );
187
+
188
+ // access offsetHeight before setting the style to prevent a layout bug
189
+ // in IE 9 which causes the element to continue to take up space even
190
+ // after it is removed from the DOM (#8026)
191
+ div.offsetHeight;
192
+
193
+ $.extend( div.style, {
194
+ minHeight: "100px",
195
+ height: "auto",
196
+ padding: 0,
197
+ borderWidth: 0
198
+ });
199
+
200
+ $.support.minHeight = div.offsetHeight === 100;
201
+ $.support.selectstart = "onselectstart" in div;
202
+
203
+ // set display to none to avoid a layout bug in IE
204
+ // http://dev.jquery.com/ticket/4014
205
+ body.removeChild( div ).style.display = "none";
206
+ });
207
+
208
+ // support: jQuery <1.8
209
+ if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
210
+ $.each( [ "Width", "Height" ], function( i, name ) {
211
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
212
+ type = name.toLowerCase(),
213
+ orig = {
214
+ innerWidth: $.fn.innerWidth,
215
+ innerHeight: $.fn.innerHeight,
216
+ outerWidth: $.fn.outerWidth,
217
+ outerHeight: $.fn.outerHeight
218
+ };
219
+
220
+ function reduce( elem, size, border, margin ) {
221
+ $.each( side, function() {
222
+ size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
223
+ if ( border ) {
224
+ size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
225
+ }
226
+ if ( margin ) {
227
+ size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
228
+ }
229
+ });
230
+ return size;
231
+ }
232
+
233
+ $.fn[ "inner" + name ] = function( size ) {
234
+ if ( size === undefined ) {
235
+ return orig[ "inner" + name ].call( this );
236
+ }
237
+
238
+ return this.each(function() {
239
+ $( this ).css( type, reduce( this, size ) + "px" );
240
+ });
241
+ };
242
+
243
+ $.fn[ "outer" + name] = function( size, margin ) {
244
+ if ( typeof size !== "number" ) {
245
+ return orig[ "outer" + name ].call( this, size );
246
+ }
247
+
248
+ return this.each(function() {
249
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
250
+ });
251
+ };
252
+ });
253
+ }
254
+
255
+ // support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
256
+ if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
257
+ $.fn.removeData = (function( removeData ) {
258
+ return function( key ) {
259
+ if ( arguments.length ) {
260
+ return removeData.call( this, $.camelCase( key ) );
261
+ } else {
262
+ return removeData.call( this );
263
+ }
264
+ };
265
+ })( $.fn.removeData );
266
+ }
267
+
268
+
269
+
270
+
271
+
272
+ // deprecated
273
+
274
+ (function() {
275
+ var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || [];
276
+ $.ui.ie = uaMatch.length ? true : false;
277
+ $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6;
278
+ })();
279
+
280
+ $.fn.extend({
281
+ disableSelection: function() {
282
+ return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
283
+ ".ui-disableSelection", function( event ) {
284
+ event.preventDefault();
285
+ });
286
+ },
287
+
288
+ enableSelection: function() {
289
+ return this.unbind( ".ui-disableSelection" );
290
+ }
291
+ });
292
+
293
+ $.extend( $.ui, {
294
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
295
+ plugin: {
296
+ add: function( module, option, set ) {
297
+ var i,
298
+ proto = $.ui[ module ].prototype;
299
+ for ( i in set ) {
300
+ proto.plugins[ i ] = proto.plugins[ i ] || [];
301
+ proto.plugins[ i ].push( [ option, set[ i ] ] );
302
+ }
303
+ },
304
+ call: function( instance, name, args ) {
305
+ var i,
306
+ set = instance.plugins[ name ];
307
+ if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
308
+ return;
309
+ }
310
+
311
+ for ( i = 0; i < set.length; i++ ) {
312
+ if ( instance.options[ set[ i ][ 0 ] ] ) {
313
+ set[ i ][ 1 ].apply( instance.element, args );
314
+ }
315
+ }
316
+ }
317
+ },
318
+
319
+ contains: $.contains,
320
+
321
+ // only used by resizable
322
+ hasScroll: function( el, a ) {
323
+
324
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
325
+ if ( $( el ).css( "overflow" ) === "hidden") {
326
+ return false;
327
+ }
328
+
329
+ var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
330
+ has = false;
331
+
332
+ if ( el[ scroll ] > 0 ) {
333
+ return true;
334
+ }
335
+
336
+ // TODO: determine which cases actually cause this to happen
337
+ // if the element doesn't have the scroll set, see if it's possible to
338
+ // set the scroll
339
+ el[ scroll ] = 1;
340
+ has = ( el[ scroll ] > 0 );
341
+ el[ scroll ] = 0;
342
+ return has;
343
+ },
344
+
345
+ // these are odd functions, fix the API or move into individual plugins
346
+ isOverAxis: function( x, reference, size ) {
347
+ //Determines when x coordinate is over "b" element axis
348
+ return ( x > reference ) && ( x < ( reference + size ) );
349
+ },
350
+ isOver: function( y, x, top, left, height, width ) {
351
+ //Determines when x, y coordinates is over "b" element
352
+ return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
353
+ }
354
+ });
355
+
356
+ })( jQuery );
@@ -0,0 +1,50 @@
1
+ /*!
2
+ * jQuery UI Effects Highlight @VERSION
3
+ * http://jqueryui.com
4
+ *
5
+ * Copyright 2012 jQuery Foundation and other contributors
6
+ * Released under the MIT license.
7
+ * http://jquery.org/license
8
+ *
9
+ * http://api.jqueryui.com/highlight-effect/
10
+ *
11
+ * Depends:
12
+ * jquery.ui.effect.js
13
+ */
14
+ (function( $, undefined ) {
15
+
16
+ $.effects.effect.highlight = function( o, done ) {
17
+ var elem = $( this ),
18
+ props = [ "backgroundImage", "backgroundColor", "opacity" ],
19
+ mode = $.effects.setMode( elem, o.mode || "show" ),
20
+ animation = {
21
+ backgroundColor: elem.css( "backgroundColor" )
22
+ };
23
+
24
+ if (mode === "hide") {
25
+ animation.opacity = 0;
26
+ }
27
+
28
+ $.effects.save( elem, props );
29
+
30
+ elem
31
+ .show()
32
+ .css({
33
+ backgroundImage: "none",
34
+ backgroundColor: o.color || "#ffff99"
35
+ })
36
+ .animate( animation, {
37
+ queue: false,
38
+ duration: o.duration,
39
+ easing: o.easing,
40
+ complete: function() {
41
+ if ( mode === "hide" ) {
42
+ elem.hide();
43
+ }
44
+ $.effects.restore( elem, props );
45
+ done();
46
+ }
47
+ });
48
+ };
49
+
50
+ })(jQuery);
@@ -0,0 +1,1276 @@
1
+ /*!
2
+ * jQuery UI Effects @VERSION
3
+ * http://jqueryui.com
4
+ *
5
+ * Copyright 2012 jQuery Foundation and other contributors
6
+ * Released under the MIT license.
7
+ * http://jquery.org/license
8
+ *
9
+ * http://api.jqueryui.com/category/effects-core/
10
+ */
11
+ ;(jQuery.effects || (function($, undefined) {
12
+
13
+ var backCompat = $.uiBackCompat !== false,
14
+ // prefix used for storing data on .data()
15
+ dataSpace = "ui-effects-";
16
+
17
+ $.effects = {
18
+ effect: {}
19
+ };
20
+
21
+ /*!
22
+ * jQuery Color Animations v2.0.0
23
+ * http://jquery.com/
24
+ *
25
+ * Copyright 2012 jQuery Foundation and other contributors
26
+ * Released under the MIT license.
27
+ * http://jquery.org/license
28
+ *
29
+ * Date: Mon Aug 13 13:41:02 2012 -0500
30
+ */
31
+ (function( jQuery, undefined ) {
32
+
33
+ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),
34
+
35
+ // plusequals test for += 100 -= 100
36
+ rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
37
+ // a set of RE's that can match strings and generate color tuples.
38
+ stringParsers = [{
39
+ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
40
+ parse: function( execResult ) {
41
+ return [
42
+ execResult[ 1 ],
43
+ execResult[ 2 ],
44
+ execResult[ 3 ],
45
+ execResult[ 4 ]
46
+ ];
47
+ }
48
+ }, {
49
+ re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
50
+ parse: function( execResult ) {
51
+ return [
52
+ execResult[ 1 ] * 2.55,
53
+ execResult[ 2 ] * 2.55,
54
+ execResult[ 3 ] * 2.55,
55
+ execResult[ 4 ]
56
+ ];
57
+ }
58
+ }, {
59
+ // this regex ignores A-F because it's compared against an already lowercased string
60
+ re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
61
+ parse: function( execResult ) {
62
+ return [
63
+ parseInt( execResult[ 1 ], 16 ),
64
+ parseInt( execResult[ 2 ], 16 ),
65
+ parseInt( execResult[ 3 ], 16 )
66
+ ];
67
+ }
68
+ }, {
69
+ // this regex ignores A-F because it's compared against an already lowercased string
70
+ re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
71
+ parse: function( execResult ) {
72
+ return [
73
+ parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
74
+ parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
75
+ parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
76
+ ];
77
+ }
78
+ }, {
79
+ re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
80
+ space: "hsla",
81
+ parse: function( execResult ) {
82
+ return [
83
+ execResult[ 1 ],
84
+ execResult[ 2 ] / 100,
85
+ execResult[ 3 ] / 100,
86
+ execResult[ 4 ]
87
+ ];
88
+ }
89
+ }],
90
+
91
+ // jQuery.Color( )
92
+ color = jQuery.Color = function( color, green, blue, alpha ) {
93
+ return new jQuery.Color.fn.parse( color, green, blue, alpha );
94
+ },
95
+ spaces = {
96
+ rgba: {
97
+ props: {
98
+ red: {
99
+ idx: 0,
100
+ type: "byte"
101
+ },
102
+ green: {
103
+ idx: 1,
104
+ type: "byte"
105
+ },
106
+ blue: {
107
+ idx: 2,
108
+ type: "byte"
109
+ }
110
+ }
111
+ },
112
+
113
+ hsla: {
114
+ props: {
115
+ hue: {
116
+ idx: 0,
117
+ type: "degrees"
118
+ },
119
+ saturation: {
120
+ idx: 1,
121
+ type: "percent"
122
+ },
123
+ lightness: {
124
+ idx: 2,
125
+ type: "percent"
126
+ }
127
+ }
128
+ }
129
+ },
130
+ propTypes = {
131
+ "byte": {
132
+ floor: true,
133
+ max: 255
134
+ },
135
+ "percent": {
136
+ max: 1
137
+ },
138
+ "degrees": {
139
+ mod: 360,
140
+ floor: true
141
+ }
142
+ },
143
+ support = color.support = {},
144
+
145
+ // element for support tests
146
+ supportElem = jQuery( "<p>" )[ 0 ],
147
+
148
+ // colors = jQuery.Color.names
149
+ colors,
150
+
151
+ // local aliases of functions called often
152
+ each = jQuery.each;
153
+
154
+ // determine rgba support immediately
155
+ supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
156
+ support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
157
+
158
+ // define cache name and alpha properties
159
+ // for rgba and hsla spaces
160
+ each( spaces, function( spaceName, space ) {
161
+ space.cache = "_" + spaceName;
162
+ space.props.alpha = {
163
+ idx: 3,
164
+ type: "percent",
165
+ def: 1
166
+ };
167
+ });
168
+
169
+ function clamp( value, prop, allowEmpty ) {
170
+ var type = propTypes[ prop.type ] || {};
171
+
172
+ if ( value == null ) {
173
+ return (allowEmpty || !prop.def) ? null : prop.def;
174
+ }
175
+
176
+ // ~~ is an short way of doing floor for positive numbers
177
+ value = type.floor ? ~~value : parseFloat( value );
178
+
179
+ // IE will pass in empty strings as value for alpha,
180
+ // which will hit this case
181
+ if ( isNaN( value ) ) {
182
+ return prop.def;
183
+ }
184
+
185
+ if ( type.mod ) {
186
+ // we add mod before modding to make sure that negatives values
187
+ // get converted properly: -10 -> 350
188
+ return (value + type.mod) % type.mod;
189
+ }
190
+
191
+ // for now all property types without mod have min and max
192
+ return 0 > value ? 0 : type.max < value ? type.max : value;
193
+ }
194
+
195
+ function stringParse( string ) {
196
+ var inst = color(),
197
+ rgba = inst._rgba = [];
198
+
199
+ string = string.toLowerCase();
200
+
201
+ each( stringParsers, function( i, parser ) {
202
+ var parsed,
203
+ match = parser.re.exec( string ),
204
+ values = match && parser.parse( match ),
205
+ spaceName = parser.space || "rgba";
206
+
207
+ if ( values ) {
208
+ parsed = inst[ spaceName ]( values );
209
+
210
+ // if this was an rgba parse the assignment might happen twice
211
+ // oh well....
212
+ inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
213
+ rgba = inst._rgba = parsed._rgba;
214
+
215
+ // exit each( stringParsers ) here because we matched
216
+ return false;
217
+ }
218
+ });
219
+
220
+ // Found a stringParser that handled it
221
+ if ( rgba.length ) {
222
+
223
+ // if this came from a parsed string, force "transparent" when alpha is 0
224
+ // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
225
+ if ( rgba.join() === "0,0,0,0" ) {
226
+ jQuery.extend( rgba, colors.transparent );
227
+ }
228
+ return inst;
229
+ }
230
+
231
+ // named colors
232
+ return colors[ string ];
233
+ }
234
+
235
+ color.fn = jQuery.extend( color.prototype, {
236
+ parse: function( red, green, blue, alpha ) {
237
+ if ( red === undefined ) {
238
+ this._rgba = [ null, null, null, null ];
239
+ return this;
240
+ }
241
+ if ( red.jquery || red.nodeType ) {
242
+ red = jQuery( red ).css( green );
243
+ green = undefined;
244
+ }
245
+
246
+ var inst = this,
247
+ type = jQuery.type( red ),
248
+ rgba = this._rgba = [];
249
+
250
+ // more than 1 argument specified - assume ( red, green, blue, alpha )
251
+ if ( green !== undefined ) {
252
+ red = [ red, green, blue, alpha ];
253
+ type = "array";
254
+ }
255
+
256
+ if ( type === "string" ) {
257
+ return this.parse( stringParse( red ) || colors._default );
258
+ }
259
+
260
+ if ( type === "array" ) {
261
+ each( spaces.rgba.props, function( key, prop ) {
262
+ rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
263
+ });
264
+ return this;
265
+ }
266
+
267
+ if ( type === "object" ) {
268
+ if ( red instanceof color ) {
269
+ each( spaces, function( spaceName, space ) {
270
+ if ( red[ space.cache ] ) {
271
+ inst[ space.cache ] = red[ space.cache ].slice();
272
+ }
273
+ });
274
+ } else {
275
+ each( spaces, function( spaceName, space ) {
276
+ var cache = space.cache;
277
+ each( space.props, function( key, prop ) {
278
+
279
+ // if the cache doesn't exist, and we know how to convert
280
+ if ( !inst[ cache ] && space.to ) {
281
+
282
+ // if the value was null, we don't need to copy it
283
+ // if the key was alpha, we don't need to copy it either
284
+ if ( key === "alpha" || red[ key ] == null ) {
285
+ return;
286
+ }
287
+ inst[ cache ] = space.to( inst._rgba );
288
+ }
289
+
290
+ // this is the only case where we allow nulls for ALL properties.
291
+ // call clamp with alwaysAllowEmpty
292
+ inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
293
+ });
294
+
295
+ // everything defined but alpha?
296
+ if ( inst[ cache ] && $.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
297
+ // use the default of 1
298
+ inst[ cache ][ 3 ] = 1;
299
+ if ( space.from ) {
300
+ inst._rgba = space.from( inst[ cache ] );
301
+ }
302
+ }
303
+ });
304
+ }
305
+ return this;
306
+ }
307
+ },
308
+ is: function( compare ) {
309
+ var is = color( compare ),
310
+ same = true,
311
+ inst = this;
312
+
313
+ each( spaces, function( _, space ) {
314
+ var localCache,
315
+ isCache = is[ space.cache ];
316
+ if (isCache) {
317
+ localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
318
+ each( space.props, function( _, prop ) {
319
+ if ( isCache[ prop.idx ] != null ) {
320
+ same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
321
+ return same;
322
+ }
323
+ });
324
+ }
325
+ return same;
326
+ });
327
+ return same;
328
+ },
329
+ _space: function() {
330
+ var used = [],
331
+ inst = this;
332
+ each( spaces, function( spaceName, space ) {
333
+ if ( inst[ space.cache ] ) {
334
+ used.push( spaceName );
335
+ }
336
+ });
337
+ return used.pop();
338
+ },
339
+ transition: function( other, distance ) {
340
+ var end = color( other ),
341
+ spaceName = end._space(),
342
+ space = spaces[ spaceName ],
343
+ startColor = this.alpha() === 0 ? color( "transparent" ) : this,
344
+ start = startColor[ space.cache ] || space.to( startColor._rgba ),
345
+ result = start.slice();
346
+
347
+ end = end[ space.cache ];
348
+ each( space.props, function( key, prop ) {
349
+ var index = prop.idx,
350
+ startValue = start[ index ],
351
+ endValue = end[ index ],
352
+ type = propTypes[ prop.type ] || {};
353
+
354
+ // if null, don't override start value
355
+ if ( endValue === null ) {
356
+ return;
357
+ }
358
+ // if null - use end
359
+ if ( startValue === null ) {
360
+ result[ index ] = endValue;
361
+ } else {
362
+ if ( type.mod ) {
363
+ if ( endValue - startValue > type.mod / 2 ) {
364
+ startValue += type.mod;
365
+ } else if ( startValue - endValue > type.mod / 2 ) {
366
+ startValue -= type.mod;
367
+ }
368
+ }
369
+ result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
370
+ }
371
+ });
372
+ return this[ spaceName ]( result );
373
+ },
374
+ blend: function( opaque ) {
375
+ // if we are already opaque - return ourself
376
+ if ( this._rgba[ 3 ] === 1 ) {
377
+ return this;
378
+ }
379
+
380
+ var rgb = this._rgba.slice(),
381
+ a = rgb.pop(),
382
+ blend = color( opaque )._rgba;
383
+
384
+ return color( jQuery.map( rgb, function( v, i ) {
385
+ return ( 1 - a ) * blend[ i ] + a * v;
386
+ }));
387
+ },
388
+ toRgbaString: function() {
389
+ var prefix = "rgba(",
390
+ rgba = jQuery.map( this._rgba, function( v, i ) {
391
+ return v == null ? ( i > 2 ? 1 : 0 ) : v;
392
+ });
393
+
394
+ if ( rgba[ 3 ] === 1 ) {
395
+ rgba.pop();
396
+ prefix = "rgb(";
397
+ }
398
+
399
+ return prefix + rgba.join() + ")";
400
+ },
401
+ toHslaString: function() {
402
+ var prefix = "hsla(",
403
+ hsla = jQuery.map( this.hsla(), function( v, i ) {
404
+ if ( v == null ) {
405
+ v = i > 2 ? 1 : 0;
406
+ }
407
+
408
+ // catch 1 and 2
409
+ if ( i && i < 3 ) {
410
+ v = Math.round( v * 100 ) + "%";
411
+ }
412
+ return v;
413
+ });
414
+
415
+ if ( hsla[ 3 ] === 1 ) {
416
+ hsla.pop();
417
+ prefix = "hsl(";
418
+ }
419
+ return prefix + hsla.join() + ")";
420
+ },
421
+ toHexString: function( includeAlpha ) {
422
+ var rgba = this._rgba.slice(),
423
+ alpha = rgba.pop();
424
+
425
+ if ( includeAlpha ) {
426
+ rgba.push( ~~( alpha * 255 ) );
427
+ }
428
+
429
+ return "#" + jQuery.map( rgba, function( v ) {
430
+
431
+ // default to 0 when nulls exist
432
+ v = ( v || 0 ).toString( 16 );
433
+ return v.length === 1 ? "0" + v : v;
434
+ }).join("");
435
+ },
436
+ toString: function() {
437
+ return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
438
+ }
439
+ });
440
+ color.fn.parse.prototype = color.fn;
441
+
442
+ // hsla conversions adapted from:
443
+ // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
444
+
445
+ function hue2rgb( p, q, h ) {
446
+ h = ( h + 1 ) % 1;
447
+ if ( h * 6 < 1 ) {
448
+ return p + (q - p) * h * 6;
449
+ }
450
+ if ( h * 2 < 1) {
451
+ return q;
452
+ }
453
+ if ( h * 3 < 2 ) {
454
+ return p + (q - p) * ((2/3) - h) * 6;
455
+ }
456
+ return p;
457
+ }
458
+
459
+ spaces.hsla.to = function ( rgba ) {
460
+ if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
461
+ return [ null, null, null, rgba[ 3 ] ];
462
+ }
463
+ var r = rgba[ 0 ] / 255,
464
+ g = rgba[ 1 ] / 255,
465
+ b = rgba[ 2 ] / 255,
466
+ a = rgba[ 3 ],
467
+ max = Math.max( r, g, b ),
468
+ min = Math.min( r, g, b ),
469
+ diff = max - min,
470
+ add = max + min,
471
+ l = add * 0.5,
472
+ h, s;
473
+
474
+ if ( min === max ) {
475
+ h = 0;
476
+ } else if ( r === max ) {
477
+ h = ( 60 * ( g - b ) / diff ) + 360;
478
+ } else if ( g === max ) {
479
+ h = ( 60 * ( b - r ) / diff ) + 120;
480
+ } else {
481
+ h = ( 60 * ( r - g ) / diff ) + 240;
482
+ }
483
+
484
+ if ( l === 0 || l === 1 ) {
485
+ s = l;
486
+ } else if ( l <= 0.5 ) {
487
+ s = diff / add;
488
+ } else {
489
+ s = diff / ( 2 - add );
490
+ }
491
+ return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
492
+ };
493
+
494
+ spaces.hsla.from = function ( hsla ) {
495
+ if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
496
+ return [ null, null, null, hsla[ 3 ] ];
497
+ }
498
+ var h = hsla[ 0 ] / 360,
499
+ s = hsla[ 1 ],
500
+ l = hsla[ 2 ],
501
+ a = hsla[ 3 ],
502
+ q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
503
+ p = 2 * l - q;
504
+
505
+ return [
506
+ Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
507
+ Math.round( hue2rgb( p, q, h ) * 255 ),
508
+ Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
509
+ a
510
+ ];
511
+ };
512
+
513
+
514
+ each( spaces, function( spaceName, space ) {
515
+ var props = space.props,
516
+ cache = space.cache,
517
+ to = space.to,
518
+ from = space.from;
519
+
520
+ // makes rgba() and hsla()
521
+ color.fn[ spaceName ] = function( value ) {
522
+
523
+ // generate a cache for this space if it doesn't exist
524
+ if ( to && !this[ cache ] ) {
525
+ this[ cache ] = to( this._rgba );
526
+ }
527
+ if ( value === undefined ) {
528
+ return this[ cache ].slice();
529
+ }
530
+
531
+ var ret,
532
+ type = jQuery.type( value ),
533
+ arr = ( type === "array" || type === "object" ) ? value : arguments,
534
+ local = this[ cache ].slice();
535
+
536
+ each( props, function( key, prop ) {
537
+ var val = arr[ type === "object" ? key : prop.idx ];
538
+ if ( val == null ) {
539
+ val = local[ prop.idx ];
540
+ }
541
+ local[ prop.idx ] = clamp( val, prop );
542
+ });
543
+
544
+ if ( from ) {
545
+ ret = color( from( local ) );
546
+ ret[ cache ] = local;
547
+ return ret;
548
+ } else {
549
+ return color( local );
550
+ }
551
+ };
552
+
553
+ // makes red() green() blue() alpha() hue() saturation() lightness()
554
+ each( props, function( key, prop ) {
555
+ // alpha is included in more than one space
556
+ if ( color.fn[ key ] ) {
557
+ return;
558
+ }
559
+ color.fn[ key ] = function( value ) {
560
+ var vtype = jQuery.type( value ),
561
+ fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
562
+ local = this[ fn ](),
563
+ cur = local[ prop.idx ],
564
+ match;
565
+
566
+ if ( vtype === "undefined" ) {
567
+ return cur;
568
+ }
569
+
570
+ if ( vtype === "function" ) {
571
+ value = value.call( this, cur );
572
+ vtype = jQuery.type( value );
573
+ }
574
+ if ( value == null && prop.empty ) {
575
+ return this;
576
+ }
577
+ if ( vtype === "string" ) {
578
+ match = rplusequals.exec( value );
579
+ if ( match ) {
580
+ value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
581
+ }
582
+ }
583
+ local[ prop.idx ] = value;
584
+ return this[ fn ]( local );
585
+ };
586
+ });
587
+ });
588
+
589
+ // add .fx.step functions
590
+ each( stepHooks, function( i, hook ) {
591
+ jQuery.cssHooks[ hook ] = {
592
+ set: function( elem, value ) {
593
+ var parsed, curElem,
594
+ backgroundColor = "";
595
+
596
+ if ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) {
597
+ value = color( parsed || value );
598
+ if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
599
+ curElem = hook === "backgroundColor" ? elem.parentNode : elem;
600
+ while (
601
+ (backgroundColor === "" || backgroundColor === "transparent") &&
602
+ curElem && curElem.style
603
+ ) {
604
+ try {
605
+ backgroundColor = jQuery.css( curElem, "backgroundColor" );
606
+ curElem = curElem.parentNode;
607
+ } catch ( e ) {
608
+ }
609
+ }
610
+
611
+ value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
612
+ backgroundColor :
613
+ "_default" );
614
+ }
615
+
616
+ value = value.toRgbaString();
617
+ }
618
+ try {
619
+ elem.style[ hook ] = value;
620
+ } catch( error ) {
621
+ // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
622
+ }
623
+ }
624
+ };
625
+ jQuery.fx.step[ hook ] = function( fx ) {
626
+ if ( !fx.colorInit ) {
627
+ fx.start = color( fx.elem, hook );
628
+ fx.end = color( fx.end );
629
+ fx.colorInit = true;
630
+ }
631
+ jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
632
+ };
633
+ });
634
+
635
+ jQuery.cssHooks.borderColor = {
636
+ expand: function( value ) {
637
+ var expanded = {};
638
+
639
+ each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
640
+ expanded[ "border" + part + "Color" ] = value;
641
+ });
642
+ return expanded;
643
+ }
644
+ };
645
+
646
+ // Basic color names only.
647
+ // Usage of any of the other color names requires adding yourself or including
648
+ // jquery.color.svg-names.js.
649
+ colors = jQuery.Color.names = {
650
+ // 4.1. Basic color keywords
651
+ aqua: "#00ffff",
652
+ black: "#000000",
653
+ blue: "#0000ff",
654
+ fuchsia: "#ff00ff",
655
+ gray: "#808080",
656
+ green: "#008000",
657
+ lime: "#00ff00",
658
+ maroon: "#800000",
659
+ navy: "#000080",
660
+ olive: "#808000",
661
+ purple: "#800080",
662
+ red: "#ff0000",
663
+ silver: "#c0c0c0",
664
+ teal: "#008080",
665
+ white: "#ffffff",
666
+ yellow: "#ffff00",
667
+
668
+ // 4.2.3. "transparent" color keyword
669
+ transparent: [ null, null, null, 0 ],
670
+
671
+ _default: "#ffffff"
672
+ };
673
+
674
+ })( jQuery );
675
+
676
+
677
+
678
+ /******************************************************************************/
679
+ /****************************** CLASS ANIMATIONS ******************************/
680
+ /******************************************************************************/
681
+ (function() {
682
+
683
+ var classAnimationActions = [ "add", "remove", "toggle" ],
684
+ shorthandStyles = {
685
+ border: 1,
686
+ borderBottom: 1,
687
+ borderColor: 1,
688
+ borderLeft: 1,
689
+ borderRight: 1,
690
+ borderTop: 1,
691
+ borderWidth: 1,
692
+ margin: 1,
693
+ padding: 1
694
+ };
695
+
696
+ $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
697
+ $.fx.step[ prop ] = function( fx ) {
698
+ if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
699
+ jQuery.style( fx.elem, prop, fx.end );
700
+ fx.setAttr = true;
701
+ }
702
+ };
703
+ });
704
+
705
+ function getElementStyles() {
706
+ var style = this.ownerDocument.defaultView ?
707
+ this.ownerDocument.defaultView.getComputedStyle( this, null ) :
708
+ this.currentStyle,
709
+ newStyle = {},
710
+ key,
711
+ len;
712
+
713
+ // webkit enumerates style porperties
714
+ if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
715
+ len = style.length;
716
+ while ( len-- ) {
717
+ key = style[ len ];
718
+ if ( typeof style[ key ] === "string" ) {
719
+ newStyle[ $.camelCase( key ) ] = style[ key ];
720
+ }
721
+ }
722
+ } else {
723
+ for ( key in style ) {
724
+ if ( typeof style[ key ] === "string" ) {
725
+ newStyle[ key ] = style[ key ];
726
+ }
727
+ }
728
+ }
729
+
730
+ return newStyle;
731
+ }
732
+
733
+
734
+ function styleDifference( oldStyle, newStyle ) {
735
+ var diff = {},
736
+ name, value;
737
+
738
+ for ( name in newStyle ) {
739
+ value = newStyle[ name ];
740
+ if ( oldStyle[ name ] !== value ) {
741
+ if ( !shorthandStyles[ name ] ) {
742
+ if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
743
+ diff[ name ] = value;
744
+ }
745
+ }
746
+ }
747
+ }
748
+
749
+ return diff;
750
+ }
751
+
752
+ $.effects.animateClass = function( value, duration, easing, callback ) {
753
+ var o = $.speed( duration, easing, callback );
754
+
755
+ return this.queue( function() {
756
+ var animated = $( this ),
757
+ baseClass = animated.attr( "class" ) || "",
758
+ applyClassChange,
759
+ allAnimations = o.children ? animated.find( "*" ).andSelf() : animated;
760
+
761
+ // map the animated objects to store the original styles.
762
+ allAnimations = allAnimations.map(function() {
763
+ var el = $( this );
764
+ return {
765
+ el: el,
766
+ start: getElementStyles.call( this )
767
+ };
768
+ });
769
+
770
+ // apply class change
771
+ applyClassChange = function() {
772
+ $.each( classAnimationActions, function(i, action) {
773
+ if ( value[ action ] ) {
774
+ animated[ action + "Class" ]( value[ action ] );
775
+ }
776
+ });
777
+ };
778
+ applyClassChange();
779
+
780
+ // map all animated objects again - calculate new styles and diff
781
+ allAnimations = allAnimations.map(function() {
782
+ this.end = getElementStyles.call( this.el[ 0 ] );
783
+ this.diff = styleDifference( this.start, this.end );
784
+ return this;
785
+ });
786
+
787
+ // apply original class
788
+ animated.attr( "class", baseClass );
789
+
790
+ // map all animated objects again - this time collecting a promise
791
+ allAnimations = allAnimations.map(function() {
792
+ var styleInfo = this,
793
+ dfd = $.Deferred(),
794
+ opts = jQuery.extend({}, o, {
795
+ queue: false,
796
+ complete: function() {
797
+ dfd.resolve( styleInfo );
798
+ }
799
+ });
800
+
801
+ this.el.animate( this.diff, opts );
802
+ return dfd.promise();
803
+ });
804
+
805
+ // once all animations have completed:
806
+ $.when.apply( $, allAnimations.get() ).done(function() {
807
+
808
+ // set the final class
809
+ applyClassChange();
810
+
811
+ // for each animated element,
812
+ // clear all css properties that were animated
813
+ $.each( arguments, function() {
814
+ var el = this.el;
815
+ $.each( this.diff, function(key) {
816
+ el.css( key, '' );
817
+ });
818
+ });
819
+
820
+ // this is guarnteed to be there if you use jQuery.speed()
821
+ // it also handles dequeuing the next anim...
822
+ o.complete.call( animated[ 0 ] );
823
+ });
824
+ });
825
+ };
826
+
827
+ $.fn.extend({
828
+ _addClass: $.fn.addClass,
829
+ addClass: function( classNames, speed, easing, callback ) {
830
+ return speed ?
831
+ $.effects.animateClass.call( this,
832
+ { add: classNames }, speed, easing, callback ) :
833
+ this._addClass( classNames );
834
+ },
835
+
836
+ _removeClass: $.fn.removeClass,
837
+ removeClass: function( classNames, speed, easing, callback ) {
838
+ return speed ?
839
+ $.effects.animateClass.call( this,
840
+ { remove: classNames }, speed, easing, callback ) :
841
+ this._removeClass( classNames );
842
+ },
843
+
844
+ _toggleClass: $.fn.toggleClass,
845
+ toggleClass: function( classNames, force, speed, easing, callback ) {
846
+ if ( typeof force === "boolean" || force === undefined ) {
847
+ if ( !speed ) {
848
+ // without speed parameter
849
+ return this._toggleClass( classNames, force );
850
+ } else {
851
+ return $.effects.animateClass.call( this,
852
+ (force ? { add: classNames } : { remove: classNames }),
853
+ speed, easing, callback );
854
+ }
855
+ } else {
856
+ // without force parameter
857
+ return $.effects.animateClass.call( this,
858
+ { toggle: classNames }, force, speed, easing );
859
+ }
860
+ },
861
+
862
+ switchClass: function( remove, add, speed, easing, callback) {
863
+ return $.effects.animateClass.call( this, {
864
+ add: add,
865
+ remove: remove
866
+ }, speed, easing, callback );
867
+ }
868
+ });
869
+
870
+ })();
871
+
872
+ /******************************************************************************/
873
+ /*********************************** EFFECTS **********************************/
874
+ /******************************************************************************/
875
+
876
+ (function() {
877
+
878
+ $.extend( $.effects, {
879
+ version: "@VERSION",
880
+
881
+ // Saves a set of properties in a data storage
882
+ save: function( element, set ) {
883
+ for( var i=0; i < set.length; i++ ) {
884
+ if ( set[ i ] !== null ) {
885
+ element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
886
+ }
887
+ }
888
+ },
889
+
890
+ // Restores a set of previously saved properties from a data storage
891
+ restore: function( element, set ) {
892
+ var val, i;
893
+ for( i=0; i < set.length; i++ ) {
894
+ if ( set[ i ] !== null ) {
895
+ val = element.data( dataSpace + set[ i ] );
896
+ // support: jQuery 1.6.2
897
+ // http://bugs.jquery.com/ticket/9917
898
+ // jQuery 1.6.2 incorrectly returns undefined for any falsy value.
899
+ // We can't differentiate between "" and 0 here, so we just assume
900
+ // empty string since it's likely to be a more common value...
901
+ if ( val === undefined ) {
902
+ val = "";
903
+ }
904
+ element.css( set[ i ], val );
905
+ }
906
+ }
907
+ },
908
+
909
+ setMode: function( el, mode ) {
910
+ if (mode === "toggle") {
911
+ mode = el.is( ":hidden" ) ? "show" : "hide";
912
+ }
913
+ return mode;
914
+ },
915
+
916
+ // Translates a [top,left] array into a baseline value
917
+ // this should be a little more flexible in the future to handle a string & hash
918
+ getBaseline: function( origin, original ) {
919
+ var y, x;
920
+ switch ( origin[ 0 ] ) {
921
+ case "top": y = 0; break;
922
+ case "middle": y = 0.5; break;
923
+ case "bottom": y = 1; break;
924
+ default: y = origin[ 0 ] / original.height;
925
+ }
926
+ switch ( origin[ 1 ] ) {
927
+ case "left": x = 0; break;
928
+ case "center": x = 0.5; break;
929
+ case "right": x = 1; break;
930
+ default: x = origin[ 1 ] / original.width;
931
+ }
932
+ return {
933
+ x: x,
934
+ y: y
935
+ };
936
+ },
937
+
938
+ // Wraps the element around a wrapper that copies position properties
939
+ createWrapper: function( element ) {
940
+
941
+ // if the element is already wrapped, return it
942
+ if ( element.parent().is( ".ui-effects-wrapper" )) {
943
+ return element.parent();
944
+ }
945
+
946
+ // wrap the element
947
+ var props = {
948
+ width: element.outerWidth(true),
949
+ height: element.outerHeight(true),
950
+ "float": element.css( "float" )
951
+ },
952
+ wrapper = $( "<div></div>" )
953
+ .addClass( "ui-effects-wrapper" )
954
+ .css({
955
+ fontSize: "100%",
956
+ background: "transparent",
957
+ border: "none",
958
+ margin: 0,
959
+ padding: 0
960
+ }),
961
+ // Store the size in case width/height are defined in % - Fixes #5245
962
+ size = {
963
+ width: element.width(),
964
+ height: element.height()
965
+ },
966
+ active = document.activeElement;
967
+
968
+ // support: Firefox
969
+ // Firefox incorrectly exposes anonymous content
970
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
971
+ try {
972
+ active.id;
973
+ } catch( e ) {
974
+ active = document.body;
975
+ }
976
+
977
+ element.wrap( wrapper );
978
+
979
+ // Fixes #7595 - Elements lose focus when wrapped.
980
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
981
+ $( active ).focus();
982
+ }
983
+
984
+ wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
985
+
986
+ // transfer positioning properties to the wrapper
987
+ if ( element.css( "position" ) === "static" ) {
988
+ wrapper.css({ position: "relative" });
989
+ element.css({ position: "relative" });
990
+ } else {
991
+ $.extend( props, {
992
+ position: element.css( "position" ),
993
+ zIndex: element.css( "z-index" )
994
+ });
995
+ $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
996
+ props[ pos ] = element.css( pos );
997
+ if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
998
+ props[ pos ] = "auto";
999
+ }
1000
+ });
1001
+ element.css({
1002
+ position: "relative",
1003
+ top: 0,
1004
+ left: 0,
1005
+ right: "auto",
1006
+ bottom: "auto"
1007
+ });
1008
+ }
1009
+ element.css(size);
1010
+
1011
+ return wrapper.css( props ).show();
1012
+ },
1013
+
1014
+ removeWrapper: function( element ) {
1015
+ var active = document.activeElement;
1016
+
1017
+ if ( element.parent().is( ".ui-effects-wrapper" ) ) {
1018
+ element.parent().replaceWith( element );
1019
+
1020
+ // Fixes #7595 - Elements lose focus when wrapped.
1021
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
1022
+ $( active ).focus();
1023
+ }
1024
+ }
1025
+
1026
+
1027
+ return element;
1028
+ },
1029
+
1030
+ setTransition: function( element, list, factor, value ) {
1031
+ value = value || {};
1032
+ $.each( list, function( i, x ) {
1033
+ var unit = element.cssUnit( x );
1034
+ if ( unit[ 0 ] > 0 ) {
1035
+ value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
1036
+ }
1037
+ });
1038
+ return value;
1039
+ }
1040
+ });
1041
+
1042
+ // return an effect options object for the given parameters:
1043
+ function _normalizeArguments( effect, options, speed, callback ) {
1044
+
1045
+ // allow passing all options as the first parameter
1046
+ if ( $.isPlainObject( effect ) ) {
1047
+ options = effect;
1048
+ effect = effect.effect;
1049
+ }
1050
+
1051
+ // convert to an object
1052
+ effect = { effect: effect };
1053
+
1054
+ // catch (effect, null, ...)
1055
+ if ( options == null ) {
1056
+ options = {};
1057
+ }
1058
+
1059
+ // catch (effect, callback)
1060
+ if ( $.isFunction( options ) ) {
1061
+ callback = options;
1062
+ speed = null;
1063
+ options = {};
1064
+ }
1065
+
1066
+ // catch (effect, speed, ?)
1067
+ if ( typeof options === "number" || $.fx.speeds[ options ] ) {
1068
+ callback = speed;
1069
+ speed = options;
1070
+ options = {};
1071
+ }
1072
+
1073
+ // catch (effect, options, callback)
1074
+ if ( $.isFunction( speed ) ) {
1075
+ callback = speed;
1076
+ speed = null;
1077
+ }
1078
+
1079
+ // add options to effect
1080
+ if ( options ) {
1081
+ $.extend( effect, options );
1082
+ }
1083
+
1084
+ speed = speed || options.duration;
1085
+ effect.duration = $.fx.off ? 0 :
1086
+ typeof speed === "number" ? speed :
1087
+ speed in $.fx.speeds ? $.fx.speeds[ speed ] :
1088
+ $.fx.speeds._default;
1089
+
1090
+ effect.complete = callback || options.complete;
1091
+
1092
+ return effect;
1093
+ }
1094
+
1095
+ function standardSpeed( speed ) {
1096
+ // valid standard speeds
1097
+ if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
1098
+ return true;
1099
+ }
1100
+
1101
+ // invalid strings - treat as "normal" speed
1102
+ if ( typeof speed === "string" && !$.effects.effect[ speed ] ) {
1103
+ // TODO: remove in 2.0 (#7115)
1104
+ if ( backCompat && $.effects[ speed ] ) {
1105
+ return false;
1106
+ }
1107
+ return true;
1108
+ }
1109
+
1110
+ return false;
1111
+ }
1112
+
1113
+ $.fn.extend({
1114
+ effect: function( /* effect, options, speed, callback */ ) {
1115
+ var args = _normalizeArguments.apply( this, arguments ),
1116
+ mode = args.mode,
1117
+ queue = args.queue,
1118
+ effectMethod = $.effects.effect[ args.effect ],
1119
+
1120
+ // DEPRECATED: remove in 2.0 (#7115)
1121
+ oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ];
1122
+
1123
+ if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) {
1124
+ // delegate to the original method (e.g., .show()) if possible
1125
+ if ( mode ) {
1126
+ return this[ mode ]( args.duration, args.complete );
1127
+ } else {
1128
+ return this.each( function() {
1129
+ if ( args.complete ) {
1130
+ args.complete.call( this );
1131
+ }
1132
+ });
1133
+ }
1134
+ }
1135
+
1136
+ function run( next ) {
1137
+ var elem = $( this ),
1138
+ complete = args.complete,
1139
+ mode = args.mode;
1140
+
1141
+ function done() {
1142
+ if ( $.isFunction( complete ) ) {
1143
+ complete.call( elem[0] );
1144
+ }
1145
+ if ( $.isFunction( next ) ) {
1146
+ next();
1147
+ }
1148
+ }
1149
+
1150
+ // if the element is hiddden and mode is hide,
1151
+ // or element is visible and mode is show
1152
+ if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
1153
+ done();
1154
+ } else {
1155
+ effectMethod.call( elem[0], args, done );
1156
+ }
1157
+ }
1158
+
1159
+ // TODO: remove this check in 2.0, effectMethod will always be true
1160
+ if ( effectMethod ) {
1161
+ return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
1162
+ } else {
1163
+ // DEPRECATED: remove in 2.0 (#7115)
1164
+ return oldEffectMethod.call(this, {
1165
+ options: args,
1166
+ duration: args.duration,
1167
+ callback: args.complete,
1168
+ mode: args.mode
1169
+ });
1170
+ }
1171
+ },
1172
+
1173
+ _show: $.fn.show,
1174
+ show: function( speed ) {
1175
+ if ( standardSpeed( speed ) ) {
1176
+ return this._show.apply( this, arguments );
1177
+ } else {
1178
+ var args = _normalizeArguments.apply( this, arguments );
1179
+ args.mode = "show";
1180
+ return this.effect.call( this, args );
1181
+ }
1182
+ },
1183
+
1184
+ _hide: $.fn.hide,
1185
+ hide: function( speed ) {
1186
+ if ( standardSpeed( speed ) ) {
1187
+ return this._hide.apply( this, arguments );
1188
+ } else {
1189
+ var args = _normalizeArguments.apply( this, arguments );
1190
+ args.mode = "hide";
1191
+ return this.effect.call( this, args );
1192
+ }
1193
+ },
1194
+
1195
+ // jQuery core overloads toggle and creates _toggle
1196
+ __toggle: $.fn.toggle,
1197
+ toggle: function( speed ) {
1198
+ if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) {
1199
+ return this.__toggle.apply( this, arguments );
1200
+ } else {
1201
+ var args = _normalizeArguments.apply( this, arguments );
1202
+ args.mode = "toggle";
1203
+ return this.effect.call( this, args );
1204
+ }
1205
+ },
1206
+
1207
+ // helper functions
1208
+ cssUnit: function(key) {
1209
+ var style = this.css( key ),
1210
+ val = [];
1211
+
1212
+ $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
1213
+ if ( style.indexOf( unit ) > 0 ) {
1214
+ val = [ parseFloat( style ), unit ];
1215
+ }
1216
+ });
1217
+ return val;
1218
+ }
1219
+ });
1220
+
1221
+ })();
1222
+
1223
+ /******************************************************************************/
1224
+ /*********************************** EASING ***********************************/
1225
+ /******************************************************************************/
1226
+
1227
+ (function() {
1228
+
1229
+ // based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
1230
+
1231
+ var baseEasings = {};
1232
+
1233
+ $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
1234
+ baseEasings[ name ] = function( p ) {
1235
+ return Math.pow( p, i + 2 );
1236
+ };
1237
+ });
1238
+
1239
+ $.extend( baseEasings, {
1240
+ Sine: function ( p ) {
1241
+ return 1 - Math.cos( p * Math.PI / 2 );
1242
+ },
1243
+ Circ: function ( p ) {
1244
+ return 1 - Math.sqrt( 1 - p * p );
1245
+ },
1246
+ Elastic: function( p ) {
1247
+ return p === 0 || p === 1 ? p :
1248
+ -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
1249
+ },
1250
+ Back: function( p ) {
1251
+ return p * p * ( 3 * p - 2 );
1252
+ },
1253
+ Bounce: function ( p ) {
1254
+ var pow2,
1255
+ bounce = 4;
1256
+
1257
+ while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
1258
+ return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
1259
+ }
1260
+ });
1261
+
1262
+ $.each( baseEasings, function( name, easeIn ) {
1263
+ $.easing[ "easeIn" + name ] = easeIn;
1264
+ $.easing[ "easeOut" + name ] = function( p ) {
1265
+ return 1 - easeIn( 1 - p );
1266
+ };
1267
+ $.easing[ "easeInOut" + name ] = function( p ) {
1268
+ return p < 0.5 ?
1269
+ easeIn( p * 2 ) / 2 :
1270
+ 1 - easeIn( p * -2 + 2 ) / 2;
1271
+ };
1272
+ });
1273
+
1274
+ })();
1275
+
1276
+ })(jQuery));