WP Photo Album Plus - Version 7.5.07.003

Version Description

= 7.5.07 =

  • 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.07.003
Comparing to
See all releases

Code changes from version 7.5.07.002 to 7.5.07.003

Files changed (5) hide show
  1. js/wppa-all.js +1 -1
  2. js/wppa-zoom.js +30 -13
  3. js/wppa-zoom.min.js +1 -1
  4. wppa-utils.php +4 -1
  5. wppa.php +2 -2
js/wppa-all.js CHANGED
@@ -13,4 +13,4 @@ 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(){for(var r,h=jQuery,a=!1,t=0;t<wppaZoomableData.length;t++)void 0!==wppaZoomableData[t]&&((r=wppaZoomableData[t]).image.complete?r.initialized||((r=wppaZoomableData[t]).manualControl=!1,r.deltaX=0,r.deltaY=0,r.deltaFactor=1,r.run=4,r.busy=!1,r.abort=!1,r.itemid=r.mocc+"-"+r.id,r.div=h("#wppa-pan-div-"+r.itemid),r.canvas=document.getElementById("wppa-pan-canvas-"+r.itemid),r.left=h("#wppa-pctl-left-"+r.itemid),r.right=h("#wppa-pctl-right-"+r.itemid),r.up=h("#wppa-pctl-up-"+r.itemid),r.down=h("#wppa-pctl-down-"+r.itemid),r.zoomin=h("#wppa-pctl-zoomin-"+r.itemid),r.zoomout=h("#wppa-pctl-zoomout-"+r.itemid),r.prev=h("#wppa-pctl-prev-"+r.itemid),r.next=h("#wppa-pctl-next-"+r.itemid),r.canvasWidth=r.width,r.canvasHeight=r.height,r.savedCanvasX=0,r.savedCanvasY=0,r.fromHeight=r.image.height,r.fromWidth=r.image.width,r.imageRatio=r.image.width/r.image.height,r.fromX=0,r.fromY=0,r.centerX=r.fromX+r.fromWidth/2,r.centerY=r.fromY+r.fromHeight/2,r.ctx=null,r.buttondown=!1,r.enableManual=!0,r.isMobile?(r.right.on("touchstart",n),r.right.on("touchend",l),r.left.on("touchstart",i),r.left.on("touchend",l),r.up.on("touchstart",p),r.up.on("touchend",l),r.down.on("touchstart",s),r.down.on("touchend",l),r.zoomin.on("touchstart",m),r.zoomin.on("touchend",l),r.zoomout.on("touchstart",d),r.zoomout.on("touchend",l)):(r.canvas.addEventListener("mousedown",f),r.canvas.addEventListener("mousemove",v),r.canvas.addEventListener("mouseup",g),r.canvas.addEventListener("mouseout",g),document.getElementById("wppa-pan-canvas-"+r.itemid).addEventListener("wheel",c),r.right.on("mousedown",n),r.right.on("mouseup",l),r.left.on("mousedown",i),r.left.on("mouseup",l),r.up.on("mousedown",p),r.up.on("mouseup",l),r.down.on("mousedown",s),r.down.on("mouseup",l),r.zoomin.on("mousedown",m),r.zoomin.on("mouseup",l),r.zoomout.on("mousedown",d),r.zoomout.on("mouseup",l)),r.isLightbox&&(h("#wppa-fulls-btn").on("click",function(){abort=!0}),r.prev&&(r.prev.on("click",o),r.next.on("click",e))),h(window).on("DOMContentLoaded load resize orientationchange",w),u(t),w(),r.initialized=!0):a=!0);function u(a){if((r=wppaZoomableData[a]).isLightbox&&(wppaOvlOpen||(r.abort=!0)),r.abort)return r.ctx=null,void(r.prevctx=null);var t,o,e,n,i;0!=r.run&&(r.busy||(r.busy=!0,r.manualControl||(r.fromX+=r.deltaX,r.fromY+=r.deltaY,t=r.fromHeight/r.deltaFactor,o=r.fromWidth/r.deltaFactor,50<t&&1!=r.deltaFactor&&(wppaIsFs()||t<=r.image.height)&&(r.fromX-=(o-r.fromWidth)/2,r.fromY-=(t-r.fromHeight)/2,r.fromWidth=o,r.fromHeight=t)),r.fromX=Math.max(0,Math.min(r.image.width-r.fromWidth,r.fromX)),r.fromY=Math.max(0,Math.min(r.image.height-r.fromHeight,r.fromY)),e=screen.width/screen.height,n=(1-r.image.width/r.fromWidth)*r.canvas.width/2,i=(1-r.image.height/r.fromHeight)*r.canvas.height/2,r.ctx=r.canvas.getContext("2d"),e>r.imageRatio&&t>r.image.height&&wppaIsFs()||e<=r.imageRatio&&o>r.image.width&&wppaIsFs()?(r.enableManual=!1,r.ctx.clearRect(0,0,r.canvas.width,r.canvas.height),r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,n,i,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"default"})):(r.enableManual=!0,r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,0,0,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"grab"})),wppaIsFs()?(r.fsMaskTop=i,r.fsMaskLeft=n,r.fsMaskBottom=r.canvas.height-i,r.fsMaskRight=r.canvas.width-n):(r.fsMaskTop=0,r.fsMaskLeft=0,r.fsMaskBottom=0,r.fsMaskRight=0),r.busy=!1,0<r.run&&(r.manualControl?setTimeout(function(){u(a)},25):r.buttondown&&setTimeout(function(){u(a)},5)),r.run<5&&r.run--,r.initializing&&(r.initializing=!1,r.run--),wppaAdjustControlbar()))}function o(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowPrev())}function e(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowNext())}function n(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaX=3,r.buttondown=!0,u(t))}function i(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaX=-3,r.buttondown=!0,u(t))}function p(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaY=-3,r.buttondown=!0,u(t))}function s(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaY=3,r.buttondown=!0,u(t))}function m(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaFactor=1.005,r.buttondown=!0,u(t))}function d(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaFactor=.995,r.buttondown=!0,u(t))}function c(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=4,wppaZoomableData[t].deltaFactor=1+a.deltaY*wppaZoomableData[t].zoomsensitivity/(wppaIsChrome?1e4:1e3),u(t),setTimeout(function(){wppaZoomableData[t].deltaFactor=1},25),a.stopPropagation())}function l(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].deltaX=0,wppaZoomableData[t].deltaY=0,wppaZoomableData[t].deltaFactor=1,wppaZoomableData[t].isLightbox?wppaZoomableData[t].run--:wppaZoomableData[t].run=4,r.buttondown=!1)}function w(a){for(var t,o,e,n,i,r,p,s,m,d,c,l=0;l<wppaZoomableData.length;l++){wppaZoomableData[l]&&wppaZoomableData[l].canvas&&!wppaZoomableData[l].abort&&(o=(t=wppaZoomableData[l]).imageRatio,t.isLightbox?(h("#wppa-overlay-ic").css("display",""),r=(n=!wppaIsFs())?(i=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(i=screen.width,screen.height),p=parseInt(p),s=parseInt(s),c=(d=8)+(t.controls?t.icsize+10:0)+10,n?(d+=2*t.borderWidth,c+=2*t.borderWidth):d=40,n?m=(e=(i-d)/o<r-c)?(r-(s=(p=i-d)/o)-c)/2+20:(p=o*(r-(t.controls?t.icsize:0)-24),n&&(p-=24),s=p/o,20):(screenRatio=screen.width/screen.height,(e=screenRatio<o)?(p=(s=screen.height)*o,screen.width,m=0):(s=(p=screen.width)/o,m=(screen.height-s)/2,0)),h("#wppa-ovl-pan-container").css({marginTop:m}),h("#wppa-overlay-ic").css({marginTop:0}),t.canvasWidth=p,t.canvasHeight=s,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight,n?(h("#wppa-ovl-pan-container").css({backgroundColor:t.backgroundColor,padding:t.padding,borderRadius:t.borderRadius,borderWidth:t.borderWidth,width:p,marginLeft:0}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}),e?h("#wppa-overlay-ic").css({left:4}):h("#wppa-overlay-ic").css({left:(i-p)/2})):(h("#wppa-overlay-ic").css({marginLeft:0}),h("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:p,left:(i-p)/2,position:"fixed"}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}))):(t.canvasWidth=h(t.div).parent().width(),t.canvasHeight=t.canvasWidth/o,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight),t.run=5,u(l))}}function f(a){a.preventDefault();var t,o=jQuery(this).attr("data-mocc");wppaZoomableData[o]&&(t=wppaZoomableData[o],wppaIsFs()&&(a.offsetX<t.fsMaskLeft||a.offsetX>t.fsMaskRight||a.offsetY<t.fsMaskTop||a.offsetY>t.fsMaskBottom)&&jQuery("#wppa-overlay-bg").trigger("click"),t.enableManual&&(t.manualControl=!0,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY,t.run=5,u(o)))}function v(a){var t,o,e,n,i=jQuery(this).attr("data-mocc");!wppaZoomableData[i]||(t=wppaZoomableData[i]).manualControl&&(o=t.canvas.width/t.fromWidth,e=(t.savedCanvasX-a.offsetX)/o+t.fromX,n=(t.savedCanvasY-a.offsetY)/o+t.fromY,0<e&&0<n&&e+t.fromWidth<t.image.width&&n+t.fromHeight<t.image.height&&(t.fromX=e,t.fromY=n,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY))}function g(a){var t,o=jQuery(this).attr("data-mocc");!wppaZoomableData[o]||(t=wppaZoomableData[o]).manualControl&&(t.run=4,t.manualControl=!1)}a?setTimeout(function(){wppaDoZoomPan()},300):h("#wppa-ovl-spin").hide()}
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(){for(var r,h=jQuery,a=!1,t=0;t<wppaZoomableData.length;t++)void 0!==wppaZoomableData[t]&&((r=wppaZoomableData[t]).image.complete?r.initialized||((r=wppaZoomableData[t]).manualControl=!1,r.deltaX=0,r.deltaY=0,r.deltaFactor=1,r.run=4,r.busy=!1,r.abort=!1,r.itemid=r.mocc+"-"+r.id,r.div=h("#wppa-pan-div-"+r.itemid),r.canvas=document.getElementById("wppa-pan-canvas-"+r.itemid),r.left=h("#wppa-pctl-left-"+r.itemid),r.right=h("#wppa-pctl-right-"+r.itemid),r.up=h("#wppa-pctl-up-"+r.itemid),r.down=h("#wppa-pctl-down-"+r.itemid),r.zoomin=h("#wppa-pctl-zoomin-"+r.itemid),r.zoomout=h("#wppa-pctl-zoomout-"+r.itemid),r.prev=h("#wppa-pctl-prev-"+r.itemid),r.next=h("#wppa-pctl-next-"+r.itemid),r.canvasWidth=r.width,r.canvasHeight=r.height,r.savedCanvasX=0,r.savedCanvasY=0,r.fromHeight=r.image.height,r.fromWidth=r.image.width,r.imageRatio=r.image.width/r.image.height,r.fromX=0,r.fromY=0,r.centerX=r.fromX+r.fromWidth/2,r.centerY=r.fromY+r.fromHeight/2,r.ctx=null,r.buttondown=!1,r.enableManual=!0,r.isMobile?(r.right.on("touchstart",n),r.right.on("touchend",l),r.left.on("touchstart",i),r.left.on("touchend",l),r.up.on("touchstart",p),r.up.on("touchend",l),r.down.on("touchstart",s),r.down.on("touchend",l),r.zoomin.on("touchstart",c),r.zoomin.on("touchend",l),r.zoomout.on("touchstart",m),r.zoomout.on("touchend",l),r.canvas.addEventListener("touchstart",v)):(r.canvas.addEventListener("mousedown",f),r.canvas.addEventListener("mousemove",g),r.canvas.addEventListener("mouseup",b),r.canvas.addEventListener("mouseout",b),document.getElementById("wppa-pan-canvas-"+r.itemid).addEventListener("wheel",d),r.right.on("mousedown",n),r.right.on("mouseup",l),r.left.on("mousedown",i),r.left.on("mouseup",l),r.up.on("mousedown",p),r.up.on("mouseup",l),r.down.on("mousedown",s),r.down.on("mouseup",l),r.zoomin.on("mousedown",c),r.zoomin.on("mouseup",l),r.zoomout.on("mousedown",m),r.zoomout.on("mouseup",l)),r.isLightbox&&(h("#wppa-fulls-btn").on("click",function(){abort=!0}),r.prev&&(r.prev.on("click",o),r.next.on("click",e))),h(window).on("DOMContentLoaded load resize orientationchange",w),u(t),w(),r.initialized=!0):a=!0);function u(a){if((r=wppaZoomableData[a]).isLightbox&&(wppaOvlOpen||(r.abort=!0)),r.abort)return r.ctx=null,void(r.prevctx=null);var t,o,e,n,i;0!=r.run&&(r.busy||(r.busy=!0,r.manualControl||(r.fromX+=r.deltaX,r.fromY+=r.deltaY,t=r.fromHeight/r.deltaFactor,o=r.fromWidth/r.deltaFactor,50<t&&1!=r.deltaFactor&&(wppaIsFs()||t<=r.image.height)&&(r.fromX-=(o-r.fromWidth)/2,r.fromY-=(t-r.fromHeight)/2,r.fromWidth=o,r.fromHeight=t)),r.fromX=Math.max(0,Math.min(r.image.width-r.fromWidth,r.fromX)),r.fromY=Math.max(0,Math.min(r.image.height-r.fromHeight,r.fromY)),e=screen.width/screen.height,n=(1-r.image.width/r.fromWidth)*r.canvas.width/2,i=(1-r.image.height/r.fromHeight)*r.canvas.height/2,r.ctx=r.canvas.getContext("2d"),e>r.imageRatio&&t>r.image.height&&wppaIsFs()||e<=r.imageRatio&&o>r.image.width&&wppaIsFs()?(r.enableManual=!1,r.ctx.clearRect(0,0,r.canvas.width,r.canvas.height),r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,n,i,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"default"})):(r.enableManual=!0,r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,0,0,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"grab"})),wppaIsFs()?(r.fsMaskTop=i-(r.canvas.height-screen.height)/2,r.fsMaskLeft=n-(r.canvas.width-screen.width)/2,r.fsMaskBottom=screen.height-r.fsMaskTop,r.fsMaskRight=screen.width-r.fsMaskLeft):(r.fsMaskTop=0,r.fsMaskLeft=0,r.fsMaskBottom=0,r.fsMaskRight=0),r.busy=!1,0<r.run&&(r.manualControl?setTimeout(function(){u(a)},25):r.buttondown&&setTimeout(function(){u(a)},5)),r.run<5&&r.run--,r.initializing&&(r.initializing=!1,r.run--),wppaAdjustControlbar()))}function o(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowPrev())}function e(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowNext())}function n(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaX=3,r.buttondown=!0,u(t))}function i(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaX=-3,r.buttondown=!0,u(t))}function p(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaY=-3,r.buttondown=!0,u(t))}function s(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaY=3,r.buttondown=!0,u(t))}function c(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaFactor=1.005,r.buttondown=!0,u(t))}function m(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaFactor=.995,r.buttondown=!0,u(t))}function d(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=4,wppaZoomableData[t].deltaFactor=1+a.deltaY*wppaZoomableData[t].zoomsensitivity/(wppaIsChrome?1e4:1e3),u(t),setTimeout(function(){wppaZoomableData[t].deltaFactor=1},25),a.stopPropagation())}function l(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].deltaX=0,wppaZoomableData[t].deltaY=0,wppaZoomableData[t].deltaFactor=1,wppaZoomableData[t].isLightbox?wppaZoomableData[t].run--:wppaZoomableData[t].run=4,r.buttondown=!1)}function w(a){for(var t,o,e,n,i,r,p,s,c,m,d,l=0;l<wppaZoomableData.length;l++){wppaZoomableData[l]&&wppaZoomableData[l].canvas&&!wppaZoomableData[l].abort&&(o=(t=wppaZoomableData[l]).imageRatio,t.isLightbox?(h("#wppa-overlay-ic").css("display",""),r=(n=!wppaIsFs())?(i=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(i=screen.width,screen.height),p=parseInt(p),s=parseInt(s),d=(m=8)+(t.controls?t.icsize+10:0)+10,n?(m+=2*t.borderWidth,d+=2*t.borderWidth):m=40,n?c=(e=(i-m)/o<r-d)?(r-(s=(p=i-m)/o)-d)/2+20:(p=o*(r-(t.controls?t.icsize:0)-24),n&&(p-=24),s=p/o,20):(screenRatio=screen.width/screen.height,(e=screenRatio<o)?(p=(s=screen.height)*o,screen.width,c=0):(s=(p=screen.width)/o,c=(screen.height-s)/2,0)),h("#wppa-ovl-pan-container").css({marginTop:c}),h("#wppa-overlay-ic").css({marginTop:0}),t.canvasWidth=p,t.canvasHeight=s,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight,n?(h("#wppa-ovl-pan-container").css({backgroundColor:t.backgroundColor,padding:t.padding,borderRadius:t.borderRadius,borderWidth:t.borderWidth,width:p,marginLeft:0}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}),e?h("#wppa-overlay-ic").css({left:4}):h("#wppa-overlay-ic").css({left:(i-p)/2})):(h("#wppa-overlay-ic").css({marginLeft:0}),h("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:p,left:(i-p)/2,position:"fixed"}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}))):(t.canvasWidth=h(t.div).parent().width(),t.canvasHeight=t.canvasWidth/o,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight),t.run=5,u(l))}}function f(a){a.preventDefault();var t,o,e=jQuery(this).attr("data-mocc");wppaZoomableData[e]&&(t=wppaZoomableData[e],wppaIsFs()&&(o=a.screenX,((o=a.screenY)<t.fsMaskLeft||o>t.fsMaskRight||Y<t.fsMaskTop||Y>t.fsMaskBottom)&&jQuery("#wppa-overlay-bg").trigger("click")),t.enableManual&&(t.manualControl=!0,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY,t.run=5,u(e)))}function v(a){if(!r.isLightbox)return!0;if(!wppaIsFs())return!0;var t=a.touches[0].screenX,o=a.touches[0].screenY;return(t<r.fsMaskLeft||t>r.fsMaskRight||o<r.fsMaskTop||o>r.fsMaskBottom)&&jQuery("#wppa-overlay-bg").trigger("click"),!0}function g(a){var t,o,e,n,i=jQuery(this).attr("data-mocc");!wppaZoomableData[i]||(t=wppaZoomableData[i]).manualControl&&(o=t.canvas.width/t.fromWidth,e=(t.savedCanvasX-a.offsetX)/o+t.fromX,n=(t.savedCanvasY-a.offsetY)/o+t.fromY,0<e&&0<n&&e+t.fromWidth<t.image.width&&n+t.fromHeight<t.image.height&&(t.fromX=e,t.fromY=n,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY))}function b(a){var t,o=jQuery(this).attr("data-mocc");!wppaZoomableData[o]||(t=wppaZoomableData[o]).manualControl&&(t.run=4,t.manualControl=!1)}a?setTimeout(function(){wppaDoZoomPan()},300):h("#wppa-ovl-spin").hide()}
js/wppa-zoom.js CHANGED
@@ -1,7 +1,7 @@
1
  // wppa-zoom.js
2
  //
3
  // contains wppa functions for simple zoomable photos
4
- // Vaersion 7.5.06
5
  //
6
 
7
  // The main proccedure
@@ -70,6 +70,7 @@ function wppaDoZoomPan() {
70
  args.zoomin.on("touchend", onButtonUp);
71
  args.zoomout.on("touchstart", onZoomOutMouseDown);
72
  args.zoomout.on("touchend", onButtonUp);
 
73
  }
74
  else {
75
  args.canvas.addEventListener("mousedown", onCanvasMouseDown);
@@ -204,10 +205,10 @@ function wppaDoZoomPan() {
204
 
205
  // Calculate image loc on screen
206
  if ( wppaIsFs() ) {
207
- args.fsMaskTop = toY;
208
- args.fsMaskLeft = toX;
209
- args.fsMaskBottom = args.canvas.height - toY;
210
- args.fsMaskRight = args.canvas.width - toX;
211
  }
212
 
213
  // Not fullscreen
@@ -536,22 +537,19 @@ function wppaDoZoomPan() {
536
 
537
  var mocc = jQuery(this).attr('data-mocc');
538
  if ( ! wppaZoomableData[mocc] ) return;
539
-
540
  var args = wppaZoomableData[mocc];
541
 
542
  // If fs and outside image, transfer to wppa-overlay-bg
543
  if ( wppaIsFs() ) {
544
- if ( e.offsetX < args.fsMaskLeft ||
545
- e.offsetX > args.fsMaskRight ||
546
- e.offsetY < args.fsMaskTop ||
547
- e.offsetY > args.fsMaskBottom ) {
548
- jQuery( '#wppa-overlay-bg' ).trigger( 'click' );
549
- }
550
  }
551
 
552
  if ( ! args.enableManual ) return;
553
 
554
- // e.preventDefault();
555
  args.manualControl = true;
556
  args.savedCanvasX = e.offsetX;
557
  args.savedCanvasY = e.offsetY;
@@ -559,6 +557,25 @@ function wppaDoZoomPan() {
559
  render(mocc);
560
  }
561
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  // When the mouse is down (manual control) and moved adjust the coorinates
563
  function onCanvasMouseMove(e){
564
 
1
  // wppa-zoom.js
2
  //
3
  // contains wppa functions for simple zoomable photos
4
+ // Vaersion 7.5.07
5
  //
6
 
7
  // The main proccedure
70
  args.zoomin.on("touchend", onButtonUp);
71
  args.zoomout.on("touchstart", onZoomOutMouseDown);
72
  args.zoomout.on("touchend", onButtonUp);
73
+ args.canvas.addEventListener("touchstart", onCanvasTouchStart);
74
  }
75
  else {
76
  args.canvas.addEventListener("mousedown", onCanvasMouseDown);
205
 
206
  // Calculate image loc on screen
207
  if ( wppaIsFs() ) {
208
+ args.fsMaskTop = toY - ( args.canvas.height - screen.height ) / 2;
209
+ args.fsMaskLeft = toX - ( args.canvas.width - screen.width ) / 2;
210
+ args.fsMaskBottom = screen.height - args.fsMaskTop;
211
+ args.fsMaskRight = screen.width - args.fsMaskLeft;
212
  }
213
 
214
  // Not fullscreen
537
 
538
  var mocc = jQuery(this).attr('data-mocc');
539
  if ( ! wppaZoomableData[mocc] ) return;
 
540
  var args = wppaZoomableData[mocc];
541
 
542
  // If fs and outside image, transfer to wppa-overlay-bg
543
  if ( wppaIsFs() ) {
544
+ var X = e.screenX;
545
+ var X = e.screenY;
546
+ if ( X < args.fsMaskLeft || X > args.fsMaskRight || Y < args.fsMaskTop || Y > args.fsMaskBottom ) {
547
+ jQuery( '#wppa-overlay-bg' ).trigger( 'click' );
548
+ }
 
549
  }
550
 
551
  if ( ! args.enableManual ) return;
552
 
 
553
  args.manualControl = true;
554
  args.savedCanvasX = e.offsetX;
555
  args.savedCanvasY = e.offsetY;
557
  render(mocc);
558
  }
559
 
560
+ // When a touch is done on the canvas in fs lightbox, transfer it to a click on the fs background
561
+ function onCanvasTouchStart(e) {
562
+
563
+ if ( ! args.isLightbox ) return true;
564
+ if ( ! wppaIsFs() ) return true;
565
+
566
+ var X = e.touches[0].screenX;
567
+ var Y = e.touches[0].screenY;
568
+
569
+ if ( X < args.fsMaskLeft ||
570
+ X > args.fsMaskRight ||
571
+ Y < args.fsMaskTop ||
572
+ Y > args.fsMaskBottom ) {
573
+ jQuery( '#wppa-overlay-bg' ).trigger( 'click' );
574
+ }
575
+
576
+ return true;
577
+ }
578
+
579
  // When the mouse is down (manual control) and moved adjust the coorinates
580
  function onCanvasMouseMove(e){
581
 
js/wppa-zoom.min.js CHANGED
@@ -1 +1 @@
1
- function wppaDoZoomPan(){for(var r,h=jQuery,a=!1,t=0;t<wppaZoomableData.length;t++)void 0!==wppaZoomableData[t]&&((r=wppaZoomableData[t]).image.complete?r.initialized||((r=wppaZoomableData[t]).manualControl=!1,r.deltaX=0,r.deltaY=0,r.deltaFactor=1,r.run=4,r.busy=!1,r.abort=!1,r.itemid=r.mocc+"-"+r.id,r.div=h("#wppa-pan-div-"+r.itemid),r.canvas=document.getElementById("wppa-pan-canvas-"+r.itemid),r.left=h("#wppa-pctl-left-"+r.itemid),r.right=h("#wppa-pctl-right-"+r.itemid),r.up=h("#wppa-pctl-up-"+r.itemid),r.down=h("#wppa-pctl-down-"+r.itemid),r.zoomin=h("#wppa-pctl-zoomin-"+r.itemid),r.zoomout=h("#wppa-pctl-zoomout-"+r.itemid),r.prev=h("#wppa-pctl-prev-"+r.itemid),r.next=h("#wppa-pctl-next-"+r.itemid),r.canvasWidth=r.width,r.canvasHeight=r.height,r.savedCanvasX=0,r.savedCanvasY=0,r.fromHeight=r.image.height,r.fromWidth=r.image.width,r.imageRatio=r.image.width/r.image.height,r.fromX=0,r.fromY=0,r.centerX=r.fromX+r.fromWidth/2,r.centerY=r.fromY+r.fromHeight/2,r.ctx=null,r.buttondown=!1,r.enableManual=!0,r.isMobile?(r.right.on("touchstart",n),r.right.on("touchend",l),r.left.on("touchstart",i),r.left.on("touchend",l),r.up.on("touchstart",p),r.up.on("touchend",l),r.down.on("touchstart",s),r.down.on("touchend",l),r.zoomin.on("touchstart",m),r.zoomin.on("touchend",l),r.zoomout.on("touchstart",d),r.zoomout.on("touchend",l)):(r.canvas.addEventListener("mousedown",f),r.canvas.addEventListener("mousemove",v),r.canvas.addEventListener("mouseup",g),r.canvas.addEventListener("mouseout",g),document.getElementById("wppa-pan-canvas-"+r.itemid).addEventListener("wheel",c),r.right.on("mousedown",n),r.right.on("mouseup",l),r.left.on("mousedown",i),r.left.on("mouseup",l),r.up.on("mousedown",p),r.up.on("mouseup",l),r.down.on("mousedown",s),r.down.on("mouseup",l),r.zoomin.on("mousedown",m),r.zoomin.on("mouseup",l),r.zoomout.on("mousedown",d),r.zoomout.on("mouseup",l)),r.isLightbox&&(h("#wppa-fulls-btn").on("click",function(){abort=!0}),r.prev&&(r.prev.on("click",o),r.next.on("click",e))),h(window).on("DOMContentLoaded load resize orientationchange",w),u(t),w(),r.initialized=!0):a=!0);function u(a){if((r=wppaZoomableData[a]).isLightbox&&(wppaOvlOpen||(r.abort=!0)),r.abort)return r.ctx=null,void(r.prevctx=null);var t,o,e,n,i;0!=r.run&&(r.busy||(r.busy=!0,r.manualControl||(r.fromX+=r.deltaX,r.fromY+=r.deltaY,t=r.fromHeight/r.deltaFactor,o=r.fromWidth/r.deltaFactor,50<t&&1!=r.deltaFactor&&(wppaIsFs()||t<=r.image.height)&&(r.fromX-=(o-r.fromWidth)/2,r.fromY-=(t-r.fromHeight)/2,r.fromWidth=o,r.fromHeight=t)),r.fromX=Math.max(0,Math.min(r.image.width-r.fromWidth,r.fromX)),r.fromY=Math.max(0,Math.min(r.image.height-r.fromHeight,r.fromY)),e=screen.width/screen.height,n=(1-r.image.width/r.fromWidth)*r.canvas.width/2,i=(1-r.image.height/r.fromHeight)*r.canvas.height/2,r.ctx=r.canvas.getContext("2d"),e>r.imageRatio&&t>r.image.height&&wppaIsFs()||e<=r.imageRatio&&o>r.image.width&&wppaIsFs()?(r.enableManual=!1,r.ctx.clearRect(0,0,r.canvas.width,r.canvas.height),r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,n,i,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"default"})):(r.enableManual=!0,r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,0,0,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"grab"})),wppaIsFs()?(r.fsMaskTop=i,r.fsMaskLeft=n,r.fsMaskBottom=r.canvas.height-i,r.fsMaskRight=r.canvas.width-n):(r.fsMaskTop=0,r.fsMaskLeft=0,r.fsMaskBottom=0,r.fsMaskRight=0),r.busy=!1,0<r.run&&(r.manualControl?setTimeout(function(){u(a)},25):r.buttondown&&setTimeout(function(){u(a)},5)),r.run<5&&r.run--,r.initializing&&(r.initializing=!1,r.run--),wppaAdjustControlbar()))}function o(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowPrev())}function e(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowNext())}function n(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaX=3,r.buttondown=!0,u(t))}function i(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaX=-3,r.buttondown=!0,u(t))}function p(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaY=-3,r.buttondown=!0,u(t))}function s(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaY=3,r.buttondown=!0,u(t))}function m(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaFactor=1.005,r.buttondown=!0,u(t))}function d(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaFactor=.995,r.buttondown=!0,u(t))}function c(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=4,wppaZoomableData[t].deltaFactor=1+a.deltaY*wppaZoomableData[t].zoomsensitivity/(wppaIsChrome?1e4:1e3),u(t),setTimeout(function(){wppaZoomableData[t].deltaFactor=1},25),a.stopPropagation())}function l(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].deltaX=0,wppaZoomableData[t].deltaY=0,wppaZoomableData[t].deltaFactor=1,wppaZoomableData[t].isLightbox?wppaZoomableData[t].run--:wppaZoomableData[t].run=4,r.buttondown=!1)}function w(a){for(var t,o,e,n,i,r,p,s,m,d,c,l=0;l<wppaZoomableData.length;l++){wppaZoomableData[l]&&wppaZoomableData[l].canvas&&!wppaZoomableData[l].abort&&(o=(t=wppaZoomableData[l]).imageRatio,t.isLightbox?(h("#wppa-overlay-ic").css("display",""),r=(n=!wppaIsFs())?(i=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(i=screen.width,screen.height),p=parseInt(p),s=parseInt(s),c=(d=8)+(t.controls?t.icsize+10:0)+10,n?(d+=2*t.borderWidth,c+=2*t.borderWidth):d=40,n?m=(e=(i-d)/o<r-c)?(r-(s=(p=i-d)/o)-c)/2+20:(p=o*(r-(t.controls?t.icsize:0)-24),n&&(p-=24),s=p/o,20):(screenRatio=screen.width/screen.height,(e=screenRatio<o)?(p=(s=screen.height)*o,screen.width,m=0):(s=(p=screen.width)/o,m=(screen.height-s)/2,0)),h("#wppa-ovl-pan-container").css({marginTop:m}),h("#wppa-overlay-ic").css({marginTop:0}),t.canvasWidth=p,t.canvasHeight=s,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight,n?(h("#wppa-ovl-pan-container").css({backgroundColor:t.backgroundColor,padding:t.padding,borderRadius:t.borderRadius,borderWidth:t.borderWidth,width:p,marginLeft:0}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}),e?h("#wppa-overlay-ic").css({left:4}):h("#wppa-overlay-ic").css({left:(i-p)/2})):(h("#wppa-overlay-ic").css({marginLeft:0}),h("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:p,left:(i-p)/2,position:"fixed"}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}))):(t.canvasWidth=h(t.div).parent().width(),t.canvasHeight=t.canvasWidth/o,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight),t.run=5,u(l))}}function f(a){a.preventDefault();var t,o=jQuery(this).attr("data-mocc");wppaZoomableData[o]&&(t=wppaZoomableData[o],wppaIsFs()&&(a.offsetX<t.fsMaskLeft||a.offsetX>t.fsMaskRight||a.offsetY<t.fsMaskTop||a.offsetY>t.fsMaskBottom)&&jQuery("#wppa-overlay-bg").trigger("click"),t.enableManual&&(t.manualControl=!0,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY,t.run=5,u(o)))}function v(a){var t,o,e,n,i=jQuery(this).attr("data-mocc");!wppaZoomableData[i]||(t=wppaZoomableData[i]).manualControl&&(o=t.canvas.width/t.fromWidth,e=(t.savedCanvasX-a.offsetX)/o+t.fromX,n=(t.savedCanvasY-a.offsetY)/o+t.fromY,0<e&&0<n&&e+t.fromWidth<t.image.width&&n+t.fromHeight<t.image.height&&(t.fromX=e,t.fromY=n,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY))}function g(a){var t,o=jQuery(this).attr("data-mocc");!wppaZoomableData[o]||(t=wppaZoomableData[o]).manualControl&&(t.run=4,t.manualControl=!1)}a?setTimeout(function(){wppaDoZoomPan()},300):h("#wppa-ovl-spin").hide()}
1
+ function wppaDoZoomPan(){for(var r,h=jQuery,a=!1,t=0;t<wppaZoomableData.length;t++)void 0!==wppaZoomableData[t]&&((r=wppaZoomableData[t]).image.complete?r.initialized||((r=wppaZoomableData[t]).manualControl=!1,r.deltaX=0,r.deltaY=0,r.deltaFactor=1,r.run=4,r.busy=!1,r.abort=!1,r.itemid=r.mocc+"-"+r.id,r.div=h("#wppa-pan-div-"+r.itemid),r.canvas=document.getElementById("wppa-pan-canvas-"+r.itemid),r.left=h("#wppa-pctl-left-"+r.itemid),r.right=h("#wppa-pctl-right-"+r.itemid),r.up=h("#wppa-pctl-up-"+r.itemid),r.down=h("#wppa-pctl-down-"+r.itemid),r.zoomin=h("#wppa-pctl-zoomin-"+r.itemid),r.zoomout=h("#wppa-pctl-zoomout-"+r.itemid),r.prev=h("#wppa-pctl-prev-"+r.itemid),r.next=h("#wppa-pctl-next-"+r.itemid),r.canvasWidth=r.width,r.canvasHeight=r.height,r.savedCanvasX=0,r.savedCanvasY=0,r.fromHeight=r.image.height,r.fromWidth=r.image.width,r.imageRatio=r.image.width/r.image.height,r.fromX=0,r.fromY=0,r.centerX=r.fromX+r.fromWidth/2,r.centerY=r.fromY+r.fromHeight/2,r.ctx=null,r.buttondown=!1,r.enableManual=!0,r.isMobile?(r.right.on("touchstart",n),r.right.on("touchend",l),r.left.on("touchstart",i),r.left.on("touchend",l),r.up.on("touchstart",p),r.up.on("touchend",l),r.down.on("touchstart",s),r.down.on("touchend",l),r.zoomin.on("touchstart",c),r.zoomin.on("touchend",l),r.zoomout.on("touchstart",m),r.zoomout.on("touchend",l),r.canvas.addEventListener("touchstart",v)):(r.canvas.addEventListener("mousedown",f),r.canvas.addEventListener("mousemove",g),r.canvas.addEventListener("mouseup",b),r.canvas.addEventListener("mouseout",b),document.getElementById("wppa-pan-canvas-"+r.itemid).addEventListener("wheel",d),r.right.on("mousedown",n),r.right.on("mouseup",l),r.left.on("mousedown",i),r.left.on("mouseup",l),r.up.on("mousedown",p),r.up.on("mouseup",l),r.down.on("mousedown",s),r.down.on("mouseup",l),r.zoomin.on("mousedown",c),r.zoomin.on("mouseup",l),r.zoomout.on("mousedown",m),r.zoomout.on("mouseup",l)),r.isLightbox&&(h("#wppa-fulls-btn").on("click",function(){abort=!0}),r.prev&&(r.prev.on("click",o),r.next.on("click",e))),h(window).on("DOMContentLoaded load resize orientationchange",w),u(t),w(),r.initialized=!0):a=!0);function u(a){if((r=wppaZoomableData[a]).isLightbox&&(wppaOvlOpen||(r.abort=!0)),r.abort)return r.ctx=null,void(r.prevctx=null);var t,o,e,n,i;0!=r.run&&(r.busy||(r.busy=!0,r.manualControl||(r.fromX+=r.deltaX,r.fromY+=r.deltaY,t=r.fromHeight/r.deltaFactor,o=r.fromWidth/r.deltaFactor,50<t&&1!=r.deltaFactor&&(wppaIsFs()||t<=r.image.height)&&(r.fromX-=(o-r.fromWidth)/2,r.fromY-=(t-r.fromHeight)/2,r.fromWidth=o,r.fromHeight=t)),r.fromX=Math.max(0,Math.min(r.image.width-r.fromWidth,r.fromX)),r.fromY=Math.max(0,Math.min(r.image.height-r.fromHeight,r.fromY)),e=screen.width/screen.height,n=(1-r.image.width/r.fromWidth)*r.canvas.width/2,i=(1-r.image.height/r.fromHeight)*r.canvas.height/2,r.ctx=r.canvas.getContext("2d"),e>r.imageRatio&&t>r.image.height&&wppaIsFs()||e<=r.imageRatio&&o>r.image.width&&wppaIsFs()?(r.enableManual=!1,r.ctx.clearRect(0,0,r.canvas.width,r.canvas.height),r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,n,i,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"default"})):(r.enableManual=!0,r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,0,0,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"grab"})),wppaIsFs()?(r.fsMaskTop=i-(r.canvas.height-screen.height)/2,r.fsMaskLeft=n-(r.canvas.width-screen.width)/2,r.fsMaskBottom=screen.height-r.fsMaskTop,r.fsMaskRight=screen.width-r.fsMaskLeft):(r.fsMaskTop=0,r.fsMaskLeft=0,r.fsMaskBottom=0,r.fsMaskRight=0),r.busy=!1,0<r.run&&(r.manualControl?setTimeout(function(){u(a)},25):r.buttondown&&setTimeout(function(){u(a)},5)),r.run<5&&r.run--,r.initializing&&(r.initializing=!1,r.run--),wppaAdjustControlbar()))}function o(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowPrev())}function e(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowNext())}function n(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaX=3,r.buttondown=!0,u(t))}function i(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaX=-3,r.buttondown=!0,u(t))}function p(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaY=-3,r.buttondown=!0,u(t))}function s(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaY=3,r.buttondown=!0,u(t))}function c(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaFactor=1.005,r.buttondown=!0,u(t))}function m(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=5,wppaZoomableData[t].deltaFactor=.995,r.buttondown=!0,u(t))}function d(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=4,wppaZoomableData[t].deltaFactor=1+a.deltaY*wppaZoomableData[t].zoomsensitivity/(wppaIsChrome?1e4:1e3),u(t),setTimeout(function(){wppaZoomableData[t].deltaFactor=1},25),a.stopPropagation())}function l(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].deltaX=0,wppaZoomableData[t].deltaY=0,wppaZoomableData[t].deltaFactor=1,wppaZoomableData[t].isLightbox?wppaZoomableData[t].run--:wppaZoomableData[t].run=4,r.buttondown=!1)}function w(a){for(var t,o,e,n,i,r,p,s,c,m,d,l=0;l<wppaZoomableData.length;l++){wppaZoomableData[l]&&wppaZoomableData[l].canvas&&!wppaZoomableData[l].abort&&(o=(t=wppaZoomableData[l]).imageRatio,t.isLightbox?(h("#wppa-overlay-ic").css("display",""),r=(n=!wppaIsFs())?(i=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(i=screen.width,screen.height),p=parseInt(p),s=parseInt(s),d=(m=8)+(t.controls?t.icsize+10:0)+10,n?(m+=2*t.borderWidth,d+=2*t.borderWidth):m=40,n?c=(e=(i-m)/o<r-d)?(r-(s=(p=i-m)/o)-d)/2+20:(p=o*(r-(t.controls?t.icsize:0)-24),n&&(p-=24),s=p/o,20):(screenRatio=screen.width/screen.height,(e=screenRatio<o)?(p=(s=screen.height)*o,screen.width,c=0):(s=(p=screen.width)/o,c=(screen.height-s)/2,0)),h("#wppa-ovl-pan-container").css({marginTop:c}),h("#wppa-overlay-ic").css({marginTop:0}),t.canvasWidth=p,t.canvasHeight=s,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight,n?(h("#wppa-ovl-pan-container").css({backgroundColor:t.backgroundColor,padding:t.padding,borderRadius:t.borderRadius,borderWidth:t.borderWidth,width:p,marginLeft:0}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}),e?h("#wppa-overlay-ic").css({left:4}):h("#wppa-overlay-ic").css({left:(i-p)/2})):(h("#wppa-overlay-ic").css({marginLeft:0}),h("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:p,left:(i-p)/2,position:"fixed"}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}))):(t.canvasWidth=h(t.div).parent().width(),t.canvasHeight=t.canvasWidth/o,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight),t.run=5,u(l))}}function f(a){a.preventDefault();var t,o,e=jQuery(this).attr("data-mocc");wppaZoomableData[e]&&(t=wppaZoomableData[e],wppaIsFs()&&(o=a.screenX,((o=a.screenY)<t.fsMaskLeft||o>t.fsMaskRight||Y<t.fsMaskTop||Y>t.fsMaskBottom)&&jQuery("#wppa-overlay-bg").trigger("click")),t.enableManual&&(t.manualControl=!0,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY,t.run=5,u(e)))}function v(a){if(!r.isLightbox)return!0;if(!wppaIsFs())return!0;var t=a.touches[0].screenX,o=a.touches[0].screenY;return(t<r.fsMaskLeft||t>r.fsMaskRight||o<r.fsMaskTop||o>r.fsMaskBottom)&&jQuery("#wppa-overlay-bg").trigger("click"),!0}function g(a){var t,o,e,n,i=jQuery(this).attr("data-mocc");!wppaZoomableData[i]||(t=wppaZoomableData[i]).manualControl&&(o=t.canvas.width/t.fromWidth,e=(t.savedCanvasX-a.offsetX)/o+t.fromX,n=(t.savedCanvasY-a.offsetY)/o+t.fromY,0<e&&0<n&&e+t.fromWidth<t.image.width&&n+t.fromHeight<t.image.height&&(t.fromX=e,t.fromY=n,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY))}function b(a){var t,o=jQuery(this).attr("data-mocc");!wppaZoomableData[o]||(t=wppaZoomableData[o]).manualControl&&(t.run=4,t.manualControl=!1)}a?setTimeout(function(){wppaDoZoomPan()},300):h("#wppa-ovl-spin").hide()}
wppa-utils.php CHANGED
@@ -1017,7 +1017,10 @@ function wppa_get_imgalt( $id, $lb = false ) {
1017
  function wppa_is_time_up( $count = '' ) {
1018
  global $wppa_endtime;
1019
 
1020
- // wppa_log( 'Dbg', 'Timeleft = ' . ( $wppa_endtime - time() ) );
 
 
 
1021
 
1022
  // Time up?
1023
  if ( $wppa_endtime > time() ) {
1017
  function wppa_is_time_up( $count = '' ) {
1018
  global $wppa_endtime;
1019
 
1020
+ if ( ! $wppa_endtime ) {
1021
+ wppa_log( 'err', 'Zero endtime, set to 25 secs after now' );
1022
+ $wppa_endtime = time() + 25;
1023
+ }
1024
 
1025
  // Time up?
1026
  if ( $wppa_endtime > time() ) {
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.07.002
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 = '7507'; // WPPA db version
27
- global $wppa_api_version; $wppa_api_version = '7.5.07.002'; // 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.07.003
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 = '7507'; // WPPA db version
27
+ global $wppa_api_version; $wppa_api_version = '7.5.07.003'; // WPPA software version
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';