slimbox2-rails 2.04.4.1 → 2.05.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/slimbox2/rails/version.rb +1 -1
- data/vendor/assets/javascripts/slimbox2.js +239 -11
- data/vendor/assets/javascripts/slimbox2.min.js +15 -0
- data/vendor/assets/stylesheets/slimbox2.css.erb +9 -9
- metadata +17 -4
- data/vendor/assets/images/white.gif +0 -0
- data/vendor/assets/javascripts/extra/android-market.js +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb81f97fdca77771d17f166e7fd60aa9b6004f41
|
4
|
+
data.tar.gz: 70bb6e7cc96e9cf0506ca3b160c7f94341633002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 821546e11a1b6605f6af4a1c76e3ba4d1f7db9848ff7ead33346f27abbff6b4d640fef0cb47ba1ebabb364da351cfbb45d8efb198d80751318c361089cb0dd5e
|
7
|
+
data.tar.gz: 370210d1bcc2651cf6ba7042cf77b3e4215e03f0d7b3669b05e18fdab7375a1fefe8e5f96a92cb73e9969a761a7fb466bcb84c80102b7047ab52f725b27eb4bd
|
data/README.md
CHANGED
@@ -12,7 +12,11 @@ With the help of [Example 9](http://www.trips.elusien.co.uk/slimbox2/example9.ht
|
|
12
12
|
|
13
13
|
## Versioning
|
14
14
|
|
15
|
-
slimbox2-rails v2.
|
15
|
+
slimbox2-rails v2.05.x was built with Slimbox v2.05
|
16
|
+
|
17
|
+
## Compatibility
|
18
|
+
|
19
|
+
Note : Confirmed at jQuery v1.7.1 and was not displayed well at 1.9.x
|
16
20
|
|
17
21
|
## Installation
|
18
22
|
|
@@ -1,15 +1,243 @@
|
|
1
|
-
|
2
|
-
Slimbox v2.
|
3
|
-
(c) 2007-
|
1
|
+
/*!
|
2
|
+
Slimbox v2.05 - The ultimate lightweight Lightbox clone for jQuery
|
3
|
+
(c) 2007-2013 Christophe Beyls <http://www.digitalia.be>
|
4
4
|
MIT-style license.
|
5
5
|
*/
|
6
|
-
(function(e){function _(){var n=t.scrollLeft(),r=t.width();e([S,L]).css("left",n+r/2);if(a){e(E).css({left:n,top:t.scrollTop(),width:r,height:t.height()})}}function D(n){if(n){e("object").add(v?"select":"embed").each(function(e,t){m[e]=[t,t.style.visibility];t.style.visibility="hidden"})}else{e.each(m,function(e,t){t[0].style.visibility=t[1]});m=[]}var r=n?"bind":"unbind";t[r]("scroll resize",_);e(document)[r]("keydown",P)}function P(t){var r=t.keyCode,i=e.inArray;return i(r,n.closeKeys)>=0?R():i(r,n.nextKeys)>=0?B():i(r,n.previousKeys)>=0?H():false}function H(){return j(o)}function B(){return j(u)}function j(e){if(e>=0){i=e;s=r[i][0];o=(i||(n.loop?r.length:0))-1;u=(i+1)%r.length||(n.loop?0:-1);q();S.className="lbLoading";y=new Image;y.onload=F;y.src=s}return false}function F(){S.className="";var t=n.scaler*Math.min(e(window).width()/y.width,e(window).height()/y.height);y.width*=t;y.height*=t;e(T).attr({src:s});e(x).css({visibility:"hidden",display:""});e(N).width(y.width);e([N,C,k]).height(y.height);e(O).html(r[i][1]||"");e(M).html((r.length>1&&n.counterText||"").replace(/{x}/,i+1).replace(/{y}/,r.length));if(o>=0){b.src=r[o][0]}if(u>=0){w.src=r[u][0]}l=x.offsetWidth;c=x.offsetHeight;var a=Math.max(0,f-c/2);if(S.offsetHeight!==c){e(S).animate({height:c,top:a},n.resizeDuration,n.resizeEasing)}if(S.offsetWidth!==l){e(S).animate({width:l,marginLeft:-l/2},n.resizeDuration,n.resizeEasing)}e(S).queue(function(){e(L).css({width:l,top:a+c,marginLeft:-l/2,visibility:"hidden",display:""});e(x).css({display:"none",visibility:"",opacity:""}).fadeIn(n.imageFadeDuration,I)})}function I(){if(o>=0){e(C).show()}if(u>=0){e(k).show()}e(A).css("marginTop",-A.offsetHeight).animate({marginTop:0},n.captionAnimationDuration);L.style.visibility=""}function q(){y.onload=null;y.src=b.src=w.src=s;e([S,x,A]).stop(true);e([C,k,x,L]).hide()}function R(){if(i>=0){q();i=o=u=-1;e(S).hide();e(E).stop().fadeOut(n.overlayFadeDuration,D)}return false}var t=e(window),n,r,i=-1,s,o,u,a,f,l,c,h,p,d,v=!window.XMLHttpRequest,m=[],g=document.documentElement,y={},b=new Image,w=new Image,E,S,x,T,N,C,k,L,A,O,M;e(function(){e("body").append(e([E=e('<div id="lbOverlay" />')[0],S=e('<div id="lbCenter" />')[0],L=e('<div id="lbBottomContainer" />')[0]]).css("display","none"));x=e('<div id="lbImage" />').appendTo(S).append(N=e('<div style="position: relative;" />').append([T=e('<img id="lbSlide" src="/assets/white.gif" alt="" />')[0],k=e('<a id="lbNextLink" href="#" />').text(".").click(B)[0],C=e('<a id="lbPrevLink" href="#" />').text(".").click(H)[0]])[0])[0];window.nextlink=document.getElementById("lbNextLink");A=e('<div id="lbBottom" />').appendTo(L).append([e('<a id="lbCloseLink" href="#" />').add(E).click(R)[0],O=e('<div id="lbCaption" />')[0],M=e('<div id="lbNumber" />')[0],e('<div style="clear: both;" />')[0]])[0]});e.slimbox=function(i,s,o){n=e.extend({loop:false,overlayOpacity:.8,overlayFadeDuration:400,resizeDuration:400,resizeEasing:"swing",initialWidth:250,initialHeight:250,slideInterval:0,scaler:.75,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},o);if(typeof i==="string"){i=[[i,s]];s=0}f=t.scrollTop()+t.height()/2;l=n.initialWidth;c=n.initialHeight;h=n.slideInterval;e(S).css({top:Math.max(0,f-c/2),width:l,height:c,marginLeft:-l/2}).show();a=v||E.currentStyle&&E.currentStyle.position!=="fixed";if(a){E.style.position="absolute"}e(E).css("opacity",n.overlayOpacity).fadeIn(n.overlayFadeDuration);_();D(1);r=i;n.loop=n.loop&&r.length>1;if(h>0){p=setInterval(function(){B()},1e3*h)}else{clearInterval(p)}return j(s)};e.fn.slimbox=function(t,r,i){r=r||function(e){return[e.href,e.title]};i=i||function(){return true};var s=this;n=e.extend({slideInterval:0},t);h=n.slideInterval;return s.unbind("click").click(function(){var n=this,o=0,u,a=0,f;u=e.grep(s,function(e,t){return i.call(n,e,t)});for(f=u.length;a<f;++a){if(u[a]===n){o=a}u[a]=r(u[a],a)}return e.slimbox(u,o,t)})}})(jQuery)
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
(function($) {
|
8
|
+
|
9
|
+
// Global variables, accessible to Slimbox only
|
10
|
+
var win = $(window), options, images, activeImage = -1, activeURL, prevImage, nextImage, compatibleOverlay, middle, centerWidth, centerHeight,
|
11
|
+
ie6 = !window.XMLHttpRequest, hiddenElements = [], documentElement = document.documentElement,
|
12
|
+
|
13
|
+
// Preload images
|
14
|
+
preload = {}, preloadPrev = new Image(), preloadNext = new Image(),
|
15
|
+
|
16
|
+
// DOM elements
|
17
|
+
overlay, center, image, sizer, prevLink, nextLink, bottomContainer, bottom, caption, number;
|
18
|
+
|
19
|
+
/*
|
20
|
+
Initialization
|
21
|
+
*/
|
22
|
+
|
23
|
+
$(function() {
|
24
|
+
// Append the Slimbox HTML code at the bottom of the document
|
25
|
+
$("body").append(
|
26
|
+
$([
|
27
|
+
overlay = $('<div id="lbOverlay" />').click(close)[0],
|
28
|
+
center = $('<div id="lbCenter" />')[0],
|
29
|
+
bottomContainer = $('<div id="lbBottomContainer" />')[0]
|
30
|
+
]).css("display", "none")
|
31
|
+
);
|
32
|
+
|
33
|
+
image = $('<div id="lbImage" />').appendTo(center).append(
|
34
|
+
sizer = $('<div style="position: relative;" />').append([
|
35
|
+
prevLink = $('<a id="lbPrevLink" href="#" />').click(previous)[0],
|
36
|
+
nextLink = $('<a id="lbNextLink" href="#" />').click(next)[0]
|
37
|
+
])[0]
|
38
|
+
)[0];
|
39
|
+
|
40
|
+
bottom = $('<div id="lbBottom" />').appendTo(bottomContainer).append([
|
41
|
+
$('<a id="lbCloseLink" href="#" />').click(close)[0],
|
42
|
+
caption = $('<div id="lbCaption" />')[0],
|
43
|
+
number = $('<div id="lbNumber" />')[0],
|
44
|
+
$('<div style="clear: both;" />')[0]
|
45
|
+
])[0];
|
14
46
|
});
|
15
|
-
|
47
|
+
|
48
|
+
|
49
|
+
/*
|
50
|
+
API
|
51
|
+
*/
|
52
|
+
|
53
|
+
// Open Slimbox with the specified parameters
|
54
|
+
$.slimbox = function(_images, startImage, _options) {
|
55
|
+
options = $.extend({
|
56
|
+
loop: false, // Allows to navigate between first and last images
|
57
|
+
overlayOpacity: 0.8, // 1 is opaque, 0 is completely transparent (change the color in the CSS file)
|
58
|
+
overlayFadeDuration: 400, // Duration of the overlay fade-in and fade-out animations (in milliseconds)
|
59
|
+
resizeDuration: 400, // Duration of each of the box resize animations (in milliseconds)
|
60
|
+
resizeEasing: "swing", // "swing" is jQuery's default easing
|
61
|
+
initialWidth: 250, // Initial width of the box (in pixels)
|
62
|
+
initialHeight: 250, // Initial height of the box (in pixels)
|
63
|
+
imageFadeDuration: 400, // Duration of the image fade-in animation (in milliseconds)
|
64
|
+
captionAnimationDuration: 400, // Duration of the caption animation (in milliseconds)
|
65
|
+
counterText: "Image {x} of {y}", // Translate or change as you wish, or set it to false to disable counter text for image groups
|
66
|
+
closeKeys: [27, 88, 67], // Array of keycodes to close Slimbox, default: Esc (27), 'x' (88), 'c' (67)
|
67
|
+
previousKeys: [37, 80], // Array of keycodes to navigate to the previous image, default: Left arrow (37), 'p' (80)
|
68
|
+
nextKeys: [39, 78] // Array of keycodes to navigate to the next image, default: Right arrow (39), 'n' (78)
|
69
|
+
}, _options);
|
70
|
+
|
71
|
+
// The function is called for a single image, with URL and Title as first two arguments
|
72
|
+
if (typeof _images == "string") {
|
73
|
+
_images = [[_images, startImage]];
|
74
|
+
startImage = 0;
|
75
|
+
}
|
76
|
+
|
77
|
+
middle = win.scrollTop() + (win.height() / 2);
|
78
|
+
centerWidth = options.initialWidth;
|
79
|
+
centerHeight = options.initialHeight;
|
80
|
+
$(center).css({top: Math.max(0, middle - (centerHeight / 2)), width: centerWidth, height: centerHeight, marginLeft: -centerWidth/2}).show();
|
81
|
+
compatibleOverlay = ie6 || (overlay.currentStyle && (overlay.currentStyle.position != "fixed"));
|
82
|
+
if (compatibleOverlay) overlay.style.position = "absolute";
|
83
|
+
$(overlay).css("opacity", options.overlayOpacity).fadeIn(options.overlayFadeDuration);
|
84
|
+
position();
|
85
|
+
setup(1);
|
86
|
+
|
87
|
+
images = _images;
|
88
|
+
options.loop = options.loop && (images.length > 1);
|
89
|
+
return changeImage(startImage);
|
90
|
+
};
|
91
|
+
|
92
|
+
/*
|
93
|
+
options: Optional options object, see jQuery.slimbox()
|
94
|
+
linkMapper: Optional function taking a link DOM element and an index as arguments and returning an array containing 2 elements:
|
95
|
+
the image URL and the image caption (may contain HTML)
|
96
|
+
linksFilter: Optional function taking a link DOM element and an index as arguments and returning true if the element is part of
|
97
|
+
the image collection that will be shown on click, false if not. "this" refers to the element that was clicked.
|
98
|
+
This function must always return true when the DOM element argument is "this".
|
99
|
+
*/
|
100
|
+
$.fn.slimbox = function(_options, linkMapper, linksFilter) {
|
101
|
+
linkMapper = linkMapper || function(el) {
|
102
|
+
return [el.href, el.title];
|
103
|
+
};
|
104
|
+
|
105
|
+
linksFilter = linksFilter || function() {
|
106
|
+
return true;
|
107
|
+
};
|
108
|
+
|
109
|
+
var links = this;
|
110
|
+
|
111
|
+
return links.unbind("click").click(function() {
|
112
|
+
// Build the list of images that will be displayed
|
113
|
+
var link = this, startIndex = 0, filteredLinks, i = 0, length;
|
114
|
+
filteredLinks = $.grep(links, function(el, i) {
|
115
|
+
return linksFilter.call(link, el, i);
|
116
|
+
});
|
117
|
+
|
118
|
+
// We cannot use jQuery.map() because it flattens the returned array
|
119
|
+
for (length = filteredLinks.length; i < length; ++i) {
|
120
|
+
if (filteredLinks[i] == link) startIndex = i;
|
121
|
+
filteredLinks[i] = linkMapper(filteredLinks[i], i);
|
122
|
+
}
|
123
|
+
|
124
|
+
return $.slimbox(filteredLinks, startIndex, _options);
|
125
|
+
});
|
126
|
+
};
|
127
|
+
|
128
|
+
|
129
|
+
/*
|
130
|
+
Internal functions
|
131
|
+
*/
|
132
|
+
|
133
|
+
function position() {
|
134
|
+
var l = win.scrollLeft(), w = win.width();
|
135
|
+
$([center, bottomContainer]).css("left", l + (w / 2));
|
136
|
+
if (compatibleOverlay) $(overlay).css({left: l, top: win.scrollTop(), width: w, height: win.height()});
|
137
|
+
}
|
138
|
+
|
139
|
+
function setup(open) {
|
140
|
+
if (open) {
|
141
|
+
$("object").add(ie6 ? "select" : "embed").each(function(index, el) {
|
142
|
+
hiddenElements[index] = [el, el.style.visibility];
|
143
|
+
el.style.visibility = "hidden";
|
144
|
+
});
|
145
|
+
} else {
|
146
|
+
$.each(hiddenElements, function(index, el) {
|
147
|
+
el[0].style.visibility = el[1];
|
148
|
+
});
|
149
|
+
hiddenElements = [];
|
150
|
+
}
|
151
|
+
var fn = open ? "bind" : "unbind";
|
152
|
+
win[fn]("scroll resize", position);
|
153
|
+
$(document)[fn]("keydown", keyDown);
|
154
|
+
}
|
155
|
+
|
156
|
+
function keyDown(event) {
|
157
|
+
var code = event.which, fn = $.inArray;
|
158
|
+
// Prevent default keyboard action (like navigating inside the page)
|
159
|
+
return (fn(code, options.closeKeys) >= 0) ? close()
|
160
|
+
: (fn(code, options.nextKeys) >= 0) ? next()
|
161
|
+
: (fn(code, options.previousKeys) >= 0) ? previous()
|
162
|
+
: null;
|
163
|
+
}
|
164
|
+
|
165
|
+
function previous() {
|
166
|
+
return changeImage(prevImage);
|
167
|
+
}
|
168
|
+
|
169
|
+
function next() {
|
170
|
+
return changeImage(nextImage);
|
171
|
+
}
|
172
|
+
|
173
|
+
function changeImage(imageIndex) {
|
174
|
+
if (imageIndex >= 0) {
|
175
|
+
activeImage = imageIndex;
|
176
|
+
activeURL = images[activeImage][0];
|
177
|
+
prevImage = (activeImage || (options.loop ? images.length : 0)) - 1;
|
178
|
+
nextImage = ((activeImage + 1) % images.length) || (options.loop ? 0 : -1);
|
179
|
+
|
180
|
+
stop();
|
181
|
+
center.className = "lbLoading";
|
182
|
+
|
183
|
+
preload = new Image();
|
184
|
+
preload.onload = animateBox;
|
185
|
+
preload.src = activeURL;
|
186
|
+
}
|
187
|
+
|
188
|
+
return false;
|
189
|
+
}
|
190
|
+
|
191
|
+
function animateBox() {
|
192
|
+
center.className = "";
|
193
|
+
$(image).css({backgroundImage: "url(" + activeURL + ")", visibility: "hidden", display: ""});
|
194
|
+
$(sizer).width(preload.width);
|
195
|
+
$([sizer, prevLink, nextLink]).height(preload.height);
|
196
|
+
|
197
|
+
$(caption).html(images[activeImage][1] || "");
|
198
|
+
$(number).html((((images.length > 1) && options.counterText) || "").replace(/{x}/, activeImage + 1).replace(/{y}/, images.length));
|
199
|
+
|
200
|
+
if (prevImage >= 0) preloadPrev.src = images[prevImage][0];
|
201
|
+
if (nextImage >= 0) preloadNext.src = images[nextImage][0];
|
202
|
+
|
203
|
+
centerWidth = image.offsetWidth;
|
204
|
+
centerHeight = image.offsetHeight;
|
205
|
+
var top = Math.max(0, middle - (centerHeight / 2));
|
206
|
+
if (center.offsetHeight != centerHeight) {
|
207
|
+
$(center).animate({height: centerHeight, top: top}, options.resizeDuration, options.resizeEasing);
|
208
|
+
}
|
209
|
+
if (center.offsetWidth != centerWidth) {
|
210
|
+
$(center).animate({width: centerWidth, marginLeft: -centerWidth/2}, options.resizeDuration, options.resizeEasing);
|
211
|
+
}
|
212
|
+
$(center).queue(function() {
|
213
|
+
$(bottomContainer).css({width: centerWidth, top: top + centerHeight, marginLeft: -centerWidth/2, visibility: "hidden", display: ""});
|
214
|
+
$(image).css({display: "none", visibility: "", opacity: ""}).fadeIn(options.imageFadeDuration, animateCaption);
|
215
|
+
});
|
216
|
+
}
|
217
|
+
|
218
|
+
function animateCaption() {
|
219
|
+
if (prevImage >= 0) $(prevLink).show();
|
220
|
+
if (nextImage >= 0) $(nextLink).show();
|
221
|
+
$(bottom).css("marginTop", -bottom.offsetHeight).animate({marginTop: 0}, options.captionAnimationDuration);
|
222
|
+
bottomContainer.style.visibility = "";
|
223
|
+
}
|
224
|
+
|
225
|
+
function stop() {
|
226
|
+
preload.onload = null;
|
227
|
+
preload.src = preloadPrev.src = preloadNext.src = activeURL;
|
228
|
+
$([center, image, bottom]).stop(true);
|
229
|
+
$([prevLink, nextLink, image, bottomContainer]).hide();
|
230
|
+
}
|
231
|
+
|
232
|
+
function close() {
|
233
|
+
if (activeImage >= 0) {
|
234
|
+
stop();
|
235
|
+
activeImage = prevImage = nextImage = -1;
|
236
|
+
$(center).hide();
|
237
|
+
$(overlay).stop().fadeOut(options.overlayFadeDuration, setup);
|
238
|
+
}
|
239
|
+
|
240
|
+
return false;
|
241
|
+
}
|
242
|
+
|
243
|
+
})(jQuery);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*!
|
2
|
+
Slimbox v2.05 - The ultimate lightweight Lightbox clone for jQuery
|
3
|
+
(c) 2007-2013 Christophe Beyls <http://www.digitalia.be>
|
4
|
+
MIT-style license.
|
5
|
+
*/
|
6
|
+
(function(w){var E=w(window),u,f,F=-1,n,x,D,v,y,L,r,m=!window.XMLHttpRequest,s=[],l=document.documentElement,k={},t=new Image(),J=new Image(),H,a,g,p,I,d,G,c,A,K;w(function(){w("body").append(w([H=w('<div id="lbOverlay" />').click(C)[0],a=w('<div id="lbCenter" />')[0],G=w('<div id="lbBottomContainer" />')[0]]).css("display","none"));g=w('<div id="lbImage" />').appendTo(a).append(p=w('<div style="position: relative;" />').append([I=w('<a id="lbPrevLink" href="#" />').click(B)[0],d=w('<a id="lbNextLink" href="#" />').click(e)[0]])[0])[0];c=w('<div id="lbBottom" />').appendTo(G).append([w('<a id="lbCloseLink" href="#" />').click(C)[0],A=w('<div id="lbCaption" />')[0],K=w('<div id="lbNumber" />')[0],w('<div style="clear: both;" />')[0]])[0]});w.slimbox=function(O,N,M){u=w.extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeEasing:"swing",initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},M);if(typeof O=="string"){O=[[O,N]];N=0}y=E.scrollTop()+(E.height()/2);L=u.initialWidth;r=u.initialHeight;w(a).css({top:Math.max(0,y-(r/2)),width:L,height:r,marginLeft:-L/2}).show();v=m||(H.currentStyle&&(H.currentStyle.position!="fixed"));if(v){H.style.position="absolute"}w(H).css("opacity",u.overlayOpacity).fadeIn(u.overlayFadeDuration);z();j(1);f=O;u.loop=u.loop&&(f.length>1);return b(N)};w.fn.slimbox=function(M,P,O){P=P||function(Q){return[Q.href,Q.title]};O=O||function(){return true};var N=this;return N.unbind("click").click(function(){var S=this,U=0,T,Q=0,R;T=w.grep(N,function(W,V){return O.call(S,W,V)});for(R=T.length;Q<R;++Q){if(T[Q]==S){U=Q}T[Q]=P(T[Q],Q)}return w.slimbox(T,U,M)})};function z(){var N=E.scrollLeft(),M=E.width();w([a,G]).css("left",N+(M/2));if(v){w(H).css({left:N,top:E.scrollTop(),width:M,height:E.height()})}}function j(M){if(M){w("object").add(m?"select":"embed").each(function(O,P){s[O]=[P,P.style.visibility];P.style.visibility="hidden"})}else{w.each(s,function(O,P){P[0].style.visibility=P[1]});s=[]}var N=M?"bind":"unbind";E[N]("scroll resize",z);w(document)[N]("keydown",o)}function o(O){var N=O.which,M=w.inArray;return(M(N,u.closeKeys)>=0)?C():(M(N,u.nextKeys)>=0)?e():(M(N,u.previousKeys)>=0)?B():null}function B(){return b(x)}function e(){return b(D)}function b(M){if(M>=0){F=M;n=f[F][0];x=(F||(u.loop?f.length:0))-1;D=((F+1)%f.length)||(u.loop?0:-1);q();a.className="lbLoading";k=new Image();k.onload=i;k.src=n}return false}function i(){a.className="";w(g).css({backgroundImage:"url("+n+")",visibility:"hidden",display:""});w(p).width(k.width);w([p,I,d]).height(k.height);w(A).html(f[F][1]||"");w(K).html((((f.length>1)&&u.counterText)||"").replace(/{x}/,F+1).replace(/{y}/,f.length));if(x>=0){t.src=f[x][0]}if(D>=0){J.src=f[D][0]}L=g.offsetWidth;r=g.offsetHeight;var M=Math.max(0,y-(r/2));if(a.offsetHeight!=r){w(a).animate({height:r,top:M},u.resizeDuration,u.resizeEasing)}if(a.offsetWidth!=L){w(a).animate({width:L,marginLeft:-L/2},u.resizeDuration,u.resizeEasing)}w(a).queue(function(){w(G).css({width:L,top:M+r,marginLeft:-L/2,visibility:"hidden",display:""});w(g).css({display:"none",visibility:"",opacity:""}).fadeIn(u.imageFadeDuration,h)})}function h(){if(x>=0){w(I).show()}if(D>=0){w(d).show()}w(c).css("marginTop",-c.offsetHeight).animate({marginTop:0},u.captionAnimationDuration);G.style.visibility=""}function q(){k.onload=null;k.src=t.src=J.src=n;w([a,g,c]).stop(true);w([I,d,g,G]).hide()}function C(){if(F>=0){q();F=x=D=-1;w(a).hide();w(H).stop().fadeOut(u.overlayFadeDuration,j)}return false}})(jQuery);
|
7
|
+
|
8
|
+
// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
|
9
|
+
if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
|
10
|
+
jQuery(function($) {
|
11
|
+
$("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el) {
|
12
|
+
return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
|
13
|
+
});
|
14
|
+
});
|
15
|
+
}
|
@@ -30,10 +30,14 @@
|
|
30
30
|
background-repeat: no-repeat;
|
31
31
|
}
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
/* override style to limit the size of image to 640x480 in the lightbox */
|
34
|
+
#lbImage {
|
35
|
+
width:640px;
|
36
|
+
height:480px;
|
37
|
+
background-repeat: no-repeat;
|
38
|
+
background-position:center;
|
39
|
+
background-size: cover;
|
40
|
+
-moz-background-size: cover;
|
37
41
|
}
|
38
42
|
|
39
43
|
#lbPrevLink, #lbNextLink {
|
@@ -42,9 +46,6 @@
|
|
42
46
|
top: 0;
|
43
47
|
width: 50%;
|
44
48
|
outline: none;
|
45
|
-
font-size: 100000px; /* Workaround needed for IE */
|
46
|
-
overflow: hidden; /* Workaround needed for IE */
|
47
|
-
color: #666;
|
48
49
|
}
|
49
50
|
|
50
51
|
#lbPrevLink {
|
@@ -56,7 +57,6 @@
|
|
56
57
|
}
|
57
58
|
|
58
59
|
#lbNextLink {
|
59
|
-
width: 100%;
|
60
60
|
right: 0;
|
61
61
|
}
|
62
62
|
|
@@ -90,4 +90,4 @@
|
|
90
90
|
|
91
91
|
#lbCaption {
|
92
92
|
font-weight: bold;
|
93
|
-
}
|
93
|
+
}
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slimbox2-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.05.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hyoseong Choi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.1'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,13 +65,12 @@ files:
|
|
51
65
|
- vendor/assets/images/loading.gif
|
52
66
|
- vendor/assets/images/nextlabel.gif
|
53
67
|
- vendor/assets/images/prevlabel.gif
|
54
|
-
- vendor/assets/images/white.gif
|
55
|
-
- vendor/assets/javascripts/extra/android-market.js
|
56
68
|
- vendor/assets/javascripts/extra/autoactivation.js
|
57
69
|
- vendor/assets/javascripts/extra/fix-urls.js
|
58
70
|
- vendor/assets/javascripts/extra/flickr.js
|
59
71
|
- vendor/assets/javascripts/extra/picasaweb.js
|
60
72
|
- vendor/assets/javascripts/slimbox2.js
|
73
|
+
- vendor/assets/javascripts/slimbox2.min.js
|
61
74
|
- vendor/assets/stylesheets/slimbox2-rtl.css
|
62
75
|
- vendor/assets/stylesheets/slimbox2.css.erb
|
63
76
|
- MIT-LICENSE
|
Binary file
|
@@ -1,22 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
This code automatically integrates Android Market URLs with Slimbox using QR code generation.
|
3
|
-
It will scan for all Android market links. These links have URLs starting with "market://".
|
4
|
-
Note that you don't need to add rel="lightbox" to these links.
|
5
|
-
On an Android phone's browser, clicking on Android Market links will open the Android Market.
|
6
|
-
Desktop browsers are normally unable to open these links.
|
7
|
-
But thanks to this script, clicking on them will open Slimbox and display a barcode (QR Code)
|
8
|
-
that you can scan with your Android phone using your favorite barcode scanner application.
|
9
|
-
Scanning the barcode will open the Android Market on the phone.
|
10
|
-
The title attribute of the link will be used as description text.
|
11
|
-
|
12
|
-
Add the following code to the autoload code block.
|
13
|
-
*/
|
14
|
-
|
15
|
-
if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
|
16
|
-
jQuery(function($) {
|
17
|
-
$("a[href^='market://']").slimbox({}, function(el) {
|
18
|
-
return ["http://chart.apis.google.com/chart?chs=400x400&cht=qr&chl=" + encodeURIComponent(el.href.replace(/\/\?/, "?")),
|
19
|
-
el.title + "<br />Scan this barcode with your Android phone."];
|
20
|
-
});
|
21
|
-
});
|
22
|
-
}
|