WP Photo Album Plus - Version 7.5.09.009

Version Description

= 7.5.09 =

  • This version addresses various bug fixes and feature requests.
Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 7.5.09.009
Comparing to
See all releases

Code changes from version 7.5.09.007 to 7.5.09.009

js/wppa-all.js CHANGED
@@ -13,6 +13,6 @@ var wppaJsPopupVersion="7.5.03";function wppaPopUp(p,t,e,r,a,i,o,n,d,s){var c,l,
13
  // wppa-touch
14
  var wppaJsTouchVersion="7.5.03",wppaTriggerElementID=null,wppaFingerCount=0,wppaStartX=0,wppaStartY=0,wppaCurX=0,wppaCurY=0,wppaDeltaX=0,wppaDeltaY=0,wppaHorzDiff=0,wppaVertDiff=0,wppaMinLength=72,wppaSwipeLength=0,wppaSwipeAngle=null,wppaSwipeDirection=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=0,wppaMobileTimeStart=0;function wppaStartTime(){var p=(new Date).getTime();return wppaMobileTimeStart=p,!0}function wppaInTime(){return(new Date).getTime()-wppaMobileTimeStart<250}function wppaTapLink(p,e){wppaInTime()&&(_bumpClickCount(p),document.location.href=e)}function wppaTouchStart(p,e,a){-1==(wppaSwipeMocc=a)&&(wppaSwipeOnLightbox=!0,p.preventDefault()),1==(wppaFingerCount=p.touches.length)?(wppaStartX=p.touches[0].pageX,wppaStartY=p.touches[0].pageY,wppaTriggerElementID=e):wppaTouchCancel()}function wppaTouchMove(p){wppaSwipeOnLightbox&&p.preventDefault(),1==p.touches.length?(wppaCurX=p.touches[0].pageX,wppaCurY=p.touches[0].pageY):wppaTouchCancel()}function wppaTouchEnd(p){wppaSwipeOnLightbox&&p.preventDefault(),1==wppaFingerCount&&0!=wppaCurX&&(wppaSwipeLength=Math.round(Math.sqrt(Math.pow(wppaCurX-wppaStartX,2)+Math.pow(wppaCurY-wppaStartY,2))),wppaMinLength<=wppaSwipeLength&&(wppaCalculateAngle(),wppaDetermineSwipeDirection(),wppaProcessingRoutine())),wppaTouchCancel()}function wppaTouchCancel(){wppaTriggerElementID=wppaSwipeDirection=wppaSwipeAngle=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=wppaSwipeLength=wppaVertDiff=wppaHorzDiff=wppaDeltaY=wppaDeltaX=wppaCurY=wppaCurX=wppaStartY=wppaStartX=wppaFingerCount=0}function wppaCalculateAngle(){var p=wppaStartX-wppaCurX,e=wppaCurY-wppaStartY,a=(Math.round(Math.sqrt(Math.pow(p,2)+Math.pow(e,2))),Math.atan2(e,p));(wppaSwipeAngle=Math.round(180*a/Math.PI))<0&&(wppaSwipeAngle=360-Math.abs(wppaSwipeAngle))}function wppaDetermineSwipeDirection(){wppaSwipeDirection=wppaSwipeAngle<=45&&0<=wppaSwipeAngle||wppaSwipeAngle<=360&&315<=wppaSwipeAngle?"left":135<=wppaSwipeAngle&&wppaSwipeAngle<=225?"right":45<wppaSwipeAngle&&wppaSwipeAngle<135?"down":"up"}function wppaProcessingRoutine(){document.getElementById(wppaTriggerElementID);if(wppaSwipeOnLightbox)"left"==wppaSwipeDirection?wppaOvlShowNext():"right"==wppaSwipeDirection&&wppaOvlShowPrev();else{if("right"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]-1,idx<0){if(!wppaSlideWrap)return;idx=_wppaSlides[wppaSwipeMocc].length-1}wppaGotoKeepState(wppaSwipeMocc,idx)}if("left"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]+1,idx==_wppaSlides[wppaSwipeMocc].length){if(!wppaSlideWrap)return;idx=0}wppaGotoKeepState(wppaSwipeMocc,idx)}}wppaTouchCancel()}
15
  // wppa-zoom
16
- function wppaDoZoomPan(o){var p=jQuery,e=g(o);if(!e.initialized&&!e.abort){if(e.isLightbox&&p("#wppa-ovl-spin").show(),!e.image.complete)return wppaConsoleLog("Loading image "+o),void setTimeout(function(){wppaDoZoomPan(o)},200);wppaConsoleLog("Loading image "+o+" complete"),p(image).css({width:image.naturalWidth,height:image.naturalHeight,maxWidth:image.naturalWidth,maxHeight:image.naturalHeight}),e.manual=!1,e.deltaX=0,e.deltaY=0,e.deltaFactor=1,e.busy=!1,e.div=p("#wppa-pan-div-"+e.itemId),e.canvas=document.getElementById("wppa-pan-canvas-"+e.itemId),e.left=p("#wppa-pctl-left-"+e.itemId),e.right=p("#wppa-pctl-right-"+e.itemId),e.up=p("#wppa-pctl-up-"+e.itemId),e.down=p("#wppa-pctl-down-"+e.itemId),e.zoomin=p("#wppa-pctl-zoomin-"+e.itemId),e.zoomout=p("#wppa-pctl-zoomout-"+e.itemId),e.prev=p("#wppa-pctl-prev-"+e.itemId),e.next=p("#wppa-pctl-next-"+e.itemId),e.exit=p("#wppa-exit-btn-2"),e.canvasWidth=e.width,e.canvasHeight=e.height,e.savedCanvasX=0,e.savedCanvasY=0,e.fromHeight=e.image.height,e.fromWidth=e.image.width,e.imageRatio=e.image.width/e.image.height,e.fromX=0,e.fromY=0,e.centerX=e.fromX+e.fromWidth/2,e.centerY=e.fromY+e.fromHeight/2,e.ctx=null,e.buttondown=!1,e.enableManual=!0,e.ctrlbarUpdate=!0,e.pause=!1,wppaIsMobile?(e.right.on("touchstart",function(t){n(o)}),e.right.on("touchend",function(t){u(o)}),e.left.on("touchstart",function(t){i(o)}),e.left.on("touchend",function(t){u(o)}),e.up.on("touchstart",function(t){s(o)}),e.up.on("touchend",function(t){u(o)}),e.down.on("touchstart",function(t){c(o)}),e.down.on("touchend",function(t){u(o)}),e.zoomin.on("touchstart",function(t){r(o)}),e.zoomin.on("touchend",function(t){u(o)}),e.zoomout.on("touchstart",function(t){d(o)}),e.zoomout.on("touchend",function(t){u(o)}),e.canvas.addEventListener("touchstart",function(t){m(o,t)}),e.canvas.addEventListener("touchmove",function(t){f(o,t)}),e.canvas.addEventListener("touchend",function(t){l(o)})):(e.canvas.addEventListener("mousedown",function(t){m(o,t)}),e.canvas.addEventListener("mousemove",function(t){f(o,t)}),e.canvas.addEventListener("mouseup",function(t){l(o)}),e.canvas.addEventListener("mouseleave",function(t){(e=g(o)).manual&&g(o,{pause:!0})}),e.canvas.addEventListener("mouseenter",function(t){var a;g(a=o,{pause:!1}).manual&&h(a)}),document.getElementById("wppa-pan-canvas-"+e.itemId).addEventListener("wheel",function(t){var a,n;a=o,(n=t).preventDefault(),n.stopPropagation(),e=g(a),g(a,{deltaFactor:1+n.deltaY*e.zoomsensitivity/(wppaIsChrome?1e4:1e3),manual:!1}),h(a),setTimeout(function(){g(a,{deltaFactor:1})},25)}),e.right.on("mousedown",function(t){n(o)}),e.right.on("mouseup",function(t){u(o)}),e.left.on("mousedown",function(t){i(o)}),e.left.on("mouseup",function(t){u(o)}),e.up.on("mousedown",function(t){s(o)}),e.up.on("mouseup",function(t){u(o)}),e.down.on("mousedown",function(t){c(o)}),e.down.on("mouseup",function(t){u(o)}),e.zoomin.on("mousedown",function(t){r(o)}),e.zoomin.on("mouseup",function(t){u(o)}),e.zoomout.on("mousedown",function(t){d(o)}),e.zoomout.on("mouseup",function(t){u(o)})),e.isLightbox&&(p(".wppa-fulls-btn").on("click",function(){g(0,{abort:!0})}),p(".wppa-exit-fulls-btn").on("click",function(){g(0,{abort:!0})}),e.prev&&(e.prev.on("click",function(t){p("#wppa-ovl-spin").show(),g(0,{abort:!0}),wppaOvlShowPrev()}),e.next.on("click",function(t){p("#wppa-ovl-spin").show(),g(0,{abort:!0}),wppaOvlShowNext()})),e.exit.on("click",function(t){p("#wppa-ovl-spin").hide(),g(0,{abort:!0}),wppaOvlHide()})),p(window).on("DOMContentLoaded load resize orientationchange",function(t){a(o)}),a(o),e.initialized=!0,g(o,e),p("#wppa-ovl-spin").hide()}function h(t){var a,n,o,e,i,s=g(t);(s.isLightbox&&!wppaOvlOpen||!s.isLightbox&&wppaOvlOpen)&&(s=g(0,{abort:!0})),s.abort?g(t,{manual:!1,buttondown:!1,pause:!1,ctx:null}):s.busy||(wppaDebugCounter++,wppaConsoleLog("Render zoom "+t+" "+wppaDebugCounter),(s=g(t,{busy:!0})).manual||(s.fromX+=s.deltaX,s.fromY+=s.deltaY,a=s.fromHeight/s.deltaFactor,n=s.fromWidth/s.deltaFactor,50<a&&1!=s.deltaFactor&&(wppaIsFs()||a<=s.image.height)&&(s.fromX-=(n-s.fromWidth)/2,s.fromY-=(a-s.fromHeight)/2,s.fromWidth=n,s.fromHeight=a)),s.fromX=Math.max(0,Math.min(s.image.width-s.fromWidth,s.fromX)),s.fromY=Math.max(0,Math.min(s.image.height-s.fromHeight,s.fromY)),o=screen.width/screen.height,e=(1-s.image.width/s.fromWidth)*s.canvas.width/2,i=(1-s.image.height/s.fromHeight)*s.canvas.height/2,s.ctx=s.canvas.getContext("2d"),o>s.imageRatio&&a>s.image.height&&wppaIsFs()||o<=s.imageRatio&&n>s.image.width&&wppaIsFs()?(s.enableManual=!1,s.ctx.clearRect(0,0,s.canvas.width,s.canvas.height),s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,e,i,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"default"})):(s.enableManual=!0,s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,0,0,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"grab"})),wppaIsFs()?(s.fsMaskTop=i-(s.canvas.height-screen.height)/2,s.fsMaskLeft=e-(s.canvas.width-screen.width)/2,s.fsMaskBottom=screen.height-s.fsMaskTop,s.fsMaskRight=screen.width-s.fsMaskLeft):(s.fsMaskTop=0,s.fsMaskLeft=0,s.fsMaskBottom=0,s.fsMaskRight=0),s.ctrlbarUpdate&&(wppaAdjustControlbar(),s.ctrlbarUpdate=!1),s.busy=!1,g(t,s),s.pause||!s.manual&&!s.buttondown||setTimeout(function(){h(t)},5),s.pause&&g(t,{pause:!1}))}function a(t){var a,n,o,e,i,s,c,r,d,u=g(t);u.isLightbox?(p("#wppa-overlay-ic").css("display",""),e=(n=!wppaIsFs())?(o=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(o=screen.width,screen.height),c=0,d=(r=8)+(u.controls?u.icsize+10:0)+10,n?(r+=2*u.borderWidth,d+=2*u.borderWidth):r=40,a=n?e-d>(o-r)/u.imageRatio:(screenRatio=screen.width/screen.height,screenRatio<u.imageRatio),n&&a&&(c=(e-(s=(i=o-r)/u.imageRatio)-d)/2+20),n&&!a&&(s=(i=u.imageRatio*(e-(u.controls?u.icsize:0)-48))/u.imageRatio,c=20),!n&&a&&(i=(s=screen.height)*u.imageRatio,c=0),n||a||(s=(i=screen.width)/u.imageRatio,c=(screen.height-s)/2),p("#wppa-ovl-pan-container").css({marginTop:c}),p("#wppa-overlay-ic").css({marginTop:0}),u.canvasWidth=i,u.canvasHeight=s,u.canvas.width=u.canvasWidth,u.canvas.height=u.canvasHeight,n?(p("#wppa-ovl-pan-container").css({backgroundColor:u.backgroundColor,padding:u.padding,borderRadius:u.borderRadius,borderWidth:u.borderWidth,width:i,marginLeft:0}),p("#wppa-pctl-div-"+u.itemId).css({marginLeft:0}),a?p("#wppa-overlay-ic").css({left:4}):p("#wppa-overlay-ic").css({left:(o-i)/2})):(p("#wppa-overlay-ic").css({marginLeft:0}),p("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:i,left:(o-i)/2,position:"fixed"}),p("#wppa-pctl-div-"+u.itemId).css({marginLeft:0}))):(u.canvasWidth=p(u.div).parent().width(),u.canvasHeight=u.canvasWidth/u.imageRatio,u.canvas.width=u.canvasWidth,u.canvas.height=u.canvasHeight),u.ctrlbarUpdate=!0,g(t,u),h(t)}function n(t){var a=g(t),n=a.image.naturalWidth/a.canvas.width;n<1.5&&(n=1.5),g(t,{deltaX:n*=1.5,buttondown:!0,manual:!1}),h(t)}function i(t){var a=g(t),n=a.image.naturalWidth/a.canvas.width;n<1.5&&(n=1.5),g(t,{deltaX:-(n*=1.5),buttondown:!0,manual:!1}),h(t)}function s(t){var a=g(t),n=a.image.naturalHeight/a.canvas.height;n<1.5&&(n=1.5),g(t,{deltaY:-(n*=1.5),buttondown:!0,manual:!1}),h(t)}function c(t){var a=g(t),n=a.image.naturalHeight/a.canvas.height;n<1.5&&(n=1.5),g(t,{deltaY:n*=1.5,buttondown:!0,manual:!1}),h(t)}function r(t){g(t,{deltaFactor:1.005,buttondown:!0,manual:!1}),h(t)}function d(t){g(t,{deltaFactor:.995,buttondown:!0,manual:!1}),h(t)}function u(t){g(t,{deltaX:0,deltaY:0,deltaFactor:1,buttondown:!1})}function m(t,a){var n=g(t),o=w(a).X,e=w(a).Y;if(wppaIsFs()&&n.isLightbox&&(o<n.fsMaskLeft||o>n.fsMaskRight||e<n.fsMaskTop||e>n.fsMaskBottom))return g(0,{abort:!0}),void jQuery("#wppa-overlay-bg").trigger("click");n.enableManual&&(g(t,{manual:!0,savedCanvasX:o=v(t,a).X,savedCanvasY:e=v(t,a).Y}),h(t))}function f(t,a){var n,o,e,i=g(t),s=v(t,a).X,c=v(t,a).Y;i.manual&&(n=i.canvas.width/i.fromWidth,o=(i.savedCanvasX-s)/n+i.fromX,e=(i.savedCanvasY-c)/n+i.fromY,0<o&&0<e&&o+i.fromWidth<i.image.width&&e+i.fromHeight<i.image.height&&g(t,{fromX:o,fromY:e,savedCanvasX:s,savedCanvasY:c}))}function l(t){g(t,{manual:!1})}function g(t,a){if(a)for(var n in a)wppaZoomData[t][n]=a[n];return wppaZoomData[t]}function w(t){var a,n;return n=wppaIsMobile?(a=t.touches[0].screenX,t.touches[0].screenY):(a=t.screenX,t.screenY),{X:a,Y:n}}function v(t,a){var n,o,e;return e=wppaIsMobile?(n=g(t),o=a.touches[0].screenX-n.fsMaskLeft,a.touches[0].screenY-n.fsMaskTop):(o=a.offsetX,a.offsetY),{X:o,Y:e}}}
17
  // wppa-spheric
18
- function wppaDoSphericPan(t){var c=jQuery,d=v(t);if(!d.initialized&&!d.abort){if(d.isLightbox&&c("#wppa-ovl-spin").show(),!d.image.complete)return wppaConsoleLog("Loading image "+t),void setTimeout(function(){wppaDoSphericPan(t)},200);wppaConsoleLog("Loading image "+t+" complete"),c(image).css({width:image.naturalWidth,height:image.naturalHeight,maxWidth:image.naturalWidth,maxHeight:image.naturalHeight}),d.manCtrl=!1,d.butDown=!1,d.lon=180,d.lat=0,d.dFov=0,d.fov=75,d.abort=!1,d.aspect=2,d.div=c("#wppa-pan-div-"+t),d.left=c("#wppa-pctl-left-"+t),d.right=c("#wppa-pctl-right-"+t),d.up=c("#wppa-pctl-up-"+t),d.down=c("#wppa-pctl-down-"+t),d.zoomin=c("#wppa-pctl-zoomin-"+t),d.zoomout=c("#wppa-pctl-zoomout-"+t),d.prev=c("#wppa-pctl-prev-"+t),d.next=c("#wppa-pctl-next-"+t),d.pause=!1,d.mFakt=wppaIsMobile?"2":"1",d.isLightbox&&(wppaGlobalOvlPanoramaId++,d.uId=wppaGlobalOvlPanoramaId),c(d.div).html(""),d.wppaRenderer=new THREE.WebGLRenderer,d.wppaRenderer.setSize(d.width,d.height),c(d.div).append(d.wppaRenderer.domElement),d.wppaScene=new THREE.Scene,d.wppaSphere=new THREE.SphereGeometry(100,100,40),d.wppaSphere.applyMatrix((new THREE.Matrix4).makeScale(-1,1,1)),d.wppaSphereMaterial=new THREE.MeshBasicMaterial,d.wppaSphereMaterial.map=THREE.ImageUtils.loadTexture(d.url),d.wppaSphereMesh=new THREE.Mesh(d.wppaSphere,d.wppaSphereMaterial),d.wppaScene.add(d.wppaSphereMesh),wppaIsMobile?(d.right.on("touchstart",function(n){u(t)}),d.right.on("touchend",function(n){m(t)}),d.left.on("touchstart",function(n){s(t)}),d.left.on("touchend",function(n){m(t)}),d.up.on("touchstart",function(n){l(t)}),d.up.on("touchend",function(n){m(t)}),d.down.on("touchstart",function(n){h(t)}),d.down.on("touchend",function(n){m(t)}),d.zoomin.on("touchstart",function(n){i(t)}),d.zoomin.on("touchend",function(n){m(t)}),d.zoomout.on("touchstart",function(n){r(t)}),d.zoomout.on("touchend",function(n){m(t)}),d.enableManual&&(c("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchstart",function(n){o(t,n)}),c("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchmove",function(n){e(t,n)}),c("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchend",function(n){p(t)}))):(d.right.on("mousedown",function(n){u(t)}),d.right.on("mouseup",function(n){m(t)}),d.left.on("mousedown",function(n){s(t)}),d.left.on("mouseup",function(n){m(t)}),d.up.on("mousedown",function(n){l(t)}),d.up.on("mouseup",function(n){m(t)}),d.down.on("mousedown",function(n){h(t)}),d.down.on("mouseup",function(n){m(t)}),d.zoomin.on("mousedown",function(n){i(t)}),d.zoomin.on("mouseup",function(n){m(t)}),d.zoomout.on("mousedown",function(n){r(t)}),d.zoomout.on("mouseup",function(n){m(t)}),d.enableManual&&(c("#wppa-pan-div-"+t+" canvas").on("mousedown",function(n){o(t,n)}),c("#wppa-pan-div-"+t+" canvas").on("mousemove",function(n){e(t,n)}),c("#wppa-pan-div-"+t+" canvas").on("mouseup",function(n){p(t)}),c("#wppa-pan-div-"+t+" canvas")[0].addEventListener("wheel",function(n){var a,o;a=t,(o=n).preventDefault(),o.stopPropagation(),d=v(a),v(a,{manCtrl:!1,butDown:!1,autorun:!1,dX:0,dFov:-o.deltaY*d.zoomsensitivity/(wppaIsChrome?60:6)}),w(a),setTimeout(function(){v(a,{dFov:0})},25)}))),d.isLightbox&&d.prev&&(d.prev.on("click",function(n){c("#wppa-overlay-ic").css({display:"none"}),c("#wppa-ovl-spin").show(),v(t,{abort:!0}),c("body").trigger("quitimage"),wppaOvlShowPrev()}),d.next.on("click",function(n){c("#wppa-overlay-ic").css({display:"none"}),c("#wppa-ovl-spin").show(),v(t,{abort:!0}),c("body").trigger("quitimage"),wppaOvlShowNext()}),c("body").on("quitimage",function(n){var a;a=t,wppaConsoleLog("Quit Image"),(d=v(a,{abort:!0})).wppaRenderer.resetGLState(),d.wppaSphere.dispose(),d.wppaSphereMaterial.dispose()})),v(t,d),c(window).on("DOMContentLoaded load resize orientationchange",function(n){a(t)}),a(t)}function w(n){var a=v(n);wppaConsoleLog("Spheric render "+n+", dFov="+a.dFov+", dX="+a.dX+", dY="+a.dY+", pause="+a.pause+", autorun="+a.autorun),a.isLightbox&&(!wppaOvlOpen||wppaOvlActivePanorama!=a.id||wppaGlobalOvlPanoramaId>a.uId)&&(abort=!0),a.abort||((a.butDown||a.manCtrl)&&a.autorun&&(a.autorun=!1,a.dX=0),0==a.dX&&0==a.dY&&0==a.dFov&&(a.pause=!0),a.butDown&&(a.pause=!1),a.fov+=a.dFov,a.fov=Math.max(20,Math.min(120,a.fov)),a.wppaCamera=new THREE.PerspectiveCamera(a.fov,a.aspect,1,1e3),a.wppaCamera.target=new THREE.Vector3(0,0,0),a.lon+=a.dX,a.lat+=a.dY,a.lat=Math.max(-85,Math.min(85,a.lat)),a.wppaCamera.target.x=500*Math.sin(THREE.Math.degToRad(90-a.lat))*Math.cos(THREE.Math.degToRad(a.lon)),a.wppaCamera.target.y=500*Math.cos(THREE.Math.degToRad(90-a.lat)),a.wppaCamera.target.z=500*Math.sin(THREE.Math.degToRad(90-a.lat))*Math.sin(THREE.Math.degToRad(a.lon)),a.wppaCamera.lookAt(a.wppaCamera.target),a.wppaRenderer.render(a.wppaScene,a.wppaCamera),wppaAdjustControlbar(),c("#wppa-ovl-spin").hide(),(a.autorun||!a.pause&&(a.manCtrl||a.butDown))&&setTimeout(function(){w(n)},15))}function a(n){wppaConsoleLog("Resize mocc "+n);var a,o,t,e,p,i,r,u,s=!wppaIsFs();d.isLightbox?(c("#wppa-overlay-ic").css("display",""),c("#wppa-overlay-ic").css("width",""),t=(s=!wppaIsFs())?(o=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(o=screen.width,screen.height),i=(p=8)+(d.controls?d.icsize+10:0)+30,s&&(p+=2*d.borderWidth,i+=2*d.borderWidth),a=(o-p)/2+i<t,e=s?a?(t-(u=(r=o-p)/2)-i)/2+20:(r=2*(u=t-i),20):(r=screen.width,u=screen.height,0),d.aspect=r/u,c("#wppa-ovl-pan-container").css({top:e}),c("#wppa-overlay-ic").css({top:0}),s?(c("#wppa-ovl-pan-container").css({backgroundColor:d.backgroundColor,padding:d.padding+"px",borderRadius:d.borderRadius+"px",width:r,marginLeft:0}),c("#wppa-pctl-div-"+n).css({marginLeft:0}),a?c("#wppa-overlay-ic").css({marginLeft:4}):c("#wppa-overlay-ic").css({left:(o-r)/2,marginLeft:0})):(c("#wppa-overlay-ic").css({marginLeft:0}),c("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,width:r,left:(o-r)/2}),c("#wppa-pctl-div-"+n).css({marginLeft:0}))):u=(r=c(d.div).parent().width())*d.height/d.width,d.wppaRenderer.setSize(r,u),setTimeout(function(){w(n)},250)}function o(n,a){a.preventDefault(),a.stopPropagation(),d=v(n,{manCtrl:!0,butDown:!1,autorun:!1,dX:0}),wppaIsMobile?v(n,{sX:a.touches[0].clientX,sY:a.touches[0].clientY}):v(n,{sX:a.clientX,sY:a.clientY}),v(n,{sLon:d.lon,sLat:d.lat}),w(n)}function e(n,a){a.preventDefault(),a.stopPropagation(),(d=v(n)).manCtrl&&(wppaIsMobile?v(n,{lon:.1*(d.sX-a.touches[0].clientX)+d.sLon,lat:.1*(a.touches[0].clientY-d.sY)+d.sLat,pause:!1}):v(n,{lon:.1*(d.sX-a.clientX)+d.sLon,lat:.1*(a.clientY-d.sY)+d.sLat,pause:!1}),w(n))}function p(n){v(n,{manCtrl:!1})}function i(n){d=v(n),v(n,{dFov:-.4*d.mFakt,butDown:!0}),w(n)}function r(n){d=v(n),v(n,{dFov:.4*d.mFakt,butDown:!0}),w(n)}function u(n){d=v(n),v(n,{dX:.2*d.mFakt,butDown:!0}),w(n)}function s(n){d=v(n),v(n,{dX:-.2*d.mFakt,butDown:!0}),w(n)}function l(n){d=v(n),v(n,{dY:.2*d.mFakt,butDown:!0}),w(n)}function h(n){d=v(n),v(n,{dY:-.2*d.mFakt,butDown:!0}),w(n)}function m(n){d=v(n),v(n,{dX:0,dY:0,dFov:0,butDown:!1})}function v(n,a){if(a)for(var o in a)wppaSphericData[n][o]=a[o];return wppaSphericData[n]}}
13
  // wppa-touch
14
  var wppaJsTouchVersion="7.5.03",wppaTriggerElementID=null,wppaFingerCount=0,wppaStartX=0,wppaStartY=0,wppaCurX=0,wppaCurY=0,wppaDeltaX=0,wppaDeltaY=0,wppaHorzDiff=0,wppaVertDiff=0,wppaMinLength=72,wppaSwipeLength=0,wppaSwipeAngle=null,wppaSwipeDirection=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=0,wppaMobileTimeStart=0;function wppaStartTime(){var p=(new Date).getTime();return wppaMobileTimeStart=p,!0}function wppaInTime(){return(new Date).getTime()-wppaMobileTimeStart<250}function wppaTapLink(p,e){wppaInTime()&&(_bumpClickCount(p),document.location.href=e)}function wppaTouchStart(p,e,a){-1==(wppaSwipeMocc=a)&&(wppaSwipeOnLightbox=!0,p.preventDefault()),1==(wppaFingerCount=p.touches.length)?(wppaStartX=p.touches[0].pageX,wppaStartY=p.touches[0].pageY,wppaTriggerElementID=e):wppaTouchCancel()}function wppaTouchMove(p){wppaSwipeOnLightbox&&p.preventDefault(),1==p.touches.length?(wppaCurX=p.touches[0].pageX,wppaCurY=p.touches[0].pageY):wppaTouchCancel()}function wppaTouchEnd(p){wppaSwipeOnLightbox&&p.preventDefault(),1==wppaFingerCount&&0!=wppaCurX&&(wppaSwipeLength=Math.round(Math.sqrt(Math.pow(wppaCurX-wppaStartX,2)+Math.pow(wppaCurY-wppaStartY,2))),wppaMinLength<=wppaSwipeLength&&(wppaCalculateAngle(),wppaDetermineSwipeDirection(),wppaProcessingRoutine())),wppaTouchCancel()}function wppaTouchCancel(){wppaTriggerElementID=wppaSwipeDirection=wppaSwipeAngle=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=wppaSwipeLength=wppaVertDiff=wppaHorzDiff=wppaDeltaY=wppaDeltaX=wppaCurY=wppaCurX=wppaStartY=wppaStartX=wppaFingerCount=0}function wppaCalculateAngle(){var p=wppaStartX-wppaCurX,e=wppaCurY-wppaStartY,a=(Math.round(Math.sqrt(Math.pow(p,2)+Math.pow(e,2))),Math.atan2(e,p));(wppaSwipeAngle=Math.round(180*a/Math.PI))<0&&(wppaSwipeAngle=360-Math.abs(wppaSwipeAngle))}function wppaDetermineSwipeDirection(){wppaSwipeDirection=wppaSwipeAngle<=45&&0<=wppaSwipeAngle||wppaSwipeAngle<=360&&315<=wppaSwipeAngle?"left":135<=wppaSwipeAngle&&wppaSwipeAngle<=225?"right":45<wppaSwipeAngle&&wppaSwipeAngle<135?"down":"up"}function wppaProcessingRoutine(){document.getElementById(wppaTriggerElementID);if(wppaSwipeOnLightbox)"left"==wppaSwipeDirection?wppaOvlShowNext():"right"==wppaSwipeDirection&&wppaOvlShowPrev();else{if("right"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]-1,idx<0){if(!wppaSlideWrap)return;idx=_wppaSlides[wppaSwipeMocc].length-1}wppaGotoKeepState(wppaSwipeMocc,idx)}if("left"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]+1,idx==_wppaSlides[wppaSwipeMocc].length){if(!wppaSlideWrap)return;idx=0}wppaGotoKeepState(wppaSwipeMocc,idx)}}wppaTouchCancel()}
15
  // wppa-zoom
16
+ function wppaDoZoomPan(e){var p=jQuery,o=w(e);if(!o.initialized&&!o.abort){if(o.isLightbox&&p("#wppa-ovl-spin").show(),!o.image.complete)return wppaConsoleLog("Loading image "+e),void setTimeout(function(){wppaDoZoomPan(e)},200);wppaConsoleLog("Loading image "+e+" complete"),p(image).css({width:image.naturalWidth,height:image.naturalHeight,maxWidth:image.naturalWidth,maxHeight:image.naturalHeight}),o.manual=!1,o.deltaX=0,o.deltaY=0,o.deltaFactor=1,o.busy=!1,o.div=p("#wppa-pan-div-"+o.itemId),o.canvas=document.getElementById("wppa-pan-canvas-"+o.itemId),o.left=p("#wppa-pctl-left-"+o.itemId),o.right=p("#wppa-pctl-right-"+o.itemId),o.up=p("#wppa-pctl-up-"+o.itemId),o.down=p("#wppa-pctl-down-"+o.itemId),o.zoomin=p("#wppa-pctl-zoomin-"+o.itemId),o.zoomout=p("#wppa-pctl-zoomout-"+o.itemId),o.prev=p("#wppa-pctl-prev-"+o.itemId),o.next=p("#wppa-pctl-next-"+o.itemId),o.exit=p("#wppa-exit-btn-2"),o.canvasWidth=o.width,o.canvasHeight=o.height,o.savedCanvasX=0,o.savedCanvasY=0,o.fromHeight=o.image.height,o.fromWidth=o.image.width,o.imageRatio=o.image.width/o.image.height,o.fromX=0,o.fromY=0,o.centerX=o.fromX+o.fromWidth/2,o.centerY=o.fromY+o.fromHeight/2,o.ctx=null,o.buttondown=!1,o.enableManual=!0,o.ctrlbarUpdate=!0,o.pause=!1,o.time=0,wppaIsMobile?(o.right.on("touchstart",function(t){n(e)}),o.right.on("touchend",function(t){m(e)}),o.left.on("touchstart",function(t){i(e)}),o.left.on("touchend",function(t){m(e)}),o.up.on("touchstart",function(t){s(e)}),o.up.on("touchend",function(t){m(e)}),o.down.on("touchstart",function(t){r(e)}),o.down.on("touchend",function(t){m(e)}),o.zoomin.on("touchstart",function(t){c(e)}),o.zoomin.on("touchend",function(t){m(e)}),o.zoomout.on("touchstart",function(t){u(e)}),o.zoomout.on("touchend",function(t){m(e)}),o.canvas.addEventListener("touchstart",function(t){f(e,t)}),o.canvas.addEventListener("touchmove",function(t){l(e,t)}),o.canvas.addEventListener("touchend",function(t){g(e)})):(o.canvas.addEventListener("mousedown",function(t){f(e,t)}),o.canvas.addEventListener("mousemove",function(t){l(e,t)}),o.canvas.addEventListener("mouseup",function(t){g(e)}),o.canvas.addEventListener("mouseleave",function(t){(o=w(e)).manual&&w(e,{pause:!0})}),o.canvas.addEventListener("mouseenter",function(t){var a;w(a=e,{pause:!1}).manual&&h(a)}),document.getElementById("wppa-pan-canvas-"+o.itemId).addEventListener("wheel",function(t){var a,n;a=e,(n=t).preventDefault(),n.stopPropagation(),o=w(a),w(a,{deltaFactor:1+n.deltaY*o.zoomsensitivity/(wppaIsChrome?1e4:1e3),manual:!1}),h(a),setTimeout(function(){w(a,{deltaFactor:1})},25)}),o.right.on("mousedown",function(t){n(e)}),o.right.on("mouseup",function(t){m(e)}),o.left.on("mousedown",function(t){i(e)}),o.left.on("mouseup",function(t){m(e)}),o.up.on("mousedown",function(t){s(e)}),o.up.on("mouseup",function(t){m(e)}),o.down.on("mousedown",function(t){r(e)}),o.down.on("mouseup",function(t){m(e)}),o.zoomin.on("mousedown",function(t){c(e)}),o.zoomin.on("mouseup",function(t){m(e)}),o.zoomout.on("mousedown",function(t){u(e)}),o.zoomout.on("mouseup",function(t){m(e)})),o.isLightbox&&(p(".wppa-fulls-btn").on("click",function(){w(0,{abort:!0})}),p(".wppa-exit-fulls-btn").on("click",function(){w(0,{abort:!0})}),o.prev&&(o.prev.on("click",function(t){p("#wppa-ovl-spin").show(),w(0,{abort:!0}),wppaOvlShowPrev()}),o.next.on("click",function(t){p("#wppa-ovl-spin").show(),w(0,{abort:!0}),wppaOvlShowNext()})),o.exit.on("click",function(t){p("#wppa-ovl-spin").hide(),w(0,{abort:!0}),wppaOvlHide()})),p(window).on("DOMContentLoaded load resize orientationchange",function(){setTimeout(function(t){a(e)},25)}),a(e),o.initialized=!0,w(e,o),p("#wppa-ovl-spin").hide()}function h(t){var a,n,e,o,i,s=w(t);L()<s.time+10?wppaConsoleLog("Skipped render "+t):(w(t,{time:L()}),wppaConsoleLog("Zoom render "+t),(s.isLightbox&&!wppaOvlOpen||!s.isLightbox&&wppaOvlOpen)&&(s=w(0,{abort:!0})),s.abort?w(t,{manual:!1,buttondown:!1,pause:!1,ctx:null}):s.busy||(wppaDebugCounter++,(s=w(t,{busy:!0})).manual||(s.fromX+=s.deltaX,s.fromY+=s.deltaY,a=s.fromHeight/s.deltaFactor,n=s.fromWidth/s.deltaFactor,50<a&&1!=s.deltaFactor&&(wppaIsFs()||a<=s.image.height)&&(s.fromX-=(n-s.fromWidth)/2,s.fromY-=(a-s.fromHeight)/2,s.fromWidth=n,s.fromHeight=a)),s.fromX=Math.max(0,Math.min(s.image.width-s.fromWidth,s.fromX)),s.fromY=Math.max(0,Math.min(s.image.height-s.fromHeight,s.fromY)),e=screen.width/screen.height,o=(1-s.image.width/s.fromWidth)*s.canvas.width/2,i=(1-s.image.height/s.fromHeight)*s.canvas.height/2,s.ctx=s.canvas.getContext("2d"),e>s.imageRatio&&a>s.image.height&&wppaIsFs()||e<=s.imageRatio&&n>s.image.width&&wppaIsFs()?(s.enableManual=!1,s.ctx.clearRect(0,0,s.canvas.width,s.canvas.height),s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,o,i,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"default"})):(s.enableManual=!0,s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,0,0,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"grab"})),wppaIsFs()?(s.fsMaskTop=i-(s.canvas.height-screen.height)/2,s.fsMaskLeft=o-(s.canvas.width-screen.width)/2,s.fsMaskBottom=screen.height-s.fsMaskTop,s.fsMaskRight=screen.width-s.fsMaskLeft):(s.fsMaskTop=0,s.fsMaskLeft=0,s.fsMaskBottom=0,s.fsMaskRight=0),s.ctrlbarUpdate&&(wppaAdjustControlbar(),s.ctrlbarUpdate=!1),s.busy=!1,w(t,s),s.pause||!s.manual&&!s.buttondown||setTimeout(function(){h(t)},10),s.pause&&w(t,{pause:!1})))}function a(t){var a,n,e,o,i,s,r,c,d,u=w(t);u&&(u.isLightbox?(p("#wppa-overlay-ic").css("display",""),o=(n=!wppaIsFs())?(e=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(e=screen.width,screen.height),r=0,d=(c=8)+(u.controls?u.icsize+10:0)+10,n?(c+=2*u.borderWidth,d+=2*u.borderWidth):c=40,a=n?o-d>(e-c)/u.imageRatio:(screenRatio=screen.width/screen.height,screenRatio<u.imageRatio),n&&a&&(r=(o-(s=(i=e-c)/u.imageRatio)-d)/2+20),n&&!a&&(s=(i=u.imageRatio*(o-(u.controls?u.icsize:0)-48))/u.imageRatio,r=20),!n&&a&&(i=(s=screen.height)*u.imageRatio,r=0),n||a||(s=(i=screen.width)/u.imageRatio,r=(screen.height-s)/2),p("#wppa-ovl-pan-container").css({marginTop:r}),p("#wppa-overlay-ic").css({marginTop:0}),u.canvasWidth=i,u.canvasHeight=s,u.canvas.width=u.canvasWidth,u.canvas.height=u.canvasHeight,n?(p("#wppa-ovl-pan-container").css({backgroundColor:u.backgroundColor,padding:u.padding,borderRadius:u.borderRadius,borderWidth:u.borderWidth,width:i,marginLeft:0}),p("#wppa-pctl-div-"+u.itemId).css({marginLeft:0}),a?p("#wppa-overlay-ic").css({left:4}):p("#wppa-overlay-ic").css({left:(e-i)/2})):(p("#wppa-overlay-ic").css({marginLeft:0}),p("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:i,left:(e-i)/2,position:"fixed"}),p("#wppa-pctl-div-"+u.itemId).css({marginLeft:0}))):(u.canvasWidth=p(u.div).parent().width(),u.canvasHeight=u.canvasWidth/u.imageRatio,u.canvas.width=u.canvasWidth,u.canvas.height=u.canvasHeight),u.ctrlbarUpdate=!0,w(t,u),setTimeout(function(){h(t)},250))}function n(t){var a=w(t),n=a.image.naturalWidth/a.canvas.width;n<1.5&&(n=1.5),w(t,{deltaX:n*=1.5,buttondown:!0,manual:!1}),h(t)}function i(t){var a=w(t),n=a.image.naturalWidth/a.canvas.width;n<1.5&&(n=1.5),w(t,{deltaX:-(n*=1.5),buttondown:!0,manual:!1}),h(t)}function s(t){var a=w(t),n=a.image.naturalHeight/a.canvas.height;n<1.5&&(n=1.5),w(t,{deltaY:-(n*=1.5),buttondown:!0,manual:!1}),h(t)}function r(t){var a=w(t),n=a.image.naturalHeight/a.canvas.height;n<1.5&&(n=1.5),w(t,{deltaY:n*=1.5,buttondown:!0,manual:!1}),h(t)}function c(t){w(t,{deltaFactor:1.005,buttondown:!0,manual:!1}),h(t)}function u(t){w(t,{deltaFactor:.995,buttondown:!0,manual:!1}),h(t)}function m(t){w(t,{deltaX:0,deltaY:0,deltaFactor:1,buttondown:!1})}function f(t,a){var n=w(t),e=v(a).X,o=v(a).Y;if(wppaIsFs()&&n.isLightbox&&(e<n.fsMaskLeft||e>n.fsMaskRight||o<n.fsMaskTop||o>n.fsMaskBottom))return w(0,{abort:!0}),void jQuery("#wppa-overlay-bg").trigger("click");n.enableManual&&(w(t,{manual:!0,savedCanvasX:e=b(t,a).X,savedCanvasY:o=b(t,a).Y}),h(t))}function l(t,a){var n,e,o,i=w(t),s=b(t,a).X,r=b(t,a).Y;i.manual&&(n=i.canvas.width/i.fromWidth,e=(i.savedCanvasX-s)/n+i.fromX,o=(i.savedCanvasY-r)/n+i.fromY,0<e&&0<o&&e+i.fromWidth<i.image.width&&o+i.fromHeight<i.image.height&&w(t,{fromX:e,fromY:o,savedCanvasX:s,savedCanvasY:r}))}function g(t){w(t,{manual:!1})}function w(t,a){if(!wppaZoomData[t])return!1;if(a)for(var n in a)wppaZoomData[t][n]=a[n];return wppaZoomData[t]}function v(t){var a,n;return n=wppaIsMobile?(a=t.touches[0].screenX,t.touches[0].screenY):(a=t.screenX,t.screenY),{X:a,Y:n}}function b(t,a){var n,e,o;return o=wppaIsMobile?(n=w(t),e=a.touches[0].screenX-n.fsMaskLeft,a.touches[0].screenY-n.fsMaskTop):(e=a.offsetX,a.offsetY),{X:e,Y:o}}function L(){return d=new Date,d.getTime()}}
17
  // wppa-spheric
18
+ function wppaDoSphericPan(t){var s=jQuery,w=v(t);if(!w.initialized&&!w.abort){if(w.isLightbox&&s("#wppa-ovl-spin").show(),!w.image.complete)return wppaConsoleLog("Loading image "+t),void setTimeout(function(){wppaDoSphericPan(t)},200);wppaConsoleLog("Loading image "+t+" complete"),s(image).css({width:image.naturalWidth,height:image.naturalHeight,maxWidth:image.naturalWidth,maxHeight:image.naturalHeight}),w.manCtrl=!1,w.butDown=!1,w.lon=180,w.lat=0,w.dFov=0,w.fov=75,w.abort=!1,w.aspect=2,w.div=s("#wppa-pan-div-"+t),w.left=s("#wppa-pctl-left-"+t),w.right=s("#wppa-pctl-right-"+t),w.up=s("#wppa-pctl-up-"+t),w.down=s("#wppa-pctl-down-"+t),w.zoomin=s("#wppa-pctl-zoomin-"+t),w.zoomout=s("#wppa-pctl-zoomout-"+t),w.prev=s("#wppa-pctl-prev-"+t),w.next=s("#wppa-pctl-next-"+t),w.pause=!1,w.mFakt=wppaIsMobile?"2":"1",w.time=0,w.isLightbox&&(wppaGlobalOvlPanoramaId++,w.uId=wppaGlobalOvlPanoramaId),s(w.div).html(""),w.wppaRenderer=new THREE.WebGLRenderer,w.wppaRenderer.setSize(w.width,w.height),s(w.div).append(w.wppaRenderer.domElement),w.wppaScene=new THREE.Scene,w.wppaSphere=new THREE.SphereGeometry(100,100,40),w.wppaSphere.applyMatrix((new THREE.Matrix4).makeScale(-1,1,1)),w.wppaSphereMaterial=new THREE.MeshBasicMaterial,w.wppaSphereMaterial.map=THREE.ImageUtils.loadTexture(w.url),w.wppaSphereMesh=new THREE.Mesh(w.wppaSphere,w.wppaSphereMaterial),w.wppaScene.add(w.wppaSphereMesh),wppaIsMobile?(w.right.on("touchstart",function(n){u(t)}),w.right.on("touchend",function(n){f(t)}),w.left.on("touchstart",function(n){c(t)}),w.left.on("touchend",function(n){f(t)}),w.up.on("touchstart",function(n){h(t)}),w.up.on("touchend",function(n){f(t)}),w.down.on("touchstart",function(n){m(t)}),w.down.on("touchend",function(n){f(t)}),w.zoomin.on("touchstart",function(n){i(t)}),w.zoomin.on("touchend",function(n){f(t)}),w.zoomout.on("touchstart",function(n){r(t)}),w.zoomout.on("touchend",function(n){f(t)}),w.enableManual&&(s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchstart",function(n){a(t,n)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchmove",function(n){e(t,n)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchend",function(n){p(t)}))):(w.right.on("mousedown",function(n){u(t)}),w.right.on("mouseup",function(n){f(t)}),w.left.on("mousedown",function(n){c(t)}),w.left.on("mouseup",function(n){f(t)}),w.up.on("mousedown",function(n){h(t)}),w.up.on("mouseup",function(n){f(t)}),w.down.on("mousedown",function(n){m(t)}),w.down.on("mouseup",function(n){f(t)}),w.zoomin.on("mousedown",function(n){i(t)}),w.zoomin.on("mouseup",function(n){f(t)}),w.zoomout.on("mousedown",function(n){r(t)}),w.zoomout.on("mouseup",function(n){f(t)}),w.enableManual&&(s("#wppa-pan-div-"+t+" canvas").on("mousedown",function(n){a(t,n)}),s("#wppa-pan-div-"+t+" canvas").on("mousemove",function(n){e(t,n)}),s("#wppa-pan-div-"+t+" canvas").on("mouseup",function(n){p(t)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("wheel",function(n){var o,a;o=t,(a=n).preventDefault(),a.stopPropagation(),w=v(o),v(o,{manCtrl:!1,butDown:!1,autorun:!1,dX:0,dFov:-a.deltaY*w.zoomsensitivity/(wppaIsChrome?60:6)}),l(o),setTimeout(function(){v(o,{dFov:0})},25)}))),w.isLightbox&&w.prev&&(w.prev.on("click",function(n){s("#wppa-overlay-ic").css({display:"none"}),s("#wppa-ovl-spin").show(),v(t,{abort:!0}),s("body").trigger("quitimage"),wppaOvlShowPrev()}),w.next.on("click",function(n){s("#wppa-overlay-ic").css({display:"none"}),s("#wppa-ovl-spin").show(),v(t,{abort:!0}),s("body").trigger("quitimage"),wppaOvlShowNext()}),s("body").on("quitimage",function(n){var o;o=t,wppaConsoleLog("Quit Image"),(w=v(o,{abort:!0})).wppaRenderer.resetGLState(),w.wppaSphere.dispose(),w.wppaSphereMaterial.dispose()})),v(t,w),s(window).on("DOMContentLoaded load resize orientationchange",function(){setTimeout(function(n){o(t)},25)}),o(t)}function l(n){var o=v(n);g()<o.time+25?wppaConsoleLog("Skipped render "+n):(v(n,{time:g()}),wppaConsoleLog("Spheric render "+n+", dFov="+o.dFov+", dX="+o.dX+", dY="+o.dY+", pause="+o.pause+", autorun="+o.autorun),o.isLightbox&&(!wppaOvlOpen||wppaOvlActivePanorama!=o.id||wppaGlobalOvlPanoramaId>o.uId)&&(abort=!0),o.abort||((o.butDown||o.manCtrl)&&o.autorun&&(o.autorun=!1,o.dX=0),0==o.dX&&0==o.dY&&0==o.dFov&&(o.pause=!0),o.butDown&&(o.pause=!1),o.fov+=o.dFov,o.fov=Math.max(20,Math.min(120,o.fov)),o.wppaCamera=new THREE.PerspectiveCamera(o.fov,o.aspect,1,1e3),o.wppaCamera.target=new THREE.Vector3(0,0,0),o.lon+=o.dX,o.lat+=o.dY,o.lat=Math.max(-85,Math.min(85,o.lat)),o.wppaCamera.target.x=500*Math.sin(THREE.Math.degToRad(90-o.lat))*Math.cos(THREE.Math.degToRad(o.lon)),o.wppaCamera.target.y=500*Math.cos(THREE.Math.degToRad(90-o.lat)),o.wppaCamera.target.z=500*Math.sin(THREE.Math.degToRad(90-o.lat))*Math.sin(THREE.Math.degToRad(o.lon)),o.wppaCamera.lookAt(o.wppaCamera.target),o.wppaRenderer.render(o.wppaScene,o.wppaCamera),wppaAdjustControlbar(),s("#wppa-ovl-spin").hide(),(o.autorun||!o.pause&&(o.manCtrl||o.butDown))&&setTimeout(function(){l(n)},25)))}function o(n){wppaConsoleLog("Resize mocc "+n);var o,a,t,e,p,i,r,u,c=!wppaIsFs();(w=v(n))&&(w.isLightbox?(s("#wppa-overlay-ic").css("display",""),s("#wppa-overlay-ic").css("width",""),t=(c=!wppaIsFs())?(a=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(a=screen.width,screen.height),i=(p=8)+(w.controls?w.icsize+10:0)+30,c&&(p+=2*w.borderWidth,i+=2*w.borderWidth),o=(a-p)/2+i<t,e=c?o?(t-(u=(r=a-p)/2)-i)/2+20:(r=2*(u=t-i),20):(r=screen.width,u=screen.height,0),w.aspect=r/u,s("#wppa-ovl-pan-container").css({top:e}),s("#wppa-overlay-ic").css({top:0}),c?(s("#wppa-ovl-pan-container").css({backgroundColor:w.backgroundColor,padding:w.padding+"px",borderRadius:w.borderRadius+"px",width:r,marginLeft:0}),s("#wppa-pctl-div-"+n).css({marginLeft:0}),o?s("#wppa-overlay-ic").css({left:4}):s("#wppa-overlay-ic").css({left:(a-r)/2,marginLeft:0})):(s("#wppa-overlay-ic").css({marginLeft:0}),s("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,width:r,left:(a-r)/2}),s("#wppa-pctl-div-"+n).css({marginLeft:0}))):u=(r=s(w.div).parent().width())*w.height/w.width,w.wppaRenderer.setSize(r,u),w.width=r,w.height=u,v(n,w),setTimeout(function(){l(n)},250))}function a(n,o){o.preventDefault(),o.stopPropagation(),w=v(n,{manCtrl:!0,butDown:!1,autorun:!1,dX:0}),wppaIsMobile?v(n,{sX:o.touches[0].clientX,sY:o.touches[0].clientY}):v(n,{sX:o.clientX,sY:o.clientY}),v(n,{sLon:w.lon,sLat:w.lat}),l(n)}function e(n,o){o.preventDefault(),o.stopPropagation(),(w=v(n)).manCtrl&&(wppaIsMobile?v(n,{lon:.1*(w.sX-o.touches[0].clientX)+w.sLon,lat:.1*(o.touches[0].clientY-w.sY)+w.sLat,pause:!1}):v(n,{lon:.1*(w.sX-o.clientX)+w.sLon,lat:.1*(o.clientY-w.sY)+w.sLat,pause:!1}),l(n))}function p(n){v(n,{manCtrl:!1})}function i(n){w=v(n),v(n,{dFov:-.4*w.mFakt,butDown:!0}),l(n)}function r(n){w=v(n),v(n,{dFov:.4*w.mFakt,butDown:!0}),l(n)}function u(n){w=v(n),v(n,{dX:.2*w.mFakt,butDown:!0}),l(n)}function c(n){w=v(n),v(n,{dX:-.2*w.mFakt,butDown:!0}),l(n)}function h(n){w=v(n),v(n,{dY:.2*w.mFakt,butDown:!0}),l(n)}function m(n){w=v(n),v(n,{dY:-.2*w.mFakt,butDown:!0}),l(n)}function f(n){w=v(n),v(n,{dX:0,dY:0,dFov:0,butDown:!1})}function v(n,o){if(!wppaSphericData[n])return!1;if(o)for(var a in o)wppaSphericData[n][a]=o[a];return wppaSphericData[n]}function g(){return d=new Date,d.getTime()}}
js/wppa-spheric.js CHANGED
@@ -55,6 +55,7 @@ function wppaDoSphericPan(mocc) {
55
  data.next = $("#wppa-pctl-next-"+mocc );
56
  data.pause = false;
57
  data.mFakt = ( wppaIsMobile ? '2' : '1' );
 
58
 
59
  if ( data.isLightbox ) {
60
  wppaGlobalOvlPanoramaId++;
@@ -135,7 +136,7 @@ function wppaDoSphericPan(mocc) {
135
 
136
  update(mocc,data);
137
 
138
- $(window).on("DOMContentLoaded load resize orientationchange",function(e){resize(mocc, e)});
139
 
140
  resize(mocc);
141
 
@@ -143,6 +144,13 @@ function wppaDoSphericPan(mocc) {
143
 
144
  var data = update(mocc);
145
 
 
 
 
 
 
 
 
146
  wppaConsoleLog("Spheric render "+mocc+", dFov="+data.dFov+", dX="+data.dX+", dY="+data.dY+", pause="+data.pause+", autorun="+data.autorun);
147
 
148
  if ( data.isLightbox ) {
@@ -174,14 +182,21 @@ function wppaDoSphericPan(mocc) {
174
  $("#wppa-ovl-spin").hide();
175
 
176
  if ( data.autorun || ( ! data.pause && ( data.manCtrl || data.butDown ) ) ) {
177
- setTimeout(function(){render(mocc)},15);
178
  }
179
  }
180
 
181
- function resize(mocc,e){
182
 
183
  wppaConsoleLog("Resize mocc "+mocc);
184
  var modeIsNormal = ! wppaIsFs();
 
 
 
 
 
 
 
185
 
186
  if ( data.isLightbox ) {
187
 
@@ -203,8 +218,6 @@ function wppaDoSphericPan(mocc) {
203
 
204
  // Initialize new display sizes
205
  var
206
- newWidth,
207
- newHeight,
208
  topMarg,
209
  leftMarg,
210
  extraX = 8,
@@ -258,7 +271,7 @@ function wppaDoSphericPan(mocc) {
258
 
259
  // Limit specific
260
  if ( widthIsLim ) {
261
- $("#wppa-overlay-ic").css({marginLeft:4});
262
  }
263
  else {
264
  $("#wppa-overlay-ic").css({left:(contWidth-newWidth)/2,marginLeft:0});
@@ -293,10 +306,14 @@ function wppaDoSphericPan(mocc) {
293
  else {
294
 
295
  var containerwidth = $(data.div).parent().width();
296
- var newWidth = containerwidth;
297
- var newHeight = newWidth * data.height / data.width;
298
  data.wppaRenderer.setSize(newWidth, newHeight);
299
  }
 
 
 
 
300
 
301
  setTimeout(function(){render(mocc)},250);
302
  }
@@ -450,6 +467,8 @@ function wppaDoSphericPan(mocc) {
450
  // Update data
451
  function update(mocc, data) {
452
 
 
 
453
  if (data) {
454
  for (var property in data) {
455
  wppaSphericData[mocc][property] = data[property];
@@ -467,4 +486,10 @@ function wppaDoSphericPan(mocc) {
467
  data.wppaSphere.dispose();
468
  data.wppaSphereMaterial.dispose();
469
  }
 
 
 
 
 
 
470
  }
55
  data.next = $("#wppa-pctl-next-"+mocc );
56
  data.pause = false;
57
  data.mFakt = ( wppaIsMobile ? '2' : '1' );
58
+ data.time = 0;
59
 
60
  if ( data.isLightbox ) {
61
  wppaGlobalOvlPanoramaId++;
136
 
137
  update(mocc,data);
138
 
139
+ $(window).on("DOMContentLoaded load resize orientationchange",function(){setTimeout(function(e){resize(mocc, e)},25)});
140
 
141
  resize(mocc);
142
 
144
 
145
  var data = update(mocc);
146
 
147
+ // To prevent multiple invocations - caused by e.g. resize events - see if we were here less than the repeat time ago
148
+ if ( timnow() < data.time + 25 ) {
149
+ wppaConsoleLog('Skipped render '+mocc);
150
+ return;
151
+ }
152
+ update(mocc,{time:timnow()});
153
+
154
  wppaConsoleLog("Spheric render "+mocc+", dFov="+data.dFov+", dX="+data.dX+", dY="+data.dY+", pause="+data.pause+", autorun="+data.autorun);
155
 
156
  if ( data.isLightbox ) {
182
  $("#wppa-ovl-spin").hide();
183
 
184
  if ( data.autorun || ( ! data.pause && ( data.manCtrl || data.butDown ) ) ) {
185
+ setTimeout(function(){render(mocc)},25);
186
  }
187
  }
188
 
189
+ function resize(mocc,e) {
190
 
191
  wppaConsoleLog("Resize mocc "+mocc);
192
  var modeIsNormal = ! wppaIsFs();
193
+
194
+ var newWidth;
195
+ var newHeight;
196
+
197
+
198
+ data = update(mocc);
199
+ if ( ! data ) return;
200
 
201
  if ( data.isLightbox ) {
202
 
218
 
219
  // Initialize new display sizes
220
  var
 
 
221
  topMarg,
222
  leftMarg,
223
  extraX = 8,
271
 
272
  // Limit specific
273
  if ( widthIsLim ) {
274
+ $("#wppa-overlay-ic").css({left:4});
275
  }
276
  else {
277
  $("#wppa-overlay-ic").css({left:(contWidth-newWidth)/2,marginLeft:0});
306
  else {
307
 
308
  var containerwidth = $(data.div).parent().width();
309
+ newWidth = containerwidth;
310
+ newHeight = newWidth * data.height / data.width;
311
  data.wppaRenderer.setSize(newWidth, newHeight);
312
  }
313
+
314
+ data.width = newWidth;
315
+ data.height = newHeight;
316
+ update(mocc,data);
317
 
318
  setTimeout(function(){render(mocc)},250);
319
  }
467
  // Update data
468
  function update(mocc, data) {
469
 
470
+ if ( ! wppaSphericData[mocc] ) return false;
471
+
472
  if (data) {
473
  for (var property in data) {
474
  wppaSphericData[mocc][property] = data[property];
486
  data.wppaSphere.dispose();
487
  data.wppaSphereMaterial.dispose();
488
  }
489
+
490
+ // Get current time in ms
491
+ function timnow() {
492
+ d = new Date();
493
+ return d.getTime();
494
+ }
495
  }
js/wppa-spheric.min.js CHANGED
@@ -1 +1 @@
1
- function wppaDoSphericPan(t){var c=jQuery,d=v(t);if(!d.initialized&&!d.abort){if(d.isLightbox&&c("#wppa-ovl-spin").show(),!d.image.complete)return wppaConsoleLog("Loading image "+t),void setTimeout(function(){wppaDoSphericPan(t)},200);wppaConsoleLog("Loading image "+t+" complete"),c(image).css({width:image.naturalWidth,height:image.naturalHeight,maxWidth:image.naturalWidth,maxHeight:image.naturalHeight}),d.manCtrl=!1,d.butDown=!1,d.lon=180,d.lat=0,d.dFov=0,d.fov=75,d.abort=!1,d.aspect=2,d.div=c("#wppa-pan-div-"+t),d.left=c("#wppa-pctl-left-"+t),d.right=c("#wppa-pctl-right-"+t),d.up=c("#wppa-pctl-up-"+t),d.down=c("#wppa-pctl-down-"+t),d.zoomin=c("#wppa-pctl-zoomin-"+t),d.zoomout=c("#wppa-pctl-zoomout-"+t),d.prev=c("#wppa-pctl-prev-"+t),d.next=c("#wppa-pctl-next-"+t),d.pause=!1,d.mFakt=wppaIsMobile?"2":"1",d.isLightbox&&(wppaGlobalOvlPanoramaId++,d.uId=wppaGlobalOvlPanoramaId),c(d.div).html(""),d.wppaRenderer=new THREE.WebGLRenderer,d.wppaRenderer.setSize(d.width,d.height),c(d.div).append(d.wppaRenderer.domElement),d.wppaScene=new THREE.Scene,d.wppaSphere=new THREE.SphereGeometry(100,100,40),d.wppaSphere.applyMatrix((new THREE.Matrix4).makeScale(-1,1,1)),d.wppaSphereMaterial=new THREE.MeshBasicMaterial,d.wppaSphereMaterial.map=THREE.ImageUtils.loadTexture(d.url),d.wppaSphereMesh=new THREE.Mesh(d.wppaSphere,d.wppaSphereMaterial),d.wppaScene.add(d.wppaSphereMesh),wppaIsMobile?(d.right.on("touchstart",function(n){u(t)}),d.right.on("touchend",function(n){m(t)}),d.left.on("touchstart",function(n){s(t)}),d.left.on("touchend",function(n){m(t)}),d.up.on("touchstart",function(n){l(t)}),d.up.on("touchend",function(n){m(t)}),d.down.on("touchstart",function(n){h(t)}),d.down.on("touchend",function(n){m(t)}),d.zoomin.on("touchstart",function(n){i(t)}),d.zoomin.on("touchend",function(n){m(t)}),d.zoomout.on("touchstart",function(n){r(t)}),d.zoomout.on("touchend",function(n){m(t)}),d.enableManual&&(c("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchstart",function(n){o(t,n)}),c("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchmove",function(n){e(t,n)}),c("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchend",function(n){p(t)}))):(d.right.on("mousedown",function(n){u(t)}),d.right.on("mouseup",function(n){m(t)}),d.left.on("mousedown",function(n){s(t)}),d.left.on("mouseup",function(n){m(t)}),d.up.on("mousedown",function(n){l(t)}),d.up.on("mouseup",function(n){m(t)}),d.down.on("mousedown",function(n){h(t)}),d.down.on("mouseup",function(n){m(t)}),d.zoomin.on("mousedown",function(n){i(t)}),d.zoomin.on("mouseup",function(n){m(t)}),d.zoomout.on("mousedown",function(n){r(t)}),d.zoomout.on("mouseup",function(n){m(t)}),d.enableManual&&(c("#wppa-pan-div-"+t+" canvas").on("mousedown",function(n){o(t,n)}),c("#wppa-pan-div-"+t+" canvas").on("mousemove",function(n){e(t,n)}),c("#wppa-pan-div-"+t+" canvas").on("mouseup",function(n){p(t)}),c("#wppa-pan-div-"+t+" canvas")[0].addEventListener("wheel",function(n){var a,o;a=t,(o=n).preventDefault(),o.stopPropagation(),d=v(a),v(a,{manCtrl:!1,butDown:!1,autorun:!1,dX:0,dFov:-o.deltaY*d.zoomsensitivity/(wppaIsChrome?60:6)}),w(a),setTimeout(function(){v(a,{dFov:0})},25)}))),d.isLightbox&&d.prev&&(d.prev.on("click",function(n){c("#wppa-overlay-ic").css({display:"none"}),c("#wppa-ovl-spin").show(),v(t,{abort:!0}),c("body").trigger("quitimage"),wppaOvlShowPrev()}),d.next.on("click",function(n){c("#wppa-overlay-ic").css({display:"none"}),c("#wppa-ovl-spin").show(),v(t,{abort:!0}),c("body").trigger("quitimage"),wppaOvlShowNext()}),c("body").on("quitimage",function(n){var a;a=t,wppaConsoleLog("Quit Image"),(d=v(a,{abort:!0})).wppaRenderer.resetGLState(),d.wppaSphere.dispose(),d.wppaSphereMaterial.dispose()})),v(t,d),c(window).on("DOMContentLoaded load resize orientationchange",function(n){a(t)}),a(t)}function w(n){var a=v(n);wppaConsoleLog("Spheric render "+n+", dFov="+a.dFov+", dX="+a.dX+", dY="+a.dY+", pause="+a.pause+", autorun="+a.autorun),a.isLightbox&&(!wppaOvlOpen||wppaOvlActivePanorama!=a.id||wppaGlobalOvlPanoramaId>a.uId)&&(abort=!0),a.abort||((a.butDown||a.manCtrl)&&a.autorun&&(a.autorun=!1,a.dX=0),0==a.dX&&0==a.dY&&0==a.dFov&&(a.pause=!0),a.butDown&&(a.pause=!1),a.fov+=a.dFov,a.fov=Math.max(20,Math.min(120,a.fov)),a.wppaCamera=new THREE.PerspectiveCamera(a.fov,a.aspect,1,1e3),a.wppaCamera.target=new THREE.Vector3(0,0,0),a.lon+=a.dX,a.lat+=a.dY,a.lat=Math.max(-85,Math.min(85,a.lat)),a.wppaCamera.target.x=500*Math.sin(THREE.Math.degToRad(90-a.lat))*Math.cos(THREE.Math.degToRad(a.lon)),a.wppaCamera.target.y=500*Math.cos(THREE.Math.degToRad(90-a.lat)),a.wppaCamera.target.z=500*Math.sin(THREE.Math.degToRad(90-a.lat))*Math.sin(THREE.Math.degToRad(a.lon)),a.wppaCamera.lookAt(a.wppaCamera.target),a.wppaRenderer.render(a.wppaScene,a.wppaCamera),wppaAdjustControlbar(),c("#wppa-ovl-spin").hide(),(a.autorun||!a.pause&&(a.manCtrl||a.butDown))&&setTimeout(function(){w(n)},15))}function a(n){wppaConsoleLog("Resize mocc "+n);var a,o,t,e,p,i,r,u,s=!wppaIsFs();d.isLightbox?(c("#wppa-overlay-ic").css("display",""),c("#wppa-overlay-ic").css("width",""),t=(s=!wppaIsFs())?(o=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(o=screen.width,screen.height),i=(p=8)+(d.controls?d.icsize+10:0)+30,s&&(p+=2*d.borderWidth,i+=2*d.borderWidth),a=(o-p)/2+i<t,e=s?a?(t-(u=(r=o-p)/2)-i)/2+20:(r=2*(u=t-i),20):(r=screen.width,u=screen.height,0),d.aspect=r/u,c("#wppa-ovl-pan-container").css({top:e}),c("#wppa-overlay-ic").css({top:0}),s?(c("#wppa-ovl-pan-container").css({backgroundColor:d.backgroundColor,padding:d.padding+"px",borderRadius:d.borderRadius+"px",width:r,marginLeft:0}),c("#wppa-pctl-div-"+n).css({marginLeft:0}),a?c("#wppa-overlay-ic").css({marginLeft:4}):c("#wppa-overlay-ic").css({left:(o-r)/2,marginLeft:0})):(c("#wppa-overlay-ic").css({marginLeft:0}),c("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,width:r,left:(o-r)/2}),c("#wppa-pctl-div-"+n).css({marginLeft:0}))):u=(r=c(d.div).parent().width())*d.height/d.width,d.wppaRenderer.setSize(r,u),setTimeout(function(){w(n)},250)}function o(n,a){a.preventDefault(),a.stopPropagation(),d=v(n,{manCtrl:!0,butDown:!1,autorun:!1,dX:0}),wppaIsMobile?v(n,{sX:a.touches[0].clientX,sY:a.touches[0].clientY}):v(n,{sX:a.clientX,sY:a.clientY}),v(n,{sLon:d.lon,sLat:d.lat}),w(n)}function e(n,a){a.preventDefault(),a.stopPropagation(),(d=v(n)).manCtrl&&(wppaIsMobile?v(n,{lon:.1*(d.sX-a.touches[0].clientX)+d.sLon,lat:.1*(a.touches[0].clientY-d.sY)+d.sLat,pause:!1}):v(n,{lon:.1*(d.sX-a.clientX)+d.sLon,lat:.1*(a.clientY-d.sY)+d.sLat,pause:!1}),w(n))}function p(n){v(n,{manCtrl:!1})}function i(n){d=v(n),v(n,{dFov:-.4*d.mFakt,butDown:!0}),w(n)}function r(n){d=v(n),v(n,{dFov:.4*d.mFakt,butDown:!0}),w(n)}function u(n){d=v(n),v(n,{dX:.2*d.mFakt,butDown:!0}),w(n)}function s(n){d=v(n),v(n,{dX:-.2*d.mFakt,butDown:!0}),w(n)}function l(n){d=v(n),v(n,{dY:.2*d.mFakt,butDown:!0}),w(n)}function h(n){d=v(n),v(n,{dY:-.2*d.mFakt,butDown:!0}),w(n)}function m(n){d=v(n),v(n,{dX:0,dY:0,dFov:0,butDown:!1})}function v(n,a){if(a)for(var o in a)wppaSphericData[n][o]=a[o];return wppaSphericData[n]}}
1
+ function wppaDoSphericPan(t){var s=jQuery,w=v(t);if(!w.initialized&&!w.abort){if(w.isLightbox&&s("#wppa-ovl-spin").show(),!w.image.complete)return wppaConsoleLog("Loading image "+t),void setTimeout(function(){wppaDoSphericPan(t)},200);wppaConsoleLog("Loading image "+t+" complete"),s(image).css({width:image.naturalWidth,height:image.naturalHeight,maxWidth:image.naturalWidth,maxHeight:image.naturalHeight}),w.manCtrl=!1,w.butDown=!1,w.lon=180,w.lat=0,w.dFov=0,w.fov=75,w.abort=!1,w.aspect=2,w.div=s("#wppa-pan-div-"+t),w.left=s("#wppa-pctl-left-"+t),w.right=s("#wppa-pctl-right-"+t),w.up=s("#wppa-pctl-up-"+t),w.down=s("#wppa-pctl-down-"+t),w.zoomin=s("#wppa-pctl-zoomin-"+t),w.zoomout=s("#wppa-pctl-zoomout-"+t),w.prev=s("#wppa-pctl-prev-"+t),w.next=s("#wppa-pctl-next-"+t),w.pause=!1,w.mFakt=wppaIsMobile?"2":"1",w.time=0,w.isLightbox&&(wppaGlobalOvlPanoramaId++,w.uId=wppaGlobalOvlPanoramaId),s(w.div).html(""),w.wppaRenderer=new THREE.WebGLRenderer,w.wppaRenderer.setSize(w.width,w.height),s(w.div).append(w.wppaRenderer.domElement),w.wppaScene=new THREE.Scene,w.wppaSphere=new THREE.SphereGeometry(100,100,40),w.wppaSphere.applyMatrix((new THREE.Matrix4).makeScale(-1,1,1)),w.wppaSphereMaterial=new THREE.MeshBasicMaterial,w.wppaSphereMaterial.map=THREE.ImageUtils.loadTexture(w.url),w.wppaSphereMesh=new THREE.Mesh(w.wppaSphere,w.wppaSphereMaterial),w.wppaScene.add(w.wppaSphereMesh),wppaIsMobile?(w.right.on("touchstart",function(n){u(t)}),w.right.on("touchend",function(n){f(t)}),w.left.on("touchstart",function(n){c(t)}),w.left.on("touchend",function(n){f(t)}),w.up.on("touchstart",function(n){h(t)}),w.up.on("touchend",function(n){f(t)}),w.down.on("touchstart",function(n){m(t)}),w.down.on("touchend",function(n){f(t)}),w.zoomin.on("touchstart",function(n){i(t)}),w.zoomin.on("touchend",function(n){f(t)}),w.zoomout.on("touchstart",function(n){r(t)}),w.zoomout.on("touchend",function(n){f(t)}),w.enableManual&&(s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchstart",function(n){a(t,n)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchmove",function(n){e(t,n)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchend",function(n){p(t)}))):(w.right.on("mousedown",function(n){u(t)}),w.right.on("mouseup",function(n){f(t)}),w.left.on("mousedown",function(n){c(t)}),w.left.on("mouseup",function(n){f(t)}),w.up.on("mousedown",function(n){h(t)}),w.up.on("mouseup",function(n){f(t)}),w.down.on("mousedown",function(n){m(t)}),w.down.on("mouseup",function(n){f(t)}),w.zoomin.on("mousedown",function(n){i(t)}),w.zoomin.on("mouseup",function(n){f(t)}),w.zoomout.on("mousedown",function(n){r(t)}),w.zoomout.on("mouseup",function(n){f(t)}),w.enableManual&&(s("#wppa-pan-div-"+t+" canvas").on("mousedown",function(n){a(t,n)}),s("#wppa-pan-div-"+t+" canvas").on("mousemove",function(n){e(t,n)}),s("#wppa-pan-div-"+t+" canvas").on("mouseup",function(n){p(t)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("wheel",function(n){var o,a;o=t,(a=n).preventDefault(),a.stopPropagation(),w=v(o),v(o,{manCtrl:!1,butDown:!1,autorun:!1,dX:0,dFov:-a.deltaY*w.zoomsensitivity/(wppaIsChrome?60:6)}),l(o),setTimeout(function(){v(o,{dFov:0})},25)}))),w.isLightbox&&w.prev&&(w.prev.on("click",function(n){s("#wppa-overlay-ic").css({display:"none"}),s("#wppa-ovl-spin").show(),v(t,{abort:!0}),s("body").trigger("quitimage"),wppaOvlShowPrev()}),w.next.on("click",function(n){s("#wppa-overlay-ic").css({display:"none"}),s("#wppa-ovl-spin").show(),v(t,{abort:!0}),s("body").trigger("quitimage"),wppaOvlShowNext()}),s("body").on("quitimage",function(n){var o;o=t,wppaConsoleLog("Quit Image"),(w=v(o,{abort:!0})).wppaRenderer.resetGLState(),w.wppaSphere.dispose(),w.wppaSphereMaterial.dispose()})),v(t,w),s(window).on("DOMContentLoaded load resize orientationchange",function(){setTimeout(function(n){o(t)},25)}),o(t)}function l(n){var o=v(n);g()<o.time+25?wppaConsoleLog("Skipped render "+n):(v(n,{time:g()}),wppaConsoleLog("Spheric render "+n+", dFov="+o.dFov+", dX="+o.dX+", dY="+o.dY+", pause="+o.pause+", autorun="+o.autorun),o.isLightbox&&(!wppaOvlOpen||wppaOvlActivePanorama!=o.id||wppaGlobalOvlPanoramaId>o.uId)&&(abort=!0),o.abort||((o.butDown||o.manCtrl)&&o.autorun&&(o.autorun=!1,o.dX=0),0==o.dX&&0==o.dY&&0==o.dFov&&(o.pause=!0),o.butDown&&(o.pause=!1),o.fov+=o.dFov,o.fov=Math.max(20,Math.min(120,o.fov)),o.wppaCamera=new THREE.PerspectiveCamera(o.fov,o.aspect,1,1e3),o.wppaCamera.target=new THREE.Vector3(0,0,0),o.lon+=o.dX,o.lat+=o.dY,o.lat=Math.max(-85,Math.min(85,o.lat)),o.wppaCamera.target.x=500*Math.sin(THREE.Math.degToRad(90-o.lat))*Math.cos(THREE.Math.degToRad(o.lon)),o.wppaCamera.target.y=500*Math.cos(THREE.Math.degToRad(90-o.lat)),o.wppaCamera.target.z=500*Math.sin(THREE.Math.degToRad(90-o.lat))*Math.sin(THREE.Math.degToRad(o.lon)),o.wppaCamera.lookAt(o.wppaCamera.target),o.wppaRenderer.render(o.wppaScene,o.wppaCamera),wppaAdjustControlbar(),s("#wppa-ovl-spin").hide(),(o.autorun||!o.pause&&(o.manCtrl||o.butDown))&&setTimeout(function(){l(n)},25)))}function o(n){wppaConsoleLog("Resize mocc "+n);var o,a,t,e,p,i,r,u,c=!wppaIsFs();(w=v(n))&&(w.isLightbox?(s("#wppa-overlay-ic").css("display",""),s("#wppa-overlay-ic").css("width",""),t=(c=!wppaIsFs())?(a=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(a=screen.width,screen.height),i=(p=8)+(w.controls?w.icsize+10:0)+30,c&&(p+=2*w.borderWidth,i+=2*w.borderWidth),o=(a-p)/2+i<t,e=c?o?(t-(u=(r=a-p)/2)-i)/2+20:(r=2*(u=t-i),20):(r=screen.width,u=screen.height,0),w.aspect=r/u,s("#wppa-ovl-pan-container").css({top:e}),s("#wppa-overlay-ic").css({top:0}),c?(s("#wppa-ovl-pan-container").css({backgroundColor:w.backgroundColor,padding:w.padding+"px",borderRadius:w.borderRadius+"px",width:r,marginLeft:0}),s("#wppa-pctl-div-"+n).css({marginLeft:0}),o?s("#wppa-overlay-ic").css({left:4}):s("#wppa-overlay-ic").css({left:(a-r)/2,marginLeft:0})):(s("#wppa-overlay-ic").css({marginLeft:0}),s("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,width:r,left:(a-r)/2}),s("#wppa-pctl-div-"+n).css({marginLeft:0}))):u=(r=s(w.div).parent().width())*w.height/w.width,w.wppaRenderer.setSize(r,u),w.width=r,w.height=u,v(n,w),setTimeout(function(){l(n)},250))}function a(n,o){o.preventDefault(),o.stopPropagation(),w=v(n,{manCtrl:!0,butDown:!1,autorun:!1,dX:0}),wppaIsMobile?v(n,{sX:o.touches[0].clientX,sY:o.touches[0].clientY}):v(n,{sX:o.clientX,sY:o.clientY}),v(n,{sLon:w.lon,sLat:w.lat}),l(n)}function e(n,o){o.preventDefault(),o.stopPropagation(),(w=v(n)).manCtrl&&(wppaIsMobile?v(n,{lon:.1*(w.sX-o.touches[0].clientX)+w.sLon,lat:.1*(o.touches[0].clientY-w.sY)+w.sLat,pause:!1}):v(n,{lon:.1*(w.sX-o.clientX)+w.sLon,lat:.1*(o.clientY-w.sY)+w.sLat,pause:!1}),l(n))}function p(n){v(n,{manCtrl:!1})}function i(n){w=v(n),v(n,{dFov:-.4*w.mFakt,butDown:!0}),l(n)}function r(n){w=v(n),v(n,{dFov:.4*w.mFakt,butDown:!0}),l(n)}function u(n){w=v(n),v(n,{dX:.2*w.mFakt,butDown:!0}),l(n)}function c(n){w=v(n),v(n,{dX:-.2*w.mFakt,butDown:!0}),l(n)}function h(n){w=v(n),v(n,{dY:.2*w.mFakt,butDown:!0}),l(n)}function m(n){w=v(n),v(n,{dY:-.2*w.mFakt,butDown:!0}),l(n)}function f(n){w=v(n),v(n,{dX:0,dY:0,dFov:0,butDown:!1})}function v(n,o){if(!wppaSphericData[n])return!1;if(o)for(var a in o)wppaSphericData[n][a]=o[a];return wppaSphericData[n]}function g(){return d=new Date,d.getTime()}}
js/wppa-zoom.js CHANGED
@@ -68,6 +68,7 @@ function wppaDoZoomPan(mocc) {
68
  data.enableManual = true;
69
  data.ctrlbarUpdate = true;
70
  data.pause = false;
 
71
 
72
  // Install event listeners
73
  if ( wppaIsMobile ) {
@@ -124,7 +125,7 @@ function wppaDoZoomPan(mocc) {
124
  }
125
 
126
  // Install Resize handler
127
- $(window).on("DOMContentLoaded load resize orientationchange",function(e){resize(mocc, e)});
128
 
129
  // Resize
130
  resize(mocc);
@@ -143,6 +144,15 @@ function wppaDoZoomPan(mocc) {
143
 
144
  var data = update(mocc);
145
 
 
 
 
 
 
 
 
 
 
146
  if ( ( data.isLightbox && ! wppaOvlOpen ) || ( ! data.isLightbox && wppaOvlOpen ) ) {
147
 
148
  data = update(0,{abort:true});
@@ -164,7 +174,7 @@ function wppaDoZoomPan(mocc) {
164
 
165
  // Finally decides to do the rendering
166
  wppaDebugCounter++;
167
- wppaConsoleLog('Render zoom '+mocc+' '+wppaDebugCounter);
168
 
169
  data = update(mocc,{busy:true});
170
 
@@ -250,7 +260,7 @@ function wppaDoZoomPan(mocc) {
250
 
251
  // Re-render if needed
252
  if ( ! data.pause && ( data.manual || data.buttondown ) ) {
253
- setTimeout(function(){render(mocc)},5);
254
  }
255
 
256
  // Reset pause
@@ -264,6 +274,7 @@ function wppaDoZoomPan(mocc) {
264
  function resize(mocc, e){
265
 
266
  var data = update(mocc);
 
267
 
268
  if ( data.isLightbox ) {
269
 
@@ -402,7 +413,7 @@ function wppaDoZoomPan(mocc) {
402
 
403
  // Save data and render
404
  update(mocc, data);
405
- render(mocc);
406
 
407
  }
408
 
@@ -632,6 +643,8 @@ function wppaDoZoomPan(mocc) {
632
  // Update data
633
  function update(mocc, data) {
634
 
 
 
635
  if (data) {
636
  for (var property in data) {
637
  wppaZoomData[mocc][property] = data[property];
@@ -669,5 +682,11 @@ function wppaDoZoomPan(mocc) {
669
  }
670
  return {X:X,Y:Y};
671
  }
 
 
 
 
 
 
672
  }
673
 
68
  data.enableManual = true;
69
  data.ctrlbarUpdate = true;
70
  data.pause = false;
71
+ data.time = 0;
72
 
73
  // Install event listeners
74
  if ( wppaIsMobile ) {
125
  }
126
 
127
  // Install Resize handler
128
+ $(window).on("DOMContentLoaded load resize orientationchange",function(){setTimeout(function(e){resize(mocc, e)},25)});
129
 
130
  // Resize
131
  resize(mocc);
144
 
145
  var data = update(mocc);
146
 
147
+ // To prevent multiple invocations - caused by e.g. resize events - see if we were here less than the repeat time ago
148
+ if ( timnow() < data.time + 10 ) {
149
+ wppaConsoleLog('Skipped render '+mocc);
150
+ return;
151
+ }
152
+ update(mocc,{time:timnow()});
153
+
154
+ wppaConsoleLog("Zoom render "+mocc);
155
+
156
  if ( ( data.isLightbox && ! wppaOvlOpen ) || ( ! data.isLightbox && wppaOvlOpen ) ) {
157
 
158
  data = update(0,{abort:true});
174
 
175
  // Finally decides to do the rendering
176
  wppaDebugCounter++;
177
+ // wppaConsoleLog('Render zoom '+mocc+' '+wppaDebugCounter);
178
 
179
  data = update(mocc,{busy:true});
180
 
260
 
261
  // Re-render if needed
262
  if ( ! data.pause && ( data.manual || data.buttondown ) ) {
263
+ setTimeout(function(){render(mocc)},10);
264
  }
265
 
266
  // Reset pause
274
  function resize(mocc, e){
275
 
276
  var data = update(mocc);
277
+ if ( ! data ) return;
278
 
279
  if ( data.isLightbox ) {
280
 
413
 
414
  // Save data and render
415
  update(mocc, data);
416
+ setTimeout(function(){render(mocc)},250);
417
 
418
  }
419
 
643
  // Update data
644
  function update(mocc, data) {
645
 
646
+ if ( ! wppaZoomData[mocc] ) return false;
647
+
648
  if (data) {
649
  for (var property in data) {
650
  wppaZoomData[mocc][property] = data[property];
682
  }
683
  return {X:X,Y:Y};
684
  }
685
+
686
+ // Get current time in ms
687
+ function timnow() {
688
+ d = new Date();
689
+ return d.getTime();
690
+ }
691
  }
692
 
js/wppa-zoom.min.js CHANGED
@@ -1 +1 @@
1
- function wppaDoZoomPan(o){var p=jQuery,e=g(o);if(!e.initialized&&!e.abort){if(e.isLightbox&&p("#wppa-ovl-spin").show(),!e.image.complete)return wppaConsoleLog("Loading image "+o),void setTimeout(function(){wppaDoZoomPan(o)},200);wppaConsoleLog("Loading image "+o+" complete"),p(image).css({width:image.naturalWidth,height:image.naturalHeight,maxWidth:image.naturalWidth,maxHeight:image.naturalHeight}),e.manual=!1,e.deltaX=0,e.deltaY=0,e.deltaFactor=1,e.busy=!1,e.div=p("#wppa-pan-div-"+e.itemId),e.canvas=document.getElementById("wppa-pan-canvas-"+e.itemId),e.left=p("#wppa-pctl-left-"+e.itemId),e.right=p("#wppa-pctl-right-"+e.itemId),e.up=p("#wppa-pctl-up-"+e.itemId),e.down=p("#wppa-pctl-down-"+e.itemId),e.zoomin=p("#wppa-pctl-zoomin-"+e.itemId),e.zoomout=p("#wppa-pctl-zoomout-"+e.itemId),e.prev=p("#wppa-pctl-prev-"+e.itemId),e.next=p("#wppa-pctl-next-"+e.itemId),e.exit=p("#wppa-exit-btn-2"),e.canvasWidth=e.width,e.canvasHeight=e.height,e.savedCanvasX=0,e.savedCanvasY=0,e.fromHeight=e.image.height,e.fromWidth=e.image.width,e.imageRatio=e.image.width/e.image.height,e.fromX=0,e.fromY=0,e.centerX=e.fromX+e.fromWidth/2,e.centerY=e.fromY+e.fromHeight/2,e.ctx=null,e.buttondown=!1,e.enableManual=!0,e.ctrlbarUpdate=!0,e.pause=!1,wppaIsMobile?(e.right.on("touchstart",function(t){n(o)}),e.right.on("touchend",function(t){u(o)}),e.left.on("touchstart",function(t){i(o)}),e.left.on("touchend",function(t){u(o)}),e.up.on("touchstart",function(t){s(o)}),e.up.on("touchend",function(t){u(o)}),e.down.on("touchstart",function(t){c(o)}),e.down.on("touchend",function(t){u(o)}),e.zoomin.on("touchstart",function(t){r(o)}),e.zoomin.on("touchend",function(t){u(o)}),e.zoomout.on("touchstart",function(t){d(o)}),e.zoomout.on("touchend",function(t){u(o)}),e.canvas.addEventListener("touchstart",function(t){m(o,t)}),e.canvas.addEventListener("touchmove",function(t){f(o,t)}),e.canvas.addEventListener("touchend",function(t){l(o)})):(e.canvas.addEventListener("mousedown",function(t){m(o,t)}),e.canvas.addEventListener("mousemove",function(t){f(o,t)}),e.canvas.addEventListener("mouseup",function(t){l(o)}),e.canvas.addEventListener("mouseleave",function(t){(e=g(o)).manual&&g(o,{pause:!0})}),e.canvas.addEventListener("mouseenter",function(t){var a;g(a=o,{pause:!1}).manual&&h(a)}),document.getElementById("wppa-pan-canvas-"+e.itemId).addEventListener("wheel",function(t){var a,n;a=o,(n=t).preventDefault(),n.stopPropagation(),e=g(a),g(a,{deltaFactor:1+n.deltaY*e.zoomsensitivity/(wppaIsChrome?1e4:1e3),manual:!1}),h(a),setTimeout(function(){g(a,{deltaFactor:1})},25)}),e.right.on("mousedown",function(t){n(o)}),e.right.on("mouseup",function(t){u(o)}),e.left.on("mousedown",function(t){i(o)}),e.left.on("mouseup",function(t){u(o)}),e.up.on("mousedown",function(t){s(o)}),e.up.on("mouseup",function(t){u(o)}),e.down.on("mousedown",function(t){c(o)}),e.down.on("mouseup",function(t){u(o)}),e.zoomin.on("mousedown",function(t){r(o)}),e.zoomin.on("mouseup",function(t){u(o)}),e.zoomout.on("mousedown",function(t){d(o)}),e.zoomout.on("mouseup",function(t){u(o)})),e.isLightbox&&(p(".wppa-fulls-btn").on("click",function(){g(0,{abort:!0})}),p(".wppa-exit-fulls-btn").on("click",function(){g(0,{abort:!0})}),e.prev&&(e.prev.on("click",function(t){p("#wppa-ovl-spin").show(),g(0,{abort:!0}),wppaOvlShowPrev()}),e.next.on("click",function(t){p("#wppa-ovl-spin").show(),g(0,{abort:!0}),wppaOvlShowNext()})),e.exit.on("click",function(t){p("#wppa-ovl-spin").hide(),g(0,{abort:!0}),wppaOvlHide()})),p(window).on("DOMContentLoaded load resize orientationchange",function(t){a(o)}),a(o),e.initialized=!0,g(o,e),p("#wppa-ovl-spin").hide()}function h(t){var a,n,o,e,i,s=g(t);(s.isLightbox&&!wppaOvlOpen||!s.isLightbox&&wppaOvlOpen)&&(s=g(0,{abort:!0})),s.abort?g(t,{manual:!1,buttondown:!1,pause:!1,ctx:null}):s.busy||(wppaDebugCounter++,wppaConsoleLog("Render zoom "+t+" "+wppaDebugCounter),(s=g(t,{busy:!0})).manual||(s.fromX+=s.deltaX,s.fromY+=s.deltaY,a=s.fromHeight/s.deltaFactor,n=s.fromWidth/s.deltaFactor,50<a&&1!=s.deltaFactor&&(wppaIsFs()||a<=s.image.height)&&(s.fromX-=(n-s.fromWidth)/2,s.fromY-=(a-s.fromHeight)/2,s.fromWidth=n,s.fromHeight=a)),s.fromX=Math.max(0,Math.min(s.image.width-s.fromWidth,s.fromX)),s.fromY=Math.max(0,Math.min(s.image.height-s.fromHeight,s.fromY)),o=screen.width/screen.height,e=(1-s.image.width/s.fromWidth)*s.canvas.width/2,i=(1-s.image.height/s.fromHeight)*s.canvas.height/2,s.ctx=s.canvas.getContext("2d"),o>s.imageRatio&&a>s.image.height&&wppaIsFs()||o<=s.imageRatio&&n>s.image.width&&wppaIsFs()?(s.enableManual=!1,s.ctx.clearRect(0,0,s.canvas.width,s.canvas.height),s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,e,i,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"default"})):(s.enableManual=!0,s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,0,0,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"grab"})),wppaIsFs()?(s.fsMaskTop=i-(s.canvas.height-screen.height)/2,s.fsMaskLeft=e-(s.canvas.width-screen.width)/2,s.fsMaskBottom=screen.height-s.fsMaskTop,s.fsMaskRight=screen.width-s.fsMaskLeft):(s.fsMaskTop=0,s.fsMaskLeft=0,s.fsMaskBottom=0,s.fsMaskRight=0),s.ctrlbarUpdate&&(wppaAdjustControlbar(),s.ctrlbarUpdate=!1),s.busy=!1,g(t,s),s.pause||!s.manual&&!s.buttondown||setTimeout(function(){h(t)},5),s.pause&&g(t,{pause:!1}))}function a(t){var a,n,o,e,i,s,c,r,d,u=g(t);u.isLightbox?(p("#wppa-overlay-ic").css("display",""),e=(n=!wppaIsFs())?(o=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(o=screen.width,screen.height),c=0,d=(r=8)+(u.controls?u.icsize+10:0)+10,n?(r+=2*u.borderWidth,d+=2*u.borderWidth):r=40,a=n?e-d>(o-r)/u.imageRatio:(screenRatio=screen.width/screen.height,screenRatio<u.imageRatio),n&&a&&(c=(e-(s=(i=o-r)/u.imageRatio)-d)/2+20),n&&!a&&(s=(i=u.imageRatio*(e-(u.controls?u.icsize:0)-48))/u.imageRatio,c=20),!n&&a&&(i=(s=screen.height)*u.imageRatio,c=0),n||a||(s=(i=screen.width)/u.imageRatio,c=(screen.height-s)/2),p("#wppa-ovl-pan-container").css({marginTop:c}),p("#wppa-overlay-ic").css({marginTop:0}),u.canvasWidth=i,u.canvasHeight=s,u.canvas.width=u.canvasWidth,u.canvas.height=u.canvasHeight,n?(p("#wppa-ovl-pan-container").css({backgroundColor:u.backgroundColor,padding:u.padding,borderRadius:u.borderRadius,borderWidth:u.borderWidth,width:i,marginLeft:0}),p("#wppa-pctl-div-"+u.itemId).css({marginLeft:0}),a?p("#wppa-overlay-ic").css({left:4}):p("#wppa-overlay-ic").css({left:(o-i)/2})):(p("#wppa-overlay-ic").css({marginLeft:0}),p("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:i,left:(o-i)/2,position:"fixed"}),p("#wppa-pctl-div-"+u.itemId).css({marginLeft:0}))):(u.canvasWidth=p(u.div).parent().width(),u.canvasHeight=u.canvasWidth/u.imageRatio,u.canvas.width=u.canvasWidth,u.canvas.height=u.canvasHeight),u.ctrlbarUpdate=!0,g(t,u),h(t)}function n(t){var a=g(t),n=a.image.naturalWidth/a.canvas.width;n<1.5&&(n=1.5),g(t,{deltaX:n*=1.5,buttondown:!0,manual:!1}),h(t)}function i(t){var a=g(t),n=a.image.naturalWidth/a.canvas.width;n<1.5&&(n=1.5),g(t,{deltaX:-(n*=1.5),buttondown:!0,manual:!1}),h(t)}function s(t){var a=g(t),n=a.image.naturalHeight/a.canvas.height;n<1.5&&(n=1.5),g(t,{deltaY:-(n*=1.5),buttondown:!0,manual:!1}),h(t)}function c(t){var a=g(t),n=a.image.naturalHeight/a.canvas.height;n<1.5&&(n=1.5),g(t,{deltaY:n*=1.5,buttondown:!0,manual:!1}),h(t)}function r(t){g(t,{deltaFactor:1.005,buttondown:!0,manual:!1}),h(t)}function d(t){g(t,{deltaFactor:.995,buttondown:!0,manual:!1}),h(t)}function u(t){g(t,{deltaX:0,deltaY:0,deltaFactor:1,buttondown:!1})}function m(t,a){var n=g(t),o=w(a).X,e=w(a).Y;if(wppaIsFs()&&n.isLightbox&&(o<n.fsMaskLeft||o>n.fsMaskRight||e<n.fsMaskTop||e>n.fsMaskBottom))return g(0,{abort:!0}),void jQuery("#wppa-overlay-bg").trigger("click");n.enableManual&&(g(t,{manual:!0,savedCanvasX:o=v(t,a).X,savedCanvasY:e=v(t,a).Y}),h(t))}function f(t,a){var n,o,e,i=g(t),s=v(t,a).X,c=v(t,a).Y;i.manual&&(n=i.canvas.width/i.fromWidth,o=(i.savedCanvasX-s)/n+i.fromX,e=(i.savedCanvasY-c)/n+i.fromY,0<o&&0<e&&o+i.fromWidth<i.image.width&&e+i.fromHeight<i.image.height&&g(t,{fromX:o,fromY:e,savedCanvasX:s,savedCanvasY:c}))}function l(t){g(t,{manual:!1})}function g(t,a){if(a)for(var n in a)wppaZoomData[t][n]=a[n];return wppaZoomData[t]}function w(t){var a,n;return n=wppaIsMobile?(a=t.touches[0].screenX,t.touches[0].screenY):(a=t.screenX,t.screenY),{X:a,Y:n}}function v(t,a){var n,o,e;return e=wppaIsMobile?(n=g(t),o=a.touches[0].screenX-n.fsMaskLeft,a.touches[0].screenY-n.fsMaskTop):(o=a.offsetX,a.offsetY),{X:o,Y:e}}}
1
+ function wppaDoZoomPan(e){var p=jQuery,o=w(e);if(!o.initialized&&!o.abort){if(o.isLightbox&&p("#wppa-ovl-spin").show(),!o.image.complete)return wppaConsoleLog("Loading image "+e),void setTimeout(function(){wppaDoZoomPan(e)},200);wppaConsoleLog("Loading image "+e+" complete"),p(image).css({width:image.naturalWidth,height:image.naturalHeight,maxWidth:image.naturalWidth,maxHeight:image.naturalHeight}),o.manual=!1,o.deltaX=0,o.deltaY=0,o.deltaFactor=1,o.busy=!1,o.div=p("#wppa-pan-div-"+o.itemId),o.canvas=document.getElementById("wppa-pan-canvas-"+o.itemId),o.left=p("#wppa-pctl-left-"+o.itemId),o.right=p("#wppa-pctl-right-"+o.itemId),o.up=p("#wppa-pctl-up-"+o.itemId),o.down=p("#wppa-pctl-down-"+o.itemId),o.zoomin=p("#wppa-pctl-zoomin-"+o.itemId),o.zoomout=p("#wppa-pctl-zoomout-"+o.itemId),o.prev=p("#wppa-pctl-prev-"+o.itemId),o.next=p("#wppa-pctl-next-"+o.itemId),o.exit=p("#wppa-exit-btn-2"),o.canvasWidth=o.width,o.canvasHeight=o.height,o.savedCanvasX=0,o.savedCanvasY=0,o.fromHeight=o.image.height,o.fromWidth=o.image.width,o.imageRatio=o.image.width/o.image.height,o.fromX=0,o.fromY=0,o.centerX=o.fromX+o.fromWidth/2,o.centerY=o.fromY+o.fromHeight/2,o.ctx=null,o.buttondown=!1,o.enableManual=!0,o.ctrlbarUpdate=!0,o.pause=!1,o.time=0,wppaIsMobile?(o.right.on("touchstart",function(t){n(e)}),o.right.on("touchend",function(t){m(e)}),o.left.on("touchstart",function(t){i(e)}),o.left.on("touchend",function(t){m(e)}),o.up.on("touchstart",function(t){s(e)}),o.up.on("touchend",function(t){m(e)}),o.down.on("touchstart",function(t){r(e)}),o.down.on("touchend",function(t){m(e)}),o.zoomin.on("touchstart",function(t){c(e)}),o.zoomin.on("touchend",function(t){m(e)}),o.zoomout.on("touchstart",function(t){u(e)}),o.zoomout.on("touchend",function(t){m(e)}),o.canvas.addEventListener("touchstart",function(t){f(e,t)}),o.canvas.addEventListener("touchmove",function(t){l(e,t)}),o.canvas.addEventListener("touchend",function(t){g(e)})):(o.canvas.addEventListener("mousedown",function(t){f(e,t)}),o.canvas.addEventListener("mousemove",function(t){l(e,t)}),o.canvas.addEventListener("mouseup",function(t){g(e)}),o.canvas.addEventListener("mouseleave",function(t){(o=w(e)).manual&&w(e,{pause:!0})}),o.canvas.addEventListener("mouseenter",function(t){var a;w(a=e,{pause:!1}).manual&&h(a)}),document.getElementById("wppa-pan-canvas-"+o.itemId).addEventListener("wheel",function(t){var a,n;a=e,(n=t).preventDefault(),n.stopPropagation(),o=w(a),w(a,{deltaFactor:1+n.deltaY*o.zoomsensitivity/(wppaIsChrome?1e4:1e3),manual:!1}),h(a),setTimeout(function(){w(a,{deltaFactor:1})},25)}),o.right.on("mousedown",function(t){n(e)}),o.right.on("mouseup",function(t){m(e)}),o.left.on("mousedown",function(t){i(e)}),o.left.on("mouseup",function(t){m(e)}),o.up.on("mousedown",function(t){s(e)}),o.up.on("mouseup",function(t){m(e)}),o.down.on("mousedown",function(t){r(e)}),o.down.on("mouseup",function(t){m(e)}),o.zoomin.on("mousedown",function(t){c(e)}),o.zoomin.on("mouseup",function(t){m(e)}),o.zoomout.on("mousedown",function(t){u(e)}),o.zoomout.on("mouseup",function(t){m(e)})),o.isLightbox&&(p(".wppa-fulls-btn").on("click",function(){w(0,{abort:!0})}),p(".wppa-exit-fulls-btn").on("click",function(){w(0,{abort:!0})}),o.prev&&(o.prev.on("click",function(t){p("#wppa-ovl-spin").show(),w(0,{abort:!0}),wppaOvlShowPrev()}),o.next.on("click",function(t){p("#wppa-ovl-spin").show(),w(0,{abort:!0}),wppaOvlShowNext()})),o.exit.on("click",function(t){p("#wppa-ovl-spin").hide(),w(0,{abort:!0}),wppaOvlHide()})),p(window).on("DOMContentLoaded load resize orientationchange",function(){setTimeout(function(t){a(e)},25)}),a(e),o.initialized=!0,w(e,o),p("#wppa-ovl-spin").hide()}function h(t){var a,n,e,o,i,s=w(t);L()<s.time+10?wppaConsoleLog("Skipped render "+t):(w(t,{time:L()}),wppaConsoleLog("Zoom render "+t),(s.isLightbox&&!wppaOvlOpen||!s.isLightbox&&wppaOvlOpen)&&(s=w(0,{abort:!0})),s.abort?w(t,{manual:!1,buttondown:!1,pause:!1,ctx:null}):s.busy||(wppaDebugCounter++,(s=w(t,{busy:!0})).manual||(s.fromX+=s.deltaX,s.fromY+=s.deltaY,a=s.fromHeight/s.deltaFactor,n=s.fromWidth/s.deltaFactor,50<a&&1!=s.deltaFactor&&(wppaIsFs()||a<=s.image.height)&&(s.fromX-=(n-s.fromWidth)/2,s.fromY-=(a-s.fromHeight)/2,s.fromWidth=n,s.fromHeight=a)),s.fromX=Math.max(0,Math.min(s.image.width-s.fromWidth,s.fromX)),s.fromY=Math.max(0,Math.min(s.image.height-s.fromHeight,s.fromY)),e=screen.width/screen.height,o=(1-s.image.width/s.fromWidth)*s.canvas.width/2,i=(1-s.image.height/s.fromHeight)*s.canvas.height/2,s.ctx=s.canvas.getContext("2d"),e>s.imageRatio&&a>s.image.height&&wppaIsFs()||e<=s.imageRatio&&n>s.image.width&&wppaIsFs()?(s.enableManual=!1,s.ctx.clearRect(0,0,s.canvas.width,s.canvas.height),s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,o,i,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"default"})):(s.enableManual=!0,s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,0,0,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"grab"})),wppaIsFs()?(s.fsMaskTop=i-(s.canvas.height-screen.height)/2,s.fsMaskLeft=o-(s.canvas.width-screen.width)/2,s.fsMaskBottom=screen.height-s.fsMaskTop,s.fsMaskRight=screen.width-s.fsMaskLeft):(s.fsMaskTop=0,s.fsMaskLeft=0,s.fsMaskBottom=0,s.fsMaskRight=0),s.ctrlbarUpdate&&(wppaAdjustControlbar(),s.ctrlbarUpdate=!1),s.busy=!1,w(t,s),s.pause||!s.manual&&!s.buttondown||setTimeout(function(){h(t)},10),s.pause&&w(t,{pause:!1})))}function a(t){var a,n,e,o,i,s,r,c,d,u=w(t);u&&(u.isLightbox?(p("#wppa-overlay-ic").css("display",""),o=(n=!wppaIsFs())?(e=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(e=screen.width,screen.height),r=0,d=(c=8)+(u.controls?u.icsize+10:0)+10,n?(c+=2*u.borderWidth,d+=2*u.borderWidth):c=40,a=n?o-d>(e-c)/u.imageRatio:(screenRatio=screen.width/screen.height,screenRatio<u.imageRatio),n&&a&&(r=(o-(s=(i=e-c)/u.imageRatio)-d)/2+20),n&&!a&&(s=(i=u.imageRatio*(o-(u.controls?u.icsize:0)-48))/u.imageRatio,r=20),!n&&a&&(i=(s=screen.height)*u.imageRatio,r=0),n||a||(s=(i=screen.width)/u.imageRatio,r=(screen.height-s)/2),p("#wppa-ovl-pan-container").css({marginTop:r}),p("#wppa-overlay-ic").css({marginTop:0}),u.canvasWidth=i,u.canvasHeight=s,u.canvas.width=u.canvasWidth,u.canvas.height=u.canvasHeight,n?(p("#wppa-ovl-pan-container").css({backgroundColor:u.backgroundColor,padding:u.padding,borderRadius:u.borderRadius,borderWidth:u.borderWidth,width:i,marginLeft:0}),p("#wppa-pctl-div-"+u.itemId).css({marginLeft:0}),a?p("#wppa-overlay-ic").css({left:4}):p("#wppa-overlay-ic").css({left:(e-i)/2})):(p("#wppa-overlay-ic").css({marginLeft:0}),p("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:i,left:(e-i)/2,position:"fixed"}),p("#wppa-pctl-div-"+u.itemId).css({marginLeft:0}))):(u.canvasWidth=p(u.div).parent().width(),u.canvasHeight=u.canvasWidth/u.imageRatio,u.canvas.width=u.canvasWidth,u.canvas.height=u.canvasHeight),u.ctrlbarUpdate=!0,w(t,u),setTimeout(function(){h(t)},250))}function n(t){var a=w(t),n=a.image.naturalWidth/a.canvas.width;n<1.5&&(n=1.5),w(t,{deltaX:n*=1.5,buttondown:!0,manual:!1}),h(t)}function i(t){var a=w(t),n=a.image.naturalWidth/a.canvas.width;n<1.5&&(n=1.5),w(t,{deltaX:-(n*=1.5),buttondown:!0,manual:!1}),h(t)}function s(t){var a=w(t),n=a.image.naturalHeight/a.canvas.height;n<1.5&&(n=1.5),w(t,{deltaY:-(n*=1.5),buttondown:!0,manual:!1}),h(t)}function r(t){var a=w(t),n=a.image.naturalHeight/a.canvas.height;n<1.5&&(n=1.5),w(t,{deltaY:n*=1.5,buttondown:!0,manual:!1}),h(t)}function c(t){w(t,{deltaFactor:1.005,buttondown:!0,manual:!1}),h(t)}function u(t){w(t,{deltaFactor:.995,buttondown:!0,manual:!1}),h(t)}function m(t){w(t,{deltaX:0,deltaY:0,deltaFactor:1,buttondown:!1})}function f(t,a){var n=w(t),e=v(a).X,o=v(a).Y;if(wppaIsFs()&&n.isLightbox&&(e<n.fsMaskLeft||e>n.fsMaskRight||o<n.fsMaskTop||o>n.fsMaskBottom))return w(0,{abort:!0}),void jQuery("#wppa-overlay-bg").trigger("click");n.enableManual&&(w(t,{manual:!0,savedCanvasX:e=b(t,a).X,savedCanvasY:o=b(t,a).Y}),h(t))}function l(t,a){var n,e,o,i=w(t),s=b(t,a).X,r=b(t,a).Y;i.manual&&(n=i.canvas.width/i.fromWidth,e=(i.savedCanvasX-s)/n+i.fromX,o=(i.savedCanvasY-r)/n+i.fromY,0<e&&0<o&&e+i.fromWidth<i.image.width&&o+i.fromHeight<i.image.height&&w(t,{fromX:e,fromY:o,savedCanvasX:s,savedCanvasY:r}))}function g(t){w(t,{manual:!1})}function w(t,a){if(!wppaZoomData[t])return!1;if(a)for(var n in a)wppaZoomData[t][n]=a[n];return wppaZoomData[t]}function v(t){var a,n;return n=wppaIsMobile?(a=t.touches[0].screenX,t.touches[0].screenY):(a=t.screenX,t.screenY),{X:a,Y:n}}function b(t,a){var n,e,o;return o=wppaIsMobile?(n=w(t),e=a.touches[0].screenX-n.fsMaskLeft,a.touches[0].screenY-n.fsMaskTop):(e=a.offsetX,a.offsetY),{X:e,Y:o}}function L(){return d=new Date,d.getTime()}}
theme/wppa-style.css CHANGED
@@ -8,7 +8,7 @@
8
  /*
9
  /* You may always look into a newer version of this file to see what new classes and id's come with an upgrade
10
  /*
11
- /* This is version 7.5.06
12
  */
13
 
14
  .wppa-container, .wppa-cover-box, .wppa-thumb-area {
@@ -591,4 +591,9 @@ display:none;
591
  #wppa-pre-curr {
592
  max-width:48000px !important;
593
  max-height:48000px !important;
 
 
 
 
 
594
  }
8
  /*
9
  /* You may always look into a newer version of this file to see what new classes and id's come with an upgrade
10
  /*
11
+ /* This is version 7.5.09
12
  */
13
 
14
  .wppa-container, .wppa-cover-box, .wppa-thumb-area {
591
  #wppa-pre-curr {
592
  max-width:48000px !important;
593
  max-height:48000px !important;
594
+ }
595
+
596
+ /* spheric panorama */
597
+ .wppa-pan-div canvas {
598
+ background-color:transparent;
599
  }
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 7.5.09.007
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_revno; $wppa_revno = '7509'; // WPPA db version
27
- global $wppa_api_version; $wppa_api_version = '7.5.09.007'; // WPPA software version
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 7.5.09.009
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_revno; $wppa_revno = '7509'; // WPPA db version
27
+ global $wppa_api_version; $wppa_api_version = '7.5.09.009'; // WPPA software version
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';