geoblacklight 2.4.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +142 -0
  3. data/.gitignore +8 -0
  4. data/.rubocop.yml +24 -23
  5. data/.rubocop_todo.yml +398 -12
  6. data/README.md +3 -3
  7. data/Rakefile +13 -4
  8. data/app/assets/images/favicon.ico +0 -0
  9. data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
  10. data/app/assets/javascripts/geoblacklight/geoblacklight.js +18 -1
  11. data/app/assets/javascripts/geoblacklight/modules/bookmarks.js +43 -0
  12. data/app/assets/javascripts/geoblacklight/modules/metadata_download_button.js +6 -1
  13. data/app/assets/javascripts/geoblacklight/modules/results.js +7 -8
  14. data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +31 -0
  15. data/app/assets/javascripts/geoblacklight/modules/util.js +5 -0
  16. data/app/assets/javascripts/geoblacklight/viewers/esri.js +3 -3
  17. data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +1 -1
  18. data/app/assets/javascripts/geoblacklight/viewers/index_map.js +1 -1
  19. data/app/assets/javascripts/geoblacklight/viewers/map.js +12 -2
  20. data/app/assets/javascripts/geoblacklight/viewers/tms.js +10 -0
  21. data/app/assets/javascripts/geoblacklight/viewers/wms.js +3 -3
  22. data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +2 -0
  23. data/app/assets/stylesheets/geoblacklight/modules/_base.scss +33 -0
  24. data/app/assets/stylesheets/geoblacklight/{_blacklight_overrides.scss → modules/_blacklight_overrides.scss} +1 -1
  25. data/app/assets/stylesheets/geoblacklight/{_styles.scss → modules/_styles.scss} +1 -0
  26. data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +37 -54
  27. data/app/assets/stylesheets/geoblacklight/modules/item.scss +1 -0
  28. data/app/assets/stylesheets/geoblacklight/modules/results.scss +17 -29
  29. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +12 -42
  30. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +17 -59
  31. data/app/controllers/download_controller.rb +12 -12
  32. data/app/controllers/relation_controller.rb +1 -0
  33. data/app/controllers/wms_controller.rb +1 -0
  34. data/app/helpers/arcgis_helper.rb +1 -0
  35. data/app/helpers/blacklight_helper.rb +1 -0
  36. data/app/helpers/carto_helper.rb +1 -0
  37. data/app/helpers/geoblacklight_helper.rb +37 -72
  38. data/app/models/concerns/geoblacklight/solr_document.rb +15 -19
  39. data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +2 -1
  40. data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -13
  41. data/app/models/concerns/geoblacklight/solr_document/citation.rb +1 -0
  42. data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
  43. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +2 -1
  44. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +6 -4
  45. data/app/presenters/geoblacklight/document_presenter.rb +2 -1
  46. data/app/views/catalog/_arcgis.html.erb +4 -0
  47. data/app/views/catalog/_carto.html.erb +4 -0
  48. data/app/views/catalog/_document_split.html.erb +1 -1
  49. data/app/views/catalog/_downloads_primary.html.erb +8 -1
  50. data/app/views/catalog/_header_icons.html.erb +3 -3
  51. data/app/views/catalog/_home_text.html.erb +3 -0
  52. data/app/views/catalog/_index_split_default.html.erb +21 -21
  53. data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
  54. data/app/views/download/hgl.html.erb +13 -11
  55. data/app/views/relation/_ancestors.html.erb +3 -6
  56. data/app/views/relation/_descendants.html.erb +4 -7
  57. data/app/views/relation/index.html.erb +20 -8
  58. data/app/views/relation/index.json.jbuilder +2 -1
  59. data/app/views/shared/_header_navbar.html.erb +0 -2
  60. data/babel.config.json +4 -0
  61. data/bin/coverage.rb +36 -0
  62. data/config/initializers/new_gbl_settings_defaults_3_3.yml +10 -0
  63. data/config/initializers/rails_config.rb +5 -0
  64. data/config/locales/geoblacklight.en.yml +7 -2
  65. data/geoblacklight.gemspec +7 -9
  66. data/jest.config.js +25 -0
  67. data/lib/generators/geoblacklight/assets_generator.rb +46 -0
  68. data/lib/generators/geoblacklight/install_generator.rb +4 -10
  69. data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +1 -0
  70. data/lib/generators/geoblacklight/templates/assets/_customizations.scss +28 -0
  71. data/{app/assets/stylesheets/geoblacklight/application.scss → lib/generators/geoblacklight/templates/assets/_geoblacklight.scss} +0 -1
  72. data/lib/generators/geoblacklight/templates/assets/application.scss +7 -0
  73. data/lib/generators/geoblacklight/templates/{geoblacklight.js → assets/geoblacklight.js} +0 -0
  74. data/lib/generators/geoblacklight/templates/catalog_controller.rb +5 -3
  75. data/lib/generators/geoblacklight/templates/settings.yml +20 -17
  76. data/lib/generators/geoblacklight/webpacker_generator.rb +1 -0
  77. data/lib/geoblacklight.rb +2 -2
  78. data/lib/geoblacklight/bounding_box.rb +2 -1
  79. data/lib/geoblacklight/catalog_helper_override.rb +1 -0
  80. data/lib/geoblacklight/constants.rb +2 -0
  81. data/lib/geoblacklight/download.rb +2 -1
  82. data/lib/geoblacklight/download/geojson_download.rb +1 -0
  83. data/lib/geoblacklight/download/geotiff_download.rb +1 -0
  84. data/lib/geoblacklight/download/hgl_download.rb +1 -0
  85. data/lib/geoblacklight/download/kmz_download.rb +3 -2
  86. data/lib/geoblacklight/download/shapefile_download.rb +1 -0
  87. data/lib/geoblacklight/engine.rb +2 -2
  88. data/lib/geoblacklight/exceptions.rb +1 -0
  89. data/lib/geoblacklight/geoblacklight_helper_behavior.rb +1 -0
  90. data/lib/geoblacklight/geometry.rb +70 -0
  91. data/lib/geoblacklight/item_viewer.rb +6 -1
  92. data/lib/geoblacklight/metadata.rb +1 -0
  93. data/lib/geoblacklight/metadata/base.rb +2 -7
  94. data/lib/geoblacklight/metadata/fgdc.rb +1 -0
  95. data/lib/geoblacklight/metadata/html.rb +2 -2
  96. data/lib/geoblacklight/metadata/iso19139.rb +1 -0
  97. data/lib/geoblacklight/metadata_transformer.rb +1 -0
  98. data/lib/geoblacklight/metadata_transformer/base.rb +1 -0
  99. data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
  100. data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
  101. data/lib/geoblacklight/reference.rb +1 -0
  102. data/lib/geoblacklight/references.rb +7 -3
  103. data/lib/geoblacklight/relation/ancestors.rb +3 -2
  104. data/lib/geoblacklight/relation/descendants.rb +2 -1
  105. data/lib/geoblacklight/relation/relation_response.rb +2 -1
  106. data/lib/geoblacklight/routes.rb +1 -0
  107. data/lib/geoblacklight/routes/downloadable.rb +1 -0
  108. data/lib/geoblacklight/routes/exportable.rb +1 -0
  109. data/lib/geoblacklight/routes/wms.rb +1 -0
  110. data/lib/geoblacklight/version.rb +2 -1
  111. data/lib/geoblacklight/view_helper_override.rb +1 -0
  112. data/lib/geoblacklight/wms_layer.rb +2 -4
  113. data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -0
  114. data/lib/tasks/geoblacklight.rake +38 -32
  115. data/package.json +17 -1
  116. data/setupJest.js +14 -0
  117. data/solr/conf/schema.xml +1 -3
  118. data/spec/config/initializers/rails_config_spec.rb +14 -0
  119. data/spec/controllers/catalog_controller_spec.rb +7 -6
  120. data/spec/controllers/download_controller_spec.rb +1 -0
  121. data/spec/controllers/relation_controller_spec.rb +1 -0
  122. data/spec/controllers/wms_controller_spec.rb +1 -0
  123. data/spec/factories/user.rb +1 -0
  124. data/spec/features/bookmarks_spec.rb +1 -0
  125. data/spec/features/configurable_basemap_spec.rb +1 -0
  126. data/spec/features/data_dictionary_download_spec.rb +1 -0
  127. data/spec/features/download_layer_spec.rb +2 -1
  128. data/spec/features/empty_search_spec.rb +1 -0
  129. data/spec/features/esri_viewer_spec.rb +1 -5
  130. data/spec/features/exports_spec.rb +4 -12
  131. data/spec/features/help_text_spec.rb +1 -0
  132. data/spec/features/home_page_spec.rb +6 -0
  133. data/spec/features/iiif_viewer_spec.rb +1 -0
  134. data/spec/features/index_map_spec.rb +1 -0
  135. data/spec/features/layer_inspection_spec.rb +1 -0
  136. data/spec/features/layer_opacity_spec.rb +1 -0
  137. data/spec/features/layer_preview_spec.rb +1 -0
  138. data/spec/features/layer_with_no_references_spec.rb +1 -0
  139. data/spec/features/linkified_attribute_table_spec.rb +1 -0
  140. data/spec/features/metadata_panel_spec.rb +1 -0
  141. data/spec/features/missing_metadata_spec.rb +1 -0
  142. data/spec/features/multiple_downloads_spec.rb +15 -0
  143. data/spec/features/oembed_spec.rb +1 -0
  144. data/spec/features/relations_spec.rb +10 -29
  145. data/spec/features/saved_searches_spec.rb +1 -0
  146. data/spec/features/search_bar_spec.rb +1 -0
  147. data/spec/features/search_results_map_spec.rb +1 -6
  148. data/spec/features/search_results_overlap_ratio_spec.rb +6 -5
  149. data/spec/features/search_spec.rb +1 -0
  150. data/spec/features/show_page_metadata_spec.rb +1 -0
  151. data/spec/features/sms_spec.rb +1 -0
  152. data/spec/features/split_view.html.erb_spec.rb +3 -2
  153. data/spec/features/suppressed_records_spec.rb +1 -0
  154. data/spec/features/tms_spec.rb +10 -0
  155. data/spec/features/web_services_modal_spec.rb +1 -0
  156. data/spec/fixtures/solr_documents/multiple-downloads.json +30 -0
  157. data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
  158. data/spec/fixtures/solr_documents/tms.json +29 -0
  159. data/spec/helpers/arcgis_helper_spec.rb +1 -0
  160. data/spec/helpers/carto_helper_spec.rb +1 -0
  161. data/spec/helpers/geoblacklight_helper_spec.rb +73 -14
  162. data/spec/javascripts/geoblacklight_spec.js +0 -6
  163. data/spec/javascripts/metadata_download_button_spec.js +5 -3
  164. data/spec/javascripts/util_spec.js +2 -4
  165. data/spec/lib/geoblacklight/bounding_box_spec.rb +1 -0
  166. data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -2
  167. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -0
  168. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -0
  169. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -0
  170. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +3 -2
  171. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -0
  172. data/spec/lib/geoblacklight/download_spec.rb +3 -2
  173. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
  174. data/spec/lib/geoblacklight/geometry_spec.rb +48 -0
  175. data/spec/lib/geoblacklight/item_viewer_spec.rb +13 -0
  176. data/spec/lib/geoblacklight/metadata/base_spec.rb +1 -0
  177. data/spec/lib/geoblacklight/metadata/html_spec.rb +1 -0
  178. data/spec/lib/geoblacklight/metadata_spec.rb +1 -0
  179. data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +3 -2
  180. data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +3 -2
  181. data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +3 -2
  182. data/spec/lib/geoblacklight/metadata_transformer_spec.rb +4 -3
  183. data/spec/lib/geoblacklight/reference_spec.rb +1 -0
  184. data/spec/lib/geoblacklight/references_spec.rb +3 -4
  185. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +2 -1
  186. data/spec/lib/geoblacklight/relation/descendants_spec.rb +2 -1
  187. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +1 -0
  188. data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -0
  189. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +5 -4
  190. data/spec/lib/geoblacklight/wms_layer_spec.rb +1 -0
  191. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +1 -20
  192. data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +1 -0
  193. data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +1 -0
  194. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +1 -0
  195. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +1 -0
  196. data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +15 -2
  197. data/spec/routing/catalog_routing_spec.rb +1 -0
  198. data/spec/spec_helper.rb +12 -9
  199. data/spec/support/backport_test_helpers.rb +1 -0
  200. data/spec/support/features.rb +1 -0
  201. data/spec/support/features/session_helpers.rb +1 -0
  202. data/spec/support/fixtures.rb +1 -0
  203. data/spec/tasks/geoblacklight_spec.rb +4 -3
  204. data/spec/test_app_templates/Gemfile.extra +1 -0
  205. data/spec/test_app_templates/lib/generators/test_app_generator.rb +2 -8
  206. data/spec/views/catalog/_document_split.html.erb_spec.rb +2 -1
  207. data/spec/views/catalog/_index_split.html.erb_spec.rb +2 -1
  208. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +1 -0
  209. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -0
  210. data/spec/views/catalog/_show_tools.html.erb_spec.rb +3 -5
  211. data/template.rb +4 -2
  212. metadata +74 -78
  213. data/.circleci/config.yml +0 -164
  214. data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +0 -36
  215. data/app/assets/stylesheets/geoblacklight/modules/relations.scss +0 -15
  216. data/app/views/catalog/_exports.html.erb +0 -3
  217. data/app/views/catalog/_show_tools.html.erb +0 -25
  218. data/lib/generators/geoblacklight/templates/geoblacklight.scss +0 -4
  219. data/spec/javascripts/spec_helper.js +0 -32
  220. data/spec/lib/geoblacklight/controller_override_spec.rb +0 -1
  221. data/spec/teaspoon_env.rb +0 -213
  222. data/vendor/assets/javascripts/readmore.js +0 -0
  223. data/vendor/assets/javascripts/readmore.min.js +0 -0
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GeoBlacklight
2
2
 
3
- [![CircleCI](https://circleci.com/gh/geoblacklight/geoblacklight.svg?style=svg)](https://circleci.com/gh/geoblacklight/geoblacklight) | [![Coverage Status](https://img.shields.io/coveralls/geoblacklight/geoblacklight.svg)](https://coveralls.io/r/geoblacklight/geoblacklight?branch=coveralls) | [![Gem Version](https://img.shields.io/gem/v/geoblacklight.svg)](https://github.com/geoblacklight/geoblacklight/releases)
3
+ [![CircleCI](https://circleci.com/gh/geoblacklight/geoblacklight.svg?style=svg)](https://circleci.com/gh/geoblacklight/geoblacklight) | [![Coverage Status](https://raw.githubusercontent.com/geoblacklight/geoblacklight/coverage-badge/coverage.svg)]() | [![Gem Version](https://img.shields.io/gem/v/geoblacklight.svg)](https://github.com/geoblacklight/geoblacklight/releases)
4
4
 
5
5
  GeoBlacklight is a world-class discovery platform for geospatial (GIS) holdings. It
6
6
  is an open collaborative project aiming to build off of the successes
@@ -13,7 +13,7 @@ communities. We're actively looking for community input and development partners
13
13
  In order to create a new GeoBlacklight application from the template, run the following:
14
14
 
15
15
  ```
16
- $ rails new app-name -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/master/template.rb
16
+ $ DISABLE_SPRING=1 rails new app-name -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/main/template.rb
17
17
  ```
18
18
 
19
19
  To launch app:
@@ -26,7 +26,7 @@ $ rake geoblacklight:server
26
26
  Note that this method launches an application that does not have any fixture records to be examined. You may want to launch a test application that has fixture data loaded into a Solr core. If so, refer to the [development guide](https://github.com/geoblacklight/geoblacklight/wiki/Development). For further information on installing a blank app, see the [installation guide](https://github.com/geoblacklight/geoblacklight/wiki/Installation)
27
27
 
28
28
  ### Webpacker
29
- GeoBlacklight can use [Webpacker](https://github.com/rails/webpacker) in order to manage JavaScript dependencies and assets, which requires that either [Yarn](https://yarnpkg.com/) or the [Node Package Manager](https://www.npmjs.com/) be available on the system where this is deployed. How Webpacker interacts with Rails is overviewed within its own documentation, including [how best to configure JavaScript processing settings](https://github.com/rails/webpacker/blob/master/docs/webpack.md). We encourage you to review this.
29
+ GeoBlacklight can use [Webpacker](https://github.com/rails/webpacker) in order to manage JavaScript dependencies and assets, which requires that either [Yarn](https://yarnpkg.com/) or the [Node Package Manager](https://www.npmjs.com/) be available on the system where this is deployed. How Webpacker interacts with Rails is overviewed within its own documentation, including [how best to configure JavaScript processing settings](https://github.com/rails/webpacker). We encourage you to review this.
30
30
 
31
31
  ### Contributing
32
32
  Interested in contributing to GeoBlacklight? Please see our [contributing](CONTRIBUTING.md) guide.
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
  require 'rails'
3
4
  begin
4
5
  require 'bundler/setup'
@@ -25,9 +26,9 @@ RSpec::Core::RakeTask.new(:spec) do |t|
25
26
  t.verbose = false
26
27
  end
27
28
 
28
- desc 'Run Teaspoon JavaScript tests'
29
- task :teaspoon do
30
- system('teaspoon --require=.internal_test_app/spec/teaspoon_env.rb')
29
+ desc 'Run JavaScript unit tests'
30
+ task :javascript_tests do
31
+ system '/bin/bash -c yarn test'
31
32
  end
32
33
 
33
34
  desc 'Run test suite'
@@ -42,7 +43,7 @@ task ci: ['geoblacklight:generate'] do
42
43
  end
43
44
  end
44
45
  # Run JavaScript tests
45
- Rake::Task['teaspoon'].invoke
46
+ Rake::Task['javascript_tests'].invoke
46
47
  end
47
48
 
48
49
  namespace :geoblacklight do
@@ -54,6 +55,7 @@ namespace :geoblacklight do
54
55
 
55
56
  desc 'Create the test rails app'
56
57
  task generate: ['engine_cart:generate'] do
58
+ # Intentionally Empty Block
57
59
  end
58
60
 
59
61
  namespace :internal do
@@ -120,6 +122,13 @@ namespace :geoblacklight do
120
122
  end
121
123
  end
122
124
  end
125
+
126
+ desc 'Stdout output asset paths'
127
+ task :asset_paths do
128
+ within_test_app do
129
+ system 'bundle exec rake geoblacklight:application_asset_paths'
130
+ end
131
+ end
123
132
  end
124
133
 
125
134
  task default: [:ci]
Binary file
@@ -3,7 +3,7 @@
3
3
 
4
4
  var Downloader = L.Class.extend({
5
5
  options: {
6
- spinner: $('<i class="fa fa-spinner fa-spin fa-2x fa-align-center"></i>')
6
+ spinner: $('<div class="spinner-border spinner-border-sm float-right" role="status"><span class="sr-only">Downloading</span></div>')
7
7
  },
8
8
 
9
9
  initialize: function(el, options) {
@@ -19,6 +19,17 @@
19
19
  }
20
20
  };
21
21
 
22
+ /**
23
+ * Convert GeoJSON string to Leaflet LatLngBounds.
24
+ * @param {String} geojson GeoJSON string
25
+ * @return {L.LatLngBounds} Converted Leaflet LatLngBounds object
26
+ */
27
+ L.geoJSONToBounds = function(geojson) {
28
+ var layer = L.geoJSON();
29
+ layer.addData(geojson);
30
+ return layer.getBounds();
31
+ }
32
+
22
33
  var GeoBlacklight = L.Class.extend({
23
34
  statics: {
24
35
  __version__: '2.0.0',
@@ -38,5 +49,11 @@
38
49
 
39
50
  // Hash for leaflet controls.
40
51
  GeoBlacklight.Controls = {};
52
+
53
+ // Basic support of CommonJS module
54
+ if (typeof exports === "object") {
55
+ module.exports = GeoBlacklight;
56
+ }
57
+
41
58
  global.GeoBlacklight = GeoBlacklight;
42
- }(this);
59
+ }(this || {});
@@ -0,0 +1,43 @@
1
+ Blacklight.onLoad(function() {
2
+ $('[data-map="bookmarks"]').each(function() {
3
+ var data = $(this).data(),
4
+ world = L.latLngBounds([[-90, -180], [90, 180]]),
5
+ geoblacklight, bbox;
6
+
7
+ if (typeof data.mapGeom === 'string') {
8
+ bbox = L.geoJSONToBounds(data.mapGeom);
9
+ } else {
10
+ $('.document [data-geom]').each(function() {
11
+ try {
12
+ var currentBounds = L.geoJSONToBounds($(this).data().geom);
13
+ if (!world.contains(currentBounds)) {
14
+ throw "Invalid bounds";
15
+ }
16
+ if (typeof bbox === 'undefined') {
17
+ bbox = currentBounds;
18
+ } else {
19
+ bbox.extend(currentBounds);
20
+ }
21
+ } catch (e) {
22
+ bbox = L.bboxToBounds("-180 -90 180 90");
23
+ }
24
+ });
25
+ }
26
+
27
+ // instantiate new map
28
+ geoblacklight = new GeoBlacklight.Viewer.Map(this, { bbox: bbox });
29
+ geoblacklight.removeBoundsOverlay();
30
+
31
+ // set hover listeners on map
32
+ $('#content')
33
+ .on('mouseenter', '#documents [data-layer-id]', function() {
34
+ if($(this).data('bbox') !== "") {
35
+ var geom = $(this).data('geom')
36
+ geoblacklight.addGeoJsonOverlay(geom)
37
+ }
38
+ })
39
+ .on('mouseleave', '#documents [data-layer-id]', function() {
40
+ geoblacklight.removeBoundsOverlay();
41
+ });
42
+ });
43
+ });
@@ -45,9 +45,14 @@
45
45
  }
46
46
  },
47
47
  });
48
+
49
+ // Basic support of CommonJS module
50
+ if (typeof exports === "object") {
51
+ module.exports = MetadataDownloadButton;
52
+ }
48
53
 
49
54
  global.GeoBlacklight.MetadataDownloadButton = MetadataDownloadButton;
50
55
  global.GeoBlacklight.metadataDownloadButton = function metadataDownloadButton(el, options) {
51
56
  return new MetadataDownloadButton(el, options);
52
57
  };
53
- })(this);
58
+ })(this || { GeoBlacklight: {}});
@@ -14,13 +14,12 @@ Blacklight.onLoad(function() {
14
14
  world = L.latLngBounds([[-90, -180], [90, 180]]),
15
15
  geoblacklight, bbox;
16
16
 
17
- if (typeof data.mapBbox === 'string') {
18
- bbox = L.bboxToBounds(data.mapBbox);
17
+ if (typeof data.mapGeom === 'string') {
18
+ bbox = L.geoJSONToBounds(data.mapGeom);
19
19
  } else {
20
- $('.document [data-bbox]').each(function() {
21
-
20
+ $('.document [data-geom]').each(function() {
22
21
  try {
23
- var currentBounds = L.bboxToBounds($(this).data().bbox);
22
+ var currentBounds = L.geoJSONToBounds($(this).data().geom);
24
23
  if (!world.contains(currentBounds)) {
25
24
  throw "Invalid bounds";
26
25
  }
@@ -50,9 +49,9 @@ Blacklight.onLoad(function() {
50
49
  // set hover listeners on map
51
50
  $('#content')
52
51
  .on('mouseenter', '#documents [data-layer-id]', function() {
53
- if($(this).data('bbox').length > 0) {
54
- var bounds = L.bboxToBounds($(this).data('bbox'));
55
- geoblacklight.addBoundsOverlay(bounds);
52
+ if($(this).data('bbox') !== "") {
53
+ var geom = $(this).data('geom')
54
+ geoblacklight.addGeoJsonOverlay(geom)
56
55
  }
57
56
  })
58
57
  .on('mouseleave', '#documents [data-layer-id]', function() {
@@ -0,0 +1,31 @@
1
+ /* global Blacklight */
2
+
3
+ Blacklight.onLoad(function() {
4
+ 'use strict';
5
+
6
+ $('body').on('mouseenter', '.blacklight-icons.svg_tooltip svg', function() {
7
+ var svgTitle = $(this).find('title');
8
+ var titleText = svgTitle && svgTitle.text();
9
+
10
+ if (titleText !== undefined && titleText !== '') {
11
+ $(this).tooltip({ placement: 'bottom', title: titleText });
12
+ $(this).tooltip('show');
13
+
14
+ // Store the original title in the data-original-title attribute
15
+ // and remove the title element on mouseenter.
16
+ // This prevents the title from interfering w/ Bootstrap's tooltip.
17
+ $(this).attr('data-original-title', titleText);
18
+ svgTitle.remove();
19
+ }
20
+ });
21
+
22
+ $('body').on('mouseleave', '.blacklight-icons.svg_tooltip svg', function() {
23
+ var originalTitle = $(this).attr('data-original-title');
24
+
25
+ if (originalTitle !== undefined && originalTitle !== '') {
26
+ // Restore the SVG title element from data-original-title on mouseleave
27
+ $(this).prepend($('<title>' + originalTitle + '</title>'));
28
+ $(this).attr('data-original-title', '');
29
+ }
30
+ });
31
+ });
@@ -36,3 +36,8 @@ GeoBlacklight.Util = {
36
36
  }
37
37
  }
38
38
  };
39
+
40
+ // Basic support of CommonJS module
41
+ if (typeof exports === "object") {
42
+ module.exports = GeoBlacklight.Util;
43
+ }
@@ -4,7 +4,7 @@ GeoBlacklight.Viewer.Esri = GeoBlacklight.Viewer.Map.extend({
4
4
  layerInfo: {},
5
5
 
6
6
  load: function() {
7
- this.options.bbox = L.bboxToBounds(this.data.mapBbox);
7
+ this.options.bbox = L.geoJSONToBounds(this.data.mapGeom);
8
8
  this.map = L.map(this.element).fitBounds(this.options.bbox);
9
9
  this.map.addLayer(this.selectBasemap());
10
10
  this.map.addLayer(this.overlay);
@@ -50,8 +50,8 @@ GeoBlacklight.Viewer.Esri = GeoBlacklight.Viewer.Map.extend({
50
50
  appendLoadingMessage: function() {
51
51
  var spinner = '<tbody class="attribute-table-body"><tr><td colspan="2">' +
52
52
  '<span id="attribute-table">' +
53
- '<i class="fa fa-spinner fa-spin fa-align-center">' +
54
- '</i></span>' +
53
+ '<div class="spinner-border" role="status"><span class="sr-only">Inspecting</span></div>' +
54
+ '</span>' +
55
55
  '</td></tr></tbody>';
56
56
 
57
57
  $('.attribute-table-body').html(spinner);
@@ -30,7 +30,7 @@ GeoBlacklight.Viewer.TiledMapLayer = GeoBlacklight.Viewer.Esri.extend({
30
30
  _this.appendLoadingMessage();
31
31
 
32
32
  // query layer at click location
33
- L.esri.Tasks.identifyFeatures({
33
+ L.esri.identifyFeatures({
34
34
  url: layer.options.url,
35
35
  useCors: true
36
36
  })
@@ -67,4 +67,4 @@ GeoBlacklight.Viewer.IndexMap = GeoBlacklight.Viewer.Map.extend({
67
67
  _this.map.fitBounds(geoJSONLayer.getBounds());
68
68
  });
69
69
  }
70
- });
70
+ });
@@ -14,8 +14,8 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
14
14
  overlay: L.layerGroup(),
15
15
 
16
16
  load: function() {
17
- if (this.data.mapBbox) {
18
- this.options.bbox = L.bboxToBounds(this.data.mapBbox);
17
+ if (this.data.mapGeom) {
18
+ this.options.bbox = L.geoJSONToBounds(this.data.mapGeom);
19
19
  }
20
20
  this.map = L.map(this.element).fitBounds(this.options.bbox);
21
21
 
@@ -53,6 +53,16 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
53
53
  this.overlay.clearLayers();
54
54
  },
55
55
 
56
+ /**
57
+ * Add a GeoJSON overlay to map.
58
+ * @param {string} geojson GeoJSON string
59
+ */
60
+ addGeoJsonOverlay: function(geojson) {
61
+ var layer = L.geoJSON();
62
+ layer.addData(geojson);
63
+ this.overlay.addLayer(layer);
64
+ },
65
+
56
66
  /**
57
67
  * Selects basemap if specified in data options, if not return positron.
58
68
  */
@@ -0,0 +1,10 @@
1
+ //= require geoblacklight/viewers/wms
2
+
3
+ GeoBlacklight.Viewer.Tms = GeoBlacklight.Viewer.Wms.extend({
4
+
5
+ addPreviewLayer: function() {
6
+ var _this = this;
7
+ var wmtsLayer = L.tileLayer(this.data.url);
8
+ this.overlay.addLayer(wmtsLayer);
9
+ }
10
+ });
@@ -3,7 +3,7 @@
3
3
  GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({
4
4
 
5
5
  load: function() {
6
- this.options.bbox = L.bboxToBounds(this.data.mapBbox);
6
+ this.options.bbox = L.geoJSONToBounds(this.data.mapGeom);
7
7
  this.map = L.map(this.element).fitBounds(this.options.bbox);
8
8
  this.map.addLayer(this.selectBasemap());
9
9
  this.map.addLayer(this.overlay);
@@ -23,7 +23,7 @@ GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({
23
23
  format: 'image/png',
24
24
  transparent: true,
25
25
  tiled: true,
26
- CRS: 'EPSG:900913',
26
+ CRS: 'EPSG:3857',
27
27
  opacity: this.options.opacity,
28
28
  detectRetina: _this.detectRetina()
29
29
  });
@@ -34,7 +34,7 @@ GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({
34
34
  setupInspection: function() {
35
35
  var _this = this;
36
36
  this.map.on('click', function(e) {
37
- spinner = '<tbody class="attribute-table-body"><tr><td colspan="2"><span id="attribute-table"><i class="fa fa-spinner fa-spin fa-align-center"></i></span></td></tr></tbody>';
37
+ spinner = '<tbody class="attribute-table-body"><tr><td colspan="2"><span id="attribute-table"><div class="spinner-border" role="status"><span class="sr-only">Inspecting</span></div></span></td></tr></tbody>';
38
38
  $('.attribute-table-body').replaceWith(spinner);
39
39
  var wmsoptions = {
40
40
  URL: _this.data.url,
@@ -0,0 +1,2 @@
1
+ @import 'leaflet';
2
+ @import 'modules/base';
@@ -0,0 +1,33 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ */
12
+
13
+ @import 'styles';
14
+ @import 'facets';
15
+ @import 'mixins';
16
+ @import 'icon-customization';
17
+ @import 'home';
18
+ @import 'index_maps';
19
+ @import 'item';
20
+ @import 'layer_opacity';
21
+ @import 'metadata';
22
+ @import 'metadata_content';
23
+ @import 'metadata_missing';
24
+ @import 'metadata_markup';
25
+ @import 'modal';
26
+ @import 'results';
27
+ @import 'geosearch';
28
+ @import 'search_widgets';
29
+ @import 'sidebar';
30
+ @import 'toolbar';
31
+ @import 'web_services';
32
+ @import 'blacklight_overrides';
33
+ @import 'downloads';
@@ -2,7 +2,7 @@
2
2
  Stylesheet for overriding styles inherited from Blacklight proper
3
3
  **/
4
4
 
5
- $logo-image: image_url('blacklight/logo.svg') !default
5
+ $logo-image: image_url('blacklight/logo.svg') !default;
6
6
 
7
7
  .navbar-logo { /* The main logo image for the Blacklight instance */
8
8
  @if $logo-image {
@@ -1,4 +1,5 @@
1
1
  #table-container{
2
2
  overflow:scroll;
3
+ margin-top: 20px;
3
4
  max-height: 450px;
4
5
  }
@@ -1,91 +1,74 @@
1
- %downloads-exports {
2
- .list-group-item {
3
- display: inline-block;
4
- width: 100%;
5
- }
6
- }
7
-
8
- %download-export-links {
9
- a {
10
- width: 100%;
11
- font-weight: 600;
12
- background-color: $link-color;
13
- color: #ffffff;
14
- border-color: darken($link-color, 6.5%);
15
- white-space: inherit;
16
- }
17
- }
1
+ // Common styling for the Downloads, Export, and Authentication cards
2
+ .downloads,
3
+ .card.exports,
4
+ .authentication {
5
+ @include sidebar-children;
18
6
 
19
- @mixin download-export {
20
- &-link {
21
- &-container {
22
- text-align: center;
23
- @extend %download-export-links;
7
+ .list-group {
8
+ &.list-group-nested .list-group-item:last-child {
9
+ padding-bottom: 0;
24
10
  }
25
- }
26
- }
27
11
 
28
- .downloads {
29
- @include sidebar-children;
30
- @extend %downloads-exports;
12
+ .list-group-item {
13
+ padding: 8px 20px;
31
14
 
32
- .download {
33
- @include download-export;
15
+ a {
16
+ @extend .btn-primary;
17
+ }
18
+ }
34
19
  }
35
20
  }
36
21
 
22
+ // This section could be eliminated if we update the Authentication card
23
+ // to follow the pattern of Dowloads and Exports (put the button in a
24
+ // list-group rather than the card header).
37
25
  .authentication {
38
- @include sidebar-children;
39
26
  .card-header {
40
27
  background-color: inherit;
41
28
  border-bottom: inherit;
42
29
 
43
- @extend %download-export-links;
30
+ a {
31
+ @extend .btn-primary;
32
+ }
44
33
  }
45
34
  }
46
35
 
47
- .exports {
48
- @include sidebar-children;
49
- @extend %downloads-exports;
50
-
36
+ // Specific to the Export card (mostly because of the current external
37
+ // label + button approach, which could be mostly eliminated by reworking
38
+ // as suggested in https://github.com/sul-dlss/earthworks/issues/646)
39
+ .card.exports {
51
40
  .card-header {
52
- .fa-spinner {
53
- float: right;
41
+ .spinner-border { // if this is used, it probably should go in the card body rather than the card header
42
+ position: absolute;
43
+ right: 1rem;
44
+ top: 1rem;
54
45
  }
55
46
  }
56
47
 
57
48
  .export {
58
- @include download-export;
59
-
60
- padding-left: 0px;
61
- padding-right: 0px;
62
49
  text-align: center;
63
- width: 100%;
64
50
 
65
51
  @include media-breakpoint-up(xl) {
66
52
  text-align: left;
67
53
  }
68
54
 
69
- &-label {
70
- padding: 6px 12px;
55
+ .export-label {
56
+ padding: 6px 6px 6px 0;
71
57
 
72
58
  @include media-breakpoint-up(xl) {
73
59
  display: inline-block;
74
60
  }
75
61
  }
76
62
 
77
- &-link {
78
- &-container {
63
+ .export-link-container {
64
+ @include media-breakpoint-up(xl) {
65
+ display: inline-block;
66
+ float: right;
67
+ }
79
68
 
69
+ a {
80
70
  @include media-breakpoint-up(xl) {
81
- display: inline-block;
82
- float: right;
83
- }
84
-
85
- a {
86
- @include media-breakpoint-up(xl) {
87
- width: inherit;
88
- }
71
+ width: inherit;
89
72
  }
90
73
  }
91
74
  }