diff options
Diffstat (limited to '')
-rw-r--r-- | themes/smartpocket/js/code.photoswipe.min.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/themes/smartpocket/js/code.photoswipe.min.js b/themes/smartpocket/js/code.photoswipe.min.js index 8d6a7b843..95bc29020 100644 --- a/themes/smartpocket/js/code.photoswipe.min.js +++ b/themes/smartpocket/js/code.photoswipe.min.js @@ -1,7 +1,7 @@ // PhotoSwipe - http://www.photoswipe.com/
-// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Copyright (c) 2012 by Code Computerlove (http://www.codecomputerlove.com)
// Licensed under the MIT license
-// version: 3.0.4
+// version: 3.0.5
(function(e){if(!Function.prototype.bind)Function.prototype.bind=function(c){var a=[].slice,b=a.call(arguments,1),d=this,f=function(){},g=function(){return d.apply(this instanceof f?this:c||{},b.concat(a.call(arguments)))};f.prototype=d.prototype;g.prototype=new f;return g};if(typeof e.Code==="undefined")e.Code={};e.Code.Util={registerNamespace:function(){var c=arguments,a=null,b,d,f,g,h;b=0;for(g=c.length;b<g;b++){f=c[b];f=f.split(".");a=f[0];typeof e[a]==="undefined"&&(e[a]={});a=e[a];d=1;for(h=
f.length;d<h;++d)a[f[d]]=a[f[d]]||{},a=a[f[d]]}},coalesce:function(){var c,a;c=0;for(a=arguments.length;c<a;c++)if(!this.isNothing(arguments[c]))return arguments[c];return null},extend:function(c,a,b){var d;this.isNothing(b)&&(b=!0);if(c&&a&&this.isObject(a))for(d in a)this.objectHasProperty(a,d)&&(b?c[d]=a[d]:typeof c[d]==="undefined"&&(c[d]=a[d]))},clone:function(c){var a={};this.extend(a,c);return a},isObject:function(c){return c instanceof Object},isFunction:function(c){return{}.toString.call(c)===
"[object Function]"},isArray:function(c){return c instanceof Array},isLikeArray:function(c){return typeof c.length==="number"},isNumber:function(c){return typeof c==="number"},isString:function(c){return typeof c==="string"},isNothing:function(c){if(typeof c==="undefined"||c===null)return!0;return!1},swapArrayElements:function(c,a,b){var d=c[a];c[a]=c[b];c[b]=d},trim:function(c){return c.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},toCamelCase:function(c){return c.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-",
@@ -120,7 +120,7 @@ left:0,top:0,overflow:"hidden",zIndex:this.settings.zIndex,opacity:0});a.DOM.hid (function(e,c,a){a.registerNamespace("Code.PhotoSwipe.ZoomPanRotate");e=e.Code.PhotoSwipe;e.ZoomPanRotate.CssClasses={zoomPanRotate:"ps-zoom-pan-rotate"};e.ZoomPanRotate.EventTypes={onTransform:"PhotoSwipeZoomPanRotateOnTransform"}})(window,window.klass,window.Code.Util);
(function(e,c,a){a.registerNamespace("Code.PhotoSwipe.ZoomPanRotate");var b=e.Code.PhotoSwipe;b.ZoomPanRotate.ZoomPanRotateClass=c({el:null,settings:null,containerEl:null,imageEl:null,transformSettings:null,panStartingPoint:null,transformEl:null,dispose:function(){var b;a.DOM.removeChild(this.el,this.el.parentNode);for(b in this)a.objectHasProperty(this,b)&&(this[b]=null)},initialize:function(c,f,g){var h,j,i;this.settings=c;this.settings.target===e?(c=document.body,h=a.DOM.windowWidth(),j=a.DOM.windowHeight(),
i=a.DOM.windowScrollTop()+"px"):(c=this.settings.target,h=a.DOM.width(c),j=a.DOM.height(c),i="0px");this.imageEl=f.imageEl.cloneNode(!1);a.DOM.setStyle(this.imageEl,{zIndex:1});this.transformSettings={startingScale:1,scale:1,startingRotation:0,rotation:0,startingTranslateX:0,startingTranslateY:0,translateX:0,translateY:0};this.el=a.DOM.createElement("div",{"class":b.ZoomPanRotate.CssClasses.zoomPanRotate},"");a.DOM.setStyle(this.el,{left:0,top:i,position:"absolute",width:h,height:j,zIndex:this.settings.zIndex,
-display:"block"});a.DOM.insertBefore(this.el,g.el,c);a.Browser.iOS?(this.containerEl=a.DOM.createElement("div"),a.DOM.setStyle(this.containerEl,{left:0,top:0,width:h,height:j,position:"absolute",zIndex:1}),a.DOM.appendChild(this.imageEl,this.containerEl),a.DOM.appendChild(this.containerEl,this.el),a.Animation.resetTranslate(this.containerEl),a.Animation.resetTranslate(this.imageEl),this.transformEl=this.containerEl):(a.DOM.appendChild(this.imageEl,this.el),this.transformEl=this.imageEl)},setStartingTranslateFromCurrentTransform:function(){var b=
+display:"block"});a.DOM.insertBefore(this.el,g.el,c);a.Browser.iOS?(this.containerEl=a.DOM.createElement("div","",""),a.DOM.setStyle(this.containerEl,{left:0,top:0,width:h,height:j,position:"absolute",zIndex:1}),a.DOM.appendChild(this.imageEl,this.containerEl),a.DOM.appendChild(this.containerEl,this.el),a.Animation.resetTranslate(this.containerEl),a.Animation.resetTranslate(this.imageEl),this.transformEl=this.containerEl):(a.DOM.appendChild(this.imageEl,this.el),this.transformEl=this.imageEl)},setStartingTranslateFromCurrentTransform:function(){var b=
a.coalesce(this.transformEl.style.webkitTransform,this.transformEl.style.MozTransform,this.transformEl.style.transform);if(!a.isNothing(b)&&(b=b.match(/translate\((.*?)\)/),!a.isNothing(b)))b=b[1].split(", "),this.transformSettings.startingTranslateX=e.parseInt(b[0],10),this.transformSettings.startingTranslateY=e.parseInt(b[1],10)},getScale:function(a){a*=this.transformSettings.startingScale;if(this.settings.minUserZoom!==0&&a<this.settings.minUserZoom)a=this.settings.minUserZoom;else if(this.settings.maxUserZoom!==
0&&a>this.settings.maxUserZoom)a=this.settings.maxUserZoom;return a},setStartingScaleAndRotation:function(a,b){this.transformSettings.startingScale=this.getScale(a);this.transformSettings.startingRotation=(this.transformSettings.startingRotation+b)%360},zoomRotate:function(a,b){this.transformSettings.scale=this.getScale(a);this.transformSettings.rotation=this.transformSettings.startingRotation+b;this.applyTransform()},panStart:function(a){this.setStartingTranslateFromCurrentTransform();this.panStartingPoint=
{x:a.x,y:a.y}},pan:function(a){var b=(a.y-this.panStartingPoint.y)/this.transformSettings.scale;this.transformSettings.translateX=this.transformSettings.startingTranslateX+(a.x-this.panStartingPoint.x)/this.transformSettings.scale;this.transformSettings.translateY=this.transformSettings.startingTranslateY+b;this.applyTransform()},zoomAndPanToPoint:function(b,c){if(this.settings.target===e){this.panStart({x:a.DOM.windowWidth()/2,y:a.DOM.windowHeight()/2});var g=(c.y-this.panStartingPoint.y)/this.transformSettings.scale;
@@ -137,10 +137,10 @@ b){g=c;break}return g}})(window,window.Code.Util); uiLayerTouchHandler:null,carouselSlideByEndHandler:null,carouselSlideshowStartHandler:null,carouselSlideshowStopHandler:null,toolbarTapHandler:null,toolbarBeforeShowHandler:null,toolbarShowHandler:null,toolbarBeforeHideHandler:null,toolbarHideHandler:null,mouseWheelHandler:null,zoomPanRotateTransformHandler:null,_isResettingPosition:null,_uiWebViewResetPositionTimeout:null,dispose:function(){var b;a.Events.remove(this,i.EventTypes.onBeforeShow);a.Events.remove(this,i.EventTypes.onShow);a.Events.remove(this,
i.EventTypes.onBeforeHide);a.Events.remove(this,i.EventTypes.onHide);a.Events.remove(this,i.EventTypes.onDisplayImage);a.Events.remove(this,i.EventTypes.onResetPosition);a.Events.remove(this,i.EventTypes.onSlideshowStart);a.Events.remove(this,i.EventTypes.onSlideshowStop);a.Events.remove(this,i.EventTypes.onTouch);a.Events.remove(this,i.EventTypes.onBeforeCaptionAndToolbarShow);a.Events.remove(this,i.EventTypes.onCaptionAndToolbarShow);a.Events.remove(this,i.EventTypes.onBeforeCaptionAndToolbarHide);
a.Events.remove(this,i.EventTypes.onCaptionAndToolbarHide);a.Events.remove(this,i.EventTypes.onZoomPanRotateTransform);this.removeEventHandlers();a.isNothing(this.documentOverlay)||this.documentOverlay.dispose();a.isNothing(this.carousel)||this.carousel.dispose();a.isNothing(this.uiLayer)||this.uiLayer.dispose();a.isNothing(this.toolbar)||this.toolbar.dispose();this.destroyZoomPanRotate();a.isNothing(this.cache)||this.cache.dispose();for(b in this)a.objectHasProperty(this,b)&&(this[b]=null)},initialize:function(c,
-d,f){this.id=a.isNothing(f)?"PhotoSwipe"+(new Date).getTime().toString():f;this.originalImages=c;if(a.Browser.android&&e.navigator.userAgent.match(/Android (\d+.\d+)/).toString().replace(/^.*\,/,"")>=2.1)this.isBackEventSupported=!0;if(!this.isBackEventSupported)this.isBackEventSupported=a.objectHasProperty(e,"onhashchange");this.settings={fadeInSpeed:250,fadeOutSpeed:250,preventHide:!1,preventSlideshow:!1,zIndex:1E3,backButtonHideEnabled:!0,enableKeyboard:!0,enableMouseWheel:!0,mouseWheelSpeed:350,
-autoStartSlideshow:!1,jQueryMobile:!a.isNothing(e.jQuery)&&!a.isNothing(e.jQuery.mobile),jQueryMobileDialogHash:"&ui-state=dialog",enableUIWebViewRepositionTimeout:!1,uiWebViewResetPositionDelay:500,target:e,preventDefaultTouchEvents:!0,loop:!0,slideSpeed:250,nextPreviousSlideSpeed:0,enableDrag:!0,swipeThreshold:50,swipeTimeThreshold:250,slideTimingFunction:"ease-out",slideshowDelay:3E3,doubleTapSpeed:250,margin:20,imageScaleMethod:"fit",captionAndToolbarHide:!1,captionAndToolbarFlipPosition:!1,captionAndToolbarAutoHideDelay:5E3,
-captionAndToolbarOpacity:0.8,captionAndToolbarShowEmptyCaptions:!0,getToolbar:i.Toolbar.getToolbar,allowUserZoom:!0,allowRotationOnUserZoom:!1,maxUserZoom:5,minUserZoom:0.5,doubleTapZoomLevel:2.5,getImageSource:i.Cache.Functions.getImageSource,getImageCaption:i.Cache.Functions.getImageCaption,getImageMetaData:i.Cache.Functions.getImageMetaData,cacheMode:i.Cache.Mode.normal};a.extend(this.settings,d);this.settings.target!==e&&(d=a.DOM.getStyle(this.settings.target,"position"),(d!=="relative"||d!==
-"absolute")&&a.DOM.setStyle(this.settings.target,"position","relative"));if(this.settings.target!==e)this.isBackEventSupported=!1,this.settings.backButtonHideEnabled=!1;else if(this.settings.preventHide)this.settings.backButtonHideEnabled=!1;this.cache=new b.CacheClass(c,this.settings)},show:function(b){var c,d;this.backButtonClicked=this._isResettingPosition=!1;if(a.isNumber(b))this.currentIndex=b;else{this.currentIndex=-1;c=0;for(d=this.originalImages.length;c<d;c++)if(this.originalImages[c]===
+d,f){this.id=a.isNothing(f)?"PhotoSwipe"+(new Date).getTime().toString():f;this.originalImages=c;if(a.Browser.android&&!a.Browser.firefox&&e.navigator.userAgent.match(/Android (\d+.\d+)/).toString().replace(/^.*\,/,"")>=2.1)this.isBackEventSupported=!0;if(!this.isBackEventSupported)this.isBackEventSupported=a.objectHasProperty(e,"onhashchange");this.settings={fadeInSpeed:250,fadeOutSpeed:250,preventHide:!1,preventSlideshow:!1,zIndex:1E3,backButtonHideEnabled:!0,enableKeyboard:!0,enableMouseWheel:!0,
+mouseWheelSpeed:350,autoStartSlideshow:!1,jQueryMobile:!a.isNothing(e.jQuery)&&!a.isNothing(e.jQuery.mobile),jQueryMobileDialogHash:"&ui-state=dialog",enableUIWebViewRepositionTimeout:!1,uiWebViewResetPositionDelay:500,target:e,preventDefaultTouchEvents:!0,loop:!0,slideSpeed:250,nextPreviousSlideSpeed:0,enableDrag:!0,swipeThreshold:50,swipeTimeThreshold:250,slideTimingFunction:"ease-out",slideshowDelay:3E3,doubleTapSpeed:250,margin:20,imageScaleMethod:"fit",captionAndToolbarHide:!1,captionAndToolbarFlipPosition:!1,
+captionAndToolbarAutoHideDelay:5E3,captionAndToolbarOpacity:0.8,captionAndToolbarShowEmptyCaptions:!0,getToolbar:i.Toolbar.getToolbar,allowUserZoom:!0,allowRotationOnUserZoom:!1,maxUserZoom:5,minUserZoom:0.5,doubleTapZoomLevel:2.5,getImageSource:i.Cache.Functions.getImageSource,getImageCaption:i.Cache.Functions.getImageCaption,getImageMetaData:i.Cache.Functions.getImageMetaData,cacheMode:i.Cache.Mode.normal};a.extend(this.settings,d);this.settings.target!==e&&(d=a.DOM.getStyle(this.settings.target,
+"position"),(d!=="relative"||d!=="absolute")&&a.DOM.setStyle(this.settings.target,"position","relative"));if(this.settings.target!==e)this.isBackEventSupported=!1,this.settings.backButtonHideEnabled=!1;else if(this.settings.preventHide)this.settings.backButtonHideEnabled=!1;this.cache=new b.CacheClass(c,this.settings)},show:function(b){var c,d;this.backButtonClicked=this._isResettingPosition=!1;if(a.isNumber(b))this.currentIndex=b;else{this.currentIndex=-1;c=0;for(d=this.originalImages.length;c<d;c++)if(this.originalImages[c]===
b){this.currentIndex=c;break}}if(this.currentIndex<0||this.currentIndex>this.originalImages.length-1)throw"Code.PhotoSwipe.PhotoSwipeClass.show: Starting index out of range";this.isAlreadyGettingPage=this.getWindowDimensions();i.setActivateInstance(this);this.windowDimensions=this.getWindowDimensions();this.settings.target===e?a.DOM.addClass(e.document.body,i.CssClasses.buildingBody):a.DOM.addClass(this.settings.target,i.CssClasses.buildingBody);this.createComponents();a.Events.fire(this,{type:i.EventTypes.onBeforeShow,
target:this});this.documentOverlay.fadeIn(this.settings.fadeInSpeed,this.onDocumentOverlayFadeIn.bind(this))},getWindowDimensions:function(){return{width:a.DOM.windowWidth(),height:a.DOM.windowHeight()}},createComponents:function(){this.documentOverlay=new d.DocumentOverlayClass(this.settings);this.carousel=new f.CarouselClass(this.cache,this.settings);this.uiLayer=new h.UILayerClass(this.settings);if(!this.settings.captionAndToolbarHide)this.toolbar=new g.ToolbarClass(this.cache,this.settings)},
resetPosition:function(){if(!this._isResettingPosition){var b=this.getWindowDimensions();if(a.isNothing(this.windowDimensions)||!(b.width===this.windowDimensions.width&&b.height===this.windowDimensions.height))this._isResettingPosition=!0,this.windowDimensions=b,this.destroyZoomPanRotate(),this.documentOverlay.resetPosition(),this.carousel.resetPosition(),a.isNothing(this.toolbar)||this.toolbar.resetPosition(),this.uiLayer.resetPosition(),this._isResettingPosition=!1,a.Events.fire(this,{type:i.EventTypes.onResetPosition,
|