blacklight-gallery 3.5.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6cef93b47ca74eb2e2cf9083baafce7e28948cc568b1146dd30f98a842720f6
4
- data.tar.gz: 890631e78d834ac011666bb1b652ef97f9948b12352a4085c421b4e6f7aec6f7
3
+ metadata.gz: 3920e96baf118137203d9e67fafc19564991399b4cf2082d8fc0409e0095982a
4
+ data.tar.gz: 7435e227a144f08d25b1748f1a1d3eddf9ef958e7b25a5e8460fd1e6a8a98c64
5
5
  SHA512:
6
- metadata.gz: 79942d8ad4a805a6020fc30e96e26fc392ea38b51dbab5868379a2744fd6ee798fd1b75f9c71f744678456deb165e3510e31820ff24f5c2eb7e21c9343be3c7f
7
- data.tar.gz: 136ddeb750ddafe01d690265d734e9a183ffefebd896a024e893ae4fd8ab41762c5558fc72a4a88a7198358be9bc5594c69fc3de84304e7f1d2677148ecc64d0
6
+ metadata.gz: 9f19253bc16e2ed53b6d5b1d6a96f9df64cc0708cc0197b01b3031a877a0bf89427212036450c6d0acaecf4b647f8b79c3f09cbe9ddfbd43f5463be93dd478b5
7
+ data.tar.gz: 94d41d45a7e516a84634607d891580bd8dc66f2347f4604633643bd94df3a80f6695224b5559f5a4bc974a32b78c9464da361870351c5b44525eb2fe3dbf0884
@@ -11,26 +11,15 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- rails_version: [6.1.1]
15
- ruby: [2.7, '3.0']
16
- env:
17
- RAILS_VERSION: ${{ matrix.rails_version }}
18
- steps:
19
- - uses: actions/checkout@v2
20
- - name: Set up Ruby ${{ matrix.ruby }}
21
- uses: ruby/setup-ruby@v1
22
- with:
23
- ruby-version: ${{ matrix.ruby }}
24
- - name: Install dependencies with Rails ${{ matrix.rails_version }}
25
- run: bundle install
26
- - name: Run tests
27
- run: bundle exec rake
28
- test_rails52:
29
- runs-on: ubuntu-latest
30
- strategy:
31
- matrix:
32
- rails_version: [5.2.4.4, 6.0.3.4]
33
- ruby: [2.7]
14
+ rails_version: [6.1.4.6]
15
+ ruby: ['2.7', '3.0']
16
+ include:
17
+ - rails_version: 7.0.2.2
18
+ ruby: '3.0'
19
+ - rails_version: 5.2.4.4
20
+ ruby: '2.7'
21
+ - rails_version: 6.0.3.4
22
+ ruby: '2.7'
34
23
  env:
35
24
  RAILS_VERSION: ${{ matrix.rails_version }}
36
25
  steps:
@@ -2,9 +2,7 @@
2
2
  .document {
3
3
  border-bottom: none;
4
4
  display: flex;
5
-
6
5
  min-height: 250px;
7
- -webkit-flex: 1 0 250px;
8
6
  }
9
7
 
10
8
  .caption {
@@ -1,7 +1,24 @@
1
1
  module Blacklight
2
2
  module OpenseadragonHelper
3
+ # Somewhat arbitrary number; the only important thing is that
4
+ # it is bigger than the number of embedded viewers on a page
5
+ ID_COUNTER_MAX = (2**20) - 1
6
+
7
+ # Mint a (sufficiently) unique identifier, so we can associate
8
+ # the expand/collapse control with labels
9
+ def self.mint_id
10
+ @id_counter = ((@id_counter || 0) + 1) % ID_COUNTER_MAX
11
+
12
+ # We convert the ID to hex for markup compactness
13
+ @id_counter.to_s(16)
14
+ end
15
+
3
16
  def osd_container_class
4
17
  "col-md-6"
5
18
  end
19
+
20
+ def osd_html_id_prefix
21
+ "osd-#{Blacklight::OpenseadragonHelper.mint_id}".to_param
22
+ end
6
23
  end
7
- end
24
+ end
@@ -1,13 +1,16 @@
1
- <% image = document.to_openseadragon(blacklight_config.view_config(:show)) %>
1
+ <%
2
+ image = document.to_openseadragon(blacklight_config.view_config(:show))
3
+ id_prefix = osd_html_id_prefix
4
+ %>
2
5
  <%
3
6
  osd_config = {
4
7
  crossOriginPolicy: false,
5
- zoomInButton: "osd-zoom-in",
6
- zoomOutButton: "osd-zoom-out",
7
- homeButton: "osd-home",
8
- fullPageButton: "osd-full-page",
9
- nextButton: "osd-next",
10
- previousButton: "osd-previous"
8
+ zoomInButton: "#{id_prefix}-zoom-in",
9
+ zoomOutButton: "#{id_prefix}-zoom-out",
10
+ homeButton: "#{id_prefix}-home",
11
+ fullPageButton: "#{id_prefix}-full-page",
12
+ nextButton: "#{id_prefix}-next",
13
+ previousButton: "#{id_prefix}-previous"
11
14
  }
12
15
 
13
16
  osd_config_referencestrip = {
@@ -26,16 +29,16 @@
26
29
  <div class="col-md-6 pagination">
27
30
  <% if count > 1 %>
28
31
  <% osd_config = osd_config_referencestrip.merge(osd_config) %>
29
- <a id="osd-previous"><%= blacklight_icon('chevron_left') %></a>
30
- <span id="osd-page">1</span> of <%= count %>
31
- <a id="osd-next"><%= blacklight_icon('chevron_right') %></a>
32
+ <a id="<%= id_prefix %>-previous"><%= blacklight_icon('chevron_left') %></a>
33
+ <span id="<%= id_prefix %>-page">1</span> of <%= count %>
34
+ <a id="<%= id_prefix %>-next"><%= blacklight_icon('chevron_right') %></a>
32
35
  <% end %>
33
36
  </div>
34
37
  <div class="col-md-6 controls">
35
- <a id="osd-zoom-in"><%= blacklight_icon('add_circle') %></a>
36
- <a id="osd-zoom-out"><%= blacklight_icon('remove_circle') %></a>
37
- <a id="osd-home"><%= blacklight_icon('resize_small') %></a>
38
- <a id="osd-full-page"><%= blacklight_icon('custom_fullscreen') %></a>
38
+ <a id="<%= id_prefix %>-zoom-in"><%= blacklight_icon('add_circle') %></a>
39
+ <a id="<%= id_prefix %>-zoom-out"><%= blacklight_icon('remove_circle') %></a>
40
+ <a id="<%= id_prefix %>-home"><%= blacklight_icon('resize_small') %></a>
41
+ <a id="<%= id_prefix %>-full-page"><%= blacklight_icon('custom_fullscreen') %></a>
39
42
  </div>
40
43
  </div>
41
44
  <%= openseadragon_picture_tag image, class: 'osd-image row', data: { openseadragon: osd_config } %>
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "rails", '>= 5.1', '< 7'
20
+ spec.add_dependency "rails", '>= 5.1', '< 8'
21
21
  spec.add_dependency 'blacklight', '~> 7.17'
22
22
 
23
23
  spec.add_development_dependency "rake"
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Gallery
3
- VERSION = "3.5.0"
3
+ VERSION = "4.0.0"
4
4
  end
5
5
  end
@@ -16,10 +16,9 @@ module BlacklightGallery
16
16
 
17
17
  def configuration
18
18
  inject_into_file 'app/controllers/catalog_controller.rb', after: "configure_blacklight do |config|" do
19
- "\n config.view.gallery.document_component = Blacklight::Gallery::DocumentComponent" \
20
- "\n # config.view.gallery.classes = 'row-cols-2 row-cols-md-3'" \
21
- "\n config.view.masonry.document_component = Blacklight::Gallery::DocumentComponent" \
22
- "\n config.view.slideshow.document_component = Blacklight::Gallery::SlideshowComponent" \
19
+ "\n config.view.gallery(document_component: Blacklight::Gallery::DocumentComponent)" \
20
+ "\n config.view.masonry(document_component: Blacklight::Gallery::DocumentComponent)" \
21
+ "\n config.view.slideshow(document_component: Blacklight::Gallery::SlideshowComponent)" \
23
22
  "\n config.show.tile_source_field = :content_metadata_image_iiif_info_ssm" \
24
23
  "\n config.show.partials.insert(1, :openseadragon)"
25
24
  end
@@ -1 +0,0 @@
1
- gem 'sprockets', '< 4'
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "catalog/_document_slideshow.html.erb", :type => :view do
3
+ describe "catalog/_document_slideshow", :type => :view do
4
4
  let(:blacklight_config) do
5
5
  Blacklight::Configuration.new do |config|
6
6
  config.track_search_session = false
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe "catalog/openseadragon_default" do
4
4
  let(:document) { SolrDocument.new }
5
5
  let(:blacklight_config) { Blacklight::Configuration.new }
6
- let(:p) { "catalog/openseadragon_default.html.erb" }
6
+ let(:p) { "catalog/openseadragon_default" }
7
7
 
8
8
  before do
9
9
  allow(view).to receive_messages(blacklight_config: blacklight_config, openseadragon_picture_tag: "<img />")
@@ -14,9 +14,9 @@ describe "catalog/openseadragon_default" do
14
14
  render partial: p, locals: { document: document }
15
15
  expect(rendered).to have_selector ".openseadragon-container"
16
16
  end
17
-
17
+
18
18
  it "should support passing a container class" do
19
19
  render partial: p, locals: { document: document, osd_container_class: "custom-container" }
20
20
  expect(rendered).to have_selector ".custom-container"
21
21
  end
22
- end
22
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-gallery
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-22 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7'
22
+ version: '8'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7'
32
+ version: '8'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: blacklight
35
35
  requirement: !ruby/object:Gem::Requirement