openseadragon 0.7.0 → 0.9.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e3da1588ba9032045fdd971139a7c1148b9018a0116105dcadb4b92ec71eb1b
|
4
|
+
data.tar.gz: 9c4540d29f7811b595351270a85147e542ece5d5a8a158d31660b524588520e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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';
|
data/config/importmap.rb
ADDED
@@ -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"
|
data/lib/openseadragon/engine.rb
CHANGED
@@ -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
|
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.
|
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-
|
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.
|
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/
|