/* * VenoBox - jQuery Plugin * version: 1.8.9 * @requires jQuery >= 1.7.0 * * Examples at http://veno.es/venobox/ * License: MIT License * License URI: https://github.com/nicolafranchini/VenoBox/blob/master/LICENSE * Copyright 2013-2020 Nicola Franchini - @nicolafranchini * */ !function(e){"use strict";var s,i,a,t,o,c,r,l,d,n,v,u,b,h,k,p,g,m,f,x,w,y,_,C,z,B,P,M,E,O,D,N,U,V,I,j,R,X,Y,W,q,$,A,H,Q,S,T='',Z='',F='',G='',J='';e.fn.extend({venobox:function(K){var L=this,ee=e.extend({arrowsColor:"#B6B6B6",autoplay:!1,bgcolor:"#fff",border:"0",closeBackground:"transparent",closeColor:"#d2d2d2",framewidth:"",frameheight:"",gallItems:!1,infinigall:!1,htmlClose:"×",htmlNext:"Next",htmlPrev:"Prev",numeratio:!1,numerationBackground:"#161617",numerationColor:"#d2d2d2",numerationPosition:"top",overlayClose:!0,overlayColor:"rgba(23,23,23,0.85)",spinner:"double-bounce",spinColor:"#d2d2d2",titleattr:"title",titleBackground:"#161617",titleColor:"#d2d2d2",titlePosition:"top",share:["facebook","twitter","linkedin","pinterest","download"],cb_pre_open:function(){return!0},cb_post_open:function(){},cb_pre_close:function(){return!0},cb_post_close:function(){},cb_post_resize:function(){},cb_after_nav:function(){},cb_content_loaded:function(){},cb_init:function(){}},K);return ee.cb_init(L),this.each(function(){if((D=e(this)).data("venobox"))return!0;function K(){_=D.data("gall"),f=D.data("numeratio"),h=D.data("gallItems"),k=D.data("infinigall"),H=D.data("share"),o.html(""),"iframe"!==D.data("vbtype")&&"inline"!==D.data("vbtype")&&"ajax"!==D.data("vbtype")&&(Q={pinterest:''+T+"",facebook:''+Z+"",twitter:''+F+"",linkedin:''+G+"",download:''+J+""},e.each(H,function(e,s){o.append(Q[s])})),(p=h||e('.vbox-item[data-gall="'+_+'"]')).length<2&&(k=!1,f=!1),C=p.eq(p.index(D)+1),z=p.eq(p.index(D)-1),C.length||!0!==k||(C=p.eq(0)),p.length>=1?(N=p.index(D)+1,t.html(N+" / "+p.length)):N=1,!0===f?t.show():t.hide(),""!==y?c.show():c.hide(),C.length||!0===k?(e(".vbox-next").css("display","block"),B=!0):(e(".vbox-next").css("display","none"),B=!1),p.index(D)>0||!0===k?(e(".vbox-prev").css("display","block"),P=!0):(e(".vbox-prev").css("display","none"),P=!1),!0!==P&&!0!==B||(d.on(le.DOWN,oe),d.on(le.MOVE,ce),d.on(le.UP,re))}function se(e){return!(e.length<1)&&(!g&&(g=!0,x=e.data("overlay")||e.data("overlaycolor"),u=e.data("framewidth"),b=e.data("frameheight"),r=e.data("border"),i=e.data("bgcolor"),n=e.data("href")||e.attr("href"),s=e.data("autoplay"),y=e.data("titleattr")&&e.attr(e.data("titleattr"))||"",e===z&&d.addClass("vbox-animated").addClass("swipe-right"),e===C&&d.addClass("vbox-animated").addClass("swipe-left"),E.show(),void d.animate({opacity:0},500,function(){w.css("background",x),d.removeClass("vbox-animated").removeClass("swipe-left").removeClass("swipe-right").css({"margin-left":0,"margin-right":0}),"iframe"==e.data("vbtype")?be():"inline"==e.data("vbtype")?ke():"ajax"==e.data("vbtype")?ue():"video"==e.data("vbtype")?he(s):(d.html(''),pe()),D=e,K(),g=!1,ee.cb_after_nav(D,N,C,z)})))}function ie(e){27===e.keyCode&&ae(),37==e.keyCode&&!0===P&&se(z),39==e.keyCode&&!0===B&&se(C)}function ae(){if(!1===ee.cb_pre_close(D,N,C,z))return!1;e("body").off("keydown",ie).removeClass("vbox-open"),D.focus(),w.animate({opacity:0},500,function(){w.remove(),g=!1,ee.cb_post_close()})}L.VBclose=function(){ae()},D.addClass("vbox-item"),D.data("framewidth",ee.framewidth),D.data("frameheight",ee.frameheight),D.data("border",ee.border),D.data("bgcolor",ee.bgcolor),D.data("numeratio",ee.numeratio),D.data("gallItems",ee.gallItems),D.data("infinigall",ee.infinigall),D.data("overlaycolor",ee.overlayColor),D.data("titleattr",ee.titleattr),D.data("share",ee.share),D.data("venobox",!0),D.on("click",function(h){if(h.preventDefault(),D=e(this),!1===ee.cb_pre_open(D))return!1;switch(L.VBnext=function(){se(C)},L.VBprev=function(){se(z)},x=D.data("overlay")||D.data("overlaycolor"),u=D.data("framewidth"),b=D.data("frameheight"),s=D.data("autoplay")||ee.autoplay,r=D.data("border"),i=D.data("bgcolor"),B=!1,P=!1,g=!1,n=D.data("href")||D.attr("href"),v=D.data("css")||"",y=D.attr(D.data("titleattr"))||"",H=D.data("share"),M='
',ee.spinner){case"rotating-plane":M+='
';break;case"double-bounce":M+='
';break;case"wave":M+='
';break;case"wandering-cubes":M+='
';break;case"spinner-pulse":M+='
';break;case"chasing-dots":M+='
';break;case"three-bounce":M+='
';break;case"circle":M+='
';break;case"cube-grid":M+='
';break;case"fading-circle":M+='
';break;case"folding-cube":M+='
'}return M+="
",O=''+ee.htmlNext+''+ee.htmlPrev+"",V='
0/0
'+ee.htmlClose+"
",'
',l='
'+M+'
'+V+O+'
',e("body").append(l).addClass("vbox-open"),e(".vbox-preloader div:not(.sk-circle) .sk-child, .vbox-preloader .sk-rotating-plane, .vbox-preloader .sk-rect, .vbox-preloader div:not(.sk-folding-cube) .sk-cube, .vbox-preloader .sk-spinner-pulse").css("background-color",ee.spinColor),w=e(".vbox-overlay"),e(".vbox-container"),d=e(".vbox-content"),a=e(".vbox-left"),t=e(".vbox-num"),o=e(".vbox-share"),c=e(".vbox-title"),(E=e(".vbox-preloader")).show(),S="top"==ee.titlePosition?"bottom":"top",o.css(S,"-1px"),o.css({color:ee.titleColor,fill:ee.titleColor,"background-color":ee.titleBackground}),c.css(ee.titlePosition,"-1px"),c.css({color:ee.titleColor,"background-color":ee.titleBackground}),e(".vbox-close").css({color:ee.closeColor,"background-color":ee.closeBackground}),a.css(ee.numerationPosition,"-1px"),a.css({color:ee.numerationColor,"background-color":ee.numerationBackground}),e(".vbox-next span, .vbox-prev span").css({"border-top-color":ee.arrowsColor,"border-right-color":ee.arrowsColor}),d.html(""),d.css("opacity","0"),w.css("opacity","0"),K(),w.animate({opacity:1},250,function(){"iframe"==D.data("vbtype")?be():"inline"==D.data("vbtype")?ke():"ajax"==D.data("vbtype")?ue():"video"==D.data("vbtype")?he(s):(d.html(''),pe()),ee.cb_post_open(D,N,C,z)}),e("body").keydown(ie),e(".vbox-prev").on("click",function(){se(z)}),e(".vbox-next").on("click",function(){se(C)}),!1});var te=".vbox-overlay";function oe(e){d.addClass("vbox-animated"),j=X=e.pageY,R=Y=e.pageX,U=!0}function ce(e){if(!0===U){Y=e.pageX,X=e.pageY,q=Y-R,$=X-j;var s=Math.abs(q);s>Math.abs($)&&s<=100&&(e.preventDefault(),d.css("margin-left",q))}}function re(e){if(!0===U){U=!1;var s=D,i=!1;(W=Y-R)<0&&!0===B&&(s=C,i=!0),W>0&&!0===P&&(s=z,i=!0),Math.abs(W)>=A&&!0===i?se(s):d.css({"margin-left":0,"margin-right":0})}}ee.overlayClose||(te=".vbox-close"),e("body").on("click touchstart",te,function(s){(e(s.target).is(".vbox-overlay")||e(s.target).is(".vbox-content")||e(s.target).is(".vbox-close")||e(s.target).is(".vbox-preloader")||e(s.target).is(".vbox-container"))&&ae()}),R=0,Y=0,W=0,A=50,U=!1;var le={DOWN:"touchmousedown",UP:"touchmouseup",MOVE:"touchmousemove"},de=function(s){var i;switch(s.type){case"mousedown":i=le.DOWN;break;case"mouseup":case"mouseout":i=le.UP;break;case"mousemove":i=le.MOVE;break;default:return}var a=ve(i,s,s.pageX,s.pageY);e(s.target).trigger(a)},ne=function(s){var i;switch(s.type){case"touchstart":i=le.DOWN;break;case"touchend":i=le.UP;break;case"touchmove":i=le.MOVE;break;default:return}var a,t=s.originalEvent.touches[0];a=i==le.UP?ve(i,s,null,null):ve(i,s,t.pageX,t.pageY),e(s.target).trigger(a)},ve=function(s,i,a,t){return e.Event(s,{pageX:a,pageY:t,originalEvent:i})};function ue(){e.ajax({url:n,cache:!1}).done(function(e){d.html('
'+e+"
"),pe()}).fail(function(){d.html('

Error retrieving contents, please retry

'),ge()})}function be(){d.html(''),ge()}function he(e){var s,i=function(e){var s;e.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),RegExp.$3.indexOf("youtu")>-1?s="youtube":RegExp.$3.indexOf("vimeo")>-1&&(s="vimeo");return{type:s,id:RegExp.$6}}(n),a=(e?"?rel=0&autoplay=1":"?rel=0")+function(e){var s="",i=decodeURIComponent(e).split("?");if(void 0!==i[1]){var a,t,o=i[1].split("&");for(t=0;t'),ge()}function ke(){d.html('
'+e(n).html()+"
"),ge()}function pe(){(I=d.find("img")).length?I.each(function(){e(this).one("load",function(){ge()})}):ge()}function ge(){c.html(y),d.find(">:first-child").addClass("vbox-figlio").css({width:u,height:b,padding:r,background:i}),e("img.vbox-figlio").on("dragstart",function(e){e.preventDefault()}),me(),d.animate({opacity:"1"},"slow",function(){E.hide()}),ee.cb_content_loaded(D,N,C,z)}function me(){var s=d.outerHeight(),i=e(window).height();m=s+60