slimbox2-rails 2.05.0 → 2.05.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb81f97fdca77771d17f166e7fd60aa9b6004f41
4
- data.tar.gz: 70bb6e7cc96e9cf0506ca3b160c7f94341633002
3
+ metadata.gz: 50c2de83c46e5a47fb7ea4ec4ba4c855554a7c59
4
+ data.tar.gz: 2d5b65b5f62cb5461708f62afec2c7e4d5d73c92
5
5
  SHA512:
6
- metadata.gz: 821546e11a1b6605f6af4a1c76e3ba4d1f7db9848ff7ead33346f27abbff6b4d640fef0cb47ba1ebabb364da351cfbb45d8efb198d80751318c361089cb0dd5e
7
- data.tar.gz: 370210d1bcc2651cf6ba7042cf77b3e4215e03f0d7b3669b05e18fdab7375a1fefe8e5f96a92cb73e9969a761a7fb466bcb84c80102b7047ab52f725b27eb4bd
6
+ metadata.gz: 4acb5bb5461ce1fff90d4e1bd58db73c5b39969f647e95173d372d0899855267c3eb8646e6fdbba0b3c2c1ec0c8b7d564964fb15662793bfccc7c00cc3085aa8
7
+ data.tar.gz: 7bb18783c4800884f912da5f0b0c9411b9cf879b3a0f6b1ad2781fe6a446da584f633a20cb7bd629ed08d13adbfbbc459122a0ea8d3ba0a7c8843416dc5234c6
data/README.md CHANGED
@@ -16,7 +16,7 @@ slimbox2-rails v2.05.x was built with Slimbox v2.05
16
16
 
17
17
  ## Compatibility
18
18
 
19
- Note : Confirmed at jQuery v1.7.1 and was not displayed well at 1.9.x
19
+ Note : jQuery library (version 1.3 or more recent)
20
20
 
21
21
  ## Installation
22
22
 
@@ -1,5 +1,5 @@
1
1
  module Slimbox2
2
2
  module Rails
3
- VERSION = "2.05.0"
3
+ VERSION = "2.05.1"
4
4
  end
5
5
  end
@@ -53,6 +53,7 @@
53
53
  // Open Slimbox with the specified parameters
54
54
  $.slimbox = function(_images, startImage, _options) {
55
55
  options = $.extend({
56
+ scaler: .8,
56
57
  loop: false, // Allows to navigate between first and last images
57
58
  overlayOpacity: 0.8, // 1 is opaque, 0 is completely transparent (change the color in the CSS file)
58
59
  overlayFadeDuration: 400, // Duration of the overlay fade-in and fade-out animations (in milliseconds)
@@ -189,7 +190,13 @@
189
190
  }
190
191
 
191
192
  function animateBox() {
193
+ var maxwidth = 800; //added by rorlab
192
194
  center.className = "";
195
+ if(preload.width > maxwidth) { // if-condition added by rorlab
196
+ var c = options.scaler * Math.min($(window).width() / preload.width, $(window).height() / preload.height); //added
197
+ preload.width *= c; //added
198
+ preload.height *= c; //added
199
+ }
193
200
  $(image).css({backgroundImage: "url(" + activeURL + ")", visibility: "hidden", display: ""});
194
201
  $(sizer).width(preload.width);
195
202
  $([sizer, prevLink, nextLink]).height(preload.height);
@@ -240,4 +247,13 @@
240
247
  return false;
241
248
  }
242
249
 
243
- })(jQuery);
250
+ })(jQuery);
251
+
252
+ // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
253
+ if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
254
+ jQuery(function($) {
255
+ $("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el) {
256
+ return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
257
+ });
258
+ });
259
+ }
@@ -3,7 +3,7 @@
3
3
  (c) 2007-2013 Christophe Beyls <http://www.digitalia.be>
4
4
  MIT-style license.
5
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);
6
+ (function(e){function L(){var n=t.scrollLeft(),r=t.width();e([b,T]).css("left",n+r/2);if(a)e(y).css({left:n,top:t.scrollTop(),width:r,height:t.height()})}function A(n){if(n){e("object").add(h?"select":"embed").each(function(e,t){p[e]=[t,t.style.visibility];t.style.visibility="hidden"})}else{e.each(p,function(e,t){t[0].style.visibility=t[1]});p=[]}var r=n?"bind":"unbind";t[r]("scroll resize",L);e(document)[r]("keydown",O)}function O(t){var r=t.which,i=e.inArray;return i(r,n.closeKeys)>=0?j():i(r,n.nextKeys)>=0?_():i(r,n.previousKeys)>=0?M():null}function M(){return D(o)}function _(){return D(u)}function D(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);B();b.className="lbLoading";v=new Image;v.onload=P;v.src=s}return false}function P(){var t=800;b.className="";if(v.width>t){var a=n.scaler*Math.min(e(window).width()/v.width,e(window).height()/v.height);v.width*=a;v.height*=a}e(w).css({backgroundImage:"url("+s+")",visibility:"hidden",display:""});e(E).width(v.width);e([E,S,x]).height(v.height);e(C).html(r[i][1]||"");e(k).html((r.length>1&&n.counterText||"").replace(/{x}/,i+1).replace(/{y}/,r.length));if(o>=0)m.src=r[o][0];if(u>=0)g.src=r[u][0];l=w.offsetWidth;c=w.offsetHeight;var h=Math.max(0,f-c/2);if(b.offsetHeight!=c){e(b).animate({height:c,top:h},n.resizeDuration,n.resizeEasing)}if(b.offsetWidth!=l){e(b).animate({width:l,marginLeft:-l/2},n.resizeDuration,n.resizeEasing)}e(b).queue(function(){e(T).css({width:l,top:h+c,marginLeft:-l/2,visibility:"hidden",display:""});e(w).css({display:"none",visibility:"",opacity:""}).fadeIn(n.imageFadeDuration,H)})}function H(){if(o>=0)e(S).show();if(u>=0)e(x).show();e(N).css("marginTop",-N.offsetHeight).animate({marginTop:0},n.captionAnimationDuration);T.style.visibility=""}function B(){v.onload=null;v.src=m.src=g.src=s;e([b,w,N]).stop(true);e([S,x,w,T]).hide()}function j(){if(i>=0){B();i=o=u=-1;e(b).hide();e(y).stop().fadeOut(n.overlayFadeDuration,A)}return false}var t=e(window),n,r,i=-1,s,o,u,a,f,l,c,h=!window.XMLHttpRequest,p=[],d=document.documentElement,v={},m=new Image,g=new Image,y,b,w,E,S,x,T,N,C,k;e(function(){e("body").append(e([y=e('<div id="lbOverlay" />').click(j)[0],b=e('<div id="lbCenter" />')[0],T=e('<div id="lbBottomContainer" />')[0]]).css("display","none"));w=e('<div id="lbImage" />').appendTo(b).append(E=e('<div style="position: relative;" />').append([S=e('<a id="lbPrevLink" href="#" />').click(M)[0],x=e('<a id="lbNextLink" href="#" />').click(_)[0]])[0])[0];N=e('<div id="lbBottom" />').appendTo(T).append([e('<a id="lbCloseLink" href="#" />').click(j)[0],C=e('<div id="lbCaption" />')[0],k=e('<div id="lbNumber" />')[0],e('<div style="clear: both;" />')[0]])[0]});e.slimbox=function(i,s,o){n=e.extend({scaler:.8,loop:false,overlayOpacity:.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]},o);if(typeof i=="string"){i=[[i,s]];s=0}f=t.scrollTop()+t.height()/2;l=n.initialWidth;c=n.initialHeight;e(b).css({top:Math.max(0,f-c/2),width:l,height:c,marginLeft:-l/2}).show();a=h||y.currentStyle&&y.currentStyle.position!="fixed";if(a)y.style.position="absolute";e(y).css("opacity",n.overlayOpacity).fadeIn(n.overlayFadeDuration);L();A(1);r=i;n.loop=n.loop&&r.length>1;return D(s)};e.fn.slimbox=function(t,n,r){n=n||function(e){return[e.href,e.title]};r=r||function(){return true};var i=this;return i.unbind("click").click(function(){var s=this,o=0,u,a=0,f;u=e.grep(i,function(e,t){return r.call(s,e,t)});for(f=u.length;a<f;++a){if(u[a]==s)o=a;u[a]=n(u[a],a)}return e.slimbox(u,o,t)})}})(jQuery)
7
7
 
8
8
  // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
9
9
  if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
@@ -31,14 +31,14 @@
31
31
  }
32
32
 
33
33
  /* override style to limit the size of image to 640x480 in the lightbox */
34
- #lbImage {
34
+ /*#lbImage {
35
35
  width:640px;
36
36
  height:480px;
37
37
  background-repeat: no-repeat;
38
38
  background-position:center;
39
39
  background-size: cover;
40
40
  -moz-background-size: cover;
41
- }
41
+ }*/
42
42
 
43
43
  #lbPrevLink, #lbNextLink {
44
44
  display: block;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slimbox2-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.05.0
4
+ version: 2.05.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hyoseong Choi