blueimp-gallery 2.9.0.0 → 2.11.0.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -2
- data/lib/blueimp/gallery/version.rb +1 -1
- data/test/assets_test.rb +4 -0
- data/vendor/assets/javascripts/blueimp-gallery-all.js +2 -0
- data/vendor/assets/javascripts/blueimp-gallery-video.js +13 -12
- data/vendor/assets/javascripts/blueimp-gallery.js +51 -20
- data/vendor/assets/javascripts/blueimp-helper.js +5 -1
- data/vendor/assets/stylesheets/blueimp-gallery-video.css +17 -7
- data/vendor/assets/stylesheets/blueimp-gallery.css +8 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 108096f2fa0a84c05e3aed5ffb6443783698de31
|
4
|
+
data.tar.gz: 50e68b212131571919aaa185d129627aa8979a30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e465a5f66e0db645ede88b5ac92a4a7abdad303ab7ddaaf422cfc51f84a7775c23e58068da1e55828578b7d534c821806b5045ccad89b41e59dbefb8dfe2c4d
|
7
|
+
data.tar.gz: 12a0d568227fb11fdf9bd579c7160508ca87161fb8d78fdb1fcd86a76228248418449beddcff0f273041c82603b84fa66b6d9991dd4b3463fdce2ef7ee97957a
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,6 @@ blueimp Gallery is an image and video gallery featuring carousel and lightbox ga
|
|
5
5
|
[](http://badge.fury.io/rb/blueimp-gallery)
|
6
6
|
[](https://travis-ci.org/Phifo/blueimp-gallery)
|
7
7
|
|
8
|
-
* blueimp Gallery version 2.7.3
|
9
8
|
* Official Website: http://blueimp.github.io/Gallery/
|
10
9
|
|
11
10
|
|
@@ -151,7 +150,7 @@ blueimp.Gallery document.getElementById("links").getElementsByTagName("a"),
|
|
151
150
|
|
152
151
|
## More Features
|
153
152
|
|
154
|
-
blueimp Gallery has a lot more features and options as adding control keys, fullscreen, slide interval, etc. The complete documentation is on the [blueimp Gallery site](https://github.com/blueimp/Gallery).
|
153
|
+
blueimp Gallery has a lot more features and options as adding control keys, fullscreen, slide interval, video support (youtube and vimeo) etc. The complete documentation is on the [blueimp Gallery site](https://github.com/blueimp/Gallery).
|
155
154
|
|
156
155
|
## Contributing
|
157
156
|
|
data/test/assets_test.rb
CHANGED
@@ -20,6 +20,10 @@ class AssetsTest < ActionDispatch::IntegrationTest
|
|
20
20
|
assert_response :success
|
21
21
|
get 'assets/jquery.blueimp-gallery.js'
|
22
22
|
assert_response :success
|
23
|
+
get 'assets/blueimp-gallery-youtube.js'
|
24
|
+
assert_response :success
|
25
|
+
get 'assets/blueimp-gallery-vimeo.js'
|
26
|
+
assert_response :success
|
23
27
|
end
|
24
28
|
|
25
29
|
test 'has stylesheets assets' do
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* blueimp Gallery Video Factory JS 1.
|
2
|
+
* blueimp Gallery Video Factory JS 1.1.0
|
3
3
|
* https://github.com/blueimp/Gallery
|
4
4
|
*
|
5
5
|
* Copyright 2013, Sebastian Tschan
|
@@ -42,7 +42,7 @@
|
|
42
42
|
videoSourcesProperty: 'sources'
|
43
43
|
});
|
44
44
|
|
45
|
-
Gallery.prototype.videoFactory = function (obj, callback) {
|
45
|
+
Gallery.prototype.videoFactory = function (obj, callback, videoInterface) {
|
46
46
|
var that = this,
|
47
47
|
options = this.options,
|
48
48
|
videoContainerNode = this.elementPrototype.cloneNode(false),
|
@@ -51,7 +51,7 @@
|
|
51
51
|
type: 'error',
|
52
52
|
target: videoContainerNode
|
53
53
|
}],
|
54
|
-
video = document.createElement('video'),
|
54
|
+
video = videoInterface || document.createElement('video'),
|
55
55
|
url = this.getItemProperty(obj, options.urlProperty),
|
56
56
|
type = this.getItemProperty(obj, options.typeProperty),
|
57
57
|
title = this.getItemProperty(obj, options.titleProperty),
|
@@ -72,10 +72,7 @@
|
|
72
72
|
if (video.canPlayType) {
|
73
73
|
if (url && type && video.canPlayType(type)) {
|
74
74
|
video.src = url;
|
75
|
-
} else
|
76
|
-
if (typeof sources === 'string') {
|
77
|
-
sources = $.parseJSON(sources);
|
78
|
-
}
|
75
|
+
} else {
|
79
76
|
while (sources && sources.length) {
|
80
77
|
source = sources.shift();
|
81
78
|
url = this.getItemProperty(source, options.urlProperty);
|
@@ -88,7 +85,7 @@
|
|
88
85
|
}
|
89
86
|
}
|
90
87
|
if (posterUrl) {
|
91
|
-
video.
|
88
|
+
video.poster = posterUrl;
|
92
89
|
posterImage = this.imagePrototype.cloneNode(false);
|
93
90
|
$(posterImage).addClass(options.toggleClass);
|
94
91
|
posterImage.src = posterUrl;
|
@@ -97,11 +94,13 @@
|
|
97
94
|
}
|
98
95
|
playMediaControl = document.createElement('a');
|
99
96
|
playMediaControl.setAttribute('target', '_blank');
|
100
|
-
|
97
|
+
if (!videoInterface) {
|
98
|
+
playMediaControl.setAttribute('download', title);
|
99
|
+
}
|
101
100
|
playMediaControl.href = url;
|
102
101
|
if (video.src) {
|
103
102
|
video.controls = true;
|
104
|
-
$(video)
|
103
|
+
(videoInterface || $(video))
|
105
104
|
.on('error', function () {
|
106
105
|
that.setTimeout(callback, errorArgs);
|
107
106
|
})
|
@@ -135,14 +134,16 @@
|
|
135
134
|
videoContainer.addClass(that.options.videoLoadingClass);
|
136
135
|
});
|
137
136
|
$(playMediaControl).on('click', function (event) {
|
138
|
-
|
137
|
+
that.preventDefault(event);
|
139
138
|
if (isLoading) {
|
140
139
|
video.pause();
|
141
140
|
} else {
|
142
141
|
video.play();
|
143
142
|
}
|
144
143
|
});
|
145
|
-
videoContainerNode.appendChild(
|
144
|
+
videoContainerNode.appendChild(
|
145
|
+
(videoInterface && videoInterface.element) || video
|
146
|
+
);
|
146
147
|
}
|
147
148
|
videoContainerNode.appendChild(playMediaControl);
|
148
149
|
this.setTimeout(callback, [{
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* blueimp Gallery JS 2.
|
2
|
+
* blueimp Gallery JS 2.11.0
|
3
3
|
* https://github.com/blueimp/Gallery
|
4
4
|
*
|
5
5
|
* Copyright 2013, Sebastian Tschan
|
@@ -99,7 +99,9 @@
|
|
99
99
|
clearSlides: true,
|
100
100
|
// Defines if images should be stretched to fill the available space,
|
101
101
|
// while maintaining their aspect ratio (will only be enabled for browsers
|
102
|
-
// supporting background-size="contain", which excludes IE < 9)
|
102
|
+
// supporting background-size="contain", which excludes IE < 9).
|
103
|
+
// Set to "cover", to make images cover all available space (requires
|
104
|
+
// support for background-size="cover", which excludes IE < 9):
|
103
105
|
stretchImages: false,
|
104
106
|
// Toggle the controls on pressing the Return key:
|
105
107
|
toggleControlsOnReturn: true,
|
@@ -228,11 +230,15 @@
|
|
228
230
|
}
|
229
231
|
}
|
230
232
|
if (element.style.backgroundSize !== undefined) {
|
233
|
+
support.backgroundSize = {};
|
231
234
|
element.style.backgroundSize = 'contain';
|
232
|
-
support.backgroundSize =
|
233
|
-
|
234
|
-
.getPropertyValue('background-size') === 'contain'
|
235
|
-
|
235
|
+
support.backgroundSize.contain = window
|
236
|
+
.getComputedStyle(element)
|
237
|
+
.getPropertyValue('background-size') === 'contain';
|
238
|
+
element.style.backgroundSize = 'cover';
|
239
|
+
support.backgroundSize.cover = window
|
240
|
+
.getComputedStyle(element)
|
241
|
+
.getPropertyValue('background-size') === 'cover';
|
236
242
|
}
|
237
243
|
document.body.removeChild(element);
|
238
244
|
};
|
@@ -509,11 +515,12 @@
|
|
509
515
|
},
|
510
516
|
|
511
517
|
onmousedown: function (event) {
|
512
|
-
// Trigger on clicks of the left mouse button only
|
513
|
-
|
518
|
+
// Trigger on clicks of the left mouse button only
|
519
|
+
// and exclude video elements:
|
520
|
+
if (event.which && event.which === 1 &&
|
521
|
+
event.target.nodeName !== 'VIDEO') {
|
514
522
|
// Preventing the default mousedown action is required
|
515
523
|
// to make touch emulation work with Firefox:
|
516
|
-
event.preventDefault();
|
517
524
|
(event.originalEvent || event).touches = [{
|
518
525
|
pageX: event.pageX,
|
519
526
|
pageY: event.pageY
|
@@ -889,9 +896,7 @@
|
|
889
896
|
var that = this,
|
890
897
|
img = this.imagePrototype.cloneNode(false),
|
891
898
|
url = obj,
|
892
|
-
|
893
|
-
this.support.backgroundSize &&
|
894
|
-
this.support.backgroundSize.contain,
|
899
|
+
backgroundSize = this.options.stretchImages,
|
895
900
|
called,
|
896
901
|
element,
|
897
902
|
callbackWrapper = function (event) {
|
@@ -908,11 +913,11 @@
|
|
908
913
|
}
|
909
914
|
called = true;
|
910
915
|
$(img).off('load error', callbackWrapper);
|
911
|
-
if (
|
916
|
+
if (backgroundSize) {
|
912
917
|
if (event.type === 'load') {
|
913
918
|
element.style.background = 'url("' + url +
|
914
919
|
'") center no-repeat';
|
915
|
-
element.style.backgroundSize =
|
920
|
+
element.style.backgroundSize = backgroundSize;
|
916
921
|
}
|
917
922
|
}
|
918
923
|
callback(event);
|
@@ -923,7 +928,12 @@
|
|
923
928
|
url = this.getItemProperty(obj, this.options.urlProperty);
|
924
929
|
title = this.getItemProperty(obj, this.options.titleProperty);
|
925
930
|
}
|
926
|
-
if (
|
931
|
+
if (backgroundSize === true) {
|
932
|
+
backgroundSize = 'contain';
|
933
|
+
}
|
934
|
+
backgroundSize = this.support.backgroundSize &&
|
935
|
+
this.support.backgroundSize[backgroundSize] && backgroundSize;
|
936
|
+
if (backgroundSize) {
|
927
937
|
element = this.elementPrototype.cloneNode(false);
|
928
938
|
} else {
|
929
939
|
element = img;
|
@@ -1096,10 +1106,31 @@
|
|
1096
1106
|
return obj;
|
1097
1107
|
},
|
1098
1108
|
|
1109
|
+
getDataProperty: function (obj, property) {
|
1110
|
+
if (obj.getAttribute) {
|
1111
|
+
var prop = obj.getAttribute('data-' +
|
1112
|
+
property.replace(/([A-Z])/g, '-$1').toLowerCase());
|
1113
|
+
if (typeof prop === 'string') {
|
1114
|
+
if (/^(true|false|null|-?\d+(\.\d+)?|\{[\s\S]*\}|\[[\s\S]*\])$/
|
1115
|
+
.test(prop)) {
|
1116
|
+
try {
|
1117
|
+
return $.parseJSON(prop);
|
1118
|
+
} catch (ignore) {}
|
1119
|
+
}
|
1120
|
+
return prop;
|
1121
|
+
}
|
1122
|
+
}
|
1123
|
+
},
|
1124
|
+
|
1099
1125
|
getItemProperty: function (obj, property) {
|
1100
|
-
|
1101
|
-
|
1102
|
-
this.
|
1126
|
+
var prop = obj[property];
|
1127
|
+
if (prop === undefined) {
|
1128
|
+
prop = this.getDataProperty(obj, property);
|
1129
|
+
if (prop === undefined) {
|
1130
|
+
prop = this.getNestedProperty(obj, property);
|
1131
|
+
}
|
1132
|
+
}
|
1133
|
+
return prop;
|
1103
1134
|
},
|
1104
1135
|
|
1105
1136
|
initStartIndex: function () {
|
@@ -1195,13 +1226,13 @@
|
|
1195
1226
|
}
|
1196
1227
|
this.slidesContainer = this.container.find(
|
1197
1228
|
this.options.slidesContainer
|
1198
|
-
);
|
1229
|
+
).first();
|
1199
1230
|
if (!this.slidesContainer.length) {
|
1200
1231
|
return false;
|
1201
1232
|
}
|
1202
1233
|
this.titleElement = this.container.find(
|
1203
1234
|
this.options.titleElement
|
1204
|
-
);
|
1235
|
+
).first();
|
1205
1236
|
if (this.num === 1) {
|
1206
1237
|
this.container.addClass(this.options.singleClass);
|
1207
1238
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* blueimp helper JS 1.
|
2
|
+
* blueimp helper JS 1.2.0
|
3
3
|
* https://github.com/blueimp/Gallery
|
4
4
|
*
|
5
5
|
* Copyright 2013, Sebastian Tschan
|
@@ -172,6 +172,10 @@
|
|
172
172
|
}
|
173
173
|
}
|
174
174
|
return this;
|
175
|
+
},
|
176
|
+
|
177
|
+
first: function () {
|
178
|
+
return new Helper(this[0]);
|
175
179
|
}
|
176
180
|
|
177
181
|
});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
@charset 'UTF-8';
|
2
2
|
/*
|
3
|
-
* blueimp Gallery Video Factory CSS 1.
|
3
|
+
* blueimp Gallery Video Factory CSS 1.1.1
|
4
4
|
* https://github.com/blueimp/Gallery
|
5
5
|
*
|
6
6
|
* Copyright 2013, Sebastian Tschan
|
@@ -17,15 +17,25 @@
|
|
17
17
|
right: 0;
|
18
18
|
bottom: 0;
|
19
19
|
left: 0;
|
20
|
-
/* Prevent artifacts in Mozilla Firefox: */
|
21
|
-
-moz-backface-visibility: hidden;
|
22
|
-
}
|
23
|
-
.blueimp-gallery > .slides > .slide > .video-content > video,
|
24
|
-
.blueimp-gallery > .slides > .slide > .video-content > img {
|
25
20
|
margin: auto;
|
21
|
+
width: auto;
|
22
|
+
height: auto;
|
26
23
|
max-width: 100%;
|
27
24
|
max-height: 100%;
|
28
25
|
opacity: 1;
|
26
|
+
/* Prevent artifacts in Mozilla Firefox: */
|
27
|
+
-moz-backface-visibility: hidden;
|
28
|
+
}
|
29
|
+
.blueimp-gallery > .slides > .slide > .video-content > iframe {
|
30
|
+
width: 100%;
|
31
|
+
height: 100%;
|
32
|
+
border: none;
|
33
|
+
position: absolute;
|
34
|
+
top: 100%;
|
35
|
+
left: 0;
|
36
|
+
}
|
37
|
+
.blueimp-gallery > .slides > .slide > .video-playing > iframe {
|
38
|
+
top: 0;
|
29
39
|
}
|
30
40
|
.blueimp-gallery > .slides > .slide > .video-content > a {
|
31
41
|
position: absolute;
|
@@ -55,7 +65,7 @@
|
|
55
65
|
}
|
56
66
|
|
57
67
|
/* Replace PNGs with SVGs for capable browsers (excluding IE<9) */
|
58
|
-
body:last-child .blueimp-gallery > .slides > .slide > .video-content > a {
|
68
|
+
body:last-child .blueimp-gallery > .slides > .slide > .video-content:not(.video-loading) > a {
|
59
69
|
background-image: url("video-play.svg");
|
60
70
|
}
|
61
71
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
@charset 'UTF-8';
|
2
2
|
/*
|
3
|
-
* blueimp Gallery CSS 2.
|
3
|
+
* blueimp Gallery CSS 2.10.0
|
4
4
|
* https://github.com/blueimp/Gallery
|
5
5
|
*
|
6
6
|
* Copyright 2013, Sebastian Tschan
|
@@ -22,6 +22,8 @@
|
|
22
22
|
}
|
23
23
|
.blueimp-gallery > .slides > .slide > .slide-content {
|
24
24
|
margin: auto;
|
25
|
+
width: auto;
|
26
|
+
height: auto;
|
25
27
|
max-width: 100%;
|
26
28
|
max-height: 100%;
|
27
29
|
opacity: 1;
|
@@ -40,9 +42,9 @@
|
|
40
42
|
.blueimp-gallery-carousel {
|
41
43
|
position: relative;
|
42
44
|
z-index: auto;
|
43
|
-
height: 432px;
|
44
|
-
max-width: 768px;
|
45
45
|
margin: 1em auto;
|
46
|
+
/* Set the carousel width/height ratio to 16/9: */
|
47
|
+
padding-bottom: 56.25%;
|
46
48
|
box-shadow: 0 0 10px #000;
|
47
49
|
}
|
48
50
|
.blueimp-gallery-display {
|
@@ -54,6 +56,9 @@
|
|
54
56
|
height: 100%;
|
55
57
|
overflow: hidden;
|
56
58
|
}
|
59
|
+
.blueimp-gallery-carousel > .slides {
|
60
|
+
position: absolute;
|
61
|
+
}
|
57
62
|
.blueimp-gallery > .slides > .slide {
|
58
63
|
position: relative;
|
59
64
|
float: left;
|
@@ -201,13 +206,6 @@ body:last-child .blueimp-gallery-playing > .play-pause {
|
|
201
206
|
background-position: -20px 0;
|
202
207
|
}
|
203
208
|
|
204
|
-
@media (max-width: 767px) {
|
205
|
-
.blueimp-gallery-carousel {
|
206
|
-
height: 270px;
|
207
|
-
max-width: 480px;
|
208
|
-
}
|
209
|
-
}
|
210
|
-
|
211
209
|
/* IE7 fixes */
|
212
210
|
*+html .blueimp-gallery > .slides > .slide {
|
213
211
|
min-height: 300px;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blueimp-gallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Fernández
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|