enju_leaf 1.3.4 → 2.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (326) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -4
  3. data/app/assets/javascripts/enju_leaf/application.js +12 -0
  4. data/app/assets/javascripts/{autocomplete_agent.js → enju_leaf/autocomplete_agent.js} +0 -0
  5. data/app/assets/javascripts/{menu.js → enju_leaf/menu.js} +0 -0
  6. data/app/assets/javascripts/enju_leaf/mobile.js +5 -0
  7. data/app/assets/javascripts/{portlets.js → enju_leaf/portlets.js} +0 -0
  8. data/app/assets/javascripts/{select_locale.js → enju_leaf/select_locale.js} +0 -0
  9. data/app/assets/stylesheets/{enju_leaf.css → enju_leaf/application.scss} +6 -6
  10. data/app/assets/stylesheets/{enju.css → enju_leaf/enju.css} +0 -0
  11. data/app/assets/stylesheets/{enju_mobile.css → enju_leaf/enju_mobile.css} +0 -0
  12. data/app/assets/stylesheets/{enju_print.css → enju_leaf/enju_print.css} +0 -0
  13. data/app/assets/stylesheets/{mobile.css → enju_leaf/mobile.css} +1 -1
  14. data/app/assets/stylesheets/{pagination.css → enju_leaf/pagination.css} +0 -0
  15. data/app/assets/stylesheets/{portlets.css → enju_leaf/portlets.css} +0 -0
  16. data/app/assets/stylesheets/{print.css → enju_leaf/print.css} +1 -1
  17. data/app/assets/stylesheets/{scaffold_modified.css → enju_leaf/scaffold_modified.css} +0 -0
  18. data/app/views/devise/registrations/edit.html.erb +1 -1
  19. data/app/views/layouts/application.html.erb +4 -4
  20. data/app/views/page/_include.html.erb +1 -1
  21. data/app/views/page/_index.html+phone.erb +1 -1
  22. data/app/views/page/_menu.html.erb +1 -1
  23. data/app/views/page/_mobile.html+phone.erb +2 -2
  24. data/app/views/page/about.en.html.erb +4 -4
  25. data/app/views/page/about.ja.html.erb +4 -4
  26. data/app/views/page/advanced_search.html.erb +5 -5
  27. data/app/views/page/configuration.html.erb +0 -2
  28. data/app/views/page/opensearch.xml.builder +2 -2
  29. data/config/locales/en.yml +0 -4
  30. data/config/locales/ja.yml +0 -4
  31. data/lib/enju_leaf/engine.rb +1 -1
  32. data/lib/enju_leaf/version.rb +1 -1
  33. data/lib/generators/enju_leaf/quick_install/quick_install_generator.rb +5 -2
  34. data/lib/generators/enju_leaf/setup/setup_generator.rb +22 -17
  35. data/lib/generators/enju_leaf/setup/templates/Procfile +2 -2
  36. data/lib/generators/enju_leaf/setup/templates/config/schedule.rb +2 -2
  37. data/lib/generators/enju_leaf/setup/templates/db/seeds.rb +0 -4
  38. data/lib/tasks/enju_leaf_tasks.rake +2 -5
  39. data/spec/acceptance/profile.rb +9 -0
  40. data/spec/controllers/page_controller_spec.rb +1 -1
  41. data/spec/dummy/app/assets/javascripts/application.js +3 -0
  42. data/spec/dummy/app/assets/stylesheets/application.css +1 -0
  43. data/spec/dummy/app/controllers/application_controller.rb +0 -1
  44. data/spec/dummy/bin/bundle +1 -1
  45. data/spec/dummy/bin/setup +1 -3
  46. data/spec/dummy/bin/update +4 -2
  47. data/spec/dummy/bin/yarn +3 -3
  48. data/spec/dummy/config.ru +3 -2
  49. data/spec/dummy/config/application.rb +3 -2
  50. data/spec/dummy/config/boot.rb +4 -9
  51. data/spec/dummy/config/cable.yml +10 -0
  52. data/spec/dummy/config/database.yml +70 -9
  53. data/spec/dummy/config/environments/development.rb +9 -2
  54. data/spec/dummy/config/environments/production.rb +7 -4
  55. data/spec/dummy/config/environments/test.rb +7 -1
  56. data/spec/dummy/config/initializers/assets.rb +1 -2
  57. data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
  58. data/spec/dummy/config/locales/en.yml +30 -2
  59. data/spec/dummy/config/puma.rb +34 -0
  60. data/spec/dummy/config/routes.rb +2 -58
  61. data/spec/dummy/config/spring.rb +6 -0
  62. data/spec/dummy/config/storage.yml +34 -0
  63. data/spec/dummy/db/development.sqlite3 +0 -0
  64. data/spec/dummy/db/migrate/005_create_manifestations.rb +3 -3
  65. data/spec/dummy/db/migrate/127_create_use_restrictions.rb +3 -7
  66. data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +3 -7
  67. data/spec/dummy/db/migrate/149_create_message_templates.rb +3 -8
  68. data/spec/dummy/db/migrate/154_create_messages.rb +6 -14
  69. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +4 -4
  70. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +6 -5
  71. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +1 -0
  72. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +1 -1
  73. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
  74. data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +2 -4
  75. data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +1 -1
  76. data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +1 -1
  77. data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +1 -1
  78. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -0
  79. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -0
  80. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +1 -0
  81. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
  82. data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +1 -1
  83. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +1 -1
  84. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +4 -5
  85. data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +4 -9
  86. data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +4 -9
  87. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +1 -1
  88. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +1 -1
  89. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +1 -1
  90. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +1 -1
  91. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +1 -1
  92. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +1 -1
  93. data/spec/dummy/db/migrate/20160319144230_create_issn_records.rb +11 -0
  94. data/spec/dummy/db/migrate/20160506144040_create_isbn_records.rb +11 -0
  95. data/spec/dummy/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +1 -1
  96. data/spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb +1 -1
  97. data/spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb +1 -1
  98. data/spec/dummy/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb +9 -0
  99. data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +11 -0
  100. data/spec/dummy/db/migrate/20170114174536_add_profile_id_to_user.rb +5 -0
  101. data/spec/dummy/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
  102. data/spec/dummy/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
  103. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
  104. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +13 -0
  105. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +13 -0
  106. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +13 -0
  107. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +13 -0
  108. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +13 -0
  109. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +13 -0
  110. data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +13 -0
  111. data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +13 -0
  112. data/spec/dummy/db/migrate/20181030072731_add_not_null_to_position_on_carrier_type.rb +14 -0
  113. data/spec/dummy/db/migrate/20190102034126_create_doi_records.rb +13 -0
  114. data/spec/dummy/db/migrate/20190208135957_create_active_storage_tables.active_storage.rb +27 -0
  115. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  116. data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
  117. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  118. data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  119. data/spec/dummy/db/schema.rb +265 -135
  120. data/spec/dummy/db/test.sqlite3 +0 -0
  121. data/spec/dummy/node_modules/jquery/AUTHORS.txt +278 -0
  122. data/spec/dummy/node_modules/jquery/LICENSE.txt +36 -0
  123. data/spec/dummy/node_modules/jquery/README.md +65 -0
  124. data/spec/dummy/node_modules/jquery/bower.json +14 -0
  125. data/spec/dummy/node_modules/jquery/dist/jquery.js +9814 -0
  126. data/spec/dummy/node_modules/jquery/dist/jquery.min.js +4 -0
  127. data/spec/dummy/node_modules/jquery/dist/jquery.min.map +1 -0
  128. data/spec/dummy/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
  129. data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.js +2143 -0
  130. data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  131. data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
  132. data/spec/dummy/node_modules/jquery/package.json +84 -0
  133. data/spec/dummy/node_modules/jquery/src/ajax.js +845 -0
  134. data/spec/dummy/node_modules/jquery/src/ajax/jsonp.js +100 -0
  135. data/spec/dummy/node_modules/jquery/src/ajax/load.js +83 -0
  136. data/spec/dummy/node_modules/jquery/src/ajax/parseJSON.js +13 -0
  137. data/spec/dummy/node_modules/jquery/src/ajax/parseXML.js +27 -0
  138. data/spec/dummy/node_modules/jquery/src/ajax/script.js +68 -0
  139. data/spec/dummy/node_modules/jquery/src/ajax/var/location.js +3 -0
  140. data/spec/dummy/node_modules/jquery/src/ajax/var/nonce.js +5 -0
  141. data/spec/dummy/node_modules/jquery/src/ajax/var/rquery.js +3 -0
  142. data/spec/dummy/node_modules/jquery/src/ajax/xhr.js +167 -0
  143. data/spec/dummy/node_modules/jquery/src/attributes.js +11 -0
  144. data/spec/dummy/node_modules/jquery/src/attributes/attr.js +142 -0
  145. data/spec/dummy/node_modules/jquery/src/attributes/classes.js +177 -0
  146. data/spec/dummy/node_modules/jquery/src/attributes/prop.js +125 -0
  147. data/spec/dummy/node_modules/jquery/src/attributes/support.js +36 -0
  148. data/spec/dummy/node_modules/jquery/src/attributes/val.js +177 -0
  149. data/spec/dummy/node_modules/jquery/src/callbacks.js +232 -0
  150. data/spec/dummy/node_modules/jquery/src/core.js +494 -0
  151. data/spec/dummy/node_modules/jquery/src/core/access.js +65 -0
  152. data/spec/dummy/node_modules/jquery/src/core/init.js +134 -0
  153. data/spec/dummy/node_modules/jquery/src/core/parseHTML.js +41 -0
  154. data/spec/dummy/node_modules/jquery/src/core/ready.js +103 -0
  155. data/spec/dummy/node_modules/jquery/src/core/var/rsingleTag.js +5 -0
  156. data/spec/dummy/node_modules/jquery/src/css.js +502 -0
  157. data/spec/dummy/node_modules/jquery/src/css/addGetHookIf.js +24 -0
  158. data/spec/dummy/node_modules/jquery/src/css/adjustCSS.js +65 -0
  159. data/spec/dummy/node_modules/jquery/src/css/curCSS.js +60 -0
  160. data/spec/dummy/node_modules/jquery/src/css/defaultDisplay.js +72 -0
  161. data/spec/dummy/node_modules/jquery/src/css/hiddenVisibleSelectors.js +18 -0
  162. data/spec/dummy/node_modules/jquery/src/css/showHide.js +48 -0
  163. data/spec/dummy/node_modules/jquery/src/css/support.js +121 -0
  164. data/spec/dummy/node_modules/jquery/src/css/var/cssExpand.js +3 -0
  165. data/spec/dummy/node_modules/jquery/src/css/var/getStyles.js +15 -0
  166. data/spec/dummy/node_modules/jquery/src/css/var/isHidden.js +16 -0
  167. data/spec/dummy/node_modules/jquery/src/css/var/rmargin.js +3 -0
  168. data/spec/dummy/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
  169. data/spec/dummy/node_modules/jquery/src/css/var/swap.js +24 -0
  170. data/spec/dummy/node_modules/jquery/src/data.js +187 -0
  171. data/spec/dummy/node_modules/jquery/src/data/Data.js +200 -0
  172. data/spec/dummy/node_modules/jquery/src/data/var/acceptData.js +18 -0
  173. data/spec/dummy/node_modules/jquery/src/data/var/dataPriv.js +5 -0
  174. data/spec/dummy/node_modules/jquery/src/data/var/dataUser.js +5 -0
  175. data/spec/dummy/node_modules/jquery/src/deferred.js +158 -0
  176. data/spec/dummy/node_modules/jquery/src/deprecated.js +32 -0
  177. data/spec/dummy/node_modules/jquery/src/dimensions.js +54 -0
  178. data/spec/dummy/node_modules/jquery/src/effects.js +629 -0
  179. data/spec/dummy/node_modules/jquery/src/effects/Tween.js +121 -0
  180. data/spec/dummy/node_modules/jquery/src/effects/animatedSelector.js +13 -0
  181. data/spec/dummy/node_modules/jquery/src/event.js +711 -0
  182. data/spec/dummy/node_modules/jquery/src/event/ajax.js +20 -0
  183. data/spec/dummy/node_modules/jquery/src/event/alias.js +27 -0
  184. data/spec/dummy/node_modules/jquery/src/event/focusin.js +53 -0
  185. data/spec/dummy/node_modules/jquery/src/event/support.js +9 -0
  186. data/spec/dummy/node_modules/jquery/src/event/trigger.js +183 -0
  187. data/spec/dummy/node_modules/jquery/src/exports/amd.js +24 -0
  188. data/spec/dummy/node_modules/jquery/src/exports/global.js +26 -0
  189. data/spec/dummy/node_modules/jquery/src/intro.js +44 -0
  190. data/spec/dummy/node_modules/jquery/src/jquery.js +37 -0
  191. data/spec/dummy/node_modules/jquery/src/manipulation.js +481 -0
  192. data/spec/dummy/node_modules/jquery/src/manipulation/_evalUrl.js +20 -0
  193. data/spec/dummy/node_modules/jquery/src/manipulation/buildFragment.js +102 -0
  194. data/spec/dummy/node_modules/jquery/src/manipulation/getAll.js +21 -0
  195. data/spec/dummy/node_modules/jquery/src/manipulation/setGlobalEval.js +20 -0
  196. data/spec/dummy/node_modules/jquery/src/manipulation/support.js +33 -0
  197. data/spec/dummy/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
  198. data/spec/dummy/node_modules/jquery/src/manipulation/var/rscriptType.js +3 -0
  199. data/spec/dummy/node_modules/jquery/src/manipulation/var/rtagName.js +3 -0
  200. data/spec/dummy/node_modules/jquery/src/manipulation/wrapMap.js +27 -0
  201. data/spec/dummy/node_modules/jquery/src/offset.js +218 -0
  202. data/spec/dummy/node_modules/jquery/src/outro.js +2 -0
  203. data/spec/dummy/node_modules/jquery/src/queue.js +143 -0
  204. data/spec/dummy/node_modules/jquery/src/queue/delay.js +22 -0
  205. data/spec/dummy/node_modules/jquery/src/selector-native.js +211 -0
  206. data/spec/dummy/node_modules/jquery/src/selector-sizzle.js +14 -0
  207. data/spec/dummy/node_modules/jquery/src/selector.js +1 -0
  208. data/spec/dummy/node_modules/jquery/src/serialize.js +125 -0
  209. data/spec/dummy/node_modules/jquery/src/traversing.js +175 -0
  210. data/spec/dummy/node_modules/jquery/src/traversing/findFilter.js +100 -0
  211. data/spec/dummy/node_modules/jquery/src/traversing/var/dir.js +20 -0
  212. data/spec/dummy/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
  213. data/spec/dummy/node_modules/jquery/src/traversing/var/siblings.js +15 -0
  214. data/spec/dummy/node_modules/jquery/src/var/arr.js +3 -0
  215. data/spec/dummy/node_modules/jquery/src/var/class2type.js +5 -0
  216. data/spec/dummy/node_modules/jquery/src/var/concat.js +5 -0
  217. data/spec/dummy/node_modules/jquery/src/var/document.js +3 -0
  218. data/spec/dummy/node_modules/jquery/src/var/documentElement.js +5 -0
  219. data/spec/dummy/node_modules/jquery/src/var/hasOwn.js +5 -0
  220. data/spec/dummy/node_modules/jquery/src/var/indexOf.js +5 -0
  221. data/spec/dummy/node_modules/jquery/src/var/pnum.js +3 -0
  222. data/spec/dummy/node_modules/jquery/src/var/push.js +5 -0
  223. data/spec/dummy/node_modules/jquery/src/var/rcssNum.js +7 -0
  224. data/spec/dummy/node_modules/jquery/src/var/rnotwhite.js +3 -0
  225. data/spec/dummy/node_modules/jquery/src/var/slice.js +5 -0
  226. data/spec/dummy/node_modules/jquery/src/var/support.js +5 -0
  227. data/spec/dummy/node_modules/jquery/src/var/toString.js +5 -0
  228. data/spec/dummy/node_modules/jquery/src/wrap.js +79 -0
  229. data/spec/dummy/package.json +5 -0
  230. data/spec/dummy/public/system/user_export_files/user_exports/000/000/003/original/user_export_file_20141214-44379-1fdvvdb.txt +8 -0
  231. data/spec/dummy/public/system/user_export_files/user_exports/000/000/003/original/user_export_file_20141225-67268-nerc4o.txt +8 -0
  232. data/spec/dummy/public/system/user_export_files/user_exports/000/000/003/original/user_export_file_20150123-14447-1lf8lc5.txt +8 -0
  233. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141214-44379-1exy9mg.txt +8 -0
  234. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-58343-ztcmne.txt +8 -0
  235. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-58490-hnqvxg.txt +8 -0
  236. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-58609-5iyax7.txt +8 -0
  237. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-58776-1e9gg8b.txt +8 -0
  238. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-58951-zfxzc6.txt +8 -0
  239. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59095-l3yd2t.txt +8 -0
  240. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59220-1mgboh1.txt +8 -0
  241. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59533-1ie807t.txt +8 -0
  242. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59716-m8uy9h.txt +8 -0
  243. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59834-1fcv3ir.txt +8 -0
  244. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59932-14y6v8m.txt +8 -0
  245. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-60422-ksg8ww.txt +8 -0
  246. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-60507-j2u5ra.txt +8 -0
  247. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-60619-2j2h65.txt +8 -0
  248. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-60822-1xdqwcc.txt +8 -0
  249. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-60925-4d4ce1.txt +8 -0
  250. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-61046-y4nspn.txt +8 -0
  251. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-62053-1qsuqzd.txt +8 -0
  252. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-62204-3quf6j.txt +8 -0
  253. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-62472-w05wkf.txt +8 -0
  254. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141218-67112-1viizrs.txt +8 -0
  255. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141218-67232-11tcrfq.txt +8 -0
  256. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141218-67342-1bajplt.txt +8 -0
  257. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141218-67475-gmnmq4.txt +8 -0
  258. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-74670-mxvkc6.txt +8 -0
  259. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-74954-1m11avl.txt +8 -0
  260. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75054-1ac0xmz.txt +8 -0
  261. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75135-1r3z1p.txt +8 -0
  262. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75289-18xm9sx.txt +8 -0
  263. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75372-1ab1rn4.txt +8 -0
  264. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75612-14gavh8.txt +8 -0
  265. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75709-xgjjja.txt +8 -0
  266. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75832-uej6ye.txt +8 -0
  267. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75905-13kbauv.txt +8 -0
  268. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-76001-13yt1kv.txt +8 -0
  269. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-76158-1pitds8.txt +8 -0
  270. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-76526-q0rb2j.txt +8 -0
  271. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-76848-ya95k2.txt +8 -0
  272. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-88475-165899e.txt +8 -0
  273. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-89902-paupo2.txt +8 -0
  274. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-90001-1eg9w1e.txt +8 -0
  275. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-90157-bcu8m7.txt +8 -0
  276. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141221-7985-u6s6l1.txt +8 -0
  277. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141224-44711-1amcibm.txt +8 -0
  278. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141224-44828-ap6n8d.txt +8 -0
  279. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-48701-14hbzl1.txt +8 -0
  280. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-49875-1pc6esj.txt +8 -0
  281. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-64608-1wo1bpq.txt +8 -0
  282. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-64763-daej3l.txt +8 -0
  283. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65000-1a7srlh.txt +8 -0
  284. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65196-ggad1c.txt +8 -0
  285. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65273-tt5ev2.txt +8 -0
  286. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65424-1d17hts.txt +8 -0
  287. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65662-1gqvlj3.txt +8 -0
  288. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65725-1qpz2tm.txt +8 -0
  289. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65807-t7cfln.txt +8 -0
  290. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65962-161pm01.txt +8 -0
  291. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-66069-h9ftv6.txt +8 -0
  292. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-66327-hsz0j4.txt +8 -0
  293. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-67268-hqxt6v.txt +8 -0
  294. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150119-54567-1exwx4r.txt +8 -0
  295. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150120-80886-1whqn2s.txt +8 -0
  296. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150120-81115-hlvwc4.txt +8 -0
  297. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150121-86495-navftm.txt +8 -0
  298. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150121-86986-894a3i.txt +8 -0
  299. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150122-4492-vaml86.txt +8 -0
  300. data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150123-14447-gy0ver.txt +8 -0
  301. data/spec/dummy/yarn.lock +8 -0
  302. data/spec/factories/agent.rb +1 -1
  303. data/spec/factories/library.rb +1 -1
  304. data/spec/factories/profile.rb +3 -3
  305. data/spec/factories/user.rb +25 -31
  306. data/spec/fixtures/carrier_types.yml +23 -24
  307. data/spec/fixtures/content_types.yml +78 -22
  308. data/spec/fixtures/libraries.yml +28 -31
  309. data/spec/fixtures/library_groups.yml +33 -16
  310. data/spec/fixtures/manifestations.yml +32 -27
  311. data/spec/fixtures/roles.yml +11 -12
  312. data/spec/fixtures/shelves.yml +14 -15
  313. data/spec/fixtures/user_groups.yml +9 -16
  314. data/spec/fixtures/user_has_roles.yml +2 -1
  315. data/spec/rails_helper.rb +11 -1
  316. data/spec/system/page_spec.rb +35 -0
  317. data/spec/views/page/configuration.html.erb_spec.rb +1 -1
  318. metadata +479 -93
  319. data/app/assets/javascripts/enju_leaf.js +0 -12
  320. data/app/assets/javascripts/mobile.js +0 -4
  321. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -25
  322. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
  323. data/vendor/assets/javascripts/jquery.colorbox.js +0 -1105
  324. data/vendor/assets/javascripts/jquery.powertip.js +0 -1395
  325. data/vendor/assets/stylesheets/colorbox.css +0 -70
  326. data/vendor/assets/stylesheets/jquery.powertip.css +0 -105
@@ -1,12 +0,0 @@
1
- //= require jquery.ui.all
2
- //= require jquery.colorbox
3
- //= require jquery.highlight
4
- //= require jquery.shortcut
5
- //= require jquery.cookie
6
- //= require jquery.ui.menubar
7
- //= require select_locale
8
- //= require portlets
9
- //= require menu
10
- //= require jquery.powertip
11
- //= require cocoon
12
- //= require autocomplete_agent
@@ -1,4 +0,0 @@
1
- //= require rails-ujs
2
- //= require jquery2
3
- //= require jquery.mobile-1.4.5
4
- //= require jquery.colorbox
@@ -1,25 +0,0 @@
1
- # This migration comes from enju_library_engine (originally 20151213070943)
2
- class AddTranslationTableToLibraryGroup < ActiveRecord::Migration[4.2]
3
- def up
4
- if defined?(Globalize)
5
- LibraryGroup.create_translation_table!({
6
- login_banner: :text
7
- },
8
- migrate_data: true)
9
- end
10
-
11
- if defined?(AwesomeHstoreTranslate)
12
- add_column :library_groups, :login_banner, :hstore
13
- end
14
- end
15
-
16
- def down
17
- if defined?(Globalize)
18
- LibraryGroup.drop_translation_table! migrate_data: true
19
- end
20
-
21
- if defined?(AwesomeHstoreTranslate)
22
- remove_column :library_groups, :login_banner
23
- end
24
- end
25
- end
@@ -1,22 +0,0 @@
1
- # This migration comes from enju_library_engine (originally 20151213072705)
2
- class AddFooterBannerToLibraryGroup < ActiveRecord::Migration[4.2]
3
- def up
4
- if defined?(Globalize)
5
- LibraryGroup.add_translation_fields! footer_banner: :text
6
- end
7
-
8
- if defined?(AwesomeHstoreTranslate)
9
- add_column :library_groups, :footer_banner, :hstore
10
- end
11
- end
12
-
13
- def down
14
- if defined?(Globalize)
15
- remove_column :library_group_translations, :footer_banner
16
- end
17
-
18
- if defined?(AwesomeHstoreTranslate)
19
- remove_column :library_groups, :footer_banner
20
- end
21
- end
22
- end
@@ -1,1105 +0,0 @@
1
- /*!
2
- Colorbox 1.6.4
3
- license: MIT
4
- http://www.jacklmoore.com/colorbox
5
- */
6
- (function ($, document, window) {
7
- var
8
- // Default settings object.
9
- // See http://jacklmoore.com/colorbox for details.
10
- defaults = {
11
- // data sources
12
- html: false,
13
- photo: false,
14
- iframe: false,
15
- inline: false,
16
-
17
- // behavior and appearance
18
- transition: "elastic",
19
- speed: 300,
20
- fadeOut: 300,
21
- width: false,
22
- initialWidth: "600",
23
- innerWidth: false,
24
- maxWidth: false,
25
- height: false,
26
- initialHeight: "450",
27
- innerHeight: false,
28
- maxHeight: false,
29
- scalePhotos: true,
30
- scrolling: true,
31
- opacity: 0.9,
32
- preloading: true,
33
- className: false,
34
- overlayClose: true,
35
- escKey: true,
36
- arrowKey: true,
37
- top: false,
38
- bottom: false,
39
- left: false,
40
- right: false,
41
- fixed: false,
42
- data: undefined,
43
- closeButton: true,
44
- fastIframe: true,
45
- open: false,
46
- reposition: true,
47
- loop: true,
48
- slideshow: false,
49
- slideshowAuto: true,
50
- slideshowSpeed: 2500,
51
- slideshowStart: "start slideshow",
52
- slideshowStop: "stop slideshow",
53
- photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,
54
-
55
- // alternate image paths for high-res displays
56
- retinaImage: false,
57
- retinaUrl: false,
58
- retinaSuffix: '@2x.$1',
59
-
60
- // internationalization
61
- current: "image {current} of {total}",
62
- previous: "previous",
63
- next: "next",
64
- close: "close",
65
- xhrError: "This content failed to load.",
66
- imgError: "This image failed to load.",
67
-
68
- // accessbility
69
- returnFocus: true,
70
- trapFocus: true,
71
-
72
- // callbacks
73
- onOpen: false,
74
- onLoad: false,
75
- onComplete: false,
76
- onCleanup: false,
77
- onClosed: false,
78
-
79
- rel: function() {
80
- return this.rel;
81
- },
82
- href: function() {
83
- // using this.href would give the absolute url, when the href may have been inteded as a selector (e.g. '#container')
84
- return $(this).attr('href');
85
- },
86
- title: function() {
87
- return this.title;
88
- },
89
- createImg: function() {
90
- var img = new Image();
91
- var attrs = $(this).data('cbox-img-attrs');
92
-
93
- if (typeof attrs === 'object') {
94
- $.each(attrs, function(key, val){
95
- img[key] = val;
96
- });
97
- }
98
-
99
- return img;
100
- },
101
- createIframe: function() {
102
- var iframe = document.createElement('iframe');
103
- var attrs = $(this).data('cbox-iframe-attrs');
104
-
105
- if (typeof attrs === 'object') {
106
- $.each(attrs, function(key, val){
107
- iframe[key] = val;
108
- });
109
- }
110
-
111
- if ('frameBorder' in iframe) {
112
- iframe.frameBorder = 0;
113
- }
114
- if ('allowTransparency' in iframe) {
115
- iframe.allowTransparency = "true";
116
- }
117
- iframe.name = (new Date()).getTime(); // give the iframe a unique name to prevent caching
118
- iframe.allowFullscreen = true;
119
-
120
- return iframe;
121
- }
122
- },
123
-
124
- // Abstracting the HTML and event identifiers for easy rebranding
125
- colorbox = 'colorbox',
126
- prefix = 'cbox',
127
- boxElement = prefix + 'Element',
128
-
129
- // Events
130
- event_open = prefix + '_open',
131
- event_load = prefix + '_load',
132
- event_complete = prefix + '_complete',
133
- event_cleanup = prefix + '_cleanup',
134
- event_closed = prefix + '_closed',
135
- event_purge = prefix + '_purge',
136
-
137
- // Cached jQuery Object Variables
138
- $overlay,
139
- $box,
140
- $wrap,
141
- $content,
142
- $topBorder,
143
- $leftBorder,
144
- $rightBorder,
145
- $bottomBorder,
146
- $related,
147
- $window,
148
- $loaded,
149
- $loadingBay,
150
- $loadingOverlay,
151
- $title,
152
- $current,
153
- $slideshow,
154
- $next,
155
- $prev,
156
- $close,
157
- $groupControls,
158
- $events = $('<a/>'), // $({}) would be preferred, but there is an issue with jQuery 1.4.2
159
-
160
- // Variables for cached values or use across multiple functions
161
- settings,
162
- interfaceHeight,
163
- interfaceWidth,
164
- loadedHeight,
165
- loadedWidth,
166
- index,
167
- photo,
168
- open,
169
- active,
170
- closing,
171
- loadingTimer,
172
- publicMethod,
173
- div = "div",
174
- requests = 0,
175
- previousCSS = {},
176
- init;
177
-
178
- // ****************
179
- // HELPER FUNCTIONS
180
- // ****************
181
-
182
- // Convenience function for creating new jQuery objects
183
- function $tag(tag, id, css) {
184
- var element = document.createElement(tag);
185
-
186
- if (id) {
187
- element.id = prefix + id;
188
- }
189
-
190
- if (css) {
191
- element.style.cssText = css;
192
- }
193
-
194
- return $(element);
195
- }
196
-
197
- // Get the window height using innerHeight when available to avoid an issue with iOS
198
- // http://bugs.jquery.com/ticket/6724
199
- function winheight() {
200
- return window.innerHeight ? window.innerHeight : $(window).height();
201
- }
202
-
203
- function Settings(element, options) {
204
- if (options !== Object(options)) {
205
- options = {};
206
- }
207
-
208
- this.cache = {};
209
- this.el = element;
210
-
211
- this.value = function(key) {
212
- var dataAttr;
213
-
214
- if (this.cache[key] === undefined) {
215
- dataAttr = $(this.el).attr('data-cbox-'+key);
216
-
217
- if (dataAttr !== undefined) {
218
- this.cache[key] = dataAttr;
219
- } else if (options[key] !== undefined) {
220
- this.cache[key] = options[key];
221
- } else if (defaults[key] !== undefined) {
222
- this.cache[key] = defaults[key];
223
- }
224
- }
225
-
226
- return this.cache[key];
227
- };
228
-
229
- this.get = function(key) {
230
- var value = this.value(key);
231
- return $.isFunction(value) ? value.call(this.el, this) : value;
232
- };
233
- }
234
-
235
- // Determine the next and previous members in a group.
236
- function getIndex(increment) {
237
- var
238
- max = $related.length,
239
- newIndex = (index + increment) % max;
240
-
241
- return (newIndex < 0) ? max + newIndex : newIndex;
242
- }
243
-
244
- // Convert '%' and 'px' values to integers
245
- function setSize(size, dimension) {
246
- return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
247
- }
248
-
249
- // Checks an href to see if it is a photo.
250
- // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
251
- function isImage(settings, url) {
252
- return settings.get('photo') || settings.get('photoRegex').test(url);
253
- }
254
-
255
- function retinaUrl(settings, url) {
256
- return settings.get('retinaUrl') && window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url;
257
- }
258
-
259
- function trapFocus(e) {
260
- if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) {
261
- e.stopPropagation();
262
- $box.focus();
263
- }
264
- }
265
-
266
- function setClass(str) {
267
- if (setClass.str !== str) {
268
- $box.add($overlay).removeClass(setClass.str).addClass(str);
269
- setClass.str = str;
270
- }
271
- }
272
-
273
- function getRelated(rel) {
274
- index = 0;
275
-
276
- if (rel && rel !== false && rel !== 'nofollow') {
277
- $related = $('.' + boxElement).filter(function () {
278
- var options = $.data(this, colorbox);
279
- var settings = new Settings(this, options);
280
- return (settings.get('rel') === rel);
281
- });
282
- index = $related.index(settings.el);
283
-
284
- // Check direct calls to Colorbox.
285
- if (index === -1) {
286
- $related = $related.add(settings.el);
287
- index = $related.length - 1;
288
- }
289
- } else {
290
- $related = $(settings.el);
291
- }
292
- }
293
-
294
- function trigger(event) {
295
- // for external use
296
- $(document).trigger(event);
297
- // for internal use
298
- $events.triggerHandler(event);
299
- }
300
-
301
- var slideshow = (function(){
302
- var active,
303
- className = prefix + "Slideshow_",
304
- click = "click." + prefix,
305
- timeOut;
306
-
307
- function clear () {
308
- clearTimeout(timeOut);
309
- }
310
-
311
- function set() {
312
- if (settings.get('loop') || $related[index + 1]) {
313
- clear();
314
- timeOut = setTimeout(publicMethod.next, settings.get('slideshowSpeed'));
315
- }
316
- }
317
-
318
- function start() {
319
- $slideshow
320
- .html(settings.get('slideshowStop'))
321
- .unbind(click)
322
- .one(click, stop);
323
-
324
- $events
325
- .bind(event_complete, set)
326
- .bind(event_load, clear);
327
-
328
- $box.removeClass(className + "off").addClass(className + "on");
329
- }
330
-
331
- function stop() {
332
- clear();
333
-
334
- $events
335
- .unbind(event_complete, set)
336
- .unbind(event_load, clear);
337
-
338
- $slideshow
339
- .html(settings.get('slideshowStart'))
340
- .unbind(click)
341
- .one(click, function () {
342
- publicMethod.next();
343
- start();
344
- });
345
-
346
- $box.removeClass(className + "on").addClass(className + "off");
347
- }
348
-
349
- function reset() {
350
- active = false;
351
- $slideshow.hide();
352
- clear();
353
- $events
354
- .unbind(event_complete, set)
355
- .unbind(event_load, clear);
356
- $box.removeClass(className + "off " + className + "on");
357
- }
358
-
359
- return function(){
360
- if (active) {
361
- if (!settings.get('slideshow')) {
362
- $events.unbind(event_cleanup, reset);
363
- reset();
364
- }
365
- } else {
366
- if (settings.get('slideshow') && $related[1]) {
367
- active = true;
368
- $events.one(event_cleanup, reset);
369
- if (settings.get('slideshowAuto')) {
370
- start();
371
- } else {
372
- stop();
373
- }
374
- $slideshow.show();
375
- }
376
- }
377
- };
378
-
379
- }());
380
-
381
-
382
- function launch(element) {
383
- var options;
384
-
385
- if (!closing) {
386
-
387
- options = $(element).data(colorbox);
388
-
389
- settings = new Settings(element, options);
390
-
391
- getRelated(settings.get('rel'));
392
-
393
- if (!open) {
394
- open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
395
-
396
- setClass(settings.get('className'));
397
-
398
- // Show colorbox so the sizes can be calculated in older versions of jQuery
399
- $box.css({visibility:'hidden', display:'block', opacity:''});
400
-
401
- $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden');
402
- $content.css({width:'', height:''}).append($loaded);
403
-
404
- // Cache values needed for size calculations
405
- interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();
406
- interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
407
- loadedHeight = $loaded.outerHeight(true);
408
- loadedWidth = $loaded.outerWidth(true);
409
-
410
- // Opens inital empty Colorbox prior to content being loaded.
411
- var initialWidth = setSize(settings.get('initialWidth'), 'x');
412
- var initialHeight = setSize(settings.get('initialHeight'), 'y');
413
- var maxWidth = settings.get('maxWidth');
414
- var maxHeight = settings.get('maxHeight');
415
-
416
- settings.w = Math.max((maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth, 0);
417
- settings.h = Math.max((maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight, 0);
418
-
419
- $loaded.css({width:'', height:settings.h});
420
- publicMethod.position();
421
-
422
- trigger(event_open);
423
- settings.get('onOpen');
424
-
425
- $groupControls.add($title).hide();
426
-
427
- $box.focus();
428
-
429
- if (settings.get('trapFocus')) {
430
- // Confine focus to the modal
431
- // Uses event capturing that is not supported in IE8-
432
- if (document.addEventListener) {
433
-
434
- document.addEventListener('focus', trapFocus, true);
435
-
436
- $events.one(event_closed, function () {
437
- document.removeEventListener('focus', trapFocus, true);
438
- });
439
- }
440
- }
441
-
442
- // Return focus on closing
443
- if (settings.get('returnFocus')) {
444
- $events.one(event_closed, function () {
445
- $(settings.el).focus();
446
- });
447
- }
448
- }
449
-
450
- var opacity = parseFloat(settings.get('opacity'));
451
- $overlay.css({
452
- opacity: opacity === opacity ? opacity : '',
453
- cursor: settings.get('overlayClose') ? 'pointer' : '',
454
- visibility: 'visible'
455
- }).show();
456
-
457
- if (settings.get('closeButton')) {
458
- $close.html(settings.get('close')).appendTo($content);
459
- } else {
460
- $close.appendTo('<div/>'); // replace with .detach() when dropping jQuery < 1.4
461
- }
462
-
463
- load();
464
- }
465
- }
466
-
467
- // Colorbox's markup needs to be added to the DOM prior to being called
468
- // so that the browser will go ahead and load the CSS background images.
469
- function appendHTML() {
470
- if (!$box) {
471
- init = false;
472
- $window = $(window);
473
- $box = $tag(div).attr({
474
- id: colorbox,
475
- 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
476
- role: 'dialog',
477
- tabindex: '-1'
478
- }).hide();
479
- $overlay = $tag(div, "Overlay").hide();
480
- $loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]);
481
- $wrap = $tag(div, "Wrapper");
482
- $content = $tag(div, "Content").append(
483
- $title = $tag(div, "Title"),
484
- $current = $tag(div, "Current"),
485
- $prev = $('<button type="button"/>').attr({id:prefix+'Previous'}),
486
- $next = $('<button type="button"/>').attr({id:prefix+'Next'}),
487
- $slideshow = $('<button type="button"/>').attr({id:prefix+'Slideshow'}),
488
- $loadingOverlay
489
- );
490
-
491
- $close = $('<button type="button"/>').attr({id:prefix+'Close'});
492
-
493
- $wrap.append( // The 3x3 Grid that makes up Colorbox
494
- $tag(div).append(
495
- $tag(div, "TopLeft"),
496
- $topBorder = $tag(div, "TopCenter"),
497
- $tag(div, "TopRight")
498
- ),
499
- $tag(div, false, 'clear:left').append(
500
- $leftBorder = $tag(div, "MiddleLeft"),
501
- $content,
502
- $rightBorder = $tag(div, "MiddleRight")
503
- ),
504
- $tag(div, false, 'clear:left').append(
505
- $tag(div, "BottomLeft"),
506
- $bottomBorder = $tag(div, "BottomCenter"),
507
- $tag(div, "BottomRight")
508
- )
509
- ).find('div div').css({'float': 'left'});
510
-
511
- $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');
512
-
513
- $groupControls = $next.add($prev).add($current).add($slideshow);
514
- }
515
- if (document.body && !$box.parent().length) {
516
- $(document.body).append($overlay, $box.append($wrap, $loadingBay));
517
- }
518
- }
519
-
520
- // Add Colorbox's event bindings
521
- function addBindings() {
522
- function clickHandler(e) {
523
- // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
524
- // See: http://jacklmoore.com/notes/click-events/
525
- if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
526
- e.preventDefault();
527
- launch(this);
528
- }
529
- }
530
-
531
- if ($box) {
532
- if (!init) {
533
- init = true;
534
-
535
- // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
536
- $next.click(function () {
537
- publicMethod.next();
538
- });
539
- $prev.click(function () {
540
- publicMethod.prev();
541
- });
542
- $close.click(function () {
543
- publicMethod.close();
544
- });
545
- $overlay.click(function () {
546
- if (settings.get('overlayClose')) {
547
- publicMethod.close();
548
- }
549
- });
550
-
551
- // Key Bindings
552
- $(document).bind('keydown.' + prefix, function (e) {
553
- var key = e.keyCode;
554
- if (open && settings.get('escKey') && key === 27) {
555
- e.preventDefault();
556
- publicMethod.close();
557
- }
558
- if (open && settings.get('arrowKey') && $related[1] && !e.altKey) {
559
- if (key === 37) {
560
- e.preventDefault();
561
- $prev.click();
562
- } else if (key === 39) {
563
- e.preventDefault();
564
- $next.click();
565
- }
566
- }
567
- });
568
-
569
- if ($.isFunction($.fn.on)) {
570
- // For jQuery 1.7+
571
- $(document).on('click.'+prefix, '.'+boxElement, clickHandler);
572
- } else {
573
- // For jQuery 1.3.x -> 1.6.x
574
- // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
575
- // This is not here for jQuery 1.9, it's here for legacy users.
576
- $('.'+boxElement).live('click.'+prefix, clickHandler);
577
- }
578
- }
579
- return true;
580
- }
581
- return false;
582
- }
583
-
584
- // Don't do anything if Colorbox already exists.
585
- if ($[colorbox]) {
586
- return;
587
- }
588
-
589
- // Append the HTML when the DOM loads
590
- $(appendHTML);
591
-
592
-
593
- // ****************
594
- // PUBLIC FUNCTIONS
595
- // Usage format: $.colorbox.close();
596
- // Usage from within an iframe: parent.jQuery.colorbox.close();
597
- // ****************
598
-
599
- publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
600
- var settings;
601
- var $obj = this;
602
-
603
- options = options || {};
604
-
605
- if ($.isFunction($obj)) { // assume a call to $.colorbox
606
- $obj = $('<a/>');
607
- options.open = true;
608
- }
609
-
610
- if (!$obj[0]) { // colorbox being applied to empty collection
611
- return $obj;
612
- }
613
-
614
- appendHTML();
615
-
616
- if (addBindings()) {
617
-
618
- if (callback) {
619
- options.onComplete = callback;
620
- }
621
-
622
- $obj.each(function () {
623
- var old = $.data(this, colorbox) || {};
624
- $.data(this, colorbox, $.extend(old, options));
625
- }).addClass(boxElement);
626
-
627
- settings = new Settings($obj[0], options);
628
-
629
- if (settings.get('open')) {
630
- launch($obj[0]);
631
- }
632
- }
633
-
634
- return $obj;
635
- };
636
-
637
- publicMethod.position = function (speed, loadedCallback) {
638
- var
639
- css,
640
- top = 0,
641
- left = 0,
642
- offset = $box.offset(),
643
- scrollTop,
644
- scrollLeft;
645
-
646
- $window.unbind('resize.' + prefix);
647
-
648
- // remove the modal so that it doesn't influence the document width/height
649
- $box.css({top: -9e4, left: -9e4});
650
-
651
- scrollTop = $window.scrollTop();
652
- scrollLeft = $window.scrollLeft();
653
-
654
- if (settings.get('fixed')) {
655
- offset.top -= scrollTop;
656
- offset.left -= scrollLeft;
657
- $box.css({position: 'fixed'});
658
- } else {
659
- top = scrollTop;
660
- left = scrollLeft;
661
- $box.css({position: 'absolute'});
662
- }
663
-
664
- // keeps the top and left positions within the browser's viewport.
665
- if (settings.get('right') !== false) {
666
- left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.get('right'), 'x'), 0);
667
- } else if (settings.get('left') !== false) {
668
- left += setSize(settings.get('left'), 'x');
669
- } else {
670
- left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
671
- }
672
-
673
- if (settings.get('bottom') !== false) {
674
- top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.get('bottom'), 'y'), 0);
675
- } else if (settings.get('top') !== false) {
676
- top += setSize(settings.get('top'), 'y');
677
- } else {
678
- top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
679
- }
680
-
681
- $box.css({top: offset.top, left: offset.left, visibility:'visible'});
682
-
683
- // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
684
- // but it has to be shrank down around the size of div#colorbox when it's done. If not,
685
- // it can invoke an obscure IE bug when using iframes.
686
- $wrap[0].style.width = $wrap[0].style.height = "9999px";
687
-
688
- function modalDimensions() {
689
- $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
690
- $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
691
- }
692
-
693
- css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
694
-
695
- // setting the speed to 0 if the content hasn't changed size or position
696
- if (speed) {
697
- var tempSpeed = 0;
698
- $.each(css, function(i){
699
- if (css[i] !== previousCSS[i]) {
700
- tempSpeed = speed;
701
- return;
702
- }
703
- });
704
- speed = tempSpeed;
705
- }
706
-
707
- previousCSS = css;
708
-
709
- if (!speed) {
710
- $box.css(css);
711
- }
712
-
713
- $box.dequeue().animate(css, {
714
- duration: speed || 0,
715
- complete: function () {
716
- modalDimensions();
717
-
718
- active = false;
719
-
720
- // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
721
- $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
722
- $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
723
-
724
- if (settings.get('reposition')) {
725
- setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
726
- $window.bind('resize.' + prefix, publicMethod.position);
727
- }, 1);
728
- }
729
-
730
- if ($.isFunction(loadedCallback)) {
731
- loadedCallback();
732
- }
733
- },
734
- step: modalDimensions
735
- });
736
- };
737
-
738
- publicMethod.resize = function (options) {
739
- var scrolltop;
740
-
741
- if (open) {
742
- options = options || {};
743
-
744
- if (options.width) {
745
- settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
746
- }
747
-
748
- if (options.innerWidth) {
749
- settings.w = setSize(options.innerWidth, 'x');
750
- }
751
-
752
- $loaded.css({width: settings.w});
753
-
754
- if (options.height) {
755
- settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
756
- }
757
-
758
- if (options.innerHeight) {
759
- settings.h = setSize(options.innerHeight, 'y');
760
- }
761
-
762
- if (!options.innerHeight && !options.height) {
763
- scrolltop = $loaded.scrollTop();
764
- $loaded.css({height: "auto"});
765
- settings.h = $loaded.height();
766
- }
767
-
768
- $loaded.css({height: settings.h});
769
-
770
- if(scrolltop) {
771
- $loaded.scrollTop(scrolltop);
772
- }
773
-
774
- publicMethod.position(settings.get('transition') === "none" ? 0 : settings.get('speed'));
775
- }
776
- };
777
-
778
- publicMethod.prep = function (object) {
779
- if (!open) {
780
- return;
781
- }
782
-
783
- var callback, speed = settings.get('transition') === "none" ? 0 : settings.get('speed');
784
-
785
- $loaded.remove();
786
-
787
- $loaded = $tag(div, 'LoadedContent').append(object);
788
-
789
- function getWidth() {
790
- settings.w = settings.w || $loaded.width();
791
- settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
792
- return settings.w;
793
- }
794
- function getHeight() {
795
- settings.h = settings.h || $loaded.height();
796
- settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
797
- return settings.h;
798
- }
799
-
800
- $loaded.hide()
801
- .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
802
- .css({width: getWidth(), overflow: settings.get('scrolling') ? 'auto' : 'hidden'})
803
- .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
804
- .prependTo($content);
805
-
806
- $loadingBay.hide();
807
-
808
- // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
809
-
810
- $(photo).css({'float': 'none'});
811
-
812
- setClass(settings.get('className'));
813
-
814
- callback = function () {
815
- var total = $related.length,
816
- iframe,
817
- complete;
818
-
819
- if (!open) {
820
- return;
821
- }
822
-
823
- function removeFilter() { // Needed for IE8 in versions of jQuery prior to 1.7.2
824
- if ($.support.opacity === false) {
825
- $box[0].style.removeAttribute('filter');
826
- }
827
- }
828
-
829
- complete = function () {
830
- clearTimeout(loadingTimer);
831
- $loadingOverlay.hide();
832
- trigger(event_complete);
833
- settings.get('onComplete');
834
- };
835
-
836
-
837
- $title.html(settings.get('title')).show();
838
- $loaded.show();
839
-
840
- if (total > 1) { // handle grouping
841
- if (typeof settings.get('current') === "string") {
842
- $current.html(settings.get('current').replace('{current}', index + 1).replace('{total}', total)).show();
843
- }
844
-
845
- $next[(settings.get('loop') || index < total - 1) ? "show" : "hide"]().html(settings.get('next'));
846
- $prev[(settings.get('loop') || index) ? "show" : "hide"]().html(settings.get('previous'));
847
-
848
- slideshow();
849
-
850
- // Preloads images within a rel group
851
- if (settings.get('preloading')) {
852
- $.each([getIndex(-1), getIndex(1)], function(){
853
- var img,
854
- i = $related[this],
855
- settings = new Settings(i, $.data(i, colorbox)),
856
- src = settings.get('href');
857
-
858
- if (src && isImage(settings, src)) {
859
- src = retinaUrl(settings, src);
860
- img = document.createElement('img');
861
- img.src = src;
862
- }
863
- });
864
- }
865
- } else {
866
- $groupControls.hide();
867
- }
868
-
869
- if (settings.get('iframe')) {
870
-
871
- iframe = settings.get('createIframe');
872
-
873
- if (!settings.get('scrolling')) {
874
- iframe.scrolling = "no";
875
- }
876
-
877
- $(iframe)
878
- .attr({
879
- src: settings.get('href'),
880
- 'class': prefix + 'Iframe'
881
- })
882
- .one('load', complete)
883
- .appendTo($loaded);
884
-
885
- $events.one(event_purge, function () {
886
- iframe.src = "//about:blank";
887
- });
888
-
889
- if (settings.get('fastIframe')) {
890
- $(iframe).trigger('load');
891
- }
892
- } else {
893
- complete();
894
- }
895
-
896
- if (settings.get('transition') === 'fade') {
897
- $box.fadeTo(speed, 1, removeFilter);
898
- } else {
899
- removeFilter();
900
- }
901
- };
902
-
903
- if (settings.get('transition') === 'fade') {
904
- $box.fadeTo(speed, 0, function () {
905
- publicMethod.position(0, callback);
906
- });
907
- } else {
908
- publicMethod.position(speed, callback);
909
- }
910
- };
911
-
912
- function load () {
913
- var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
914
-
915
- active = true;
916
-
917
- photo = false;
918
-
919
- trigger(event_purge);
920
- trigger(event_load);
921
- settings.get('onLoad');
922
-
923
- settings.h = settings.get('height') ?
924
- setSize(settings.get('height'), 'y') - loadedHeight - interfaceHeight :
925
- settings.get('innerHeight') && setSize(settings.get('innerHeight'), 'y');
926
-
927
- settings.w = settings.get('width') ?
928
- setSize(settings.get('width'), 'x') - loadedWidth - interfaceWidth :
929
- settings.get('innerWidth') && setSize(settings.get('innerWidth'), 'x');
930
-
931
- // Sets the minimum dimensions for use in image scaling
932
- settings.mw = settings.w;
933
- settings.mh = settings.h;
934
-
935
- // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
936
- // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
937
- if (settings.get('maxWidth')) {
938
- settings.mw = setSize(settings.get('maxWidth'), 'x') - loadedWidth - interfaceWidth;
939
- settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
940
- }
941
- if (settings.get('maxHeight')) {
942
- settings.mh = setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight;
943
- settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
944
- }
945
-
946
- href = settings.get('href');
947
-
948
- loadingTimer = setTimeout(function () {
949
- $loadingOverlay.show();
950
- }, 100);
951
-
952
- if (settings.get('inline')) {
953
- var $target = $(href).eq(0);
954
- // Inserts an empty placeholder where inline content is being pulled from.
955
- // An event is bound to put inline content back when Colorbox closes or loads new content.
956
- $inline = $('<div>').hide().insertBefore($target);
957
-
958
- $events.one(event_purge, function () {
959
- $inline.replaceWith($target);
960
- });
961
-
962
- prep($target);
963
- } else if (settings.get('iframe')) {
964
- // IFrame element won't be added to the DOM until it is ready to be displayed,
965
- // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
966
- prep(" ");
967
- } else if (settings.get('html')) {
968
- prep(settings.get('html'));
969
- } else if (isImage(settings, href)) {
970
-
971
- href = retinaUrl(settings, href);
972
-
973
- photo = settings.get('createImg');
974
-
975
- $(photo)
976
- .addClass(prefix + 'Photo')
977
- .bind('error.'+prefix,function () {
978
- prep($tag(div, 'Error').html(settings.get('imgError')));
979
- })
980
- .one('load', function () {
981
- if (request !== requests) {
982
- return;
983
- }
984
-
985
- // A small pause because some browsers will occasionally report a
986
- // img.width and img.height of zero immediately after the img.onload fires
987
- setTimeout(function(){
988
- var percent;
989
-
990
- if (settings.get('retinaImage') && window.devicePixelRatio > 1) {
991
- photo.height = photo.height / window.devicePixelRatio;
992
- photo.width = photo.width / window.devicePixelRatio;
993
- }
994
-
995
- if (settings.get('scalePhotos')) {
996
- setResize = function () {
997
- photo.height -= photo.height * percent;
998
- photo.width -= photo.width * percent;
999
- };
1000
- if (settings.mw && photo.width > settings.mw) {
1001
- percent = (photo.width - settings.mw) / photo.width;
1002
- setResize();
1003
- }
1004
- if (settings.mh && photo.height > settings.mh) {
1005
- percent = (photo.height - settings.mh) / photo.height;
1006
- setResize();
1007
- }
1008
- }
1009
-
1010
- if (settings.h) {
1011
- photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
1012
- }
1013
-
1014
- if ($related[1] && (settings.get('loop') || $related[index + 1])) {
1015
- photo.style.cursor = 'pointer';
1016
-
1017
- $(photo).bind('click.'+prefix, function () {
1018
- publicMethod.next();
1019
- });
1020
- }
1021
-
1022
- photo.style.width = photo.width + 'px';
1023
- photo.style.height = photo.height + 'px';
1024
- prep(photo);
1025
- }, 1);
1026
- });
1027
-
1028
- photo.src = href;
1029
-
1030
- } else if (href) {
1031
- $loadingBay.load(href, settings.get('data'), function (data, status) {
1032
- if (request === requests) {
1033
- prep(status === 'error' ? $tag(div, 'Error').html(settings.get('xhrError')) : $(this).contents());
1034
- }
1035
- });
1036
- }
1037
- }
1038
-
1039
- // Navigates to the next page/image in a set.
1040
- publicMethod.next = function () {
1041
- if (!active && $related[1] && (settings.get('loop') || $related[index + 1])) {
1042
- index = getIndex(1);
1043
- launch($related[index]);
1044
- }
1045
- };
1046
-
1047
- publicMethod.prev = function () {
1048
- if (!active && $related[1] && (settings.get('loop') || index)) {
1049
- index = getIndex(-1);
1050
- launch($related[index]);
1051
- }
1052
- };
1053
-
1054
- // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
1055
- publicMethod.close = function () {
1056
- if (open && !closing) {
1057
-
1058
- closing = true;
1059
- open = false;
1060
- trigger(event_cleanup);
1061
- settings.get('onCleanup');
1062
- $window.unbind('.' + prefix);
1063
- $overlay.fadeTo(settings.get('fadeOut') || 0, 0);
1064
-
1065
- $box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () {
1066
- $box.hide();
1067
- $overlay.hide();
1068
- trigger(event_purge);
1069
- $loaded.remove();
1070
-
1071
- setTimeout(function () {
1072
- closing = false;
1073
- trigger(event_closed);
1074
- settings.get('onClosed');
1075
- }, 1);
1076
- });
1077
- }
1078
- };
1079
-
1080
- // Removes changes Colorbox made to the document, but does not remove the plugin.
1081
- publicMethod.remove = function () {
1082
- if (!$box) { return; }
1083
-
1084
- $box.stop();
1085
- $[colorbox].close();
1086
- $box.stop(false, true).remove();
1087
- $overlay.remove();
1088
- closing = false;
1089
- $box = null;
1090
- $('.' + boxElement)
1091
- .removeData(colorbox)
1092
- .removeClass(boxElement);
1093
-
1094
- $(document).unbind('click.'+prefix).unbind('keydown.'+prefix);
1095
- };
1096
-
1097
- // A method for fetching the current element Colorbox is referencing.
1098
- // returns a jQuery object.
1099
- publicMethod.element = function () {
1100
- return $(settings.el);
1101
- };
1102
-
1103
- publicMethod.settings = defaults;
1104
-
1105
- }(jQuery, document, window));