Bootstrap-Image-Gallery-rails 1.0.0.3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +123 -0
- data/lib/Bootstrap/Image/Gallery/rails.rb +12 -0
- data/lib/Bootstrap/Image/Gallery/rails/version.rb +9 -0
- data/vendor/assets/javascripts/blueimp-gallery-fullscreen.js +90 -0
- data/vendor/assets/javascripts/blueimp-gallery-indicator.js +153 -0
- data/vendor/assets/javascripts/blueimp-gallery-video.js +171 -0
- data/vendor/assets/javascripts/blueimp-gallery-vimeo.js +215 -0
- data/vendor/assets/javascripts/blueimp-gallery-youtube.js +229 -0
- data/vendor/assets/javascripts/blueimp-gallery.js +1341 -0
- data/vendor/assets/javascripts/blueimp-helper.js +191 -0
- data/vendor/assets/javascripts/bootstrap-image-gallery.js +88 -0
- data/vendor/assets/javascripts/jquery.blueimp-gallery.js +84 -0
- data/vendor/assets/stylesheets/blueimp-gallery-indicator.css +71 -0
- data/vendor/assets/stylesheets/blueimp-gallery-video.css +87 -0
- data/vendor/assets/stylesheets/blueimp-gallery.css +226 -0
- data/vendor/assets/stylesheets/bootstrap-image-gallery.css +87 -0
- metadata +89 -0
@@ -0,0 +1,191 @@
|
|
1
|
+
/*
|
2
|
+
* blueimp helper JS 1.2.0
|
3
|
+
* https://github.com/blueimp/Gallery
|
4
|
+
*
|
5
|
+
* Copyright 2013, Sebastian Tschan
|
6
|
+
* https://blueimp.net
|
7
|
+
*
|
8
|
+
* Licensed under the MIT license:
|
9
|
+
* http://www.opensource.org/licenses/MIT
|
10
|
+
*/
|
11
|
+
|
12
|
+
/* global define, window, document */
|
13
|
+
|
14
|
+
(function () {
|
15
|
+
'use strict';
|
16
|
+
|
17
|
+
function extend(obj1, obj2) {
|
18
|
+
var prop;
|
19
|
+
for (prop in obj2) {
|
20
|
+
if (obj2.hasOwnProperty(prop)) {
|
21
|
+
obj1[prop] = obj2[prop];
|
22
|
+
}
|
23
|
+
}
|
24
|
+
return obj1;
|
25
|
+
}
|
26
|
+
|
27
|
+
function Helper(query) {
|
28
|
+
if (!this || this.find !== Helper.prototype.find) {
|
29
|
+
// Called as function instead of as constructor,
|
30
|
+
// so we simply return a new instance:
|
31
|
+
return new Helper(query);
|
32
|
+
}
|
33
|
+
this.length = 0;
|
34
|
+
if (query) {
|
35
|
+
if (typeof query === 'string') {
|
36
|
+
query = this.find(query);
|
37
|
+
}
|
38
|
+
if (query.nodeType || query === query.window) {
|
39
|
+
// Single HTML element
|
40
|
+
this.length = 1;
|
41
|
+
this[0] = query;
|
42
|
+
} else {
|
43
|
+
// HTML element collection
|
44
|
+
var i = query.length;
|
45
|
+
this.length = i;
|
46
|
+
while (i) {
|
47
|
+
i -= 1;
|
48
|
+
this[i] = query[i];
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
Helper.extend = extend;
|
55
|
+
|
56
|
+
Helper.contains = function (container, element) {
|
57
|
+
do {
|
58
|
+
element = element.parentNode;
|
59
|
+
if (element === container) {
|
60
|
+
return true;
|
61
|
+
}
|
62
|
+
} while (element);
|
63
|
+
return false;
|
64
|
+
};
|
65
|
+
|
66
|
+
Helper.parseJSON = function (string) {
|
67
|
+
return window.JSON && JSON.parse(string);
|
68
|
+
};
|
69
|
+
|
70
|
+
extend(Helper.prototype, {
|
71
|
+
|
72
|
+
find: function (query) {
|
73
|
+
var container = this[0] || document;
|
74
|
+
if (typeof query === 'string') {
|
75
|
+
if (container.querySelectorAll) {
|
76
|
+
query = container.querySelectorAll(query);
|
77
|
+
} else if (query.charAt(0) === '#') {
|
78
|
+
query = container.getElementById(query.slice(1));
|
79
|
+
} else {
|
80
|
+
query = container.getElementsByTagName(query);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
return new Helper(query);
|
84
|
+
},
|
85
|
+
|
86
|
+
hasClass: function (className) {
|
87
|
+
if (!this[0]) {
|
88
|
+
return false;
|
89
|
+
}
|
90
|
+
return new RegExp('(^|\\s+)' + className +
|
91
|
+
'(\\s+|$)').test(this[0].className);
|
92
|
+
},
|
93
|
+
|
94
|
+
addClass: function (className) {
|
95
|
+
var i = this.length,
|
96
|
+
element;
|
97
|
+
while (i) {
|
98
|
+
i -= 1;
|
99
|
+
element = this[i];
|
100
|
+
if (!element.className) {
|
101
|
+
element.className = className;
|
102
|
+
return this;
|
103
|
+
}
|
104
|
+
if (this.hasClass(className)) {
|
105
|
+
return this;
|
106
|
+
}
|
107
|
+
element.className += ' ' + className;
|
108
|
+
}
|
109
|
+
return this;
|
110
|
+
},
|
111
|
+
|
112
|
+
removeClass: function (className) {
|
113
|
+
var regexp = new RegExp('(^|\\s+)' + className + '(\\s+|$)'),
|
114
|
+
i = this.length,
|
115
|
+
element;
|
116
|
+
while (i) {
|
117
|
+
i -= 1;
|
118
|
+
element = this[i];
|
119
|
+
element.className = element.className.replace(regexp, ' ');
|
120
|
+
}
|
121
|
+
return this;
|
122
|
+
},
|
123
|
+
|
124
|
+
on: function (eventName, handler) {
|
125
|
+
var eventNames = eventName.split(/\s+/),
|
126
|
+
i,
|
127
|
+
element;
|
128
|
+
while (eventNames.length) {
|
129
|
+
eventName = eventNames.shift();
|
130
|
+
i = this.length;
|
131
|
+
while (i) {
|
132
|
+
i -= 1;
|
133
|
+
element = this[i];
|
134
|
+
if (element.addEventListener) {
|
135
|
+
element.addEventListener(eventName, handler, false);
|
136
|
+
} else if (element.attachEvent) {
|
137
|
+
element.attachEvent('on' + eventName, handler);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
return this;
|
142
|
+
},
|
143
|
+
|
144
|
+
off: function (eventName, handler) {
|
145
|
+
var eventNames = eventName.split(/\s+/),
|
146
|
+
i,
|
147
|
+
element;
|
148
|
+
while (eventNames.length) {
|
149
|
+
eventName = eventNames.shift();
|
150
|
+
i = this.length;
|
151
|
+
while (i) {
|
152
|
+
i -= 1;
|
153
|
+
element = this[i];
|
154
|
+
if (element.removeEventListener) {
|
155
|
+
element.removeEventListener(eventName, handler, false);
|
156
|
+
} else if (element.detachEvent) {
|
157
|
+
element.detachEvent('on' + eventName, handler);
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
161
|
+
return this;
|
162
|
+
},
|
163
|
+
|
164
|
+
empty: function () {
|
165
|
+
var i = this.length,
|
166
|
+
element;
|
167
|
+
while (i) {
|
168
|
+
i -= 1;
|
169
|
+
element = this[i];
|
170
|
+
while (element.hasChildNodes()) {
|
171
|
+
element.removeChild(element.lastChild);
|
172
|
+
}
|
173
|
+
}
|
174
|
+
return this;
|
175
|
+
},
|
176
|
+
|
177
|
+
first: function () {
|
178
|
+
return new Helper(this[0]);
|
179
|
+
}
|
180
|
+
|
181
|
+
});
|
182
|
+
|
183
|
+
if (typeof define === 'function' && define.amd) {
|
184
|
+
define(function () {
|
185
|
+
return Helper;
|
186
|
+
});
|
187
|
+
} else {
|
188
|
+
window.blueimp = window.blueimp || {};
|
189
|
+
window.blueimp.helper = Helper;
|
190
|
+
}
|
191
|
+
}());
|
@@ -0,0 +1,88 @@
|
|
1
|
+
/*
|
2
|
+
* Bootstrap Image Gallery 3.0.1
|
3
|
+
* https://github.com/blueimp/Bootstrap-Image-Gallery
|
4
|
+
*
|
5
|
+
* Copyright 2013, Sebastian Tschan
|
6
|
+
* https://blueimp.net
|
7
|
+
*
|
8
|
+
* Licensed under the MIT license:
|
9
|
+
* http://www.opensource.org/licenses/MIT
|
10
|
+
*/
|
11
|
+
|
12
|
+
/*global define, window */
|
13
|
+
|
14
|
+
(function (factory) {
|
15
|
+
'use strict';
|
16
|
+
if (typeof define === 'function' && define.amd) {
|
17
|
+
define([
|
18
|
+
'jquery',
|
19
|
+
'./blueimp-gallery'
|
20
|
+
], factory);
|
21
|
+
} else {
|
22
|
+
factory(
|
23
|
+
window.jQuery,
|
24
|
+
window.blueimp.Gallery
|
25
|
+
);
|
26
|
+
}
|
27
|
+
}(function ($, Gallery) {
|
28
|
+
'use strict';
|
29
|
+
|
30
|
+
$.extend(Gallery.prototype.options, {
|
31
|
+
useBootstrapModal: true
|
32
|
+
});
|
33
|
+
|
34
|
+
var close = Gallery.prototype.close,
|
35
|
+
imageFactory = Gallery.prototype.imageFactory,
|
36
|
+
videoFactory = Gallery.prototype.videoFactory,
|
37
|
+
textFactory = Gallery.prototype.textFactory;
|
38
|
+
|
39
|
+
$.extend(Gallery.prototype, {
|
40
|
+
|
41
|
+
modalFactory: function (obj, callback, factoryInterface, factory) {
|
42
|
+
if (!this.options.useBootstrapModal || factoryInterface) {
|
43
|
+
return factory.call(this, obj, callback, factoryInterface);
|
44
|
+
}
|
45
|
+
var that = this,
|
46
|
+
modalTemplate = this.container.children('.modal'),
|
47
|
+
modal = modalTemplate.clone().show()
|
48
|
+
.on('click', function (event) {
|
49
|
+
// Close modal if click is outside of modal-content:
|
50
|
+
if (event.target === modal[0] ||
|
51
|
+
event.target === modal.children()[0]) {
|
52
|
+
event.preventDefault();
|
53
|
+
event.stopPropagation();
|
54
|
+
that.close();
|
55
|
+
}
|
56
|
+
}),
|
57
|
+
element = factory.call(this, obj, function (event) {
|
58
|
+
callback({
|
59
|
+
type: event.type,
|
60
|
+
target: modal[0]
|
61
|
+
});
|
62
|
+
modal.addClass('in');
|
63
|
+
}, factoryInterface);
|
64
|
+
modal.find('.modal-title').text(element.title || String.fromCharCode(160));
|
65
|
+
modal.find('.modal-body').append(element);
|
66
|
+
return modal[0];
|
67
|
+
},
|
68
|
+
|
69
|
+
imageFactory: function (obj, callback, factoryInterface) {
|
70
|
+
return this.modalFactory(obj, callback, factoryInterface, imageFactory);
|
71
|
+
},
|
72
|
+
|
73
|
+
videoFactory: function (obj, callback, factoryInterface) {
|
74
|
+
return this.modalFactory(obj, callback, factoryInterface, videoFactory);
|
75
|
+
},
|
76
|
+
|
77
|
+
textFactory: function (obj, callback, factoryInterface) {
|
78
|
+
return this.modalFactory(obj, callback, factoryInterface, textFactory);
|
79
|
+
},
|
80
|
+
|
81
|
+
close: function () {
|
82
|
+
this.container.find('.modal').removeClass('in');
|
83
|
+
close.call(this);
|
84
|
+
}
|
85
|
+
|
86
|
+
});
|
87
|
+
|
88
|
+
}));
|
@@ -0,0 +1,84 @@
|
|
1
|
+
/*
|
2
|
+
* blueimp Gallery jQuery plugin 1.2.2
|
3
|
+
* https://github.com/blueimp/Gallery
|
4
|
+
*
|
5
|
+
* Copyright 2013, Sebastian Tschan
|
6
|
+
* https://blueimp.net
|
7
|
+
*
|
8
|
+
* Licensed under the MIT license:
|
9
|
+
* http://www.opensource.org/licenses/MIT
|
10
|
+
*/
|
11
|
+
|
12
|
+
/* global define, window, document */
|
13
|
+
|
14
|
+
(function (factory) {
|
15
|
+
'use strict';
|
16
|
+
if (typeof define === 'function' && define.amd) {
|
17
|
+
define([
|
18
|
+
'jquery',
|
19
|
+
'./blueimp-gallery'
|
20
|
+
], factory);
|
21
|
+
} else {
|
22
|
+
factory(
|
23
|
+
window.jQuery,
|
24
|
+
window.blueimp.Gallery
|
25
|
+
);
|
26
|
+
}
|
27
|
+
}(function ($, Gallery) {
|
28
|
+
'use strict';
|
29
|
+
|
30
|
+
// Global click handler to open links with data-gallery attribute
|
31
|
+
// in the Gallery lightbox:
|
32
|
+
$(document).on('click', '[data-gallery]', function (event) {
|
33
|
+
// Get the container id from the data-gallery attribute:
|
34
|
+
var id = $(this).data('gallery'),
|
35
|
+
widget = $(id),
|
36
|
+
container = (widget.length && widget) ||
|
37
|
+
$(Gallery.prototype.options.container),
|
38
|
+
callbacks = {
|
39
|
+
onopen: function () {
|
40
|
+
container
|
41
|
+
.data('gallery', this)
|
42
|
+
.trigger('open');
|
43
|
+
},
|
44
|
+
onopened: function () {
|
45
|
+
container.trigger('opened');
|
46
|
+
},
|
47
|
+
onslide: function () {
|
48
|
+
container.trigger('slide', arguments);
|
49
|
+
},
|
50
|
+
onslideend: function () {
|
51
|
+
container.trigger('slideend', arguments);
|
52
|
+
},
|
53
|
+
onslidecomplete: function () {
|
54
|
+
container.trigger('slidecomplete', arguments);
|
55
|
+
},
|
56
|
+
onclose: function () {
|
57
|
+
container.trigger('close');
|
58
|
+
},
|
59
|
+
onclosed: function () {
|
60
|
+
container
|
61
|
+
.trigger('closed')
|
62
|
+
.removeData('gallery');
|
63
|
+
}
|
64
|
+
},
|
65
|
+
options = $.extend(
|
66
|
+
// Retrieve custom options from data-attributes
|
67
|
+
// on the Gallery widget:
|
68
|
+
container.data(),
|
69
|
+
{
|
70
|
+
container: container[0],
|
71
|
+
index: this,
|
72
|
+
event: event
|
73
|
+
},
|
74
|
+
callbacks
|
75
|
+
),
|
76
|
+
// Select all links with the same data-gallery attribute:
|
77
|
+
links = $('[data-gallery="' + id + '"]');
|
78
|
+
if (options.filter) {
|
79
|
+
links = links.filter(options.filter);
|
80
|
+
}
|
81
|
+
return new Gallery(links, options);
|
82
|
+
});
|
83
|
+
|
84
|
+
}));
|
@@ -0,0 +1,71 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/*
|
3
|
+
* blueimp Gallery Indicator CSS 1.1.0
|
4
|
+
* https://github.com/blueimp/Gallery
|
5
|
+
*
|
6
|
+
* Copyright 2013, Sebastian Tschan
|
7
|
+
* https://blueimp.net
|
8
|
+
*
|
9
|
+
* Licensed under the MIT license:
|
10
|
+
* http://www.opensource.org/licenses/MIT
|
11
|
+
*/
|
12
|
+
|
13
|
+
.blueimp-gallery > .indicator {
|
14
|
+
position: absolute;
|
15
|
+
top: auto;
|
16
|
+
right: 15px;
|
17
|
+
bottom: 15px;
|
18
|
+
left: 15px;
|
19
|
+
margin: 0 40px;
|
20
|
+
padding: 0;
|
21
|
+
list-style: none;
|
22
|
+
text-align: center;
|
23
|
+
line-height: 10px;
|
24
|
+
display: none;
|
25
|
+
}
|
26
|
+
.blueimp-gallery > .indicator > li {
|
27
|
+
display: inline-block;
|
28
|
+
width: 9px;
|
29
|
+
height: 9px;
|
30
|
+
margin: 6px 3px 0 3px;
|
31
|
+
-webkit-box-sizing: content-box;
|
32
|
+
-moz-box-sizing: content-box;
|
33
|
+
box-sizing: content-box;
|
34
|
+
border: 1px solid transparent;
|
35
|
+
background: #ccc;
|
36
|
+
background: rgba(255, 255, 255, 0.25) center no-repeat;
|
37
|
+
border-radius: 5px;
|
38
|
+
box-shadow: 0 0 2px #000;
|
39
|
+
opacity: 0.5;
|
40
|
+
cursor: pointer;
|
41
|
+
}
|
42
|
+
.blueimp-gallery > .indicator > li:hover,
|
43
|
+
.blueimp-gallery > .indicator > .active {
|
44
|
+
background-color: #fff;
|
45
|
+
border-color: #fff;
|
46
|
+
opacity: 1;
|
47
|
+
}
|
48
|
+
.blueimp-gallery-controls > .indicator {
|
49
|
+
display: block;
|
50
|
+
/* Fix z-index issues (controls behind slide element) on Android: */
|
51
|
+
-webkit-transform: translateZ(0);
|
52
|
+
-moz-transform: translateZ(0);
|
53
|
+
-ms-transform: translateZ(0);
|
54
|
+
-o-transform: translateZ(0);
|
55
|
+
transform: translateZ(0);
|
56
|
+
}
|
57
|
+
.blueimp-gallery-single > .indicator {
|
58
|
+
display: none;
|
59
|
+
}
|
60
|
+
.blueimp-gallery > .indicator {
|
61
|
+
-webkit-user-select: none;
|
62
|
+
-khtml-user-select: none;
|
63
|
+
-moz-user-select: none;
|
64
|
+
-ms-user-select: none;
|
65
|
+
user-select: none;
|
66
|
+
}
|
67
|
+
|
68
|
+
/* IE7 fixes */
|
69
|
+
*+html .blueimp-gallery > .indicator > li {
|
70
|
+
display: inline;
|
71
|
+
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/*
|
3
|
+
* blueimp Gallery Video Factory CSS 1.3.0
|
4
|
+
* https://github.com/blueimp/Gallery
|
5
|
+
*
|
6
|
+
* Copyright 2013, Sebastian Tschan
|
7
|
+
* https://blueimp.net
|
8
|
+
*
|
9
|
+
* Licensed under the MIT license:
|
10
|
+
* http://www.opensource.org/licenses/MIT
|
11
|
+
*/
|
12
|
+
|
13
|
+
.blueimp-gallery > .slides > .slide > .video-content > img {
|
14
|
+
position: absolute;
|
15
|
+
top: 0;
|
16
|
+
right: 0;
|
17
|
+
bottom: 0;
|
18
|
+
left: 0;
|
19
|
+
margin: auto;
|
20
|
+
width: auto;
|
21
|
+
height: auto;
|
22
|
+
max-width: 100%;
|
23
|
+
max-height: 100%;
|
24
|
+
/* Prevent artifacts in Mozilla Firefox: */
|
25
|
+
-moz-backface-visibility: hidden;
|
26
|
+
}
|
27
|
+
.blueimp-gallery > .slides > .slide > .video-content > video {
|
28
|
+
position: absolute;
|
29
|
+
top: 0;
|
30
|
+
left: 0;
|
31
|
+
width: 100%;
|
32
|
+
height: 100%;
|
33
|
+
}
|
34
|
+
.blueimp-gallery > .slides > .slide > .video-content > iframe {
|
35
|
+
position: absolute;
|
36
|
+
top: 100%;
|
37
|
+
left: 0;
|
38
|
+
width: 100%;
|
39
|
+
height: 100%;
|
40
|
+
border: none;
|
41
|
+
}
|
42
|
+
.blueimp-gallery > .slides > .slide > .video-playing > iframe {
|
43
|
+
top: 0;
|
44
|
+
}
|
45
|
+
.blueimp-gallery > .slides > .slide > .video-content > a {
|
46
|
+
position: absolute;
|
47
|
+
top: 50%;
|
48
|
+
right: 0;
|
49
|
+
left: 0;
|
50
|
+
margin: -64px auto 0;
|
51
|
+
width: 128px;
|
52
|
+
height: 128px;
|
53
|
+
background: url(/assets/Gallery/video-play.png) center no-repeat;
|
54
|
+
opacity: 0.8;
|
55
|
+
cursor: pointer;
|
56
|
+
}
|
57
|
+
.blueimp-gallery > .slides > .slide > .video-content > a:hover {
|
58
|
+
opacity: 1;
|
59
|
+
}
|
60
|
+
.blueimp-gallery > .slides > .slide > .video-playing > a,
|
61
|
+
.blueimp-gallery > .slides > .slide > .video-playing > img {
|
62
|
+
display: none;
|
63
|
+
}
|
64
|
+
.blueimp-gallery > .slides > .slide > .video-content > video {
|
65
|
+
display: none;
|
66
|
+
}
|
67
|
+
.blueimp-gallery > .slides > .slide > .video-playing > video {
|
68
|
+
display: block;
|
69
|
+
}
|
70
|
+
.blueimp-gallery > .slides > .slide > .video-loading > a {
|
71
|
+
background: url(/assets/Gallery/loading.gif) center no-repeat;
|
72
|
+
background-size: 64px 64px;
|
73
|
+
}
|
74
|
+
|
75
|
+
/* Replace PNGs with SVGs for capable browsers (excluding IE<9) */
|
76
|
+
body:last-child .blueimp-gallery > .slides > .slide > .video-content:not(.video-loading) > a {
|
77
|
+
background-image: url(/assets/Gallery/video-play.svg);
|
78
|
+
}
|
79
|
+
|
80
|
+
/* IE7 fixes */
|
81
|
+
*+html .blueimp-gallery > .slides > .slide > .video-content {
|
82
|
+
height: 100%;
|
83
|
+
}
|
84
|
+
*+html .blueimp-gallery > .slides > .slide > .video-content > a {
|
85
|
+
left: 50%;
|
86
|
+
margin-left: -64px;
|
87
|
+
}
|