slimbox2-rails 2.04.2 → 2.04.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65b20fea5106e6607290f111aa015335c04e5342
4
- data.tar.gz: 24a5ad032609bf59d3c250f101a61f810cbcad6c
3
+ metadata.gz: d529408d317cd4f56094e618f9406a7664e2236d
4
+ data.tar.gz: 2b748ec2efc9e7ca8947472b01e543c60955a394
5
5
  SHA512:
6
- metadata.gz: 7cd1454a479899dee9d3ec9669afdb560196b42e5499048b394fbd5062ddc08455817d098f924ad9f49108deda0021c53227ef7e5ea52a10ff08d1a6d45bcb39
7
- data.tar.gz: 12e8610d6f4414a921c9ff42865e9137841c1d2365ce2923f08a83c2c7deea0ae2804d7d7ea9fa286cb1f675787b5ae6ebbc3fe7f55a118bf9fcf2731971594f
6
+ metadata.gz: ea83ef26d68e1add597b4e3b03e29a6d311fa2b02777127f389f87adca4d364c6a61867d920d2de3b71b52f068878b8bc9e875bafde52178291117da04ed41b3
7
+ data.tar.gz: 3edab6f0198e7d2fbc5d991d3d87e75cd7a5928cd2c876a1a20525726fc5951ba91dc20470247619a4fe3a2d9ca6cb3fd6ad531f49b9c13a2e89475303ad8fc6
data/README.md CHANGED
@@ -4,6 +4,12 @@ Gemify Slimbox2 to use with Rails 3.1 asset pipeline.
4
4
 
5
5
  If you want to see the more information about Slimbox2, click [here](http://www.digitalia.be/software/slimbox2).
6
6
 
7
+
8
+ With the help of [Example 9](http://www.trips.elusien.co.uk/slimbox2/example9.html) on [Neil’s Slimbox Examples](http://www.trips.elusien.co.uk/slimbox2/), Travis Hydzik has managed to hack together this feature which we are happy about.(v2.04.3)
9
+
10
+ - [Modified Slimbox2 with auto resize JavaScript](http://thydzik.com/downloads/slimbox2-autosize.js)
11
+ - [Modified Slimbox2 with auto resize CSS](http://thydzik.com/downloads/slimbox2-autosize.css)
12
+
7
13
  ## Versioning
8
14
 
9
15
  slimbox2-rails v2.04.x was built with Slimbox v2.04
@@ -1,5 +1,5 @@
1
1
  module Slimbox2
2
2
  module Rails
3
- VERSION = "2.04.2"
3
+ VERSION = "2.04.3"
4
4
  end
5
5
  end
@@ -3,7 +3,7 @@
3
3
  (c) 2007-2010 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" />')[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="#" />').add(H).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.keyCode,M=w.inArray;return(M(N,u.closeKeys)>=0)?C():(M(N,u.nextKeys)>=0)?e():(M(N,u.previousKeys)>=0)?B():false}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 _(){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="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
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)) {
@@ -30,12 +30,21 @@
30
30
  background-repeat: no-repeat;
31
31
  }
32
32
 
33
+ #lbSlide{
34
+ display: block;
35
+ position: absolute;
36
+ width: 100%;
37
+ }
38
+
33
39
  #lbPrevLink, #lbNextLink {
34
40
  display: block;
35
41
  position: absolute;
36
42
  top: 0;
37
43
  width: 50%;
38
44
  outline: none;
45
+ font-size: 100000px; /* Workaround needed for IE */
46
+ overflow: hidden; /* Workaround needed for IE */
47
+ color: #666;
39
48
  }
40
49
 
41
50
  #lbPrevLink {
@@ -47,6 +56,7 @@
47
56
  }
48
57
 
49
58
  #lbNextLink {
59
+ width: 100%;
50
60
  right: 0;
51
61
  }
52
62
 
@@ -80,4 +90,4 @@
80
90
 
81
91
  #lbCaption {
82
92
  font-weight: bold;
83
- }
93
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slimbox2-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.04.2
4
+ version: 2.04.3
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-03-25 00:00:00.000000000 Z
11
+ date: 2013-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler