diff --git a/README.md b/README.md
index aad6e779..51aa9b4e 100644
--- a/README.md
+++ b/README.md
@@ -75,6 +75,8 @@ loopAtEnd: false, // true will return to the first image after the last image is
autoplayVideos: false // true will autoplay Youtube and Vimeo videos
queryStringData: {} // plain object with custom query string arguments to pass/override for video URLs,
toggleClassOnLoad: '' // CSS class that can be toggled when the slide will be loaded (like 'hidden' of Bootstrap)
+titleAttribute: 'title' // attribute to take the image title from
+captionAttribute: 'data-caption' // attribute to take the image caption from
useSVG: true
nextSlide: function(){} // called on next slide, works for next button, arrow keys and touch navigation
prevSlide: function(){} // called on previous slide, works for previous button, arrow keys and touch navigation
diff --git a/index.html b/index.html
index 151eaba5..03e18a6e 100644
--- a/index.html
+++ b/index.html
@@ -61,7 +61,7 @@
Swipebox.
-
-
+
@@ -205,6 +205,8 @@ Options
afterOpen: null, // called after opening
afterClose: function() {}, // called after closing
loopAtEnd: false // true will return to the first image after the last image is reached
+ titleAttribute: 'title', // attribute to take the image title from
+ captionAttribute: 'data-caption', // attribute to take the image caption from
} );
} )( jQuery );
diff --git a/scss/swipebox.scss b/scss/swipebox.scss
index 0448b4c9..83842958 100644
--- a/scss/swipebox.scss
+++ b/scss/swipebox.scss
@@ -115,7 +115,7 @@ html.swipebox-html.swipebox-touch {
position: absolute;
left: 0;
z-index: 999;
- height: 50px;
+ min-height: 50px;
width: 100%;
}
@@ -128,10 +128,10 @@ html.swipebox-html.swipebox-touch {
}
#swipebox-top-bar {
- top: -50px;
+ bottom: 100%;
&.visible-bars {
- transform: translate3d(0,50px,0);
+ transform: translate3d(0,100%,0);
}
}
@@ -305,4 +305,9 @@ html.swipebox-html.swipebox-touch {
font-size: 15px;
line-height: 43px;
font-family: Helvetica, Arial, sans-serif;
+
+ div.caption {
+ font-size: 13px;
+ line-height: 20px;
+ }
}
diff --git a/src/css/swipebox.css b/src/css/swipebox.css
index 37d06218..79979099 100644
--- a/src/css/swipebox.css
+++ b/src/css/swipebox.css
@@ -99,7 +99,7 @@ html.swipebox-html.swipebox-touch {
position: absolute;
left: 0;
z-index: 999;
- height: 50px;
+ min-height: 50px;
width: 100%;
}
@@ -112,11 +112,11 @@ html.swipebox-html.swipebox-touch {
}
#swipebox-top-bar {
- top: -50px;
+ bottom: 100%;
}
#swipebox-top-bar.visible-bars {
- -webkit-transform: translate3d(0, 50px, 0);
- transform: translate3d(0, 50px, 0);
+ -webkit-transform: translate3d(0, 100%, 0);
+ transform: translate3d(0, 100%, 0);
}
#swipebox-title {
@@ -293,3 +293,7 @@ html.swipebox-html.swipebox-touch {
line-height: 43px;
font-family: Helvetica, Arial, sans-serif;
}
+#swipebox-top-bar div.caption {
+ font-size:13px;
+ line-height: 20px;
+}
diff --git a/src/css/swipebox.min.css b/src/css/swipebox.min.css
index 38db35c8..baf20abb 100644
--- a/src/css/swipebox.min.css
+++ b/src/css/swipebox.min.css
@@ -1 +1 @@
-/*! Swipebox v1.3.0 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */html.swipebox-html.swipebox-touch{overflow:hidden!important}#swipebox-overlay img{border:none!important}#swipebox-overlay{width:100%;height:100%;position:fixed;top:0;left:0;z-index:99999!important;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#swipebox-container{position:relative;width:100%;height:100%}#swipebox-slider{-webkit-transition:-webkit-transform .4s ease;transition:transform .4s ease;height:100%;left:0;top:0;width:100%;white-space:nowrap;position:absolute;display:none;cursor:pointer}#swipebox-slider .slide{height:100%;width:100%;line-height:1px;text-align:center;display:inline-block}#swipebox-slider .slide:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}#swipebox-slider .slide .swipebox-inline-container,#swipebox-slider .slide .swipebox-video-container,#swipebox-slider .slide img{display:inline-block;max-height:100%;max-width:100%;margin:0;padding:0;width:auto;height:auto;vertical-align:middle}#swipebox-slider .slide .swipebox-video-container{background:0 0;max-width:1140px;max-height:100%;width:100%;padding:5%;-webkit-box-sizing:border-box;box-sizing:border-box}#swipebox-slider .slide .swipebox-video-container .swipebox-video{width:100%;height:0;padding-bottom:56.25%;overflow:hidden;position:relative}#swipebox-slider .slide .swipebox-video-container .swipebox-video iframe{width:100%!important;height:100%!important;position:absolute;top:0;left:0}#swipebox-slider .slide-loading{background:url(../img/loader.gif) center center no-repeat}#swipebox-bottom-bar,#swipebox-top-bar{-webkit-transition:.5s;transition:.5s;position:absolute;left:0;z-index:999;height:50px;width:100%}#swipebox-bottom-bar{bottom:-50px}#swipebox-bottom-bar.visible-bars{-webkit-transform:translate3d(0,-50px,0);transform:translate3d(0,-50px,0)}#swipebox-top-bar{top:-50px}#swipebox-top-bar.visible-bars{-webkit-transform:translate3d(0,50px,0);transform:translate3d(0,50px,0)}#swipebox-title{display:block;width:100%;text-align:center}#swipebox-close,#swipebox-next,#swipebox-prev{background-image:url(../img/icons.png);background-repeat:no-repeat;border:none!important;text-decoration:none!important;cursor:pointer;width:50px;height:50px;top:0}#swipebox-arrows{display:block;margin:0 auto;width:100%;height:50px}#swipebox-prev{background-position:-32px 13px;float:left}#swipebox-next{background-position:-78px 13px;float:right}#swipebox-close{top:0;right:0;position:absolute;z-index:9999;background-position:15px 12px}.swipebox-no-close-button #swipebox-close{display:none}#swipebox-next.disabled,#swipebox-prev.disabled{opacity:.3}.swipebox-no-touch #swipebox-overlay.rightSpring #swipebox-slider{-webkit-animation:rightSpring .3s;animation:rightSpring .3s}.swipebox-no-touch #swipebox-overlay.leftSpring #swipebox-slider{-webkit-animation:leftSpring .3s;animation:leftSpring .3s}.swipebox-touch #swipebox-container:after,.swipebox-touch #swipebox-container:before{-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition:all .3s ease;transition:all .3s ease;content:' ';position:absolute;z-index:999;top:0;height:100%;width:20px;opacity:0}.swipebox-touch #swipebox-container:before{left:0;-webkit-box-shadow:inset 10px 0 10px -8px #656565;box-shadow:inset 10px 0 10px -8px #656565}.swipebox-touch #swipebox-container:after{right:0;-webkit-box-shadow:inset -10px 0 10px -8px #656565;box-shadow:inset -10px 0 10px -8px #656565}.swipebox-touch #swipebox-overlay.leftSpringTouch #swipebox-container:before,.swipebox-touch #swipebox-overlay.rightSpringTouch #swipebox-container:after{opacity:1}@-webkit-keyframes rightSpring{0%{left:0}50%{left:-30px}100%{left:0}}@keyframes rightSpring{0%{left:0}50%{left:-30px}100%{left:0}}@-webkit-keyframes leftSpring{0%{left:0}50%{left:30px}100%{left:0}}@keyframes leftSpring{0%{left:0}50%{left:30px}100%{left:0}}@media screen and (min-width:800px){#swipebox-close{right:10px}#swipebox-arrows{width:92%;max-width:800px}}#swipebox-overlay{background:#0d0d0d}#swipebox-bottom-bar,#swipebox-top-bar{text-shadow:1px 1px 1px #000;background:#000;opacity:.95}#swipebox-top-bar{color:#fff!important;font-size:15px;line-height:43px;font-family:Helvetica,Arial,sans-serif}
\ No newline at end of file
+/*! Swipebox v1.3.0 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */html.swipebox-html.swipebox-touch{overflow:hidden!important}#swipebox-overlay img{border:none!important}#swipebox-overlay{width:100%;height:100%;position:fixed;top:0;left:0;z-index:99999!important;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#swipebox-container{position:relative;width:100%;height:100%}#swipebox-slider{-webkit-transition:-webkit-transform .4s ease;transition:transform .4s ease;height:100%;left:0;top:0;width:100%;white-space:nowrap;position:absolute;display:none;cursor:pointer}#swipebox-slider .slide{height:100%;width:100%;line-height:1px;text-align:center;display:inline-block}#swipebox-slider .slide:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}#swipebox-slider .slide .swipebox-inline-container,#swipebox-slider .slide .swipebox-video-container,#swipebox-slider .slide img{display:inline-block;max-height:100%;max-width:100%;margin:0;padding:0;width:auto;height:auto;vertical-align:middle}#swipebox-slider .slide .swipebox-video-container{background:0 0;max-width:1140px;max-height:100%;width:100%;padding:5%;-webkit-box-sizing:border-box;box-sizing:border-box}#swipebox-slider .slide .swipebox-video-container .swipebox-video{width:100%;height:0;padding-bottom:56.25%;overflow:hidden;position:relative}#swipebox-slider .slide .swipebox-video-container .swipebox-video iframe{width:100%!important;height:100%!important;position:absolute;top:0;left:0}#swipebox-slider .slide-loading{background:url(../img/loader.gif) no-repeat center center}#swipebox-bottom-bar,#swipebox-top-bar{-webkit-transition:.5s;transition:.5s;position:absolute;left:0;z-index:999;min-height:50px;width:100%}#swipebox-bottom-bar{bottom:-50px}#swipebox-bottom-bar.visible-bars{-webkit-transform:translate3d(0,-50px,0);transform:translate3d(0,-50px,0)}#swipebox-top-bar{bottom:100%}#swipebox-top-bar.visible-bars{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}#swipebox-title{display:block;width:100%;text-align:center}#swipebox-close,#swipebox-next,#swipebox-prev{background-image:url(../img/icons.png);background-repeat:no-repeat;border:none!important;text-decoration:none!important;cursor:pointer;width:50px;height:50px;top:0}#swipebox-arrows{display:block;margin:0 auto;width:100%;height:50px}#swipebox-prev{background-position:-32px 13px;float:left}#swipebox-next{background-position:-78px 13px;float:right}#swipebox-close{top:0;right:0;position:absolute;z-index:9999;background-position:15px 12px}.swipebox-no-close-button #swipebox-close{display:none}#swipebox-next.disabled,#swipebox-prev.disabled{opacity:.3}.swipebox-no-touch #swipebox-overlay.rightSpring #swipebox-slider{-webkit-animation:rightSpring .3s;animation:rightSpring .3s}.swipebox-no-touch #swipebox-overlay.leftSpring #swipebox-slider{-webkit-animation:leftSpring .3s;animation:leftSpring .3s}.swipebox-touch #swipebox-container:after,.swipebox-touch #swipebox-container:before{-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition:all .3s ease;transition:all .3s ease;content:' ';position:absolute;z-index:999;top:0;height:100%;width:20px;opacity:0}.swipebox-touch #swipebox-container:before{left:0;-webkit-box-shadow:inset 10px 0 10px -8px #656565;box-shadow:inset 10px 0 10px -8px #656565}.swipebox-touch #swipebox-container:after{right:0;-webkit-box-shadow:inset -10px 0 10px -8px #656565;box-shadow:inset -10px 0 10px -8px #656565}.swipebox-touch #swipebox-overlay.leftSpringTouch #swipebox-container:before{opacity:1}.swipebox-touch #swipebox-overlay.rightSpringTouch #swipebox-container:after{opacity:1}@-webkit-keyframes rightSpring{0%{left:0}50%{left:-30px}100%{left:0}}@keyframes rightSpring{0%{left:0}50%{left:-30px}100%{left:0}}@-webkit-keyframes leftSpring{0%{left:0}50%{left:30px}100%{left:0}}@keyframes leftSpring{0%{left:0}50%{left:30px}100%{left:0}}@media screen and (min-width:800px){#swipebox-close{right:10px}#swipebox-arrows{width:92%;max-width:800px}}#swipebox-overlay{background:#0d0d0d}#swipebox-bottom-bar,#swipebox-top-bar{text-shadow:1px 1px 1px #000;background:#000;opacity:.95}#swipebox-top-bar{color:#fff!important;font-size:15px;line-height:43px;font-family:Helvetica,Arial,sans-serif}#swipebox-top-bar div.caption{font-size:13px;line-height:20px}
diff --git a/src/js/jquery.swipebox.js b/src/js/jquery.swipebox.js
index c8a35291..d48a5ec0 100644
--- a/src/js/jquery.swipebox.js
+++ b/src/js/jquery.swipebox.js
@@ -26,7 +26,9 @@
loopAtEnd: false,
autoplayVideos: false,
queryStringData: {},
- toggleClassOnLoad: ''
+ toggleClassOnLoad: '',
+ titleAttribute: 'title',
+ captionAttribute: 'data-caption'
},
plugin = this,
@@ -116,10 +118,15 @@
$elem.each( function() {
var title = null,
+ caption = null,
href = null;
- if ( $( this ).attr( 'title' ) ) {
- title = $( this ).attr( 'title' );
+ if ( $( this ).attr( plugin.settings.titleAttribute ) ) {
+ title = $( this ).attr( plugin.settings.titleAttribute );
+ }
+
+ if ( $( this ).attr( plugin.settings.captionAttribute ) ) {
+ caption = $( this ).attr( plugin.settings.captionAttribute );
}
if ( $( this ).attr( 'href' ) ) {
@@ -128,7 +135,8 @@
elements.push( {
href: href,
- title: title
+ title: title,
+ caption: caption
} );
} );
@@ -710,16 +718,27 @@
*/
setTitle : function ( index ) {
var title = null;
+ var caption = null;
$( '#swipebox-title' ).empty();
if ( elements[ index ] !== undefined ) {
title = elements[ index ].title;
+ caption = elements[ index ].caption;
}
- if ( title ) {
+ if ( title || caption ) {
$( '#swipebox-top-bar' ).show();
- $( '#swipebox-title' ).append( title );
+
+ if ( title ) {
+ var tdiv = $( '' ).addClass( 'title' ).html( title );
+ $( '#swipebox-title' ).append( tdiv );
+ }
+
+ if ( caption ) {
+ var cdiv = $( '' ).addClass( 'caption' ).html( caption );
+ $( '#swipebox-title' ).append( cdiv );
+ }
} else {
$( '#swipebox-top-bar' ).hide();
}
diff --git a/src/js/jquery.swipebox.min.js b/src/js/jquery.swipebox.min.js
index 1a54f1c3..c08fea50 100644
--- a/src/js/jquery.swipebox.min.js
+++ b/src/js/jquery.swipebox.min.js
@@ -1,2 +1 @@
-/*! Swipebox v1.5.1 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */
-!function(a,b,c,d){c.swipebox=function(e,f){c(e).addClass("swipebox");var g,h,i={useCSS:!0,useSVG:!0,initialIndexOnArray:0,removeBarsOnMobile:!0,hideCloseButtonOnMobile:!1,hideBarsDelay:3e3,videoMaxWidth:1140,vimeoColor:"cccccc",beforeOpen:null,afterOpen:null,afterClose:null,afterMedia:null,nextSlide:null,prevSlide:null,loopAtEnd:!1,autoplayVideos:!1,queryStringData:{},toggleClassOnLoad:""},j=this,k=[],l=".swipebox",m=navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i),n=null!==m||b.createTouch!==d||"ontouchstart"in a||"onmsgesturechange"in a||navigator.msMaxTouchPoints,o=!!b.createElementNS&&!!b.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,p=a.innerWidth?a.innerWidth:c(a).width(),q=a.innerHeight?a.innerHeight:c(a).height(),r=0;j.settings={},c.swipebox.close=function(){g.closeSlide()},c.swipebox.extend=function(){return g},j.init=function(){j.settings=c.extend({},i,f),Array.isArray(e)?(k=e,g.target=c(a),g.init(j.settings.initialIndexOnArray)):c(b).on("click",l,function(a){if("slide current"===a.target.parentNode.className)return!1;Array.isArray(e)||(g.destroy(),h=c(l),g.actions()),k=[];var b,d,f;f||(d="data-rel",f=c(this).attr(d)),f||(d="rel",f=c(this).attr(d)),h=f&&""!==f&&"nofollow"!==f?c(l).filter("["+d+'="'+f+'"]'):c(l),h.each(function(){var a=null,b=null;c(this).attr("title")&&(a=c(this).attr("title")),c(this).attr("href")&&(b=c(this).attr("href")),k.push({href:b,title:a})}),b=h.index(c(this)),a.preventDefault(),a.stopPropagation(),g.target=c(a.target),g.init(b)})},g={init:function(a){j.settings.beforeOpen&&j.settings.beforeOpen(),this.target.trigger("swipebox-start"),c.swipebox.isOpen=!0,this.build(),this.openSlide(a),this.openMedia(a),this.preloadMedia(a+1),this.preloadMedia(a-1),j.settings.afterOpen&&j.settings.afterOpen(a)},build:function(){var a,b=this;c("body").append('\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t
'),o&&!0===j.settings.useSVG&&(a=c("#swipebox-close").css("background-image"),a=a.replace("png","svg"),c("#swipebox-prev, #swipebox-next, #swipebox-close").css({"background-image":a})),m&&j.settings.removeBarsOnMobile&&c("#swipebox-bottom-bar, #swipebox-top-bar").remove(),c.each(k,function(){c("#swipebox-slider").append('')}),b.setDim(),b.actions(),n&&b.gesture(),b.keyboard(),b.animBars(),b.resize()},setDim:function(){var b,d,e={};"onorientationchange"in a?a.addEventListener("orientationchange",function(){0===a.orientation?(b=p,d=q):90!==a.orientation&&-90!==a.orientation||(b=q,d=p)},!1):(b=a.innerWidth?a.innerWidth:c(a).width(),d=a.innerHeight?a.innerHeight:c(a).height()),e={width:b,height:d},c("#swipebox-overlay").css(e)},resize:function(){var b=this;c(a).resize(function(){b.setDim()}).resize()},supportTransition:function(){var a,c="transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition".split(" ");for(a=0;a=m||i)){var q=.75-Math.abs(d)/s.height();s.css({top:d+"px"}),s.css({opacity:q}),i=!0}e=b,b=o.pageX-n.pageX,g=100*b/p,!j&&!i&&Math.abs(b)>=l&&(c("#swipebox-slider").css({"-webkit-transition":"",transition:""}),j=!0),j&&(0b&&(k.length===a+1?c("#swipebox-overlay").addClass("rightSpringTouch"):(c("#swipebox-overlay").removeClass("leftSpringTouch").removeClass("rightSpringTouch"),c("#swipebox-slider").css({"-webkit-transform":"translate3d("+(r+g)+"%, 0, 0)",transform:"translate3d("+(r+g)+"%, 0, 0)"}))))}),!1}).bind("touchend",function(a){if(a.preventDefault(),a.stopPropagation(),c("#swipebox-slider").css({"-webkit-transition":"-webkit-transform 0.4s ease",transition:"transform 0.4s ease"}),d=o.pageY-n.pageY,b=o.pageX-n.pageX,g=100*b/p,i)if(i=!1,Math.abs(d)>=2*m&&Math.abs(d)>Math.abs(f)){var k=d>0?s.height():-s.height();s.animate({top:k+"px",opacity:0},300,function(){h.closeSlide()})}else s.animate({top:0,opacity:1},300);else j?(j=!1,b>=l&&b>=e?h.getPrev():b<=-l&&b<=e&&h.getNext()):q.hasClass("visible-bars")?(h.clearTimeout(),h.hideBars()):(h.showBars(),h.setTimeout());c("#swipebox-slider").css({"-webkit-transform":"translate3d("+r+"%, 0, 0)",transform:"translate3d("+r+"%, 0, 0)"}),c("#swipebox-overlay").removeClass("leftSpringTouch").removeClass("rightSpringTouch"),c(".touching").off("touchmove").removeClass("touching")})},setTimeout:function(){if(j.settings.hideBarsDelay>0){var b=this;b.clearTimeout(),b.timeout=a.setTimeout(function(){b.hideBars()},j.settings.hideBarsDelay)}},clearTimeout:function(){a.clearTimeout(this.timeout),this.timeout=null},showBars:function(){var a=c("#swipebox-top-bar, #swipebox-bottom-bar");this.doCssTrans()?a.addClass("visible-bars"):(c("#swipebox-top-bar").animate({top:0},500),c("#swipebox-bottom-bar").animate({bottom:0},500),setTimeout(function(){a.addClass("visible-bars")},1e3))},hideBars:function(){var a=c("#swipebox-top-bar, #swipebox-bottom-bar");this.doCssTrans()?a.removeClass("visible-bars"):(c("#swipebox-top-bar").animate({top:"-50px"},500),c("#swipebox-bottom-bar").animate({bottom:"-50px"},500),setTimeout(function(){a.removeClass("visible-bars")},1e3))},animBars:function(){var a=this,b=c("#swipebox-top-bar, #swipebox-bottom-bar");b.addClass("visible-bars"),a.setTimeout(),c("#swipebox-slider").click(function(){b.hasClass("visible-bars")||(a.showBars(),a.setTimeout())}),c("#swipebox-bottom-bar").hover(function(){a.showBars(),b.addClass("visible-bars"),a.clearTimeout()},function(){j.settings.hideBarsDelay>0&&(b.removeClass("visible-bars"),a.setTimeout())})},keyboard:function(){var b=this;c(a).bind("keyup",function(a){a.preventDefault(),a.stopPropagation(),37===a.keyCode?b.getPrev():39===a.keyCode?b.getNext():27===a.keyCode&&b.closeSlide()})},actions:function(){var a=this,b="touchend click";k.length<2?(c("#swipebox-bottom-bar").hide(),d===k[1]&&c("#swipebox-top-bar").hide()):(c("#swipebox-prev").bind(b,function(b){b.preventDefault(),b.stopPropagation(),a.getPrev(),a.setTimeout()}),c("#swipebox-next").bind(b,function(b){b.preventDefault(),b.stopPropagation(),a.getNext(),a.setTimeout()})),c("#swipebox-close").bind(b,function(b){b.preventDefault(),b.stopPropagation(),a.closeSlide()})},setSlide:function(a,b){b=b||!1;var d=c("#swipebox-slider");r=100*-a,this.doCssTrans()?d.css({"-webkit-transform":"translate3d("+100*-a+"%, 0, 0)",transform:"translate3d("+100*-a+"%, 0, 0)"}):d.animate({left:100*-a+"%"}),c("#swipebox-slider .slide").removeClass("current"),c("#swipebox-slider .slide").eq(a).addClass("current"),this.setTitle(a),b&&d.fadeIn(),c("#swipebox-prev, #swipebox-next").removeClass("disabled"),0===a?c("#swipebox-prev").addClass("disabled"):a===k.length-1&&!0!==j.settings.loopAtEnd&&c("#swipebox-next").addClass("disabled")},openSlide:function(b){c("html").addClass("swipebox-html"),n?(c("html").addClass("swipebox-touch"),j.settings.hideCloseButtonOnMobile&&c("html").addClass("swipebox-no-close-button")):c("html").addClass("swipebox-no-touch"),c(a).trigger("resize"),this.setSlide(b,!0)},preloadMedia:function(a){var b=this,c=null;k[a]!==d&&(c=k[a].href),b.isVideo(c)?b.openMedia(a):setTimeout(function(){b.openMedia(a)},1e3)},openMedia:function(a){var b,e,f=this;if(k[a]!==d&&(b=k[a].href),a<0||a>=k.length)return!1;e=c("#swipebox-slider .slide").eq(a),f.isVideo(b)?(e.html(f.getVideo(b)),j.settings.afterMedia&&j.settings.afterMedia(a)):(e.addClass("slide-loading"),f.loadMedia(b,function(){e.removeClass("slide-loading"),e.html(this),j.settings.afterMedia&&j.settings.afterMedia(a)}))},setTitle:function(a){var b=null;c("#swipebox-title").empty(),k[a]!==d&&(b=k[a].title),b?(c("#swipebox-top-bar").show(),c("#swipebox-title").append(b)):c("#swipebox-top-bar").hide()},isVideo:function(a){if(a){if(a.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||a.match(/vimeo\.com\/([0-9]*)/)||a.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/))return!0;if(a.toLowerCase().indexOf("swipeboxvideo=1")>=0)return!0}},parseUri:function(a,d){var e=b.createElement("a"),f={};return e.href=decodeURIComponent(a),e.search&&(f=JSON.parse('{"'+e.search.toLowerCase().replace("?","").replace(/&/g,'","').replace(/=/g,'":"')+'"}')),c.isPlainObject(d)&&(f=c.extend(f,d,j.settings.queryStringData)),c.map(f,function(a,b){if(a&&a>"")return encodeURIComponent(b)+"="+encodeURIComponent(a)}).join("&")},getVideo:function(a){var b="",c=a.match(/((?:www\.)?youtube\.com|(?:www\.)?youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/),d=a.match(/(?:www\.)?youtu\.be\/([a-zA-Z0-9\-_]+)/),e=a.match(/(?:www\.)?vimeo\.com\/([0-9]*)/),f="";return c||d?(d&&(c=d),console.log(c),f=g.parseUri(a,{autoplay:j.settings.autoplayVideos?"1":"0",v:""}),b=''):e?(f=g.parseUri(a,{autoplay:j.settings.autoplayVideos?"1":"0",byline:"0",portrait:"0",color:j.settings.vimeoColor}),b=''):b='','"},loadMedia:function(a,b){if(0===a.trim().indexOf("#"))b.call(c("",{class:"swipebox-inline-container"}).append(c(a).clone().toggleClass(j.settings.toggleClassOnLoad)));else if(!this.isVideo(a)){var d=c("
").on("load",function(){b.call(d)});d.attr("src",a)}},getNext:function(){var a,b=this,d=c("#swipebox-slider .slide").index(c("#swipebox-slider .slide.current"));d+1
0?(a=c("#swipebox-slider .slide").eq(b).contents().find("iframe").attr("src"),c("#swipebox-slider .slide").eq(b).contents().find("iframe").attr("src",a),b--,this.setSlide(b),this.preloadMedia(b-1),j.settings.prevSlide&&j.settings.prevSlide(b)):(c("#swipebox-overlay").addClass("leftSpring"),setTimeout(function(){c("#swipebox-overlay").removeClass("leftSpring")},500))},nextSlide:function(a){},prevSlide:function(a){},closeSlide:function(){c("html").removeClass("swipebox-html"),c("html").removeClass("swipebox-touch"),c(a).trigger("resize"),this.destroy()},destroy:function(){c(a).unbind("keyup"),c("body").unbind("touchstart"),c("body").unbind("touchmove"),c("body").unbind("touchend"),c("#swipebox-slider").unbind(),c("#swipebox-overlay").remove(),Array.isArray(e)||e.removeData("_swipebox"),this.target&&this.target.trigger("swipebox-destroy"),c.swipebox.isOpen=!1,j.settings.afterClose&&j.settings.afterClose()}},j.init()},c.fn.swipebox=function(a){if(!c.data(this,"_swipebox")){var b=new c.swipebox(this,a);this.data("_swipebox",b)}return this.data("_swipebox")}}(window,document,jQuery);
\ No newline at end of file
+!function(a,b,$,c){$.swipebox=function(e,h){$(e).addClass("swipebox");var f,i,j={useCSS:!0,useSVG:!0,initialIndexOnArray:0,removeBarsOnMobile:!0,hideCloseButtonOnMobile:!1,hideBarsDelay:3e3,videoMaxWidth:1140,vimeoColor:"cccccc",beforeOpen:null,afterOpen:null,afterClose:null,afterMedia:null,nextSlide:null,prevSlide:null,loopAtEnd:!1,autoplayVideos:!1,queryStringData:{},toggleClassOnLoad:"",titleAttribute:"title",captionAttribute:"data-caption"},d=this,k=[],l=".swipebox",g=navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i),m=null!==g||c!==b.createTouch||"ontouchstart"in a||"onmsgesturechange"in a||navigator.msMaxTouchPoints,n=!!b.createElementNS&&!!b.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,o=a.innerWidth?a.innerWidth:$(a).width(),p=a.innerHeight?a.innerHeight:$(a).height(),q=0;d.settings={},$.swipebox.close=function(){f.closeSlide()},$.swipebox.extend=function(){return f},d.init=function(){d.settings=$.extend({},j,h),Array.isArray(e)?(k=e,f.target=$(a),f.init(d.settings.initialIndexOnArray)):$(b).on("click",l,function(c){var g,b,a;if("slide current"===c.target.parentNode.className)return!1;Array.isArray(e)||(f.destroy(),i=$(l),f.actions()),k=[],a||(b="data-rel",a=$(this).attr(b)),a||(b="rel",a=$(this).attr(b)),(i=a&&""!==a&&"nofollow"!==a?$(l).filter("["+b+'="'+a+'"]'):$(l)).each(function(){var a=null,b=null,c=null;$(this).attr(d.settings.titleAttribute)&&(a=$(this).attr(d.settings.titleAttribute)),$(this).attr(d.settings.captionAttribute)&&(b=$(this).attr(d.settings.captionAttribute)),$(this).attr("href")&&(c=$(this).attr("href")),k.push({href:c,title:a,caption:b})}),g=i.index($(this)),c.preventDefault(),c.stopPropagation(),f.target=$(c.target),f.init(g)})},f={init:function(a){d.settings.beforeOpen&&d.settings.beforeOpen(),this.target.trigger("swipebox-start"),$.swipebox.isOpen=!0,this.build(),this.openSlide(a),this.openMedia(a),this.preloadMedia(a+1),this.preloadMedia(a-1),d.settings.afterOpen&&d.settings.afterOpen(a)},build:function(){var a;$("body").append(''),n&& !0===d.settings.useSVG&&(a=(a=$("#swipebox-close").css("background-image")).replace("png","svg"),$("#swipebox-prev, #swipebox-next, #swipebox-close").css({"background-image":a})),g&&d.settings.removeBarsOnMobile&&$("#swipebox-bottom-bar, #swipebox-top-bar").remove(),$.each(k,function(){$("#swipebox-slider").append('')}),this.setDim(),this.actions(),m&&this.gesture(),this.keyboard(),this.animBars(),this.resize()},setDim:function(){var b,c,d={};"onorientationchange"in a?a.addEventListener("orientationchange",function(){0===a.orientation?(b=o,c=p):(90===a.orientation|| -90===a.orientation)&&(b=p,c=o)},!1):(b=a.innerWidth?a.innerWidth:$(a).width(),c=a.innerHeight?a.innerHeight:$(a).height()),d={width:b,height:c},$("#swipebox-overlay").css(d)},resize:function(){var b=this;$(a).resize(function(){b.setDim()}).resize()},supportTransition:function(){var a,d="transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition".split(" ");for(a=0;a=50||i)){var b=.75-Math.abs(e)/n.height();n.css({top:e+"px"}),n.css({opacity:b}),i=!0}f=d,h=100*(d=m.pageX-l.pageX)/o,!j&&!i&&Math.abs(d)>=10&&($("#swipebox-slider").css({"-webkit-transition":"",transition:""}),j=!0),j&&(0d&&(k.length===c+1?$("#swipebox-overlay").addClass("rightSpringTouch"):($("#swipebox-overlay").removeClass("leftSpringTouch").removeClass("rightSpringTouch"),$("#swipebox-slider").css({"-webkit-transform":"translate3d("+(q+h)+"%, 0, 0)",transform:"translate3d("+(q+h)+"%, 0, 0)"}))))}),!1}).bind("touchend",function(c){if(c.preventDefault(),c.stopPropagation(),$("#swipebox-slider").css({"-webkit-transition":"-webkit-transform 0.4s ease",transition:"transform 0.4s ease"}),e=m.pageY-l.pageY,d=m.pageX-l.pageX,h=100*d/o,i){if(i=!1,Math.abs(e)>=100&&Math.abs(e)>Math.abs(g)){var k=e>0?n.height():-n.height();n.animate({top:k+"px",opacity:0},300,function(){a.closeSlide()})}else n.animate({top:0,opacity:1},300)}else j?(j=!1,d>=10&&d>=f?a.getPrev():d<= -10&&d<=f&&a.getNext()):b.hasClass("visible-bars")?(a.clearTimeout(),a.hideBars()):(a.showBars(),a.setTimeout());$("#swipebox-slider").css({"-webkit-transform":"translate3d("+q+"%, 0, 0)",transform:"translate3d("+q+"%, 0, 0)"}),$("#swipebox-overlay").removeClass("leftSpringTouch").removeClass("rightSpringTouch"),$(".touching").off("touchmove").removeClass("touching")})},setTimeout:function(){if(d.settings.hideBarsDelay>0){var b=this;b.clearTimeout(),b.timeout=a.setTimeout(function(){b.hideBars()},d.settings.hideBarsDelay)}},clearTimeout:function(){a.clearTimeout(this.timeout),this.timeout=null},showBars:function(){var a=$("#swipebox-top-bar, #swipebox-bottom-bar");this.doCssTrans()?a.addClass("visible-bars"):($("#swipebox-top-bar").animate({top:0},500),$("#swipebox-bottom-bar").animate({bottom:0},500),setTimeout(function(){a.addClass("visible-bars")},1e3))},hideBars:function(){var a=$("#swipebox-top-bar, #swipebox-bottom-bar");this.doCssTrans()?a.removeClass("visible-bars"):($("#swipebox-top-bar").animate({top:"-50px"},500),$("#swipebox-bottom-bar").animate({bottom:"-50px"},500),setTimeout(function(){a.removeClass("visible-bars")},1e3))},animBars:function(){var a=this,b=$("#swipebox-top-bar, #swipebox-bottom-bar");b.addClass("visible-bars"),a.setTimeout(),$("#swipebox-slider").click(function(){b.hasClass("visible-bars")||(a.showBars(),a.setTimeout())}),$("#swipebox-bottom-bar").hover(function(){a.showBars(),b.addClass("visible-bars"),a.clearTimeout()},function(){d.settings.hideBarsDelay>0&&(b.removeClass("visible-bars"),a.setTimeout())})},keyboard:function(){var b=this;$(a).bind("keyup",function(a){a.preventDefault(),a.stopPropagation(),37===a.keyCode?b.getPrev():39===a.keyCode?b.getNext():27===a.keyCode&&b.closeSlide()})},actions:function(){var b=this,a="touchend click";k.length<2?($("#swipebox-bottom-bar").hide(),c===k[1]&&$("#swipebox-top-bar").hide()):($("#swipebox-prev").bind(a,function(a){a.preventDefault(),a.stopPropagation(),b.getPrev(),b.setTimeout()}),$("#swipebox-next").bind(a,function(a){a.preventDefault(),a.stopPropagation(),b.getNext(),b.setTimeout()})),$("#swipebox-close").bind(a,function(a){a.preventDefault(),a.stopPropagation(),b.closeSlide()})},setSlide:function(a,b){b=b||!1;var c=$("#swipebox-slider");q=-(100*a),this.doCssTrans()?c.css({"-webkit-transform":"translate3d("+ -(100*a)+"%, 0, 0)",transform:"translate3d("+ -(100*a)+"%, 0, 0)"}):c.animate({left:-(100*a)+"%"}),$("#swipebox-slider .slide").removeClass("current"),$("#swipebox-slider .slide").eq(a).addClass("current"),this.setTitle(a),b&&c.fadeIn(),$("#swipebox-prev, #swipebox-next").removeClass("disabled"),0===a?$("#swipebox-prev").addClass("disabled"):a===k.length-1&& !0!==d.settings.loopAtEnd&&$("#swipebox-next").addClass("disabled")},openSlide:function(b){$("html").addClass("swipebox-html"),m?($("html").addClass("swipebox-touch"),d.settings.hideCloseButtonOnMobile&&$("html").addClass("swipebox-no-close-button")):$("html").addClass("swipebox-no-touch"),$(a).trigger("resize"),this.setSlide(b,!0)},preloadMedia:function(a){var b=this,d=null;c!==k[a]&&(d=k[a].href),b.isVideo(d)?b.openMedia(a):setTimeout(function(){b.openMedia(a)},1e3)},openMedia:function(a){var b,e;if(c!==k[a]&&(b=k[a].href),a<0||a>=k.length)return!1;e=$("#swipebox-slider .slide").eq(a),this.isVideo(b)?(e.html(this.getVideo(b)),d.settings.afterMedia&&d.settings.afterMedia(a)):(e.addClass("slide-loading"),this.loadMedia(b,function(){e.removeClass("slide-loading"),e.html(this),d.settings.afterMedia&&d.settings.afterMedia(a)}))},setTitle:function(d){var a=null,b=null;if($("#swipebox-title").empty(),c!==k[d]&&(a=k[d].title,b=k[d].caption),a||b){if($("#swipebox-top-bar").show(),a){var e=$("").addClass("title").html(a);$("#swipebox-title").append(e)}if(b){var f=$("").addClass("caption").html(b);$("#swipebox-title").append(f)}}else $("#swipebox-top-bar").hide()},isVideo:function(a){if(a&&(a.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||a.match(/vimeo\.com\/([0-9]*)/)||a.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||a.toLowerCase().indexOf("swipeboxvideo=1")>=0))return!0},parseUri:function(f,e){var c=b.createElement("a"),a={};return c.href=decodeURIComponent(f),c.search&&(a=JSON.parse('{"'+c.search.toLowerCase().replace("?","").replace(/&/g,'","').replace(/=/g,'":"')+'"}')),$.isPlainObject(e)&&(a=$.extend(a,e,d.settings.queryStringData)),$.map(a,function(a,b){if(a&&a>"")return encodeURIComponent(b)+"="+encodeURIComponent(a)}).join("&")},getVideo:function(a){var c="",b=a.match(/((?:www\.)?youtube\.com|(?:www\.)?youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/),g=a.match(/(?:www\.)?youtu\.be\/([a-zA-Z0-9\-_]+)/),h=a.match(/(?:www\.)?vimeo\.com\/([0-9]*)/),e="";return b||g?(g&&(b=g),console.log(b),e=f.parseUri(a,{autoplay:d.settings.autoplayVideos?"1":"0",v:""}),c=''):h?(e=f.parseUri(a,{autoplay:d.settings.autoplayVideos?"1":"0",byline:"0",portrait:"0",color:d.settings.vimeoColor}),c=''):c='','"},loadMedia:function(a,b){if(0===a.trim().indexOf("#"))b.call($("",{class:"swipebox-inline-container"}).append($(a).clone().toggleClass(d.settings.toggleClassOnLoad)));else if(!this.isVideo(a)){var c=$("
").on("load",function(){b.call(c)});c.attr("src",a)}},getNext:function(){var b,a=$("#swipebox-slider .slide").index($("#swipebox-slider .slide.current"));a+1
0?(b=$("#swipebox-slider .slide").eq(a).contents().find("iframe").attr("src"),$("#swipebox-slider .slide").eq(a).contents().find("iframe").attr("src",b),a--,this.setSlide(a),this.preloadMedia(a-1),d.settings.prevSlide&&d.settings.prevSlide(a)):($("#swipebox-overlay").addClass("leftSpring"),setTimeout(function(){$("#swipebox-overlay").removeClass("leftSpring")},500))},nextSlide:function(a){},prevSlide:function(a){},closeSlide:function(){$("html").removeClass("swipebox-html"),$("html").removeClass("swipebox-touch"),$(a).trigger("resize"),this.destroy()},destroy:function(){$(a).unbind("keyup"),$("body").unbind("touchstart"),$("body").unbind("touchmove"),$("body").unbind("touchend"),$("#swipebox-slider").unbind(),$("#swipebox-overlay").remove(),Array.isArray(e)||e.removeData("_swipebox"),this.target&&this.target.trigger("swipebox-destroy"),$.swipebox.isOpen=!1,d.settings.afterClose&&d.settings.afterClose()}},d.init()},$.fn.swipebox=function(a){if(!$.data(this,"_swipebox")){var b=new $.swipebox(this,a);this.data("_swipebox",b)}return this.data("_swipebox")}}(window,document,jQuery)