curation_concerns 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (424) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +18 -0
  5. data/Gemfile +31 -0
  6. data/LICENSE.txt +15 -0
  7. data/README.md +46 -0
  8. data/RELEASING.md +2 -0
  9. data/Rakefile +26 -0
  10. data/VERSION +1 -0
  11. data/app/assets/images/default.png +0 -0
  12. data/app/assets/images/nope.png +0 -0
  13. data/app/assets/javascripts/.gitkeep +0 -0
  14. data/app/assets/javascripts/curation_concerns/.gitkeep +0 -0
  15. data/app/assets/javascripts/curation_concerns/application.js +18 -0
  16. data/app/assets/javascripts/curation_concerns/browse_everything_implement.js +7 -0
  17. data/app/assets/javascripts/curation_concerns/curation_concerns.js +28 -0
  18. data/app/assets/javascripts/curation_concerns/embargoes.js +17 -0
  19. data/app/assets/javascripts/curation_concerns/facet_mine.js +22 -0
  20. data/app/assets/javascripts/curation_concerns/help_modal.js +36 -0
  21. data/app/assets/javascripts/curation_concerns/link_groups.js.coffee +123 -0
  22. data/app/assets/javascripts/curation_concerns/link_users.js.coffee +126 -0
  23. data/app/assets/javascripts/curation_concerns/proxy_rights.js.coffee +95 -0
  24. data/app/assets/javascripts/curation_concerns/proxy_submission.js +23 -0
  25. data/app/assets/javascripts/curation_concerns/select_works.js.coffee +20 -0
  26. data/app/assets/javascripts/modernizr.js +3 -0
  27. data/app/assets/stylesheets/curation_concerns/_curation_concerns.scss +9 -0
  28. data/app/assets/stylesheets/curation_concerns/_global-variables.scss +5 -0
  29. data/app/assets/stylesheets/curation_concerns/_modules.scss +13 -0
  30. data/app/assets/stylesheets/curation_concerns/_positioning.scss +138 -0
  31. data/app/assets/stylesheets/curation_concerns/_theme.scss +46 -0
  32. data/app/assets/stylesheets/curation_concerns/_typography.scss +137 -0
  33. data/app/assets/stylesheets/curation_concerns/_variables_bootstrap.scss +7 -0
  34. data/app/assets/stylesheets/curation_concerns/downloads.scss +3 -0
  35. data/app/assets/stylesheets/curation_concerns/help_requests.scss +3 -0
  36. data/app/assets/stylesheets/curation_concerns/modules/accessibility.scss +50 -0
  37. data/app/assets/stylesheets/curation_concerns/modules/accordion.scss +33 -0
  38. data/app/assets/stylesheets/curation_concerns/modules/attributes.scss +31 -0
  39. data/app/assets/stylesheets/curation_concerns/modules/classify_work.scss +100 -0
  40. data/app/assets/stylesheets/curation_concerns/modules/embargoes.scss +15 -0
  41. data/app/assets/stylesheets/curation_concerns/modules/emphatic_action_area.scss +14 -0
  42. data/app/assets/stylesheets/curation_concerns/modules/forms.scss +116 -0
  43. data/app/assets/stylesheets/curation_concerns/modules/multi_value_fields.scss +52 -0
  44. data/app/assets/stylesheets/curation_concerns/modules/pagination.scss +4 -0
  45. data/app/assets/stylesheets/curation_concerns/modules/search_results.scss +55 -0
  46. data/app/assets/stylesheets/curation_concerns/modules/site_actions.scss +53 -0
  47. data/app/assets/stylesheets/curation_concerns/modules/site_search.scss +46 -0
  48. data/app/controllers/catalog_controller.rb +3 -0
  49. data/app/controllers/collections_controller.rb +3 -0
  50. data/app/controllers/concerns/curation_concerns/application_controller_behavior.rb +28 -0
  51. data/app/controllers/concerns/curation_concerns/catalog_controller.rb +321 -0
  52. data/app/controllers/concerns/curation_concerns/collections_controller_behavior.rb +76 -0
  53. data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +125 -0
  54. data/app/controllers/concerns/curation_concerns/download_behavior.rb +60 -0
  55. data/app/controllers/concerns/curation_concerns/embargoes_controller_behavior.rb +44 -0
  56. data/app/controllers/concerns/curation_concerns/generic_files_controller_behavior.rb +149 -0
  57. data/app/controllers/concerns/curation_concerns/leases_controller_behavior.rb +36 -0
  58. data/app/controllers/concerns/curation_concerns/manages_embargoes.rb +26 -0
  59. data/app/controllers/concerns/curation_concerns/parent_container.rb +33 -0
  60. data/app/controllers/concerns/curation_concerns/themed_layout_controller.rb +31 -0
  61. data/app/controllers/concerns/curation_concerns/without_namespace.rb +15 -0
  62. data/app/controllers/curation_concerns/application_controller.rb +7 -0
  63. data/app/controllers/curation_concerns/classify_concerns_controller.rb +35 -0
  64. data/app/controllers/curation_concerns/generic_files_controller.rb +13 -0
  65. data/app/controllers/curation_concerns/permissions_controller.rb +19 -0
  66. data/app/controllers/downloads_controller.rb +4 -0
  67. data/app/controllers/embargoes_controller.rb +5 -0
  68. data/app/controllers/leases_controller.rb +5 -0
  69. data/app/controllers/registrations_controller.rb +20 -0
  70. data/app/controllers/sessions_controller.rb +4 -0
  71. data/app/datastreams/curation_concerns/generic_work_rdf_properties.rb +57 -0
  72. data/app/datastreams/generic_work_metadata.rb +3 -0
  73. data/app/forms/curation_concerns/forms/collection_edit_form.rb +17 -0
  74. data/app/forms/curation_concerns/forms/generic_file_edit_form.rb +15 -0
  75. data/app/forms/curation_concerns/forms/generic_work_edit_form.rb +9 -0
  76. data/app/helpers/curation_concerns/ability_helper.rb +46 -0
  77. data/app/helpers/curation_concerns/attribute_helper.rb +67 -0
  78. data/app/helpers/curation_concerns/catalog_helper.rb +38 -0
  79. data/app/helpers/curation_concerns/collections_helper.rb +63 -0
  80. data/app/helpers/curation_concerns/embargo_helper.rb +17 -0
  81. data/app/helpers/curation_concerns/generic_file_helper.rb +19 -0
  82. data/app/helpers/curation_concerns/lease_helper.rb +18 -0
  83. data/app/helpers/curation_concerns/main_app_helpers.rb +13 -0
  84. data/app/helpers/curation_concerns/render_constraints_helper.rb +42 -0
  85. data/app/helpers/curation_concerns/search_paths_helper.rb +13 -0
  86. data/app/helpers/curation_concerns/thumbnail_helper.rb +11 -0
  87. data/app/helpers/curation_concerns/title_helper.rb +23 -0
  88. data/app/helpers/curation_concerns/url_helper.rb +29 -0
  89. data/app/presenters/curation_concerns/collection_presenter.rb +40 -0
  90. data/app/presenters/curation_concerns/generic_file_presenter.rb +14 -0
  91. data/app/presenters/curation_concerns/generic_work_presenter.rb +13 -0
  92. data/app/search_builders/curation_concerns/search_builder.rb +49 -0
  93. data/app/services/curation_concerns/curation_concern.rb +14 -0
  94. data/app/services/curation_concerns/embargo_service.rb +26 -0
  95. data/app/services/curation_concerns/lease_service.rb +23 -0
  96. data/app/views/catalog/_action_menu_partials/_collection.html.erb +27 -0
  97. data/app/views/catalog/_action_menu_partials/_default.html.erb +27 -0
  98. data/app/views/catalog/_document.html.erb +3 -0
  99. data/app/views/catalog/_document_list.html.erb +5 -0
  100. data/app/views/catalog/_home_text.html.erb +8 -0
  101. data/app/views/catalog/_index_default.html.erb +17 -0
  102. data/app/views/catalog/_index_header_list_default.html.erb +8 -0
  103. data/app/views/catalog/_navbar.html.erb +12 -0
  104. data/app/views/catalog/_show_partials/_default.html.erb +22 -0
  105. data/app/views/catalog/_show_partials/_default_details.html.erb +15 -0
  106. data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
  107. data/app/views/catalog/index.html.erb +47 -0
  108. data/app/views/collections/_add_to_collection_modal.html.erb +15 -0
  109. data/app/views/collections/_batch_edits_actions.html.erb +3 -0
  110. data/app/views/collections/_button_for_creating_empty_collection.html.erb +3 -0
  111. data/app/views/collections/_collection.html.erb +1 -0
  112. data/app/views/collections/_dashboard_document_list.html.erb +6 -0
  113. data/app/views/collections/_document_list.html.erb +7 -0
  114. data/app/views/collections/_edit_actions.html.erb +5 -0
  115. data/app/views/collections/_edit_descriptions.html.erb +20 -0
  116. data/app/views/collections/_form.html.erb +26 -0
  117. data/app/views/collections/_form_additional_information.html.erb +6 -0
  118. data/app/views/collections/_form_for_select_collection.html.erb +34 -0
  119. data/app/views/collections/_form_permission.html.erb +36 -0
  120. data/app/views/collections/_form_representative_image.html.erb +13 -0
  121. data/app/views/collections/_form_required_information.html.erb +11 -0
  122. data/app/views/collections/_form_to_add_member.html.erb +21 -0
  123. data/app/views/collections/_identifier_and_action.html.erb +15 -0
  124. data/app/views/collections/_media_display.html.erb +1 -0
  125. data/app/views/collections/_paginate.html.erb +6 -0
  126. data/app/views/collections/_search_collection_dashboard_form.html.erb +10 -0
  127. data/app/views/collections/_show_actions.html.erb +8 -0
  128. data/app/views/collections/_show_descriptions.html.erb +10 -0
  129. data/app/views/collections/_show_fields.html.erb +0 -0
  130. data/app/views/collections/_single_item_action_fields.html.erb +6 -0
  131. data/app/views/collections/_sort_and_per_page.html.erb +29 -0
  132. data/app/views/collections/_view_type_group.html.erb +13 -0
  133. data/app/views/collections/edit.html.erb +17 -0
  134. data/app/views/collections/show.html.erb +24 -0
  135. data/app/views/curation_concerns/base/_attributes.html.erb +25 -0
  136. data/app/views/curation_concerns/base/_collections.html.erb +26 -0
  137. data/app/views/curation_concerns/base/_form.html.erb +25 -0
  138. data/app/views/curation_concerns/base/_form_additional_information.html.erb +7 -0
  139. data/app/views/curation_concerns/base/_form_content_license.html.erb +16 -0
  140. data/app/views/curation_concerns/base/_form_descriptive_fields.erb +11 -0
  141. data/app/views/curation_concerns/base/_form_editors.html.erb +15 -0
  142. data/app/views/curation_concerns/base/_form_files_and_links.html.erb +23 -0
  143. data/app/views/curation_concerns/base/_form_permission.html.erb +52 -0
  144. data/app/views/curation_concerns/base/_form_permission_embargo.html.erb +6 -0
  145. data/app/views/curation_concerns/base/_form_permission_lease.html.erb +6 -0
  146. data/app/views/curation_concerns/base/_form_permission_under_embargo.html.erb +16 -0
  147. data/app/views/curation_concerns/base/_form_permission_under_lease.html.erb +18 -0
  148. data/app/views/curation_concerns/base/_form_representative_image.html.erb +13 -0
  149. data/app/views/curation_concerns/base/_form_required_information.html.erb +11 -0
  150. data/app/views/curation_concerns/base/_form_supplementary_fields.html.erb +15 -0
  151. data/app/views/curation_concerns/base/_legally_binding_text.html.erb +33 -0
  152. data/app/views/curation_concerns/base/_related_files.html.erb +24 -0
  153. data/app/views/curation_concerns/base/_representative_media.html.erb +8 -0
  154. data/app/views/curation_concerns/base/edit.html.erb +13 -0
  155. data/app/views/curation_concerns/base/new.html.erb +12 -0
  156. data/app/views/curation_concerns/base/show.html.erb +21 -0
  157. data/app/views/curation_concerns/base/unauthorized.html.erb +3 -0
  158. data/app/views/curation_concerns/classify_concerns/new.html.erb +25 -0
  159. data/app/views/curation_concerns/collections/_form_additional_information.html.erb +6 -0
  160. data/app/views/curation_concerns/generic_files/_actions.html.erb +16 -0
  161. data/app/views/curation_concerns/generic_files/_form.html.erb +35 -0
  162. data/app/views/curation_concerns/generic_files/_generic_file.html.erb +12 -0
  163. data/app/views/curation_concerns/generic_files/_media_display.html.erb +19 -0
  164. data/app/views/curation_concerns/generic_files/edit.html.erb +5 -0
  165. data/app/views/curation_concerns/generic_files/jq_upload.json.jbuilder +8 -0
  166. data/app/views/curation_concerns/generic_files/show.html.erb +15 -0
  167. data/app/views/curation_concerns/permissions/confirm.html.erb +21 -0
  168. data/app/views/embargoes/_embargo_history.html.erb +7 -0
  169. data/app/views/embargoes/_list_active_embargoes.html.erb +16 -0
  170. data/app/views/embargoes/_list_deactivated_embargoes.html.erb +10 -0
  171. data/app/views/embargoes/_list_expired_active_embargoes.html.erb +44 -0
  172. data/app/views/embargoes/edit.html.erb +43 -0
  173. data/app/views/embargoes/index.html.erb +18 -0
  174. data/app/views/layouts/boilerplate.html.erb +22 -0
  175. data/app/views/layouts/curation_concerns/1_column.html.erb +11 -0
  176. data/app/views/layouts/curation_concerns/catalog.html.erb +37 -0
  177. data/app/views/layouts/curation_concerns.html.erb +22 -0
  178. data/app/views/leases/_lease_history.html.erb +7 -0
  179. data/app/views/leases/_list_active_leases.html.erb +16 -0
  180. data/app/views/leases/_list_deactivated_leases.html.erb +4 -0
  181. data/app/views/leases/_list_expired_active_leases.html.erb +38 -0
  182. data/app/views/leases/edit.html.erb +43 -0
  183. data/app/views/leases/index.html.erb +18 -0
  184. data/app/views/shared/_add_content.html.erb +32 -0
  185. data/app/views/shared/_brand_bar.html.erb +10 -0
  186. data/app/views/shared/_flash_message.html.erb +17 -0
  187. data/app/views/shared/_footer.html.erb +10 -0
  188. data/app/views/shared/_ga.html.erb +6 -0
  189. data/app/views/shared/_header.html.erb +12 -0
  190. data/app/views/shared/_my_actions.html.erb +21 -0
  191. data/app/views/shared/_site_actions.html.erb +7 -0
  192. data/app/views/shared/_site_search.html.erb +12 -0
  193. data/app/views/shared/_title_bar.html.erb +16 -0
  194. data/app/workers/visibility_copy_worker.rb +30 -0
  195. data/config/initializers/simple_form.rb +31 -0
  196. data/config/locales/curation_concerns.en.yml +96 -0
  197. data/config/routes.rb +4 -0
  198. data/curation_concerns-models/.gitignore +17 -0
  199. data/curation_concerns-models/Gemfile +4 -0
  200. data/curation_concerns-models/LICENSE.md +177 -0
  201. data/curation_concerns-models/README.md +42 -0
  202. data/curation_concerns-models/Rakefile +1 -0
  203. data/curation_concerns-models/app/actors/concerns/curation_concerns/manages_embargoes_actor.rb +99 -0
  204. data/curation_concerns-models/app/actors/curation_concerns/base_actor.rb +90 -0
  205. data/curation_concerns-models/app/actors/curation_concerns/generic_file_actor.rb +150 -0
  206. data/curation_concerns-models/app/actors/curation_concerns/work_actor_behavior.rb +88 -0
  207. data/curation_concerns-models/app/jobs/active_fedora_id_based_job.rb +22 -0
  208. data/curation_concerns-models/app/jobs/active_fedora_pid_based_job.rb +6 -0
  209. data/curation_concerns-models/app/jobs/audit_job.rb +58 -0
  210. data/curation_concerns-models/app/jobs/characterize_job.rb +11 -0
  211. data/curation_concerns-models/app/jobs/copy_permissions_job.rb +24 -0
  212. data/curation_concerns-models/app/jobs/create_derivatives_job.rb +15 -0
  213. data/curation_concerns-models/app/jobs/import_url_job.rb +56 -0
  214. data/curation_concerns-models/app/jobs/ingest_local_file_job.rb +48 -0
  215. data/curation_concerns-models/app/jobs/resolrize_job.rb +9 -0
  216. data/curation_concerns-models/app/models/checksum_audit_log.rb +21 -0
  217. data/curation_concerns-models/app/models/concerns/curation_concerns/ability.rb +34 -0
  218. data/curation_concerns-models/app/models/concerns/curation_concerns/basic_metadata.rb +87 -0
  219. data/curation_concerns-models/app/models/concerns/curation_concerns/collection_behavior.rb +47 -0
  220. data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/belongs_to_works.rb +53 -0
  221. data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/characterization.rb +89 -0
  222. data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/content.rb +8 -0
  223. data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/export.rb +343 -0
  224. data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/full_text_indexing.rb +12 -0
  225. data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/indexing.rb +14 -0
  226. data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file/versions.rb +16 -0
  227. data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file.rb +5 -0
  228. data/curation_concerns-models/app/models/concerns/curation_concerns/generic_file_behavior.rb +44 -0
  229. data/curation_concerns-models/app/models/concerns/curation_concerns/generic_work_behavior.rb +38 -0
  230. data/curation_concerns-models/app/models/concerns/curation_concerns/has_representative.rb +14 -0
  231. data/curation_concerns-models/app/models/concerns/curation_concerns/human_readable_type.rb +23 -0
  232. data/curation_concerns-models/app/models/concerns/curation_concerns/permissions/readable.rb +19 -0
  233. data/curation_concerns-models/app/models/concerns/curation_concerns/permissions/writable.rb +75 -0
  234. data/curation_concerns-models/app/models/concerns/curation_concerns/permissions.rb +7 -0
  235. data/curation_concerns-models/app/models/concerns/curation_concerns/serializers.rb +15 -0
  236. data/curation_concerns-models/app/models/concerns/curation_concerns/solr_document_behavior.rb +135 -0
  237. data/curation_concerns-models/app/models/concerns/curation_concerns/user.rb +65 -0
  238. data/curation_concerns-models/app/models/concerns/curation_concerns/with_basic_metadata.rb +98 -0
  239. data/curation_concerns-models/app/models/concerns/curation_concerns/with_generic_files.rb +29 -0
  240. data/curation_concerns-models/app/models/curation_concerns/classify_concern.rb +47 -0
  241. data/curation_concerns-models/app/models/curation_concerns/quick_classification_query.rb +31 -0
  242. data/curation_concerns-models/app/models/datastreams/fits_datastream.rb +148 -0
  243. data/curation_concerns-models/app/models/version_committer.rb +2 -0
  244. data/curation_concerns-models/app/services/curation_concerns/characterization_service.rb +71 -0
  245. data/curation_concerns-models/app/services/curation_concerns/full_text_extraction_service.rb +38 -0
  246. data/curation_concerns-models/app/services/curation_concerns/generic_file_audit_service.rb +85 -0
  247. data/curation_concerns-models/app/services/curation_concerns/generic_file_indexing_service.rb +14 -0
  248. data/curation_concerns-models/app/services/curation_concerns/generic_work_indexing_service.rb +16 -0
  249. data/curation_concerns-models/app/services/curation_concerns/noid.rb +23 -0
  250. data/curation_concerns-models/app/services/curation_concerns/repository_audit_service.rb +9 -0
  251. data/curation_concerns-models/app/services/curation_concerns/versioning_service.rb +27 -0
  252. data/curation_concerns-models/config/locales/curation_concerns.en.yml +6 -0
  253. data/curation_concerns-models/curation_concerns-models.gemspec +34 -0
  254. data/curation_concerns-models/lib/curation_concerns/messages.rb +66 -0
  255. data/curation_concerns-models/lib/curation_concerns/models/engine.rb +61 -0
  256. data/curation_concerns-models/lib/curation_concerns/models/resque.rb +36 -0
  257. data/curation_concerns-models/lib/curation_concerns/models/utils.rb +22 -0
  258. data/curation_concerns-models/lib/curation_concerns/models/version.rb +5 -0
  259. data/curation_concerns-models/lib/curation_concerns/models.rb +32 -0
  260. data/curation_concerns-models/lib/generators/curation_concerns/models/abstract_migration_generator.rb +30 -0
  261. data/curation_concerns-models/lib/generators/curation_concerns/models/clamav_generator.rb +19 -0
  262. data/curation_concerns-models/lib/generators/curation_concerns/models/fulltext_generator.rb +28 -0
  263. data/curation_concerns-models/lib/generators/curation_concerns/models/install_generator.rb +70 -0
  264. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/app/models/collection.rb +4 -0
  265. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/app/models/generic_file.rb +4 -0
  266. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/clamav.rb +1 -0
  267. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/curation_concerns.rb +123 -0
  268. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/mime_types.rb +6 -0
  269. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/redis.yml +9 -0
  270. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/redis_config.rb +32 -0
  271. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/resque-pool.yml +1 -0
  272. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/resque_admin.rb +10 -0
  273. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/config/resque_config.rb +5 -0
  274. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/migrations/create_checksum_audit_logs.rb +19 -0
  275. data/curation_concerns-models/lib/generators/curation_concerns/models/templates/migrations/create_version_committers.rb +15 -0
  276. data/curation_concerns-models/lib/tasks/curation_concerns-models_tasks.rake +75 -0
  277. data/curation_concerns-models/lib/tasks/migrate.rake +13 -0
  278. data/curation_concerns-models/lib/tasks/resque.rake +13 -0
  279. data/curation_concerns-models/lib/tasks/solr_reindex.rake +8 -0
  280. data/curation_concerns.gemspec +46 -0
  281. data/lib/curation_concerns/configuration.rb +74 -0
  282. data/lib/curation_concerns/controller_resource.rb +10 -0
  283. data/lib/curation_concerns/engine.rb +20 -0
  284. data/lib/curation_concerns/rails/routes.rb +76 -0
  285. data/lib/curation_concerns/spec_support.rb +10 -0
  286. data/lib/curation_concerns/version.rb +3 -0
  287. data/lib/curation_concerns.rb +8 -0
  288. data/lib/generators/curation_concerns/install_generator.rb +103 -0
  289. data/lib/generators/curation_concerns/templates/curation_concerns.css.scss +3 -0
  290. data/lib/generators/curation_concerns/templates/curation_concerns.js +1 -0
  291. data/lib/generators/curation_concerns/templates/curation_concerns_config.rb +2 -0
  292. data/lib/generators/curation_concerns/templates/curation_concerns_helper.rb +4 -0
  293. data/lib/generators/curation_concerns/work/USAGE +19 -0
  294. data/lib/generators/curation_concerns/work/templates/README +13 -0
  295. data/lib/generators/curation_concerns/work/templates/actor.rb.erb +7 -0
  296. data/lib/generators/curation_concerns/work/templates/actor_spec.rb.erb +9 -0
  297. data/lib/generators/curation_concerns/work/templates/controller.rb.erb +7 -0
  298. data/lib/generators/curation_concerns/work/templates/controller_spec.rb.erb +9 -0
  299. data/lib/generators/curation_concerns/work/templates/model.rb.erb +7 -0
  300. data/lib/generators/curation_concerns/work/templates/model_spec.rb.erb +9 -0
  301. data/lib/generators/curation_concerns/work/work_generator.rb +78 -0
  302. data/solr_conf/conf/solrconfig.xml +223 -0
  303. data/spec/abilities/collection_abilities_spec.rb +48 -0
  304. data/spec/abilities/generic_file_abilities_spec.rb +62 -0
  305. data/spec/abilities/generic_work_abilities_spec.rb +58 -0
  306. data/spec/actors/curation_concerns/generic_file_actor_spec.rb +116 -0
  307. data/spec/actors/curation_concerns/manages_embargoes_actor_spec.rb +95 -0
  308. data/spec/actors/curation_concerns/work_actor_spec.rb +203 -0
  309. data/spec/controllers/catalog_controller_spec.rb +115 -0
  310. data/spec/controllers/curation_concerns/classify_concerns_controller_spec.rb +43 -0
  311. data/spec/controllers/curation_concerns/collections_controller_spec.rb +171 -0
  312. data/spec/controllers/curation_concerns/generic_files_controller_spec.rb +251 -0
  313. data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +167 -0
  314. data/spec/controllers/curation_concerns/permissions_controller_spec.rb +29 -0
  315. data/spec/controllers/downloads_controller_spec.rb +51 -0
  316. data/spec/controllers/embargoes_controller_spec.rb +114 -0
  317. data/spec/controllers/leases_controller_spec.rb +94 -0
  318. data/spec/factories/collections.rb +15 -0
  319. data/spec/factories/create_curation_concern.rb +3 -0
  320. data/spec/factories/generic_files.rb +31 -0
  321. data/spec/factories/generic_works.rb +54 -0
  322. data/spec/factories/users.rb +28 -0
  323. data/spec/features/add_file_spec.rb +30 -0
  324. data/spec/features/collection_spec.rb +222 -0
  325. data/spec/features/create_work_spec.rb +43 -0
  326. data/spec/features/embargo_spec.rb +51 -0
  327. data/spec/features/lease_spec.rb +49 -0
  328. data/spec/features/update_file_spec.rb +32 -0
  329. data/spec/features/work_generator_spec.rb +58 -0
  330. data/spec/fixtures/Example.ogg +0 -0
  331. data/spec/fixtures/charter.docx +0 -0
  332. data/spec/fixtures/countdown.avi +0 -0
  333. data/spec/fixtures/curation_concerns_generic_stub.txt +1 -0
  334. data/spec/fixtures/files/image.png +0 -0
  335. data/spec/fixtures/image.jp2 +0 -0
  336. data/spec/fixtures/image.jpg +0 -0
  337. data/spec/fixtures/piano_note.wav +0 -0
  338. data/spec/fixtures/sample_mpeg4.mp4 +0 -0
  339. data/spec/fixtures/small_file.txt +1 -0
  340. data/spec/fixtures/spoken-text.m4a +0 -0
  341. data/spec/fixtures/test4.pdf +0 -0
  342. data/spec/fixtures/test5.mp3 +0 -0
  343. data/spec/fixtures/world.png +0 -0
  344. data/spec/forms/collection_edit_form_spec.rb +20 -0
  345. data/spec/forms/generic_file_edit_form_spec.rb +33 -0
  346. data/spec/helpers/catalog_helper_spec.rb +58 -0
  347. data/spec/helpers/configuration_helper_spec.rb +13 -0
  348. data/spec/helpers/curation_concerns/.keep +0 -0
  349. data/spec/helpers/curation_concerns/collections_helper_spec.rb +49 -0
  350. data/spec/helpers/render_constraints_helper_spec.rb +19 -0
  351. data/spec/helpers/thumbnail_helper_spec.rb +21 -0
  352. data/spec/helpers/url_helper_spec.rb +22 -0
  353. data/spec/jobs/active_fedora_id_based_job_spec.rb +14 -0
  354. data/spec/jobs/audit_job_spec.rb +53 -0
  355. data/spec/jobs/characterize_job_spec.rb +23 -0
  356. data/spec/jobs/copy_permissions_job_spec.rb +49 -0
  357. data/spec/jobs/create_derivatives_job_spec.rb +23 -0
  358. data/spec/jobs/curation_concerns_resque_queue_spec.rb +49 -0
  359. data/spec/jobs/import_url_job_spec.rb +45 -0
  360. data/spec/jobs/ingest_local_file_job_spec.rb +25 -0
  361. data/spec/lib/curation_concerns/messages_spec.rb +70 -0
  362. data/spec/lib/curation_concerns/readable_permissions_spec.rb +56 -0
  363. data/spec/lib/curation_concerns/writable_permissions_spec.rb +16 -0
  364. data/spec/matchers/metadata_field_matchers.rb +28 -0
  365. data/spec/matchers/response_matchers.rb +7 -0
  366. data/spec/matchers.rb +24 -0
  367. data/spec/models/checksum_audit_log_spec.rb +66 -0
  368. data/spec/models/curation_concerns/collection_behavior_spec.rb +107 -0
  369. data/spec/models/curation_concerns/generic_file/derivatives_spec.rb +88 -0
  370. data/spec/models/curation_concerns/generic_work_behavior_spec.rb +35 -0
  371. data/spec/models/fits_datastream_spec.rb +127 -0
  372. data/spec/models/generic_file_spec.rb +619 -0
  373. data/spec/models/generic_work_spec.rb +43 -0
  374. data/spec/models/user_spec.rb +23 -0
  375. data/spec/presenters/curation_concerns/collection_presenter_spec.rb +34 -0
  376. data/spec/presenters/curation_concerns/generic_file_presenter_spec.rb +16 -0
  377. data/spec/routing/curation_concerns/routes_spec.rb +36 -0
  378. data/spec/routing/route_spec.rb +86 -0
  379. data/spec/services/characterization_service_spec.rb +30 -0
  380. data/spec/services/embargo_service_spec.rb +38 -0
  381. data/spec/services/full_text_extraction_service_spec.rb +5 -0
  382. data/spec/services/generic_file_audit_service_spec.rb +71 -0
  383. data/spec/services/generic_file_indexing_service_spec.rb +57 -0
  384. data/spec/services/generic_work_indexing_service_spec.rb +18 -0
  385. data/spec/services/lease_service_spec.rb +53 -0
  386. data/spec/services/repository_audit_service_spec.rb +18 -0
  387. data/spec/services/versioning_service_spec.rb +32 -0
  388. data/spec/spec_helper.rb +94 -0
  389. data/spec/support/controllers/engine_helpers.rb +7 -0
  390. data/spec/support/curation_concerns/factory_helpers.rb +14 -0
  391. data/spec/support/features/fixture_file_upload.rb +14 -0
  392. data/spec/support/features/session_helpers.rb +41 -0
  393. data/spec/support/features.rb +19 -0
  394. data/spec/support/shared/shared_examples_has_dc_metadata.rb +17 -0
  395. data/spec/support/shared/shared_examples_is_embargoable.rb +8 -0
  396. data/spec/support/shared/shared_examples_with_access_rights.rb +63 -0
  397. data/spec/tasks/rake_spec.rb +24 -0
  398. data/spec/test_app_templates/Gemfile.extra +1 -0
  399. data/spec/test_app_templates/lib/generators/test_app_generator.rb +55 -0
  400. data/spec/views/catalog/index.html.erb_spec.rb +59 -0
  401. data/spec/views/curation_concerns/base/_attributes.html.erb_spec.rb +25 -0
  402. data/spec/views/curation_concerns/base/show.html.erb_spec.rb +29 -0
  403. data/spec/views/curation_concerns/permissions/confirm.html.erb_spec.rb +33 -0
  404. data/spec/views/shared/_add_content.html.erb_spec.rb +42 -0
  405. data/spec/views/shared/_my_actions.html.erb_spec.rb +23 -0
  406. data/spec/workers/visibility_copy_worker_spec.rb +70 -0
  407. data/tasks/jetty.rake +15 -0
  408. data/tasks/release.rake +93 -0
  409. data/vendor/assets/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  410. data/vendor/assets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  411. data/vendor/assets/javascripts/handlebars.js +2278 -0
  412. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.autocomplete.js +602 -0
  413. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.core.js +356 -0
  414. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.effect-highlight.js +50 -0
  415. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.effect.js +1276 -0
  416. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.menu.js +610 -0
  417. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.position.js +498 -0
  418. data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.widget.js +528 -0
  419. data/vendor/assets/javascripts/jquery.tokeninput.js +1061 -0
  420. data/vendor/assets/stylesheets/jquery-ui-lightness.css +474 -0
  421. data/vendor/assets/stylesheets/token-input-facebook.css +122 -0
  422. data/vendor/assets/stylesheets/token-input-mac.css +204 -0
  423. data/vendor/assets/stylesheets/token-input.css +127 -0
  424. metadata +888 -0
@@ -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));