geoblacklight 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (418) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +195 -0
  3. data/.github/ISSUE_TEMPLATE.md +17 -0
  4. data/.gitignore +21 -0
  5. data/.gitmodules +0 -0
  6. data/.hound.yml +8 -0
  7. data/.jshintignore +2 -0
  8. data/.jshintrc +67 -0
  9. data/.rubocop.yml +99 -0
  10. data/.rubocop_todo.yml +196 -0
  11. data/.solr_wrapper +5 -0
  12. data/CODE_OF_CONDUCT.md +76 -0
  13. data/CONTRIBUTING.md +49 -0
  14. data/Gemfile +39 -0
  15. data/LICENSE.txt +13 -0
  16. data/README.md +39 -0
  17. data/Rakefile +125 -0
  18. data/app/assets/images/blacklight/arrow-circle-down.svg +4 -0
  19. data/app/assets/images/blacklight/baruch-cuny.svg +6 -0
  20. data/app/assets/images/blacklight/berkeley.svg +7 -0
  21. data/app/assets/images/blacklight/book.svg +6 -0
  22. data/app/assets/images/blacklight/bookmark.svg +6 -0
  23. data/app/assets/images/blacklight/cd-rom.svg +6 -0
  24. data/app/assets/images/blacklight/chicago.svg +7 -0
  25. data/app/assets/images/blacklight/columbia.svg +6 -0
  26. data/app/assets/images/blacklight/cornell.svg +8 -0
  27. data/app/assets/images/blacklight/dvd-rom.svg +6 -0
  28. data/app/assets/images/blacklight/email.svg +6 -0
  29. data/app/assets/images/blacklight/esri-globe.svg +34 -0
  30. data/app/assets/images/blacklight/geoblacklight-icons.json +2079 -0
  31. data/app/assets/images/blacklight/globe.svg +4 -0
  32. data/app/assets/images/blacklight/harvard.svg +6 -0
  33. data/app/assets/images/blacklight/home.svg +4 -0
  34. data/app/assets/images/blacklight/illinois.svg +7 -0
  35. data/app/assets/images/blacklight/image.svg +6 -0
  36. data/app/assets/images/blacklight/indiana.svg +6 -0
  37. data/app/assets/images/blacklight/iowa.svg +6 -0
  38. data/app/assets/images/blacklight/leaf.svg +6 -0
  39. data/app/assets/images/blacklight/lewis-clark.svg +8 -0
  40. data/app/assets/images/blacklight/line.svg +7 -0
  41. data/app/assets/images/blacklight/logo.svg +1 -0
  42. data/app/assets/images/blacklight/map-marker.svg +6 -0
  43. data/app/assets/images/blacklight/map.svg +6 -0
  44. data/app/assets/images/blacklight/maryland.svg +6 -0
  45. data/app/assets/images/blacklight/massgis.svg +6 -0
  46. data/app/assets/images/blacklight/metadata.svg +6 -0
  47. data/app/assets/images/blacklight/michigan-state.svg +7 -0
  48. data/app/assets/images/blacklight/michigan.svg +6 -0
  49. data/app/assets/images/blacklight/minnesota.svg +6 -0
  50. data/app/assets/images/blacklight/mit.svg +6 -0
  51. data/app/assets/images/blacklight/mixed.svg +8 -0
  52. data/app/assets/images/blacklight/multilinestring.svg +9 -0
  53. data/app/assets/images/blacklight/multipoint.svg +6 -0
  54. data/app/assets/images/blacklight/multipolygon.svg +9 -0
  55. data/app/assets/images/blacklight/nyu.svg +9 -0
  56. data/app/assets/images/blacklight/ohio-state.svg +8 -0
  57. data/app/assets/images/blacklight/pagelines-brands.svg +6 -0
  58. data/app/assets/images/blacklight/paper-map.svg +6 -0
  59. data/app/assets/images/blacklight/penn-state.svg +7 -0
  60. data/app/assets/images/blacklight/point.svg +6 -0
  61. data/app/assets/images/blacklight/polygon.svg +7 -0
  62. data/app/assets/images/blacklight/polyline.svg +9 -0
  63. data/app/assets/images/blacklight/princeton.svg +6 -0
  64. data/app/assets/images/blacklight/public.svg +6 -0
  65. data/app/assets/images/blacklight/purdue.svg +7 -0
  66. data/app/assets/images/blacklight/raster.svg +6 -0
  67. data/app/assets/images/blacklight/restricted.svg +6 -0
  68. data/app/assets/images/blacklight/sms.svg +6 -0
  69. data/app/assets/images/blacklight/stanford.svg +6 -0
  70. data/app/assets/images/blacklight/table.svg +6 -0
  71. data/app/assets/images/blacklight/tags.svg +4 -0
  72. data/app/assets/images/blacklight/texas.svg +6 -0
  73. data/app/assets/images/blacklight/tufts.svg +6 -0
  74. data/app/assets/images/blacklight/ucla.svg +6 -0
  75. data/app/assets/images/blacklight/uva.svg +6 -0
  76. data/app/assets/images/blacklight/web_services.svg +6 -0
  77. data/app/assets/images/blacklight/wisconsin.svg +6 -0
  78. data/app/assets/javascripts/geoblacklight/basemaps.js +85 -0
  79. data/app/assets/javascripts/geoblacklight/controls.js +1 -0
  80. data/app/assets/javascripts/geoblacklight/controls/opacity.js +6 -0
  81. data/app/assets/javascripts/geoblacklight/downloaders.js +1 -0
  82. data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +61 -0
  83. data/app/assets/javascripts/geoblacklight/downloaders/hgl_downloader.js +32 -0
  84. data/app/assets/javascripts/geoblacklight/geoblacklight.js +42 -0
  85. data/app/assets/javascripts/geoblacklight/modules.js +1 -0
  86. data/app/assets/javascripts/geoblacklight/modules/collapse.js +7 -0
  87. data/app/assets/javascripts/geoblacklight/modules/download.js +11 -0
  88. data/app/assets/javascripts/geoblacklight/modules/geosearch.js +133 -0
  89. data/app/assets/javascripts/geoblacklight/modules/help_text.js +7 -0
  90. data/app/assets/javascripts/geoblacklight/modules/home.js +16 -0
  91. data/app/assets/javascripts/geoblacklight/modules/item.js +13 -0
  92. data/app/assets/javascripts/geoblacklight/modules/layer_opacity.js +68 -0
  93. data/app/assets/javascripts/geoblacklight/modules/metadata.js +15 -0
  94. data/app/assets/javascripts/geoblacklight/modules/metadata_download_button.js +53 -0
  95. data/app/assets/javascripts/geoblacklight/modules/relations.js +14 -0
  96. data/app/assets/javascripts/geoblacklight/modules/results.js +82 -0
  97. data/app/assets/javascripts/geoblacklight/modules/util.js +38 -0
  98. data/app/assets/javascripts/geoblacklight/templates/index_map_download.hbs +19 -0
  99. data/app/assets/javascripts/geoblacklight/templates/index_map_info.hbs +40 -0
  100. data/app/assets/javascripts/geoblacklight/viewers.js +1 -0
  101. data/app/assets/javascripts/geoblacklight/viewers/esri.js +77 -0
  102. data/app/assets/javascripts/geoblacklight/viewers/esri/dynamic_map_layer.js +85 -0
  103. data/app/assets/javascripts/geoblacklight/viewers/esri/feature_layer.js +76 -0
  104. data/app/assets/javascripts/geoblacklight/viewers/esri/image_map_layer.js +14 -0
  105. data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +50 -0
  106. data/app/assets/javascripts/geoblacklight/viewers/iiif.js +25 -0
  107. data/app/assets/javascripts/geoblacklight/viewers/index_map.js +70 -0
  108. data/app/assets/javascripts/geoblacklight/viewers/map.js +67 -0
  109. data/app/assets/javascripts/geoblacklight/viewers/oembed.js +13 -0
  110. data/app/assets/javascripts/geoblacklight/viewers/viewer.js +65 -0
  111. data/app/assets/javascripts/geoblacklight/viewers/wms.js +74 -0
  112. data/app/assets/stylesheets/geoblacklight/_blacklight_overrides.scss +51 -0
  113. data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +36 -0
  114. data/app/assets/stylesheets/geoblacklight/_styles.scss +4 -0
  115. data/app/assets/stylesheets/geoblacklight/application.scss +2 -0
  116. data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +93 -0
  117. data/app/assets/stylesheets/geoblacklight/modules/facets.scss +5 -0
  118. data/app/assets/stylesheets/geoblacklight/modules/geosearch.scss +29 -0
  119. data/app/assets/stylesheets/geoblacklight/modules/home.scss +28 -0
  120. data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +50 -0
  121. data/app/assets/stylesheets/geoblacklight/modules/index_maps.scss +7 -0
  122. data/app/assets/stylesheets/geoblacklight/modules/item.scss +26 -0
  123. data/app/assets/stylesheets/geoblacklight/modules/layer_opacity.scss +87 -0
  124. data/app/assets/stylesheets/geoblacklight/modules/metadata.scss +31 -0
  125. data/app/assets/stylesheets/geoblacklight/modules/metadata_content.scss +43 -0
  126. data/app/assets/stylesheets/geoblacklight/modules/metadata_markup.scss +9 -0
  127. data/app/assets/stylesheets/geoblacklight/modules/metadata_missing.scss +7 -0
  128. data/app/assets/stylesheets/geoblacklight/modules/mixins.scss +5 -0
  129. data/app/assets/stylesheets/geoblacklight/modules/modal.scss +14 -0
  130. data/app/assets/stylesheets/geoblacklight/modules/relations.scss +15 -0
  131. data/app/assets/stylesheets/geoblacklight/modules/results.scss +68 -0
  132. data/app/assets/stylesheets/geoblacklight/modules/search_widgets.scss +5 -0
  133. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +60 -0
  134. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +70 -0
  135. data/app/assets/stylesheets/geoblacklight/modules/web_services.scss +5 -0
  136. data/app/controllers/download_controller.rb +114 -0
  137. data/app/controllers/relation_controller.rb +20 -0
  138. data/app/controllers/wms_controller.rb +15 -0
  139. data/app/helpers/arcgis_helper.rb +12 -0
  140. data/app/helpers/blacklight_helper.rb +9 -0
  141. data/app/helpers/carto_helper.rb +29 -0
  142. data/app/helpers/geoblacklight_helper.rb +323 -0
  143. data/app/models/concerns/geoblacklight/solr_document.rb +113 -0
  144. data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +10 -0
  145. data/app/models/concerns/geoblacklight/solr_document/carto.rb +28 -0
  146. data/app/models/concerns/geoblacklight/solr_document/finder.rb +38 -0
  147. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +15 -0
  148. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +69 -0
  149. data/app/presenters/geoblacklight/document_presenter.rb +23 -0
  150. data/app/views/catalog/_data_dictionary.html.erb +6 -0
  151. data/app/views/catalog/_document_action.html.erb +6 -0
  152. data/app/views/catalog/_document_split.html.erb +6 -0
  153. data/app/views/catalog/_download_generated_link.html.erb +4 -0
  154. data/app/views/catalog/_download_link.html.erb +3 -0
  155. data/app/views/catalog/_downloads_generated.html.erb +6 -0
  156. data/app/views/catalog/_downloads_primary.html.erb +14 -0
  157. data/app/views/catalog/_downloads_secondary.html.erb +39 -0
  158. data/app/views/catalog/_exports.html.erb +3 -0
  159. data/app/views/catalog/_facet_tag_item.html.erb +3 -0
  160. data/app/views/catalog/_facet_tag_layout.html.erb +2 -0
  161. data/app/views/catalog/_header_icons.html.erb +3 -0
  162. data/app/views/catalog/_home_text.html.erb +43 -0
  163. data/app/views/catalog/_icon_facet.html.erb +16 -0
  164. data/app/views/catalog/_index_split_default.html.erb +22 -0
  165. data/app/views/catalog/_metadata.html.erb +27 -0
  166. data/app/views/catalog/_relations_container.html.erb +1 -0
  167. data/app/views/catalog/_results_pagination.html.erb +12 -0
  168. data/app/views/catalog/_show_default_attribute_table.html.erb +19 -0
  169. data/app/views/catalog/_show_default_viewer_container.html.erb +12 -0
  170. data/app/views/catalog/_show_default_viewer_information.html.erb +4 -0
  171. data/app/views/catalog/_show_downloads.html.erb +34 -0
  172. data/app/views/catalog/_show_header_default.html.erb +4 -0
  173. data/app/views/catalog/_show_sidebar.html.erb +12 -0
  174. data/app/views/catalog/_show_tools.html.erb +25 -0
  175. data/app/views/catalog/_web_services.html.erb +8 -0
  176. data/app/views/catalog/_web_services_default.html.erb +8 -0
  177. data/app/views/catalog/_web_services_wfs.html.erb +8 -0
  178. data/app/views/catalog/_web_services_wms.html.erb +8 -0
  179. data/app/views/catalog/index.html.erb +13 -0
  180. data/app/views/catalog/metadata.html.erb +11 -0
  181. data/app/views/catalog/metadata/_content.html.erb +3 -0
  182. data/app/views/catalog/metadata/_markup.html.erb +8 -0
  183. data/app/views/catalog/metadata/_missing.html.erb +6 -0
  184. data/app/views/catalog/web_services.html.erb +10 -0
  185. data/app/views/download/hgl.html.erb +25 -0
  186. data/app/views/relation/_ancestors.html.erb +11 -0
  187. data/app/views/relation/_descendants.html.erb +18 -0
  188. data/app/views/relation/index.html.erb +13 -0
  189. data/app/views/relation/index.json.jbuilder +3 -0
  190. data/app/views/shared/_header_navbar.html.erb +38 -0
  191. data/config/initializers/rails_config.rb +3 -0
  192. data/config/locales/geoblacklight.en.yml +163 -0
  193. data/geoblacklight.gemspec +49 -0
  194. data/lib/generators/geoblacklight/install_generator.rb +105 -0
  195. data/lib/generators/geoblacklight/templates/Procfile +3 -0
  196. data/lib/generators/geoblacklight/templates/catalog_controller.rb +272 -0
  197. data/lib/generators/geoblacklight/templates/geoblacklight.js +10 -0
  198. data/lib/generators/geoblacklight/templates/geoblacklight.scss +4 -0
  199. data/lib/generators/geoblacklight/templates/package.json +14 -0
  200. data/lib/generators/geoblacklight/templates/settings.yml +127 -0
  201. data/lib/generators/geoblacklight/templates/webpacker.yml +67 -0
  202. data/lib/generators/geoblacklight/webpacker_generator.rb +35 -0
  203. data/lib/geoblacklight.rb +50 -0
  204. data/lib/geoblacklight/bounding_box.rb +45 -0
  205. data/lib/geoblacklight/catalog_helper_override.rb +13 -0
  206. data/lib/geoblacklight/constants.rb +28 -0
  207. data/lib/geoblacklight/download.rb +108 -0
  208. data/lib/geoblacklight/download/geojson_download.rb +22 -0
  209. data/lib/geoblacklight/download/geotiff_download.rb +20 -0
  210. data/lib/geoblacklight/download/hgl_download.rb +18 -0
  211. data/lib/geoblacklight/download/kmz_download.rb +22 -0
  212. data/lib/geoblacklight/download/shapefile_download.rb +20 -0
  213. data/lib/geoblacklight/engine.rb +27 -0
  214. data/lib/geoblacklight/exceptions.rb +27 -0
  215. data/lib/geoblacklight/geoblacklight_helper_behavior.rb +14 -0
  216. data/lib/geoblacklight/item_viewer.rb +54 -0
  217. data/lib/geoblacklight/metadata.rb +18 -0
  218. data/lib/geoblacklight/metadata/base.rb +93 -0
  219. data/lib/geoblacklight/metadata/fgdc.rb +14 -0
  220. data/lib/geoblacklight/metadata/html.rb +13 -0
  221. data/lib/geoblacklight/metadata/iso19139.rb +14 -0
  222. data/lib/geoblacklight/metadata_transformer.rb +33 -0
  223. data/lib/geoblacklight/metadata_transformer/base.rb +42 -0
  224. data/lib/geoblacklight/metadata_transformer/fgdc.rb +8 -0
  225. data/lib/geoblacklight/metadata_transformer/iso19139.rb +8 -0
  226. data/lib/geoblacklight/reference.rb +45 -0
  227. data/lib/geoblacklight/references.rb +132 -0
  228. data/lib/geoblacklight/relation/ancestors.rb +27 -0
  229. data/lib/geoblacklight/relation/descendants.rb +27 -0
  230. data/lib/geoblacklight/relation/relation_response.rb +24 -0
  231. data/lib/geoblacklight/routes.rb +7 -0
  232. data/lib/geoblacklight/routes/downloadable.rb +14 -0
  233. data/lib/geoblacklight/routes/exportable.rb +17 -0
  234. data/lib/geoblacklight/routes/wms.rb +13 -0
  235. data/lib/geoblacklight/version.rb +3 -0
  236. data/lib/geoblacklight/view_helper_override.rb +40 -0
  237. data/lib/geoblacklight/wms_layer.rb +35 -0
  238. data/lib/geoblacklight/wms_layer/feature_info_response.rb +32 -0
  239. data/lib/tasks/geoblacklight.rake +108 -0
  240. data/package.json +4 -0
  241. data/schema/format-values.md +50 -0
  242. data/schema/geoblacklight-schema-deprecated.md +39 -0
  243. data/schema/geoblacklight-schema.json +214 -0
  244. data/schema/geoblacklight-schema.md +323 -0
  245. data/schema/geometry-type-values.md +11 -0
  246. data/schema/references.md +23 -0
  247. data/schema/schema-commentary.md +198 -0
  248. data/schema/subjects.md +41 -0
  249. data/schema/type-values.md +10 -0
  250. data/solr/conf/_rest_managed.json +3 -0
  251. data/solr/conf/admin-extra.html +31 -0
  252. data/solr/conf/core.properties +5 -0
  253. data/solr/conf/elevate.xml +36 -0
  254. data/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
  255. data/solr/conf/protwords.txt +21 -0
  256. data/solr/conf/schema.xml +198 -0
  257. data/solr/conf/scripts.conf +24 -0
  258. data/solr/conf/solrconfig.xml +243 -0
  259. data/solr/conf/spellings.txt +2 -0
  260. data/solr/conf/stopwords.txt +58 -0
  261. data/solr/conf/stopwords_en.txt +58 -0
  262. data/solr/conf/synonyms.txt +31 -0
  263. data/solr/conf/xslt/example.xsl +132 -0
  264. data/solr/conf/xslt/example_atom.xsl +67 -0
  265. data/solr/conf/xslt/example_rss.xsl +66 -0
  266. data/solr/conf/xslt/luke.xsl +337 -0
  267. data/spec/controllers/catalog_controller_spec.rb +82 -0
  268. data/spec/controllers/download_controller_spec.rb +120 -0
  269. data/spec/controllers/relation_controller_spec.rb +11 -0
  270. data/spec/controllers/wms_controller_spec.rb +34 -0
  271. data/spec/factories/user.rb +7 -0
  272. data/spec/features/bookmarks_spec.rb +10 -0
  273. data/spec/features/configurable_basemap_spec.rb +35 -0
  274. data/spec/features/data_dictionary_download_spec.rb +16 -0
  275. data/spec/features/download_layer_spec.rb +93 -0
  276. data/spec/features/empty_search_spec.rb +11 -0
  277. data/spec/features/esri_viewer_spec.rb +42 -0
  278. data/spec/features/exports_spec.rb +36 -0
  279. data/spec/features/help_text_spec.rb +8 -0
  280. data/spec/features/home_page_spec.rb +40 -0
  281. data/spec/features/iiif_viewer_spec.rb +8 -0
  282. data/spec/features/index_map_spec.rb +31 -0
  283. data/spec/features/layer_inspection_spec.rb +10 -0
  284. data/spec/features/layer_opacity_spec.rb +20 -0
  285. data/spec/features/layer_preview_spec.rb +17 -0
  286. data/spec/features/layer_with_no_references_spec.rb +8 -0
  287. data/spec/features/linkified_attribute_table_spec.rb +11 -0
  288. data/spec/features/metadata_panel_spec.rb +78 -0
  289. data/spec/features/missing_metadata_spec.rb +24 -0
  290. data/spec/features/oembed_spec.rb +9 -0
  291. data/spec/features/relations_spec.rb +51 -0
  292. data/spec/features/saved_searches_spec.rb +13 -0
  293. data/spec/features/search_bar_spec.rb +12 -0
  294. data/spec/features/search_results_map_spec.rb +55 -0
  295. data/spec/features/search_results_overlap_ratio_spec.rb +55 -0
  296. data/spec/features/search_spec.rb +14 -0
  297. data/spec/features/show_page_metadata_spec.rb +12 -0
  298. data/spec/features/sms_spec.rb +15 -0
  299. data/spec/features/split_view.html.erb_spec.rb +75 -0
  300. data/spec/features/suppressed_records_spec.rb +14 -0
  301. data/spec/features/web_services_modal_spec.rb +25 -0
  302. data/spec/fixtures/fgdc/harvard-g7064-s2-1834-k3.xml +1 -0
  303. data/spec/fixtures/iso19139/stanford-cg357zz0321.xml +581 -0
  304. data/spec/fixtures/mods/fb897vt9938.mods +111 -0
  305. data/spec/fixtures/mods/stanford-cg357zz0321.mods +113 -0
  306. data/spec/fixtures/solr_documents/README.md +40 -0
  307. data/spec/fixtures/solr_documents/actual-papermap1.json +23 -0
  308. data/spec/fixtures/solr_documents/actual-point1.json +37 -0
  309. data/spec/fixtures/solr_documents/actual-polygon1.json +23 -0
  310. data/spec/fixtures/solr_documents/actual-raster1.json +38 -0
  311. data/spec/fixtures/solr_documents/baruch_ancestor1.json +46 -0
  312. data/spec/fixtures/solr_documents/baruch_ancestor2.json +46 -0
  313. data/spec/fixtures/solr_documents/baruch_documentation_download.json +49 -0
  314. data/spec/fixtures/solr_documents/bbox-spans-180.json +20 -0
  315. data/spec/fixtures/solr_documents/cornell_html_metadata.json +42 -0
  316. data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +38 -0
  317. data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +40 -0
  318. data/spec/fixtures/solr_documents/esri-feature-layer.json +46 -0
  319. data/spec/fixtures/solr_documents/esri-image-map-layer.json +42 -0
  320. data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +22 -0
  321. data/spec/fixtures/solr_documents/esri-wms-layer.json +33 -0
  322. data/spec/fixtures/solr_documents/harvard_raster.json +44 -0
  323. data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +30 -0
  324. data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +37 -0
  325. data/spec/fixtures/solr_documents/index-map-polygon.json +37 -0
  326. data/spec/fixtures/solr_documents/index-map-stanford.json +37 -0
  327. data/spec/fixtures/solr_documents/index_map_point.json +27 -0
  328. data/spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json +30 -0
  329. data/spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json +17 -0
  330. data/spec/fixtures/solr_documents/metadata_no_solr_geom.json +23 -0
  331. data/spec/fixtures/solr_documents/no_spatial.json +21 -0
  332. data/spec/fixtures/solr_documents/oembed.json +24 -0
  333. data/spec/fixtures/solr_documents/princeton-child1.json +30 -0
  334. data/spec/fixtures/solr_documents/princeton-child2.json +30 -0
  335. data/spec/fixtures/solr_documents/princeton-child3.json +30 -0
  336. data/spec/fixtures/solr_documents/princeton-child4.json +30 -0
  337. data/spec/fixtures/solr_documents/princeton-parent.json +25 -0
  338. data/spec/fixtures/solr_documents/public_direct_download.json +34 -0
  339. data/spec/fixtures/solr_documents/public_iiif_princeton.json +36 -0
  340. data/spec/fixtures/solr_documents/public_polygon_mit.json +27 -0
  341. data/spec/fixtures/solr_documents/restricted-line.json +37 -0
  342. data/spec/fixtures/solr_documents/umn_metro_result1.json +41 -0
  343. data/spec/fixtures/solr_documents/umn_state_result1.json +38 -0
  344. data/spec/fixtures/solr_documents/umn_state_result2.json +38 -0
  345. data/spec/fixtures/solr_documents/uva_slug_colon.json +25 -0
  346. data/spec/helpers/arcgis_helper_spec.rb +14 -0
  347. data/spec/helpers/carto_helper_spec.rb +11 -0
  348. data/spec/helpers/geoblacklight_helper_spec.rb +329 -0
  349. data/spec/javascripts/geoblacklight_spec.js +21 -0
  350. data/spec/javascripts/metadata_download_button_spec.js +14 -0
  351. data/spec/javascripts/spec_helper.js +32 -0
  352. data/spec/javascripts/util_spec.js +12 -0
  353. data/spec/lib/geoblacklight/bounding_box_spec.rb +27 -0
  354. data/spec/lib/geoblacklight/controller_override_spec.rb +1 -0
  355. data/spec/lib/geoblacklight/document_presenter_spec.rb +61 -0
  356. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +19 -0
  357. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +20 -0
  358. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +60 -0
  359. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +20 -0
  360. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +19 -0
  361. data/spec/lib/geoblacklight/download_spec.rb +177 -0
  362. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +30 -0
  363. data/spec/lib/geoblacklight/item_viewer_spec.rb +63 -0
  364. data/spec/lib/geoblacklight/metadata/base_spec.rb +157 -0
  365. data/spec/lib/geoblacklight/metadata/html_spec.rb +18 -0
  366. data/spec/lib/geoblacklight/metadata_spec.rb +42 -0
  367. data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +35 -0
  368. data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +23 -0
  369. data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +23 -0
  370. data/spec/lib/geoblacklight/metadata_transformer_spec.rb +69 -0
  371. data/spec/lib/geoblacklight/reference_spec.rb +64 -0
  372. data/spec/lib/geoblacklight/references_spec.rb +216 -0
  373. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +32 -0
  374. data/spec/lib/geoblacklight/relation/descendants_spec.rb +32 -0
  375. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +43 -0
  376. data/spec/lib/geoblacklight/view_helper_override_spec.rb +37 -0
  377. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +50 -0
  378. data/spec/lib/geoblacklight/wms_layer_spec.rb +99 -0
  379. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +61 -0
  380. data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +40 -0
  381. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +16 -0
  382. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +251 -0
  383. data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +84 -0
  384. data/spec/routing/catalog_routing_spec.rb +8 -0
  385. data/spec/spec_helper.rb +79 -0
  386. data/spec/support/backport_test_helpers.rb +45 -0
  387. data/spec/support/features.rb +5 -0
  388. data/spec/support/features/session_helpers.rb +20 -0
  389. data/spec/teaspoon_env.rb +213 -0
  390. data/spec/test_app_templates/Gemfile.extra +1 -0
  391. data/spec/test_app_templates/lib/generators/test_app_generator.rb +49 -0
  392. data/spec/test_app_templates/metadata/fgdc.html +129 -0
  393. data/spec/test_app_templates/metadata/fgdc.xml +145 -0
  394. data/spec/test_app_templates/metadata/iso.html +275 -0
  395. data/spec/test_app_templates/metadata/iso.xml +511 -0
  396. data/spec/test_app_templates/solr_documents +1 -0
  397. data/spec/views/catalog/_document_split.html.erb_spec.rb +5 -0
  398. data/spec/views/catalog/_index_split.html.erb_spec.rb +5 -0
  399. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +9 -0
  400. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +41 -0
  401. data/spec/views/catalog/_show_tools.html.erb_spec.rb +39 -0
  402. data/template.rb +19 -0
  403. data/vendor/assets/images/layers-2x.png +0 -0
  404. data/vendor/assets/images/layers.png +0 -0
  405. data/vendor/assets/images/marker-icon-2x.png +0 -0
  406. data/vendor/assets/images/marker-icon.png +0 -0
  407. data/vendor/assets/images/marker-shadow.png +0 -0
  408. data/vendor/assets/javascripts/esri-leaflet.js +5 -0
  409. data/vendor/assets/javascripts/esri-leaflet.js.map +1 -0
  410. data/vendor/assets/javascripts/leaflet-iiif.js +302 -0
  411. data/vendor/assets/javascripts/leaflet-src.js.map +1 -0
  412. data/vendor/assets/javascripts/leaflet.js.erb +13922 -0
  413. data/vendor/assets/javascripts/native.history.js +1 -0
  414. data/vendor/assets/javascripts/readmore.js +618 -0
  415. data/vendor/assets/javascripts/readmore.js.map +1 -0
  416. data/vendor/assets/stylesheets/leaflet-label.css +54 -0
  417. data/vendor/assets/stylesheets/leaflet.css +635 -0
  418. metadata +967 -0
@@ -0,0 +1 @@
1
+ (function(e,t){"use strict";var n=e.History=e.History||{};if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={handlers:{},_uid:1,uid:function(e){return e._uid||(e._uid=n.Adapter._uid++)},bind:function(e,t,r){var i=n.Adapter.uid(e);n.Adapter.handlers[i]=n.Adapter.handlers[i]||{},n.Adapter.handlers[i][t]=n.Adapter.handlers[i][t]||[],n.Adapter.handlers[i][t].push(r),e["on"+t]=function(e,t){return function(r){n.Adapter.trigger(e,t,r)}}(e,t)},trigger:function(e,t,r){r=r||{};var i=n.Adapter.uid(e),s,o;n.Adapter.handlers[i]=n.Adapter.handlers[i]||{},n.Adapter.handlers[i][t]=n.Adapter.handlers[i][t]||[];for(s=0,o=n.Adapter.handlers[i][t].length;s<o;++s)n.Adapter.handlers[i][t][s].apply(this,[r])},extractEventData:function(e,n){var r=n&&n[e]||t;return r},onDomLoad:function(t){var n=e.setTimeout(function(){t()},2e3);e.onload=function(){clearTimeout(n),t()}}},typeof n.init!="undefined"&&n.init()})(window),function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;try{s=e.sessionStorage,s.setItem("TEST","1"),s.removeItem("TEST")}catch(d){s=!1}l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(e){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(d){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e<t.length;e++)f(t[e]);h.intervalList=null}},h.debug=function(){(h.options.debug||!1)&&h.log.apply(h,arguments)},h.log=function(){var e=typeof n!="undefined"&&typeof n.log!="undefined"&&typeof n.log.apply!="undefined",t=r.getElementById("log"),i,s,o,u,a;e?(u=Array.prototype.slice.call(arguments),i=u.shift(),typeof n.debug!="undefined"?n.debug.apply(n,[i,u]):n.log.apply(n,[i,u])):i="\n"+arguments[0]+"\n";for(s=1,o=arguments.length;s<o;++s){a=arguments[s];if(typeof a=="object"&&typeof l!="undefined")try{a=l.stringify(a)}catch(f){}i+="\n"+a+"\n"}return t?(t.value+=i+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):e||c(i),!0},h.getInternetExplorerMajorVersion=function(){var e=h.getInternetExplorerMajorVersion.cached=typeof h.getInternetExplorerMajorVersion.cached!="undefined"?h.getInternetExplorerMajorVersion.cached:function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()}(window)
@@ -0,0 +1,618 @@
1
+ /*!
2
+ * @preserve
3
+ *
4
+ * Readmore.js plugin
5
+ * Author: @jed_foster
6
+ * Project home: jedfoster.com/Readmore.js
7
+ * Version: 3.0.0-beta-1
8
+ * Licensed under the MIT license
9
+ *
10
+ * Debounce function from davidwalsh.name/javascript-debounce-function
11
+ */
12
+ (function webpackUniversalModuleDefinition(root, factory) {
13
+ if(typeof exports === 'object' && typeof module === 'object')
14
+ module.exports = factory();
15
+ else if(typeof define === 'function' && define.amd)
16
+ define("Readmore", [], factory);
17
+ else if(typeof exports === 'object')
18
+ exports["Readmore"] = factory();
19
+ else
20
+ root["Readmore"] = factory();
21
+ })(window, function() {
22
+ return /******/ (function(modules) { // webpackBootstrap
23
+ /******/ // The module cache
24
+ /******/ var installedModules = {};
25
+ /******/
26
+ /******/ // The require function
27
+ /******/ function __webpack_require__(moduleId) {
28
+ /******/
29
+ /******/ // Check if module is in cache
30
+ /******/ if(installedModules[moduleId]) {
31
+ /******/ return installedModules[moduleId].exports;
32
+ /******/ }
33
+ /******/ // Create a new module (and put it into the cache)
34
+ /******/ var module = installedModules[moduleId] = {
35
+ /******/ i: moduleId,
36
+ /******/ l: false,
37
+ /******/ exports: {}
38
+ /******/ };
39
+ /******/
40
+ /******/ // Execute the module function
41
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
42
+ /******/
43
+ /******/ // Flag the module as loaded
44
+ /******/ module.l = true;
45
+ /******/
46
+ /******/ // Return the exports of the module
47
+ /******/ return module.exports;
48
+ /******/ }
49
+ /******/
50
+ /******/
51
+ /******/ // expose the modules object (__webpack_modules__)
52
+ /******/ __webpack_require__.m = modules;
53
+ /******/
54
+ /******/ // expose the module cache
55
+ /******/ __webpack_require__.c = installedModules;
56
+ /******/
57
+ /******/ // define getter function for harmony exports
58
+ /******/ __webpack_require__.d = function(exports, name, getter) {
59
+ /******/ if(!__webpack_require__.o(exports, name)) {
60
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
61
+ /******/ }
62
+ /******/ };
63
+ /******/
64
+ /******/ // define __esModule on exports
65
+ /******/ __webpack_require__.r = function(exports) {
66
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
67
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
68
+ /******/ }
69
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
70
+ /******/ };
71
+ /******/
72
+ /******/ // create a fake namespace object
73
+ /******/ // mode & 1: value is a module id, require it
74
+ /******/ // mode & 2: merge all properties of value into the ns
75
+ /******/ // mode & 4: return value when already ns object
76
+ /******/ // mode & 8|1: behave like require
77
+ /******/ __webpack_require__.t = function(value, mode) {
78
+ /******/ if(mode & 1) value = __webpack_require__(value);
79
+ /******/ if(mode & 8) return value;
80
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
81
+ /******/ var ns = Object.create(null);
82
+ /******/ __webpack_require__.r(ns);
83
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
84
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
85
+ /******/ return ns;
86
+ /******/ };
87
+ /******/
88
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
89
+ /******/ __webpack_require__.n = function(module) {
90
+ /******/ var getter = module && module.__esModule ?
91
+ /******/ function getDefault() { return module['default']; } :
92
+ /******/ function getModuleExports() { return module; };
93
+ /******/ __webpack_require__.d(getter, 'a', getter);
94
+ /******/ return getter;
95
+ /******/ };
96
+ /******/
97
+ /******/ // Object.prototype.hasOwnProperty.call
98
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
99
+ /******/
100
+ /******/ // __webpack_public_path__
101
+ /******/ __webpack_require__.p = "";
102
+ /******/
103
+ /******/
104
+ /******/ // Load entry module and return exports
105
+ /******/ return __webpack_require__(__webpack_require__.s = 0);
106
+ /******/ })
107
+ /************************************************************************/
108
+ /******/ ({
109
+
110
+ /***/ "./node_modules/@babel/runtime/helpers/classCallCheck.js":
111
+ /*!***************************************************************!*\
112
+ !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
113
+ \***************************************************************/
114
+ /*! no static exports found */
115
+ /***/ (function(module, exports) {
116
+
117
+ function _classCallCheck(instance, Constructor) {
118
+ if (!(instance instanceof Constructor)) {
119
+ throw new TypeError("Cannot call a class as a function");
120
+ }
121
+ }
122
+
123
+ module.exports = _classCallCheck;
124
+
125
+ /***/ }),
126
+
127
+ /***/ "./node_modules/@babel/runtime/helpers/createClass.js":
128
+ /*!************************************************************!*\
129
+ !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
130
+ \************************************************************/
131
+ /*! no static exports found */
132
+ /***/ (function(module, exports) {
133
+
134
+ function _defineProperties(target, props) {
135
+ for (var i = 0; i < props.length; i++) {
136
+ var descriptor = props[i];
137
+ descriptor.enumerable = descriptor.enumerable || false;
138
+ descriptor.configurable = true;
139
+ if ("value" in descriptor) descriptor.writable = true;
140
+ Object.defineProperty(target, descriptor.key, descriptor);
141
+ }
142
+ }
143
+
144
+ function _createClass(Constructor, protoProps, staticProps) {
145
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
146
+ if (staticProps) _defineProperties(Constructor, staticProps);
147
+ return Constructor;
148
+ }
149
+
150
+ module.exports = _createClass;
151
+
152
+ /***/ }),
153
+
154
+ /***/ "./node_modules/@babel/runtime/helpers/typeof.js":
155
+ /*!*******************************************************!*\
156
+ !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
157
+ \*******************************************************/
158
+ /*! no static exports found */
159
+ /***/ (function(module, exports) {
160
+
161
+ function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
162
+
163
+ function _typeof(obj) {
164
+ if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
165
+ module.exports = _typeof = function _typeof(obj) {
166
+ return _typeof2(obj);
167
+ };
168
+ } else {
169
+ module.exports = _typeof = function _typeof(obj) {
170
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
171
+ };
172
+ }
173
+
174
+ return _typeof(obj);
175
+ }
176
+
177
+ module.exports = _typeof;
178
+
179
+ /***/ }),
180
+
181
+ /***/ "./src/readmore.js":
182
+ /*!*************************!*\
183
+ !*** ./src/readmore.js ***!
184
+ \*************************/
185
+ /*! exports provided: default */
186
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
187
+
188
+ "use strict";
189
+ __webpack_require__.r(__webpack_exports__);
190
+ /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
191
+ /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
192
+ /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
193
+ /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
194
+ /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js");
195
+ /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2__);
196
+
197
+
198
+
199
+ var uniqueIdCounter = 0;
200
+ var isCssEmbeddedFor = []; // from:https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md
201
+
202
+ (function removePolyfill(arr) {
203
+ arr.forEach(function (item) {
204
+ if (Object.prototype.hasOwnProperty.call(item, 'remove')) {
205
+ return;
206
+ }
207
+
208
+ Object.defineProperty(item, 'remove', {
209
+ configurable: true,
210
+ enumerable: true,
211
+ writable: true,
212
+ value: function remove() {
213
+ if (this.parentNode !== null) {
214
+ this.parentNode.removeChild(this);
215
+ }
216
+ }
217
+ });
218
+ });
219
+ })([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
220
+
221
+ function forEach(arr, callback, scope) {
222
+ for (var i = 0; i < arr.length; i += 1) {
223
+ callback.call(scope, arr[i], i);
224
+ }
225
+ }
226
+
227
+ function extend() {
228
+ for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
229
+ objects[_key] = arguments[_key];
230
+ }
231
+
232
+ var hasProp = {}.hasOwnProperty;
233
+ var child = objects[0];
234
+ var parent = objects[1];
235
+
236
+ if (objects.length > 2) {
237
+ var args = [];
238
+ Object.keys(objects).forEach(function (key) {
239
+ args.push(objects[key]);
240
+ });
241
+
242
+ while (args.length > 2) {
243
+ var c1 = args.shift();
244
+ var p1 = args.shift();
245
+ args.unshift(extend(c1, p1));
246
+ }
247
+
248
+ child = args.shift();
249
+ parent = args.shift();
250
+ }
251
+
252
+ if (parent) {
253
+ Object.keys(parent).forEach(function (key) {
254
+ if (hasProp.call(parent, key)) {
255
+ if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2___default()(parent[key]) === 'object') {
256
+ child[key] = child[key] || {};
257
+ child[key] = extend(child[key], parent[key]);
258
+ } else {
259
+ child[key] = parent[key];
260
+ }
261
+ }
262
+ });
263
+ }
264
+
265
+ return child;
266
+ }
267
+
268
+ function debounce(func, wait, immediate) {
269
+ var timeout;
270
+ return function debouncedFunc() {
271
+ var _this = this;
272
+
273
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
274
+ args[_key2] = arguments[_key2];
275
+ }
276
+
277
+ var callNow = immediate && !timeout;
278
+
279
+ var later = function later() {
280
+ timeout = null;
281
+ if (!immediate) func.apply(_this, args);
282
+ };
283
+
284
+ clearTimeout(timeout);
285
+ timeout = setTimeout(later, wait);
286
+ if (callNow) func.apply(this, args);
287
+ };
288
+ }
289
+
290
+ function uniqueId() {
291
+ uniqueIdCounter += 1;
292
+ return "rmjs-".concat(uniqueIdCounter);
293
+ }
294
+
295
+ function setBoxHeights(element) {
296
+ element.style.height = 'auto';
297
+ var expandedHeight = parseInt(element.getBoundingClientRect().height, 10);
298
+ var cssMaxHeight = parseInt(window.getComputedStyle(element).maxHeight, 10);
299
+ var defaultHeight = parseInt(element.readmore.defaultHeight, 10); // Store our measurements.
300
+
301
+ element.readmore.expandedHeight = expandedHeight;
302
+ element.readmore.maxHeight = cssMaxHeight;
303
+ element.readmore.collapsedHeight = cssMaxHeight || element.readmore.collapsedHeight || defaultHeight;
304
+ element.style.maxHeight = 'none';
305
+ }
306
+
307
+ function createElementFromString(htmlString) {
308
+ var div = document.createElement('div');
309
+ div.innerHTML = htmlString;
310
+ return div.firstChild;
311
+ }
312
+
313
+ function embedCSS(selector, options) {
314
+ if (!isCssEmbeddedFor[selector]) {
315
+ var styles = '';
316
+
317
+ if (options.embedCSS && options.blockCSS !== '') {
318
+ styles += "".concat(selector, " + [data-readmore-toggle], ").concat(selector, "[data-readmore] {\n ").concat(options.blockCSS, "\n }");
319
+ } // Include the transition CSS even if embedCSS is false
320
+
321
+
322
+ styles += "".concat(selector, "[data-readmore] {\n transition: height ").concat(options.speed, "ms;\n overflow: hidden;\n }");
323
+
324
+ (function (d, u) {
325
+ var css = d.createElement('style');
326
+ css.type = 'text/css';
327
+
328
+ if (css.styleSheet) {
329
+ css.styleSheet.cssText = u;
330
+ } else {
331
+ css.appendChild(d.createTextNode(u));
332
+ }
333
+
334
+ d.getElementsByTagName('head')[0].appendChild(css);
335
+ })(document, styles);
336
+
337
+ isCssEmbeddedFor[selector] = true;
338
+ }
339
+ }
340
+
341
+ function buildToggle(link, element, scope) {
342
+ function clickHandler(event) {
343
+ this.toggle(element, event);
344
+ }
345
+
346
+ var text = link;
347
+
348
+ if (typeof link === 'function') {
349
+ text = link(element);
350
+ }
351
+
352
+ var toggleLink = createElementFromString(text);
353
+ toggleLink.setAttribute('data-readmore-toggle', element.id);
354
+ toggleLink.setAttribute('aria-controls', element.id);
355
+ toggleLink.addEventListener('click', clickHandler.bind(scope));
356
+ return toggleLink;
357
+ }
358
+
359
+ function isEnvironmentSupported() {
360
+ return typeof window !== 'undefined' && typeof document !== 'undefined' && !!document.querySelectorAll && !!window.addEventListener;
361
+ }
362
+
363
+ var resizeBoxes = debounce(function () {
364
+ var elements = document.querySelectorAll('[data-readmore]');
365
+ forEach(elements, function (element) {
366
+ var expanded = element.getAttribute('aria-expanded') === 'true';
367
+ setBoxHeights(element);
368
+ element.style.height = "".concat(expanded ? element.readmore.expandedHeight : element.readmore.collapsedHeight, "px");
369
+ });
370
+ }, 100);
371
+ var defaults = {
372
+ speed: 100,
373
+ collapsedHeight: 200,
374
+ heightMargin: 16,
375
+ moreLink: '<a href="#">Read More</a>',
376
+ lessLink: '<a href="#">Close</a>',
377
+ embedCSS: true,
378
+ blockCSS: 'display: block; width: 100%;',
379
+ startOpen: false,
380
+ sourceOrder: 'after',
381
+ // callbacks
382
+ blockProcessed: function blockProcessed() {},
383
+ beforeToggle: function beforeToggle() {},
384
+ afterToggle: function afterToggle() {}
385
+ };
386
+
387
+ var Readmore =
388
+ /*#__PURE__*/
389
+ function () {
390
+ function Readmore() {
391
+ var _this2 = this;
392
+
393
+ _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Readmore);
394
+
395
+ if (!isEnvironmentSupported()) return;
396
+
397
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
398
+ args[_key3] = arguments[_key3];
399
+ }
400
+
401
+ var selector = args[0],
402
+ options = args[1];
403
+ var elements;
404
+
405
+ if (typeof selector === 'string') {
406
+ elements = document.querySelectorAll(selector);
407
+ } else if (selector.nodeName) {
408
+ elements = [selector]; // emulate a NodeList by casting a single Node as an array
409
+ } else {
410
+ elements = selector;
411
+ } // After all that, if we _still_ don't have iteratable NodeList, bail out.
412
+
413
+
414
+ if (!elements.length) return;
415
+ this.options = extend({}, defaults, options);
416
+
417
+ if (typeof selector === 'string') {
418
+ embedCSS(selector, this.options);
419
+ } else {
420
+ // Instances need distinct selectors so they don't stomp on each other.
421
+ this.instanceSelector = ".".concat(uniqueId());
422
+ embedCSS(this.instanceSelector, this.options);
423
+ } // Need to resize boxes when the page has fully loaded.
424
+
425
+
426
+ window.addEventListener('load', resizeBoxes);
427
+ window.addEventListener('resize', resizeBoxes);
428
+ this.elements = [];
429
+ forEach(elements, function (element) {
430
+ if (_this2.instanceSelector) {
431
+ element.classList.add(_this2.instanceSelector.substr(1));
432
+ }
433
+
434
+ var expanded = _this2.options.startOpen;
435
+ element.readmore = {
436
+ defaultHeight: _this2.options.collapsedHeight,
437
+ heightMargin: _this2.options.heightMargin
438
+ };
439
+ setBoxHeights(element);
440
+ var heightMargin = element.readmore.heightMargin;
441
+
442
+ if (element.getBoundingClientRect().height <= element.readmore.collapsedHeight + heightMargin) {
443
+ if (typeof _this2.options.blockProcessed === 'function') {
444
+ _this2.options.blockProcessed(element, false);
445
+ }
446
+
447
+ return;
448
+ }
449
+
450
+ element.setAttribute('data-readmore', '');
451
+ element.setAttribute('aria-expanded', expanded);
452
+ element.id = element.id || uniqueId();
453
+ var toggleLink = expanded ? _this2.options.lessLink : _this2.options.moreLink;
454
+ var toggleElement = buildToggle(toggleLink, element, _this2);
455
+ element.parentNode.insertBefore(toggleElement, _this2.options.sourceOrder === 'before' ? element : element.nextSibling);
456
+ element.style.height = "".concat(expanded ? element.readmore.expandedHeight : element.readmore.collapsedHeight, "px");
457
+
458
+ if (typeof _this2.options.blockProcessed === 'function') {
459
+ _this2.options.blockProcessed(element, true);
460
+ }
461
+
462
+ _this2.elements.push(element);
463
+ });
464
+ } // Signature when called internally by the toggleLink click handler:
465
+ // toggle(element, event)
466
+ //
467
+ // When called externally by an instance,
468
+ // e.g. readmoreDemo.toggle(document.querySelector('article:nth-of-type(1)')):
469
+ // toggle(elementOrQuerySelector)
470
+
471
+
472
+ _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Readmore, [{
473
+ key: "toggle",
474
+ value: function toggle() {
475
+ var _this3 = this;
476
+
477
+ var el = arguments.length <= 0 ? undefined : arguments[0];
478
+
479
+ var toggleElement = function toggleElement(element) {
480
+ var trigger = document.querySelector("[aria-controls=\"".concat(element.id, "\"]"));
481
+ var expanded = element.getBoundingClientRect().height <= element.readmore.collapsedHeight;
482
+ var newHeight = expanded ? element.readmore.expandedHeight : element.readmore.collapsedHeight; // Fire beforeToggle callback
483
+ // Since we determined the new "expanded" state above we're now out of sync
484
+ // with our true current state, so we need to flip the value of `expanded`
485
+
486
+ if (typeof _this3.options.beforeToggle === 'function') {
487
+ var shouldContinueToggle = _this3.options.beforeToggle(trigger, element, !expanded); // if the beforeToggle callback returns false, stop toggling
488
+
489
+
490
+ if (shouldContinueToggle === false) {
491
+ return;
492
+ }
493
+ }
494
+
495
+ element.style.height = "".concat(newHeight, "px");
496
+
497
+ var transitionendHandler = function transitionendHandler(transitionEvent) {
498
+ // Fire afterToggle callback
499
+ if (typeof _this3.options.afterToggle === 'function') {
500
+ _this3.options.afterToggle(trigger, element, expanded);
501
+ }
502
+
503
+ transitionEvent.stopPropagation();
504
+ element.setAttribute('aria-expanded', expanded);
505
+ element.removeEventListener('transitionend', transitionendHandler, false);
506
+ };
507
+
508
+ element.addEventListener('transitionend', transitionendHandler, false);
509
+
510
+ if (_this3.options.speed < 1) {
511
+ transitionendHandler.call(_this3, {
512
+ target: element
513
+ });
514
+ }
515
+
516
+ var toggleLink = expanded ? _this3.options.lessLink : _this3.options.moreLink;
517
+
518
+ if (!toggleLink) {
519
+ trigger.remove();
520
+ } else if (trigger && trigger.parentNode) {
521
+ trigger.parentNode.replaceChild(buildToggle(toggleLink, element, _this3), trigger);
522
+ }
523
+ };
524
+
525
+ if (typeof el === 'string') {
526
+ el = document.querySelectorAll(el);
527
+ }
528
+
529
+ if (!el) {
530
+ throw new Error('Element MUST be either an HTML node or querySelector string');
531
+ }
532
+
533
+ var event = arguments.length <= 1 ? undefined : arguments[1];
534
+
535
+ if (event) {
536
+ event.preventDefault();
537
+ event.stopPropagation();
538
+ }
539
+
540
+ if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2___default()(el) === 'object' && !el.nodeName) {
541
+ // element is likely a NodeList
542
+ forEach(el, toggleElement);
543
+ } else {
544
+ toggleElement(el);
545
+ }
546
+ }
547
+ }, {
548
+ key: "destroy",
549
+ value: function destroy(selector) {
550
+ var _this4 = this;
551
+
552
+ var elements;
553
+
554
+ if (!selector) {
555
+ elements = this.elements; // eslint-disable-line
556
+ } else if (typeof selector === 'string') {
557
+ elements = document.querySelectorAll(selector);
558
+ } else if (selector.nodeName) {
559
+ elements = [selector]; // emulate a NodeList by casting a single Node as an array
560
+ } else {
561
+ elements = selector;
562
+ }
563
+
564
+ forEach(elements, function (element) {
565
+ if (_this4.elements.indexOf(element) === -1) {
566
+ return;
567
+ }
568
+
569
+ _this4.elements = _this4.elements.filter(function (el) {
570
+ return el !== element;
571
+ });
572
+
573
+ if (_this4.instanceSelector) {
574
+ element.classList.remove(_this4.instanceSelector.substr(1));
575
+ }
576
+
577
+ delete element.readmore;
578
+ element.style.height = 'initial';
579
+ element.style.maxHeight = 'initial';
580
+ element.removeAttribute('data-readmore');
581
+ element.removeAttribute('aria-expanded');
582
+ var trigger = document.querySelector("[aria-controls=\"".concat(element.id, "\"]"));
583
+
584
+ if (trigger) {
585
+ trigger.remove();
586
+ }
587
+
588
+ if (element.id.indexOf('rmjs-') !== -1) {
589
+ element.removeAttribute('id');
590
+ }
591
+ });
592
+ delete this;
593
+ }
594
+ }]);
595
+
596
+ return Readmore;
597
+ }();
598
+
599
+ Readmore.VERSION = "3.0.0-beta-1";
600
+ /* harmony default export */ __webpack_exports__["default"] = (Readmore);
601
+
602
+ /***/ }),
603
+
604
+ /***/ 0:
605
+ /*!*******************************!*\
606
+ !*** multi ./src/readmore.js ***!
607
+ \*******************************/
608
+ /*! no static exports found */
609
+ /***/ (function(module, exports, __webpack_require__) {
610
+
611
+ module.exports = __webpack_require__(/*! ./src/readmore.js */"./src/readmore.js");
612
+
613
+
614
+ /***/ })
615
+
616
+ /******/ })["default"];
617
+ });
618
+ //# sourceMappingURL=readmore.js.map