openseadragon 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/openseadragon/openseadragon_helper.rb +58 -1
- data/lib/openseadragon/version.rb +1 -1
- data/spec/helpers/openseadragon_helper_spec.rb +20 -2
- data/vendor/assets/images/openseadragon/rotateleft_grouphover.png +0 -0
- data/vendor/assets/images/openseadragon/rotateleft_hover.png +0 -0
- data/vendor/assets/images/openseadragon/rotateleft_pressed.png +0 -0
- data/vendor/assets/images/openseadragon/rotateleft_rest.png +0 -0
- data/vendor/assets/images/openseadragon/rotateright_grouphover.png +0 -0
- data/vendor/assets/images/openseadragon/rotateright_hover.png +0 -0
- data/vendor/assets/images/openseadragon/rotateright_pressed.png +0 -0
- data/vendor/assets/images/openseadragon/rotateright_rest.png +0 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04bc58ab79202f2c92097e5319209470ea845627
|
4
|
+
data.tar.gz: 3f871fcb5a65843f8a150aa331e34d4082bc7088
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9572749a0dc443e3f083ce5b016e35343fd82e9ddd244dbe28eb8884190aca9208d5a8f66b42bcb757fdd64786baa3e5e22fa92597e2be9025faa1012b33964f
|
7
|
+
data.tar.gz: 43d9e8f330bae54958218cbcef115a26c8027f1667d8bd6a64453e7ab0388bcc0bc128932948f17bc3312f7a4cd999a28bb60dde7b43e6649e83033dac52e093
|
@@ -97,7 +97,7 @@ module Openseadragon
|
|
97
97
|
html_options.merge! src_options.fetch(:html, {})
|
98
98
|
html_options[:data] ||= {}
|
99
99
|
|
100
|
-
osd_options = html_options[:data][:openseadragon] || {}
|
100
|
+
osd_options = osd_asset_defaults.merge(html_options[:data][:openseadragon] || {})
|
101
101
|
osd_options.merge!(src_options.except(:html))
|
102
102
|
|
103
103
|
if src.respond_to? :to_tilesource
|
@@ -118,5 +118,62 @@ module Openseadragon
|
|
118
118
|
thing
|
119
119
|
end
|
120
120
|
end
|
121
|
+
|
122
|
+
def osd_asset_defaults
|
123
|
+
{
|
124
|
+
prefixUrl: '',
|
125
|
+
navImages: {
|
126
|
+
zoomIn: {
|
127
|
+
REST: image_path('openseadragon/zoomin_rest.png'),
|
128
|
+
GROUP: image_path('openseadragon/zoomin_grouphover.png'),
|
129
|
+
HOVER: image_path('openseadragon/zoomin_hover.png'),
|
130
|
+
DOWN: image_path('openseadragon/zoomin_pressed.png')
|
131
|
+
},
|
132
|
+
zoomOut: {
|
133
|
+
REST: image_path('openseadragon/zoomout_rest.png'),
|
134
|
+
GROUP: image_path('openseadragon/zoomout_grouphover.png'),
|
135
|
+
HOVER: image_path('openseadragon/zoomout_hover.png'),
|
136
|
+
DOWN: image_path('openseadragon/zoomout_pressed.png')
|
137
|
+
},
|
138
|
+
home: {
|
139
|
+
REST: image_path('openseadragon/home_rest.png'),
|
140
|
+
GROUP: image_path('openseadragon/home_grouphover.png'),
|
141
|
+
HOVER: image_path('openseadragon/home_hover.png'),
|
142
|
+
DOWN: image_path('openseadragon/home_pressed.png')
|
143
|
+
},
|
144
|
+
fullpage: {
|
145
|
+
REST: image_path('openseadragon/fullpage_rest.png'),
|
146
|
+
GROUP: image_path('openseadragon/fullpage_grouphover.png'),
|
147
|
+
HOVER: image_path('openseadragon/fullpage_hover.png'),
|
148
|
+
DOWN: image_path('openseadragon/fullpage_pressed.png')
|
149
|
+
},
|
150
|
+
rotateleft: {
|
151
|
+
REST: image_path('openseadragon/rotateleft_rest.png'),
|
152
|
+
GROUP: image_path('openseadragon/rotateleft_grouphover.png'),
|
153
|
+
HOVER: image_path('openseadragon/rotateleft_hover.png'),
|
154
|
+
DOWN: image_path('openseadragon/rotateleft_pressed.png')
|
155
|
+
},
|
156
|
+
rotateright: {
|
157
|
+
REST: image_path('openseadragon/rotateright_rest.png'),
|
158
|
+
GROUP: image_path('openseadragon/rotateright_grouphover.png'),
|
159
|
+
HOVER: image_path('openseadragon/rotateright_hover.png'),
|
160
|
+
DOWN: image_path('openseadragon/rotateright_pressed.png')
|
161
|
+
},
|
162
|
+
previous: {
|
163
|
+
REST: image_path('openseadragon/previous_rest.png'),
|
164
|
+
GROUP: image_path('openseadragon/previous_grouphover.png'),
|
165
|
+
HOVER: image_path('openseadragon/previous_hover.png'),
|
166
|
+
DOWN: image_path('openseadragon/previous_pressed.png')
|
167
|
+
},
|
168
|
+
next: {
|
169
|
+
REST: image_path('openseadragon/next_rest.png'),
|
170
|
+
GROUP: image_path('openseadragon/next_grouphover.png'),
|
171
|
+
HOVER: image_path('openseadragon/next_hover.png'),
|
172
|
+
DOWN: image_path('openseadragon/next_pressed.png')
|
173
|
+
}
|
174
|
+
}
|
175
|
+
}.with_indifferent_access
|
176
|
+
end
|
177
|
+
|
121
178
|
end
|
122
179
|
end
|
@@ -64,6 +64,8 @@ describe Openseadragon::OpenseadragonHelper do
|
|
64
64
|
end
|
65
65
|
|
66
66
|
context "with a source given as a hash" do
|
67
|
+
before { allow(helper).to receive(:osd_asset_defaults).and_return({b: 6}) }
|
68
|
+
|
67
69
|
it "should extract html options" do
|
68
70
|
response = helper.openseadragon_picture_tag(['image1.jpg' => { html: { id: 'xyz' }}])
|
69
71
|
expect(response).to have_selector 'picture source[src="image1.jpg"][id="xyz"]'
|
@@ -73,7 +75,7 @@ describe Openseadragon::OpenseadragonHelper do
|
|
73
75
|
response = helper.openseadragon_picture_tag(['image1.jpg' => { a: 1}])
|
74
76
|
expect(response).to have_selector 'picture source[src="image1.jpg"]'
|
75
77
|
expect(response).to have_selector 'picture source[src="image1.jpg"][data-openseadragon]'
|
76
|
-
expect(response).to match /data-openseadragon="#{helper.escape_once({a: 1}.to_json)}"/
|
78
|
+
expect(response).to match /data-openseadragon="#{helper.escape_once({b: 6, a: 1}.to_json)}"/
|
77
79
|
end
|
78
80
|
|
79
81
|
it "should merge a tilesource key with the options provided" do
|
@@ -81,8 +83,24 @@ describe Openseadragon::OpenseadragonHelper do
|
|
81
83
|
response = helper.openseadragon_picture_tag([source => { html: { id: 'xyz' }, b: 2, c: 3}])
|
82
84
|
expect(response).to have_selector 'picture source[src="openseadragon-tilesource"]'
|
83
85
|
expect(response).to have_selector 'picture source[src="openseadragon-tilesource"][id="xyz"]'
|
84
|
-
expect(response).to match /data-openseadragon="#{helper.escape_once({b: 2, c: 3, a: 1
|
86
|
+
expect(response).to match /data-openseadragon="#{helper.escape_once({b: 2, c: 3, a: 1}.to_json)}"/
|
85
87
|
end
|
86
88
|
end
|
89
|
+
|
90
|
+
describe "#osd_asset_defaults" do
|
91
|
+
subject { helper.send(:osd_asset_defaults) }
|
92
|
+
its(['prefixUrl']) { should eq ''}
|
93
|
+
its(['navImages']) { should eq(
|
94
|
+
"zoomIn"=>{"REST"=>"/assets/openseadragon/zoomin_rest.png", "GROUP"=>"/assets/openseadragon/zoomin_grouphover.png", "HOVER"=>"/assets/openseadragon/zoomin_hover.png", "DOWN"=>"/assets/openseadragon/zoomin_pressed.png"},
|
95
|
+
"zoomOut"=>{"REST"=>"/assets/openseadragon/zoomout_rest.png", "GROUP"=>"/assets/openseadragon/zoomout_grouphover.png", "HOVER"=>"/assets/openseadragon/zoomout_hover.png", "DOWN"=>"/assets/openseadragon/zoomout_pressed.png"},
|
96
|
+
"home"=>{"REST"=>"/assets/openseadragon/home_rest.png", "GROUP"=>"/assets/openseadragon/home_grouphover.png", "HOVER"=>"/assets/openseadragon/home_hover.png", "DOWN"=>"/assets/openseadragon/home_pressed.png"},
|
97
|
+
"fullpage"=>{"REST"=>"/assets/openseadragon/fullpage_rest.png", "GROUP"=>"/assets/openseadragon/fullpage_grouphover.png", "HOVER"=>"/assets/openseadragon/fullpage_hover.png", "DOWN"=>"/assets/openseadragon/fullpage_pressed.png"},
|
98
|
+
"rotateleft"=>{"REST"=>"/assets/openseadragon/rotateleft_rest.png", "GROUP"=>"/assets/openseadragon/rotateleft_grouphover.png", "HOVER"=>"/assets/openseadragon/rotateleft_hover.png", "DOWN"=>"/assets/openseadragon/rotateleft_pressed.png"},
|
99
|
+
"rotateright"=>{"REST"=>"/assets/openseadragon/rotateright_rest.png", "GROUP"=>"/assets/openseadragon/rotateright_grouphover.png", "HOVER"=>"/assets/openseadragon/rotateright_hover.png", "DOWN"=>"/assets/openseadragon/rotateright_pressed.png"},
|
100
|
+
"previous"=>{"REST"=>"/assets/openseadragon/previous_rest.png", "GROUP"=>"/assets/openseadragon/previous_grouphover.png", "HOVER"=>"/assets/openseadragon/previous_hover.png", "DOWN"=>"/assets/openseadragon/previous_pressed.png"},
|
101
|
+
"next"=>{"REST"=>"/assets/openseadragon/next_rest.png", "GROUP"=>"/assets/openseadragon/next_grouphover.png", "HOVER"=>"/assets/openseadragon/next_hover.png", "DOWN"=>"/assets/openseadragon/next_pressed.png"}
|
102
|
+
)}
|
103
|
+
|
104
|
+
end
|
87
105
|
end
|
88
106
|
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
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.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -151,6 +151,14 @@ files:
|
|
151
151
|
- vendor/assets/images/openseadragon/previous_hover.png
|
152
152
|
- vendor/assets/images/openseadragon/previous_pressed.png
|
153
153
|
- vendor/assets/images/openseadragon/previous_rest.png
|
154
|
+
- vendor/assets/images/openseadragon/rotateleft_grouphover.png
|
155
|
+
- vendor/assets/images/openseadragon/rotateleft_hover.png
|
156
|
+
- vendor/assets/images/openseadragon/rotateleft_pressed.png
|
157
|
+
- vendor/assets/images/openseadragon/rotateleft_rest.png
|
158
|
+
- vendor/assets/images/openseadragon/rotateright_grouphover.png
|
159
|
+
- vendor/assets/images/openseadragon/rotateright_hover.png
|
160
|
+
- vendor/assets/images/openseadragon/rotateright_pressed.png
|
161
|
+
- vendor/assets/images/openseadragon/rotateright_rest.png
|
154
162
|
- vendor/assets/images/openseadragon/zoomin_grouphover.png
|
155
163
|
- vendor/assets/images/openseadragon/zoomin_hover.png
|
156
164
|
- vendor/assets/images/openseadragon/zoomin_pressed.png
|