1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
(function(a){var c,d,e,f,g,h,i,l,j,k,m,t,w,v,y,A,B,C,E,H,K,J,Y,W,U,V,G,N,M,b,F,I,x,R,ab,z,T,S,s,r,n,o,p,X,O,P,aa,Q;var L='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.372-12 12 0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738.098.119.112.224.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146 1.124.347 2.317.535 3.554.535 6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z" fill-rule="evenodd" clip-rule="evenodd"/></svg>';var u='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm3 8h-1.35c-.538 0-.65.221-.65.778v1.222h2l-.209 2h-1.791v7h-3v-7h-2v-2h2v-2.308c0-1.769.931-2.692 3.029-2.692h1.971v3z"/></svg>';var Z='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm6.066 9.645c.183 4.04-2.83 8.544-8.164 8.544-1.622 0-3.131-.476-4.402-1.291 1.524.18 3.045-.244 4.252-1.189-1.256-.023-2.317-.854-2.684-1.995.451.086.895.061 1.298-.049-1.381-.278-2.335-1.522-2.304-2.853.388.215.83.344 1.301.359-1.279-.855-1.641-2.544-.889-3.835 1.416 1.738 3.533 2.881 5.92 3.001-.419-1.796.944-3.527 2.799-3.527.825 0 1.572.349 2.096.907.654-.128 1.27-.368 1.824-.697-.215.671-.67 1.233-1.263 1.589.581-.07 1.135-.224 1.649-.453-.384.578-.87 1.084-1.433 1.489z"/></svg>';var D='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-2 16h-2v-6h2v6zm-1-6.891c-.607 0-1.1-.496-1.1-1.109 0-.612.492-1.109 1.1-1.109s1.1.497 1.1 1.109c0 .613-.493 1.109-1.1 1.109zm8 6.891h-1.998v-2.861c0-1.881-2.002-1.722-2.002 0v2.861h-2v-6h2v1.093c.872-1.616 4-1.736 4 1.548v3.359z"/></svg>';var q='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm2 9h-4v-1h4v1zm0-3v1h-4v-1h4zm-2 13l-6-6h4v-3h4v3h4l-6 6z"/></svg>';a.fn.extend({venobox:function(ae){var af=this;var ac={arrowsColor:"#B6B6B6",autoplay:false,bgcolor:"#fff",border:"0",closeBackground:"transparent",closeColor:"#d2d2d2",framewidth:"",frameheight:"",gallItems:false,infinigall:false,htmlClose:"×",htmlNext:"<span>Next</span>",htmlPrev:"<span>Prev</span>",numeratio:false,numerationBackground:"#161617",numerationColor:"#d2d2d2",numerationPosition:"top",overlayClose:true,overlayColor:"rgba(23,23,23,0.85)",spinner:"double-bounce",spinColor:"#d2d2d2",titleattr:"title",titleBackground:"#161617",titleColor:"#d2d2d2",titlePosition:"top",share:[],cb_pre_open:function(){return true},cb_post_open:function(){},cb_pre_close:function(){return true},cb_post_close:function(){},cb_post_resize:function(){},cb_after_nav:function(){},cb_content_loaded:function(){},cb_init:function(){}};var ad=a.extend(ac,ae);ad.cb_init(af);return this.each(function(){I=a(this);if(I.data("venobox")){return true}af.VBclose=function(){ai()};I.addClass("vbox-item");I.data("framewidth",ad.framewidth);I.data("frameheight",ad.frameheight);I.data("border",ad.border);I.data("bgcolor",ad.bgcolor);I.data("numeratio",ad.numeratio);I.data("gallItems",ad.gallItems);I.data("infinigall",ad.infinigall);I.data("overlaycolor",ad.overlayColor);I.data("titleattr",ad.titleattr);I.data("share",ad.share);I.data("venobox",true);I.on("click",function(aD){aD.preventDefault();I=a(this);var aC=ad.cb_pre_open(I);if(aC===false){return false}af.VBnext=function(){ap(U)};af.VBprev=function(){ap(V)};K=I.data("overlay")||I.data("overlaycolor");w=I.data("framewidth");v=I.data("frameheight");c=I.data("autoplay")||ad.autoplay;i=I.data("border");d=I.data("bgcolor");G=false;N=false;C=false;m=I.data("href")||I.attr("href");t=I.data("css")||"";Y=I.attr(I.data("titleattr"))||"";O=I.data("share");M='<div class="vbox-preloader">';switch(ad.spinner){case"rotating-plane":M+='<div class="sk-rotating-plane"></div>';break;case"double-bounce":M+='<div class="sk-double-bounce"><div class="sk-child sk-double-bounce1"></div><div class="sk-child sk-double-bounce2"></div></div>';break;case"wave":M+='<div class="sk-wave"><div class="sk-rect sk-rect1"></div><div class="sk-rect sk-rect2"></div><div class="sk-rect sk-rect3"></div><div class="sk-rect sk-rect4"></div><div class="sk-rect sk-rect5"></div></div>';break;case"wandering-cubes":M+='<div class="sk-wandering-cubes"><div class="sk-cube sk-cube1"></div><div class="sk-cube sk-cube2"></div></div>';break;case"spinner-pulse":M+='<div class="sk-spinner sk-spinner-pulse"></div>';break;case"chasing-dots":M+='<div class="sk-chasing-dots"><div class="sk-child sk-dot1"></div><div class="sk-child sk-dot2"></div></div>';break;case"three-bounce":M+='<div class="sk-three-bounce"><div class="sk-child sk-bounce1"></div><div class="sk-child sk-bounce2"></div><div class="sk-child sk-bounce3"></div></div>';break;case"circle":M+='<div class="sk-circle"><div class="sk-circle1 sk-child"></div><div class="sk-circle2 sk-child"></div><div class="sk-circle3 sk-child"></div><div class="sk-circle4 sk-child"></div><div class="sk-circle5 sk-child"></div><div class="sk-circle6 sk-child"></div><div class="sk-circle7 sk-child"></div><div class="sk-circle8 sk-child"></div><div class="sk-circle9 sk-child"></div><div class="sk-circle10 sk-child"></div><div class="sk-circle11 sk-child"></div><div class="sk-circle12 sk-child"></div></div>';break;case"cube-grid":M+='<div class="sk-cube-grid"><div class="sk-cube sk-cube1"></div><div class="sk-cube sk-cube2"></div><div class="sk-cube sk-cube3"></div><div class="sk-cube sk-cube4"></div><div class="sk-cube sk-cube5"></div><div class="sk-cube sk-cube6"></div><div class="sk-cube sk-cube7"></div><div class="sk-cube sk-cube8"></div><div class="sk-cube sk-cube9"></div></div>';break;case"fading-circle":M+='<div class="sk-fading-circle"><div class="sk-circle1 sk-circle"></div><div class="sk-circle2 sk-circle"></div><div class="sk-circle3 sk-circle"></div><div class="sk-circle4 sk-circle"></div><div class="sk-circle5 sk-circle"></div><div class="sk-circle6 sk-circle"></div><div class="sk-circle7 sk-circle"></div><div class="sk-circle8 sk-circle"></div><div class="sk-circle9 sk-circle"></div><div class="sk-circle10 sk-circle"></div><div class="sk-circle11 sk-circle"></div><div class="sk-circle12 sk-circle"></div></div>';break;case"folding-cube":M+='<div class="sk-folding-cube"><div class="sk-cube1 sk-cube"></div><div class="sk-cube2 sk-cube"></div><div class="sk-cube4 sk-cube"></div><div class="sk-cube3 sk-cube"></div></div>';break}M+="</div>";F='<a class="vbox-next">'+ad.htmlNext+'</a><a class="vbox-prev">'+ad.htmlPrev+"</a>";ab='<div class="vbox-title"></div><div class="vbox-left"><div class="vbox-num">0/0</div></div><div class="vbox-close">'+ad.htmlClose+"</div>";aa='<div class="vbox-share"></div>';l='<div class="vbox-overlay '+t+'" style="background:'+K+'">'+M+'<div class="vbox-container"><div class="vbox-content"></div></div>'+ab+F+aa+"</div>";a("body").append(l).addClass("vbox-open");a(".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",ad.spinColor);J=a(".vbox-overlay");j=a(".vbox-container");k=a(".vbox-content");e=a(".vbox-left");f=a(".vbox-num");g=a(".vbox-share");h=a(".vbox-title");b=a(".vbox-preloader");b.show();if(ad.titlePosition=="top"){Q="bottom"}else{Q="top"}g.css(Q,"-1px");g.css({color:ad.titleColor,fill:ad.titleColor,"background-color":ad.titleBackground});h.css(ad.titlePosition,"-1px");h.css({color:ad.titleColor,"background-color":ad.titleBackground});a(".vbox-close").css({color:ad.closeColor,"background-color":ad.closeBackground});e.css(ad.numerationPosition,"-1px");e.css({color:ad.numerationColor,"background-color":ad.numerationBackground});a(".vbox-next span, .vbox-prev span").css({"border-top-color":ad.arrowsColor,"border-right-color":ad.arrowsColor});k.html("");k.css("opacity","0");J.css("opacity","0");ag();J.animate({opacity:1},250,function(){if(I.data("vbtype")=="iframe"){am()}else{if(I.data("vbtype")=="inline"){an()}else{if(I.data("vbtype")=="ajax"){al()}else{if(I.data("vbtype")=="video"){ao(c)}else{k.html('<img src="'+m+'">');ay()}}}}ad.cb_post_open(I,x,U,V)});a("body").keydown(ak);a(".vbox-prev").on("click",function(){ap(V)});a(".vbox-next").on("click",function(){ap(U)});return false});function ag(){W=I.data("gall");H=I.data("numeratio");y=I.data("gallItems");A=I.data("infinigall");O=I.data("share");g.html("");if(I.data("vbtype")!=="iframe"&&I.data("vbtype")!=="inline"&&I.data("vbtype")!=="ajax"){P={pinterest:'<a target="_blank" href="https://pinterest.com/pin/create/button/?url='+I.prop("href")+"&media="+I.prop("href")+"&description="+Y+'">'+L+"</a>",facebook:'<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='+I.prop("href")+'">'+u+"</a>",twitter:'<a target="_blank" href="https://twitter.com/intent/tweet?text='+Y+"&url="+I.prop("href")+'">'+Z+"</a>",linkedin:'<a target="_blank" href="https://www.linkedin.com/sharing/share-offsite/?url='+I.prop("href")+'">'+D+"</a>",download:'<a target="_blank" href="'+I.prop("href")+'">'+q+"</a>"};a.each(O,function(aC,aD){g.append(P[aD])})}if(y){B=y}else{B=a('.vbox-item[data-gall="'+W+'"]')}if(B.length<2){A=false;H=false}U=B.eq(B.index(I)+1);V=B.eq(B.index(I)-1);if(!U.length&&A===true){U=B.eq(0)}if(B.length>=1){x=B.index(I)+1;f.html(x+" / "+B.length)}else{x=1}if(H===true){f.show()}else{f.hide()}if(Y!==""){h.show()}else{h.hide()}if(!U.length&&A!==true){a(".vbox-next").css("display","none");G=false}else{a(".vbox-next").css("display","block");G=true}if(B.index(I)>0||A===true){a(".vbox-prev").css("display","block");N=true}else{a(".vbox-prev").css("display","none");N=false}if(N===true||G===true){k.on(az.DOWN,ar);k.on(az.MOVE,au);k.on(az.UP,aw)}}function ap(aC){if(aC.length<1){return false}if(C){return false}C=true;K=aC.data("overlay")||aC.data("overlaycolor");w=aC.data("framewidth");v=aC.data("frameheight");i=aC.data("border");d=aC.data("bgcolor");m=aC.data("href")||aC.attr("href");c=aC.data("autoplay");Y=(aC.data("titleattr")&&aC.attr(aC.data("titleattr")))||"";if(aC===V){k.addClass("vbox-animated").addClass("swipe-right")}if(aC===U){k.addClass("vbox-animated").addClass("swipe-left")}b.show();k.animate({opacity:0,},500,function(){J.css("background",K);k.removeClass("vbox-animated").removeClass("swipe-left").removeClass("swipe-right").css({"margin-left":0,"margin-right":0});if(aC.data("vbtype")=="iframe"){am()}else{if(aC.data("vbtype")=="inline"){an()}else{if(aC.data("vbtype")=="ajax"){al()}else{if(aC.data("vbtype")=="video"){ao(c)}else{k.html('<img src="'+m+'">');ay()}}}}I=aC;ag();C=false;ad.cb_after_nav(I,x,U,V)})}function ak(aC){if(aC.keyCode===27){ai()}if(aC.keyCode==37&&N===true){ap(V)}if(aC.keyCode==39&&G===true){ap(U)}}function ai(){var aC=ad.cb_pre_close(I,x,U,V);if(aC===false){return false}a("body").off("keydown",ak).removeClass("vbox-open");I.focus();J.animate({opacity:0},500,function(){J.remove();C=false;ad.cb_post_close()})}var ah=".vbox-overlay";if(!ad.overlayClose){ah=".vbox-close"}a("body").on("click touchstart",ah,function(aC){if(a(aC.target).is(".vbox-overlay")||a(aC.target).is(".vbox-content")||a(aC.target).is(".vbox-close")||a(aC.target).is(".vbox-preloader")||a(aC.target).is(".vbox-container")){ai()}});S=0;r=0;n=0;X=50;R=false;function ar(aC){k.addClass("vbox-animated");T=s=aC.pageY;S=r=aC.pageX;R=true}function au(aE){if(R===true){r=aE.pageX;s=aE.pageY;o=r-S;p=s-T;var aC=Math.abs(o);var aD=Math.abs(p);if((aC>aD)&&(aC<=100)){aE.preventDefault();k.css("margin-left",o)}}}function aw(aD){if(R===true){R=false;var aE=I;var aC=false;n=r-S;if(n<0&&G===true){aE=U;aC=true}if(n>0&&N===true){aE=V;aC=true}if(Math.abs(n)>=X&&aC===true){ap(aE)}else{k.css({"margin-left":0,"margin-right":0})}}}var az={DOWN:"touchmousedown",UP:"touchmouseup",MOVE:"touchmousemove"};var at=function(aC){var aE;switch(aC.type){case"mousedown":aE=az.DOWN;break;case"mouseup":aE=az.UP;break;case"mouseout":aE=az.UP;break;case"mousemove":aE=az.MOVE;break;default:return}var aD=aq(aE,aC,aC.pageX,aC.pageY);a(aC.target).trigger(aD)};var av=function(aC){var aF;switch(aC.type){case"touchstart":aF=az.DOWN;break;case"touchend":aF=az.UP;break;case"touchmove":aF=az.MOVE;break;default:return}var aD=aC.originalEvent.touches[0];var aE;if(aF==az.UP){aE=aq(aF,aC,null,null)}else{aE=aq(aF,aC,aD.pageX,aD.pageY)}a(aC.target).trigger(aE)};var aq=function(aD,aC,aE,aF){return a.Event(aD,{pageX:aE,pageY:aF,originalEvent:aC})};if("ontouchstart" in window){a(document).on("touchstart",av);a(document).on("touchmove",av);a(document).on("touchend",av)}else{a(document).on("mousedown",at);a(document).on("mouseup",at);a(document).on("mouseout",at);a(document).on("mousemove",at)}function al(){a.ajax({url:m,cache:false}).done(function(aC){k.html('<div class="vbox-inline">'+aC+"</div>");ay()}).fail(function(){k.html('<div class="vbox-inline"><p>Error retrieving contents, please retry</div>');aB()})}function am(){k.html('<iframe class="venoframe" src="'+m+'"></iframe>');aB()}function ao(aC){var aD;var aG=ax(m);var aF=aC?"?rel=0&autoplay=1":"?rel=0";var aE=aF+aj(m);if(aG.type=="vimeo"){aD="https://player.vimeo.com/video/"}else{if(aG.type=="youtube"){aD="https://www.youtube.com/embed/"}}k.html('<iframe class="venoframe vbvid" webkitallowfullscreen mozallowfullscreen allowfullscreen allow="autoplay" frameborder="0" src="'+aD+aG.id+aE+'"></iframe>');aB()}function ax(aD){aD.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);var aC;if(RegExp.$3.indexOf("youtu")>-1){aC="youtube"}else{if(RegExp.$3.indexOf("vimeo")>-1){aC="vimeo"}}return{type:aC,id:RegExp.$6}}function aj(aE){var aF="";var aG=decodeURIComponent(aE);var aC=aG.split("?");if(aC[1]!==undefined){var aI=aC[1].split("&");var aH;var aD;for(aD=0;aD<aI.length;aD++){aH=aI[aD].split("=");aF=aF+"&"+aH[0]+"="+aH[1]}}return encodeURI(aF)}function an(){k.html('<div class="vbox-inline">'+a(m).html()+"</div>");aB()}function ay(){z=k.find("img");if(z.length){z.each(function(){a(this).one("load",function(){aB()})})}else{aB()}}function aB(){h.html(Y);k.find(">:first-child").addClass("vbox-figlio").css({width:w,height:v,padding:i,background:d});a("img.vbox-figlio").on("dragstart",function(aC){aC.preventDefault()});j.scrollTop(0);aA();k.animate({opacity:"1"},"slow",function(){b.hide()});ad.cb_content_loaded(I,x,U,V)}function aA(){var aD=k.outerHeight();var aC=a(window).height();if(aD+60<aC){E=(aC-aD)/2}else{E="30px"}k.css("margin-top",E);k.css("margin-bottom",E);ad.cb_post_resize()}a(window).resize(function(){if(a(".vbox-content").length){setTimeout(aA(),800)}})})}})})(jQuery); |