openseadragon 0.7.0 → 0.9.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: 39aab662d767f7253ab361fd872a045e8052d5adf007e7daa0a3bd2cb02b9e31
4
- data.tar.gz: 2b64d32f2c80655ac8e54cc413bbcfae54ecab8f8ead082ff4572b249a9997d6
3
+ metadata.gz: 9e3da1588ba9032045fdd971139a7c1148b9018a0116105dcadb4b92ec71eb1b
4
+ data.tar.gz: 9c4540d29f7811b595351270a85147e542ece5d5a8a158d31660b524588520e2
5
5
  SHA512:
6
- metadata.gz: 864860428049aeb71b90f7c5f4b9f779c2861384ba26554acb23d2fbb26e70a42f59921e52b38c4de04f6be3561255ac6f8b3bf9b752f903ac7511c75c4a0a30
7
- data.tar.gz: e363a199c6c5dfe4fd23df36ba45a6cbb3c15d3aa31fff5d7d331c01f7866dc112afe02195fd02924d66560dc868b09c631a985e139165e8ef11ca0db207598a
6
+ metadata.gz: 66b8a096d5feac7919a9184c95aa27dcc212d37a544193ce446f1a9ec04987d07f7c2d2223d059fea7b76903259298b588de613787fe117f62e9ed65917a1659
7
+ data.tar.gz: 76346caa73ff55e6f0bea32ec54c11a0168a01c56ba5901b14089dcd76ad4b2c60fdc1fb00515679eccc9b8b0d3c3c1c1d81cced7c119d275cddad3641b4e6b9
@@ -2,12 +2,15 @@
2
2
 
3
3
  (function($) {
4
4
  function initOpenSeadragon() {
5
- $('picture[data-openseadragon]').openseadragon();
5
+ $('picture[data-openseadragon]:not(:has(.openseadragon-container))').openseadragon();
6
6
  }
7
7
 
8
8
  const jquery3 = parseInt($.fn.jquery.split('.')[0]) >= 3;
9
9
  let handler = 'ready';
10
- if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {
10
+
11
+ if (typeof Turbo !== 'undefined') {
12
+ handler = 'turbo:load turbo:frame-load';
13
+ } else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {
11
14
  // Turbolinks 5
12
15
  if (Turbolinks.BrowserAdapter) {
13
16
  handler = 'turbolinks:load';
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ pin_all_from File.expand_path('../app/assets/javascripts/openseadragon', __dir__), under: 'openseadragon'
4
+ pin_all_from File.expand_path('../vendor/assets/javascripts', __dir__)
@@ -5,6 +5,8 @@ module Openseadragon
5
5
  source_root File.expand_path('../templates', __FILE__)
6
6
 
7
7
  def assets
8
+ return unless defined?(Sprockets)
9
+
8
10
  copy_file "openseadragon.css", "app/assets/stylesheets/openseadragon.css"
9
11
  copy_file "openseadragon.js", "app/assets/javascripts/openseadragon.js"
10
12
 
@@ -13,6 +15,18 @@ module Openseadragon
13
15
  end
14
16
  end
15
17
 
18
+ def append_javascript
19
+ return unless defined?(Importmap) && !defined?(Sprockets)
20
+
21
+ append_to_file 'app/javascript/application.js' do
22
+ <<~CONTENT
23
+ // Openseadragon gem imports
24
+ import "openseadragon/jquery"
25
+ import "openseadragon/rails"
26
+ CONTENT
27
+ end
28
+ end
29
+
16
30
  def inject_helper
17
31
  inject_into_class 'app/controllers/application_controller.rb', ApplicationController do
18
32
  " helper Openseadragon::OpenseadragonHelper\n"
@@ -17,5 +17,9 @@ module Openseadragon
17
17
  initializer 'openseadragon.assets.precompile' do |app|
18
18
  app.config.assets.precompile += %w[openseadragon/*.png]
19
19
  end
20
+
21
+ initializer "openseadragon.importmap", before: "importmap" do |app|
22
+ app.config.importmap.paths << Engine.root.join("config/importmap.rb") if app.config.respond_to?(:importmap)
23
+ end
20
24
  end
21
25
  end
@@ -1,3 +1,3 @@
1
1
  module Openseadragon
2
- VERSION = "0.7.0"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openseadragon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-08-16 00:00:00.000000000 Z
13
+ date: 2024-12-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -135,6 +135,7 @@ files:
135
135
  - app/helpers/openseadragon/openseadragon_helper.rb
136
136
  - app/models/openseadragon/image.rb
137
137
  - app/models/openseadragon/open_street_map.rb
138
+ - config/importmap.rb
138
139
  - lib/generators/openseadragon/install_generator.rb
139
140
  - lib/generators/openseadragon/templates/openseadragon.css
140
141
  - lib/generators/openseadragon/templates/openseadragon.js
@@ -209,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
210
  - !ruby/object:Gem::Version
210
211
  version: '0'
211
212
  requirements: []
212
- rubygems_version: 3.5.15
213
+ rubygems_version: 3.5.23
213
214
  signing_key:
214
215
  specification_version: 4
215
216
  summary: OpenSeadragon assets and helpers for Rails. http://openseadragon.github.io/