docs/mindstab.net_blog/references/strongswan/trick77.com/wp-content/plugins/slickr-flickr/scripts/lightGallery.min.js?ver=1.0

1 line
12 KiB
Plaintext
Raw Normal View History

2015-12-26 20:26:02 +01:00
(function(e){"use strict";e.fn.lightGallery=function(t){var n={mode:"slide",useCSS:true,easing:"linear",speed:1e3,start:0,loop:false,auto:false,pause:4e3,escKey:true,rel:false,lang:{allPhotos:"All photos"},exThumbImage:false,thumbnail:true,caption:false,captionLink:false,desc:false,counter:false,controls:true,hideControlOnEnd:false,mobileSrc:false,mobileSrcMaxWidth:640,swipeThreshold:50,vimeoColor:"CCCCCC",videoAutoplay:true,videoMaxWidth:855,dynamic:false,dynamicEl:[],onOpen:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onBeforeClose:function(){},onCloseAfter:function(){}},r=e(this),i,s,o=false,u='<div id="lightGallery-outer"><div id="lightGallery-Gallery"><div id="lightGallery-slider"></div><a id="lightGallery-close" class="close"></a></div></div>',a=document.createTouch!==undefined||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msMaxTouchPoints,f,l,c,h,p,d,v,m,g,y,b,w=false,E=false,S=false;var x=e.extend(true,{},n,t);var T={init:function(){r.each(function(){var t=e(this);if(x.dynamic==true){i=x.dynamicEl;s=x.start;v=s;N.init(s)}else{i=e(this).children();i.click(function(n){if(x.rel==true&&t.data("rel")){var r=t.data("rel");i=e('[data-rel="'+r+'"]').children()}else{i=t.children()}n.preventDefault();n.stopPropagation();s=i.index(this);v=s;N.init(s)})}})}};var N={init:function(){this.start();this.build()},start:function(){this.structure();this.getWidth();this.closeSlide()},build:function(){this.loadContent(s);this.addCaption();this.addDesc();this.counter();this.slideTo();this.buildThumbnail();this.keyPress();this.slide(s);this.touch();this.enableTouch();setTimeout(function(){f.addClass("opacity")},50)},structure:function(){e("body").append(u).addClass("lightGallery");l=e("#lightGallery-outer");f=e("#lightGallery-Gallery");c=f.find("#lightGallery-slider");var t="";if(x.dynamic==true){for(var n=0;n<x.dynamicEl.length;n++){t+='<div class="lightGallery-slide"></div>'}}else{i.each(function(){t+='<div class="lightGallery-slide"></div>'})}c.append(t);h=f.find(".lightGallery-slide")},closeSlide:function(){var t=this;e("#lightGallery-close").bind("click touchend",function(){t.destroy()})},getWidth:function(){var t=function(){y=e(window).width()};e(window).bind("resize.lightGallery",t())},doCss:function(){var e=function(){var e=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"];var t=document.documentElement;for(var n=0;n<e.length;n++){if(e[n]in t.style){return true}}};if(x.useCSS&&e()){return true}return false},enableTouch:function(){var t=this;if(a){var n={},r={};e("body").on("touchstart.lightGallery",function(e){r=e.originalEvent.targetTouches[0];n.pageX=e.originalEvent.targetTouches[0].pageX;n.pageY=e.originalEvent.targetTouches[0].pageY});e("body").on("touchmove.lightGallery",function(e){var t=e.originalEvent;r=t.targetTouches[0];e.preventDefault()});e("body").on("touchend.lightGallery",function(e){var i=r.pageX-n.pageX,s=x.swipeThreshold;if(i>=s){t.prevSlide();clearInterval(b)}else if(i<=-s){t.nextSlide();clearInterval(b)}})}},touch:function(){var t,n;var r=this;e(".lightGallery").bind("mousedown",function(e){e.stopPropagation();e.preventDefault();t=e.pageX});e(".lightGallery").bind("mouseup",function(e){e.stopPropagation();e.preventDefault();n=e.pageX;if(n-t>20){r.prevSlide()}else if(t-n>20){r.nextSlide()}})},isVideo:function(e){var t=e.match(/youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/);var n=e.match(/vimeo\.com\/([0-9]*)/);if(t||n){return true}},loadVideo:function(e,t,n){var r=e.match(/watch\?v=([a-zA-Z0-9\-_]+)/);var i=e.match(/vimeo\.com\/([0-9]*)/);var s="";if(r){if(x.videoAutoplay===true&&t===true){t="?autoplay=1&rel=0&wmode=opaque"}else{t="?wmode=opaque"}s='<iframe id="video'+n+'" width="560" height="315" src="//www.youtube.com/embed/'+r[1]+t+'" frameborder="0" allowfullscreen></iframe>'}else if(i){if(x.videoAutoplay===true&&t===true){t="autoplay=1&"}else{t=""}s='<iframe id="video'+n+'" width="560" height="315" src="http://player.vimeo.com/video/'+i[1]+"?"+t+"byline=0&portrait=0&color