Version Description
= 7.5.08 =
- This version addresses various bug fixes and feature requests.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 7.5.08.005 |
Comparing to | |
See all releases |
Code changes from version 7.5.08.004 to 7.5.08.005
- js/wppa-all.js +1 -1
- js/wppa-zoom.js +27 -6
- js/wppa-zoom.min.js +1 -1
- 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(o){var
|
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 d=jQuery,a=wppaZoomData[o];if(!a.initialized&&!a.abort){if(a.isLightbox&&d("#wppa-ovl-spin").show(),!a.image.complete)return wppaConsoleLog("Loading image "+o),void setTimeout(function(){wppaDoZoomPan(o)},200);wppaConsoleLog("Loading image "+o+" complete"),a.manual=!1,a.deltaX=0,a.deltaY=0,a.deltaFactor=1,a.run=1,a.busy=!1,a.div=d("#wppa-pan-div-"+a.itemId),a.canvas=document.getElementById("wppa-pan-canvas-"+a.itemId),a.left=d("#wppa-pctl-left-"+a.itemId),a.right=d("#wppa-pctl-right-"+a.itemId),a.up=d("#wppa-pctl-up-"+a.itemId),a.down=d("#wppa-pctl-down-"+a.itemId),a.zoomin=d("#wppa-pctl-zoomin-"+a.itemId),a.zoomout=d("#wppa-pctl-zoomout-"+a.itemId),a.prev=d("#wppa-pctl-prev-"+a.itemId),a.next=d("#wppa-pctl-next-"+a.itemId),a.exit=d("#wppa-exit-btn-2"),a.canvasWidth=a.width,a.canvasHeight=a.height,a.savedCanvasX=0,a.savedCanvasY=0,a.fromHeight=a.image.height,a.fromWidth=a.image.width,a.imageRatio=a.image.width/a.image.height,a.fromX=0,a.fromY=0,a.centerX=a.fromX+a.fromWidth/2,a.centerY=a.fromY+a.fromHeight/2,a.ctx=null,a.buttondown=!1,a.enableManual=!0,a.ctrlbarUpdate=!0,wppaIsMobile?(a.right.on("touchstart",function(a){n(o)}),a.right.on("touchend",function(a){u(o)}),a.left.on("touchstart",function(a){e(o)}),a.left.on("touchend",function(a){u(o)}),a.up.on("touchstart",function(a){i(o)}),a.up.on("touchend",function(a){u(o)}),a.down.on("touchstart",function(a){r(o)}),a.down.on("touchend",function(a){u(o)}),a.zoomin.on("touchstart",function(a){s(o)}),a.zoomin.on("touchend",function(a){u(o)}),a.zoomout.on("touchstart",function(a){c(o)}),a.zoomout.on("touchend",function(a){u(o)}),a.canvas.addEventListener("touchstart",function(a){p(o,a)}),a.canvas.addEventListener("touchmove",function(a){h(o,a)})):(a.canvas.addEventListener("mousedown",function(a){p(o,a)}),a.canvas.addEventListener("mousemove",function(a){h(o,a)}),a.canvas.addEventListener("mouseup",function(a){f(o,{run:1,manual:!1})}),a.canvas.addEventListener("mouseleave",function(a){f(o,{run:0})}),a.canvas.addEventListener("mouseenter",function(a){var t;t=o,wppaZoomData[t].manual&&(f(t,{run:2}),m(t))}),document.getElementById("wppa-pan-canvas-"+a.itemId).addEventListener("wheel",function(a){var t,n;t=o,(n=a).preventDefault(),n.stopPropagation(),f(t,{run:1,deltaFactor:1+n.deltaY*wppaZoomData[t].zoomsensitivity/(wppaIsChrome?1e4:1e3),manual:!1}),m(t),setTimeout(function(){f(t,{deltaFactor:1})},25)}),a.right.on("mousedown",function(a){n(o)}),a.right.on("mouseup",function(a){u(o)}),a.left.on("mousedown",function(a){e(o)}),a.left.on("mouseup",function(a){u(o)}),a.up.on("mousedown",function(a){i(o)}),a.up.on("mouseup",function(a){u(o)}),a.down.on("mousedown",function(a){r(o)}),a.down.on("mouseup",function(a){u(o)}),a.zoomin.on("mousedown",function(a){s(o)}),a.zoomin.on("mouseup",function(a){u(o)}),a.zoomout.on("mousedown",function(a){c(o)}),a.zoomout.on("mouseup",function(a){u(o)})),a.isLightbox&&(d(".wppa-fulls-btn").on("click",function(){f(0,{abort:!0})}),d(".wppa-exit-fulls-btn").on("click",function(){f(0,{abort:!0})}),a.prev&&(a.prev.on("click",function(a){d("#wppa-ovl-spin").show(),f(0,{abort:!0}),wppaOvlShowPrev()}),a.next.on("click",function(a){d("#wppa-ovl-spin").show(),f(0,{abort:!0}),wppaOvlShowNext()})),a.exit.on("click",function(a){d("#wppa-ovl-spin").hide(),f(0,{abort:!0}),wppaOvlHide()})),d(window).on("DOMContentLoaded load resize orientationchange",function(a){t(o)}),t(o),a.initialized=!0,wppaZoomData[o]=a,d("#wppa-ovl-spin").hide()}function m(a){wppaDebugCounter++;var t,n,o,e,i,r=wppaZoomData[a];wppaConsoleLog("Render zoom "+a+" "+wppaDebugCounter+" run="+r.run+" abort="+r.abort),r.isLightbox?wppaOvlOpen||f(0,{abort:!0}):wppaOvlOpen&&f(a,{run:0,manual:!1}),r.abort?f(a,{ctx:null}):0!=r.run&&(r.busy||(r.busy=!0,r.manual||(r.fromX+=r.deltaX,r.fromY+=r.deltaY,t=r.fromHeight/r.deltaFactor,n=r.fromWidth/r.deltaFactor,50<t&&1!=r.deltaFactor&&(wppaIsFs()||t<=r.image.height)&&(r.fromX-=(n-r.fromWidth)/2,r.fromY-=(t-r.fromHeight)/2,r.fromWidth=n,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)),o=screen.width/screen.height,e=(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"),o>r.imageRatio&&t>r.image.height&&wppaIsFs()||o<=r.imageRatio&&n>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,e,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=e-(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.manual||r.buttondown)&&setTimeout(function(){m(a)},5),r.run<2&&r.run--,r.initializing&&(r.initializing=!1,r.run--),r.ctrlbarUpdate&&(wppaAdjustControlbar(),r.ctrlbarUpdate=!1),wppaZoomData[a]=r))}function t(a){var t,n,o,e,i,r,s,c,u,p=wppaZoomData[a];p.isLightbox?(d("#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),s=0,u=(c=8)+(p.controls?p.icsize+10:0)+10,n?(c+=2*p.borderWidth,u+=2*p.borderWidth):c=40,t=n?e-u>(o-c)/p.imageRatio:(screenRatio=screen.width/screen.height,screenRatio<p.imageRatio),n&&t&&(s=(e-(r=(i=o-c)/p.imageRatio)-u)/2+20),n&&!t&&(r=(i=p.imageRatio*(e-(p.controls?p.icsize:0)-48))/p.imageRatio,s=20),!n&&t&&(i=(r=screen.height)*p.imageRatio,s=0),n||t||(r=(i=screen.width)/p.imageRatio,s=(screen.height-r)/2),d("#wppa-ovl-pan-container").css({marginTop:s}),d("#wppa-overlay-ic").css({marginTop:0}),p.canvasWidth=i,p.canvasHeight=r,p.canvas.width=p.canvasWidth,p.canvas.height=p.canvasHeight,n?(d("#wppa-ovl-pan-container").css({backgroundColor:p.backgroundColor,padding:p.padding,borderRadius:p.borderRadius,borderWidth:p.borderWidth,width:i,marginLeft:0}),d("#wppa-pctl-div-"+p.itemId).css({marginLeft:0}),t?d("#wppa-overlay-ic").css({left:4}):d("#wppa-overlay-ic").css({left:(o-i)/2})):(d("#wppa-overlay-ic").css({marginLeft:0}),d("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:i,left:(o-i)/2,position:"fixed"}),d("#wppa-pctl-div-"+p.itemId).css({marginLeft:0}))):(p.canvasWidth=d(p.div).parent().width(),p.canvasHeight=p.canvasWidth/p.imageRatio,p.canvas.width=p.canvasWidth,p.canvas.height=p.canvasHeight),p.run=2,p.ctrlbarUpdate=!0,wppaZoomData[a]=p,m(a)}function n(a){f(a,{run:2,deltaX:3,buttondown:!0,manual:!1}),m(a)}function e(a){f(a,{run:2,deltaX:-3,buttondown:!0,manual:!1}),m(a)}function i(a){f(a,{run:2,deltaY:-3,buttondown:!0,manual:!1}),m(a)}function r(a){f(a,{run:2,deltaY:3,buttondown:!0,manual:!1}),m(a)}function s(a){f(a,{run:2,deltaFactor:1.005,buttondown:!0,manual:!1}),m(a)}function c(a){f(a,{run:2,deltaFactor:.995,buttondown:!0,manual:!1}),m(a)}function u(a){f(a,{deltaX:0,deltaY:0,deltaFactor:1,buttondown:!1,run:1})}function p(a,t){var n=wppaZoomData[a],o=w(t).X,e=w(t).Y;if(wppaIsFs()&&n.isLightbox&&(o<n.fsMaskLeft||o>n.fsMaskRight||e<n.fsMaskTop||e>n.fsMaskBottom))return f(0,{abort:!0}),void jQuery("#wppa-overlay-bg").trigger("click");n.enableManual&&(f(a,{manual:!0,savedCanvasX:o=l(a,t).X,savedCanvasY:e=l(a,t).Y,run:2}),m(a))}function h(a,t){var n,o,e,i=wppaZoomData[a],r=l(a,t).X,s=l(a,t).Y;i.manual&&(n=i.canvas.width/i.fromWidth,o=(i.savedCanvasX-r)/n+i.fromX,e=(i.savedCanvasY-s)/n+i.fromY,0<o&&0<e&&o+i.fromWidth<i.image.width&&e+i.fromHeight<i.image.height&&f(a,{fromX:o,fromY:e,savedCanvasX:r,savedCanvasY:s}))}function f(a,t){for(var n in t)wppaZoomData[a][n]=t[n]}function w(a){var t,n;return n=wppaIsMobile?(t=a.touches[0].screenX,a.touches[0].screenY):(t=a.screenX,a.screenY),{X:t,Y:n}}function l(a,t){var n,o,e;return e=wppaIsMobile?(n=wppaZoomData[a],o=t.touches[0].screenX-n.fsMaskLeft,t.touches[0].screenY-n.fsMaskTop):(o=t.offsetX,t.offsetY),{X:o,Y:e}}}
|
js/wppa-zoom.js
CHANGED
@@ -76,6 +76,7 @@ function wppaDoZoomPan(mocc) {
|
|
76 |
data.zoomout.on("touchstart", function(e){minDown(mocc, e)});
|
77 |
data.zoomout.on("touchend", function(e){buttonUp(mocc, e)});
|
78 |
data.canvas.addEventListener("touchstart", function(e){canvasDown(mocc, e)});
|
|
|
79 |
}
|
80 |
else {
|
81 |
data.canvas.addEventListener("mousedown", function(e){canvasDown(mocc, e)});
|
@@ -545,12 +546,15 @@ function wppaDoZoomPan(mocc) {
|
|
545 |
}
|
546 |
}
|
547 |
|
|
|
548 |
if ( data.enableManual ) {
|
549 |
|
|
|
|
|
550 |
update(mocc, {
|
551 |
manual :true,
|
552 |
-
savedCanvasX :
|
553 |
-
savedCanvasY :
|
554 |
run :2,
|
555 |
});
|
556 |
render(mocc);
|
@@ -561,18 +565,20 @@ function wppaDoZoomPan(mocc) {
|
|
561 |
function canvasMove(mocc, e){
|
562 |
|
563 |
var data = wppaZoomData[mocc];
|
|
|
|
|
564 |
|
565 |
if ( data.manual ){
|
566 |
var factor = data.canvas.width / data.fromWidth;
|
567 |
-
var x = ( data.savedCanvasX -
|
568 |
-
var y = ( data.savedCanvasY -
|
569 |
|
570 |
if ( x > 0 && y > 0 && ( x + data.fromWidth ) < data.image.width && ( y + data.fromHeight ) < data.image.height ) {
|
571 |
update(mocc, {
|
572 |
fromX :x,
|
573 |
fromY :y,
|
574 |
-
savedCanvasX :
|
575 |
-
savedCanvasY :
|
576 |
});
|
577 |
}
|
578 |
}
|
@@ -625,5 +631,20 @@ function wppaDoZoomPan(mocc) {
|
|
625 |
}
|
626 |
return {X:X,Y:Y};
|
627 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
628 |
}
|
629 |
|
76 |
data.zoomout.on("touchstart", function(e){minDown(mocc, e)});
|
77 |
data.zoomout.on("touchend", function(e){buttonUp(mocc, e)});
|
78 |
data.canvas.addEventListener("touchstart", function(e){canvasDown(mocc, e)});
|
79 |
+
data.canvas.addEventListener("touchmove", function(e){canvasMove(mocc, e)});
|
80 |
}
|
81 |
else {
|
82 |
data.canvas.addEventListener("mousedown", function(e){canvasDown(mocc, e)});
|
546 |
}
|
547 |
}
|
548 |
|
549 |
+
// If manual get location on image
|
550 |
if ( data.enableManual ) {
|
551 |
|
552 |
+
X = findoffsetxy(mocc,e).X;
|
553 |
+
Y = findoffsetxy(mocc,e).Y;
|
554 |
update(mocc, {
|
555 |
manual :true,
|
556 |
+
savedCanvasX :X,
|
557 |
+
savedCanvasY :Y,
|
558 |
run :2,
|
559 |
});
|
560 |
render(mocc);
|
565 |
function canvasMove(mocc, e){
|
566 |
|
567 |
var data = wppaZoomData[mocc];
|
568 |
+
var X = findoffsetxy(mocc,e).X;
|
569 |
+
var Y = findoffsetxy(mocc,e).Y;
|
570 |
|
571 |
if ( data.manual ){
|
572 |
var factor = data.canvas.width / data.fromWidth;
|
573 |
+
var x = ( data.savedCanvasX - X ) / factor + data.fromX;
|
574 |
+
var y = ( data.savedCanvasY - Y ) / factor + data.fromY;
|
575 |
|
576 |
if ( x > 0 && y > 0 && ( x + data.fromWidth ) < data.image.width && ( y + data.fromHeight ) < data.image.height ) {
|
577 |
update(mocc, {
|
578 |
fromX :x,
|
579 |
fromY :y,
|
580 |
+
savedCanvasX :X,
|
581 |
+
savedCanvasY :Y
|
582 |
});
|
583 |
}
|
584 |
}
|
631 |
}
|
632 |
return {X:X,Y:Y};
|
633 |
}
|
634 |
+
|
635 |
+
// Find offset x and y
|
636 |
+
function findoffsetxy(mocc,e) {
|
637 |
+
|
638 |
+
if ( wppaIsMobile ) {
|
639 |
+
var data = wppaZoomData[mocc];
|
640 |
+
var X = e.touches[0].screenX - data.fsMaskLeft;
|
641 |
+
var Y = e.touches[0].screenY - data.fsMaskTop;
|
642 |
+
}
|
643 |
+
else {
|
644 |
+
var X = e.offsetX;
|
645 |
+
var Y = e.offsetY;
|
646 |
+
}
|
647 |
+
return {X:X,Y:Y};
|
648 |
+
}
|
649 |
}
|
650 |
|
js/wppa-zoom.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function wppaDoZoomPan(o){var
|
1 |
+
function wppaDoZoomPan(o){var d=jQuery,a=wppaZoomData[o];if(!a.initialized&&!a.abort){if(a.isLightbox&&d("#wppa-ovl-spin").show(),!a.image.complete)return wppaConsoleLog("Loading image "+o),void setTimeout(function(){wppaDoZoomPan(o)},200);wppaConsoleLog("Loading image "+o+" complete"),a.manual=!1,a.deltaX=0,a.deltaY=0,a.deltaFactor=1,a.run=1,a.busy=!1,a.div=d("#wppa-pan-div-"+a.itemId),a.canvas=document.getElementById("wppa-pan-canvas-"+a.itemId),a.left=d("#wppa-pctl-left-"+a.itemId),a.right=d("#wppa-pctl-right-"+a.itemId),a.up=d("#wppa-pctl-up-"+a.itemId),a.down=d("#wppa-pctl-down-"+a.itemId),a.zoomin=d("#wppa-pctl-zoomin-"+a.itemId),a.zoomout=d("#wppa-pctl-zoomout-"+a.itemId),a.prev=d("#wppa-pctl-prev-"+a.itemId),a.next=d("#wppa-pctl-next-"+a.itemId),a.exit=d("#wppa-exit-btn-2"),a.canvasWidth=a.width,a.canvasHeight=a.height,a.savedCanvasX=0,a.savedCanvasY=0,a.fromHeight=a.image.height,a.fromWidth=a.image.width,a.imageRatio=a.image.width/a.image.height,a.fromX=0,a.fromY=0,a.centerX=a.fromX+a.fromWidth/2,a.centerY=a.fromY+a.fromHeight/2,a.ctx=null,a.buttondown=!1,a.enableManual=!0,a.ctrlbarUpdate=!0,wppaIsMobile?(a.right.on("touchstart",function(a){n(o)}),a.right.on("touchend",function(a){u(o)}),a.left.on("touchstart",function(a){e(o)}),a.left.on("touchend",function(a){u(o)}),a.up.on("touchstart",function(a){i(o)}),a.up.on("touchend",function(a){u(o)}),a.down.on("touchstart",function(a){r(o)}),a.down.on("touchend",function(a){u(o)}),a.zoomin.on("touchstart",function(a){s(o)}),a.zoomin.on("touchend",function(a){u(o)}),a.zoomout.on("touchstart",function(a){c(o)}),a.zoomout.on("touchend",function(a){u(o)}),a.canvas.addEventListener("touchstart",function(a){p(o,a)}),a.canvas.addEventListener("touchmove",function(a){h(o,a)})):(a.canvas.addEventListener("mousedown",function(a){p(o,a)}),a.canvas.addEventListener("mousemove",function(a){h(o,a)}),a.canvas.addEventListener("mouseup",function(a){f(o,{run:1,manual:!1})}),a.canvas.addEventListener("mouseleave",function(a){f(o,{run:0})}),a.canvas.addEventListener("mouseenter",function(a){var t;t=o,wppaZoomData[t].manual&&(f(t,{run:2}),m(t))}),document.getElementById("wppa-pan-canvas-"+a.itemId).addEventListener("wheel",function(a){var t,n;t=o,(n=a).preventDefault(),n.stopPropagation(),f(t,{run:1,deltaFactor:1+n.deltaY*wppaZoomData[t].zoomsensitivity/(wppaIsChrome?1e4:1e3),manual:!1}),m(t),setTimeout(function(){f(t,{deltaFactor:1})},25)}),a.right.on("mousedown",function(a){n(o)}),a.right.on("mouseup",function(a){u(o)}),a.left.on("mousedown",function(a){e(o)}),a.left.on("mouseup",function(a){u(o)}),a.up.on("mousedown",function(a){i(o)}),a.up.on("mouseup",function(a){u(o)}),a.down.on("mousedown",function(a){r(o)}),a.down.on("mouseup",function(a){u(o)}),a.zoomin.on("mousedown",function(a){s(o)}),a.zoomin.on("mouseup",function(a){u(o)}),a.zoomout.on("mousedown",function(a){c(o)}),a.zoomout.on("mouseup",function(a){u(o)})),a.isLightbox&&(d(".wppa-fulls-btn").on("click",function(){f(0,{abort:!0})}),d(".wppa-exit-fulls-btn").on("click",function(){f(0,{abort:!0})}),a.prev&&(a.prev.on("click",function(a){d("#wppa-ovl-spin").show(),f(0,{abort:!0}),wppaOvlShowPrev()}),a.next.on("click",function(a){d("#wppa-ovl-spin").show(),f(0,{abort:!0}),wppaOvlShowNext()})),a.exit.on("click",function(a){d("#wppa-ovl-spin").hide(),f(0,{abort:!0}),wppaOvlHide()})),d(window).on("DOMContentLoaded load resize orientationchange",function(a){t(o)}),t(o),a.initialized=!0,wppaZoomData[o]=a,d("#wppa-ovl-spin").hide()}function m(a){wppaDebugCounter++;var t,n,o,e,i,r=wppaZoomData[a];wppaConsoleLog("Render zoom "+a+" "+wppaDebugCounter+" run="+r.run+" abort="+r.abort),r.isLightbox?wppaOvlOpen||f(0,{abort:!0}):wppaOvlOpen&&f(a,{run:0,manual:!1}),r.abort?f(a,{ctx:null}):0!=r.run&&(r.busy||(r.busy=!0,r.manual||(r.fromX+=r.deltaX,r.fromY+=r.deltaY,t=r.fromHeight/r.deltaFactor,n=r.fromWidth/r.deltaFactor,50<t&&1!=r.deltaFactor&&(wppaIsFs()||t<=r.image.height)&&(r.fromX-=(n-r.fromWidth)/2,r.fromY-=(t-r.fromHeight)/2,r.fromWidth=n,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)),o=screen.width/screen.height,e=(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"),o>r.imageRatio&&t>r.image.height&&wppaIsFs()||o<=r.imageRatio&&n>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,e,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=e-(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.manual||r.buttondown)&&setTimeout(function(){m(a)},5),r.run<2&&r.run--,r.initializing&&(r.initializing=!1,r.run--),r.ctrlbarUpdate&&(wppaAdjustControlbar(),r.ctrlbarUpdate=!1),wppaZoomData[a]=r))}function t(a){var t,n,o,e,i,r,s,c,u,p=wppaZoomData[a];p.isLightbox?(d("#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),s=0,u=(c=8)+(p.controls?p.icsize+10:0)+10,n?(c+=2*p.borderWidth,u+=2*p.borderWidth):c=40,t=n?e-u>(o-c)/p.imageRatio:(screenRatio=screen.width/screen.height,screenRatio<p.imageRatio),n&&t&&(s=(e-(r=(i=o-c)/p.imageRatio)-u)/2+20),n&&!t&&(r=(i=p.imageRatio*(e-(p.controls?p.icsize:0)-48))/p.imageRatio,s=20),!n&&t&&(i=(r=screen.height)*p.imageRatio,s=0),n||t||(r=(i=screen.width)/p.imageRatio,s=(screen.height-r)/2),d("#wppa-ovl-pan-container").css({marginTop:s}),d("#wppa-overlay-ic").css({marginTop:0}),p.canvasWidth=i,p.canvasHeight=r,p.canvas.width=p.canvasWidth,p.canvas.height=p.canvasHeight,n?(d("#wppa-ovl-pan-container").css({backgroundColor:p.backgroundColor,padding:p.padding,borderRadius:p.borderRadius,borderWidth:p.borderWidth,width:i,marginLeft:0}),d("#wppa-pctl-div-"+p.itemId).css({marginLeft:0}),t?d("#wppa-overlay-ic").css({left:4}):d("#wppa-overlay-ic").css({left:(o-i)/2})):(d("#wppa-overlay-ic").css({marginLeft:0}),d("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:i,left:(o-i)/2,position:"fixed"}),d("#wppa-pctl-div-"+p.itemId).css({marginLeft:0}))):(p.canvasWidth=d(p.div).parent().width(),p.canvasHeight=p.canvasWidth/p.imageRatio,p.canvas.width=p.canvasWidth,p.canvas.height=p.canvasHeight),p.run=2,p.ctrlbarUpdate=!0,wppaZoomData[a]=p,m(a)}function n(a){f(a,{run:2,deltaX:3,buttondown:!0,manual:!1}),m(a)}function e(a){f(a,{run:2,deltaX:-3,buttondown:!0,manual:!1}),m(a)}function i(a){f(a,{run:2,deltaY:-3,buttondown:!0,manual:!1}),m(a)}function r(a){f(a,{run:2,deltaY:3,buttondown:!0,manual:!1}),m(a)}function s(a){f(a,{run:2,deltaFactor:1.005,buttondown:!0,manual:!1}),m(a)}function c(a){f(a,{run:2,deltaFactor:.995,buttondown:!0,manual:!1}),m(a)}function u(a){f(a,{deltaX:0,deltaY:0,deltaFactor:1,buttondown:!1,run:1})}function p(a,t){var n=wppaZoomData[a],o=w(t).X,e=w(t).Y;if(wppaIsFs()&&n.isLightbox&&(o<n.fsMaskLeft||o>n.fsMaskRight||e<n.fsMaskTop||e>n.fsMaskBottom))return f(0,{abort:!0}),void jQuery("#wppa-overlay-bg").trigger("click");n.enableManual&&(f(a,{manual:!0,savedCanvasX:o=l(a,t).X,savedCanvasY:e=l(a,t).Y,run:2}),m(a))}function h(a,t){var n,o,e,i=wppaZoomData[a],r=l(a,t).X,s=l(a,t).Y;i.manual&&(n=i.canvas.width/i.fromWidth,o=(i.savedCanvasX-r)/n+i.fromX,e=(i.savedCanvasY-s)/n+i.fromY,0<o&&0<e&&o+i.fromWidth<i.image.width&&e+i.fromHeight<i.image.height&&f(a,{fromX:o,fromY:e,savedCanvasX:r,savedCanvasY:s}))}function f(a,t){for(var n in t)wppaZoomData[a][n]=t[n]}function w(a){var t,n;return n=wppaIsMobile?(t=a.touches[0].screenX,a.touches[0].screenY):(t=a.screenX,a.screenY),{X:t,Y:n}}function l(a,t){var n,o,e;return e=wppaIsMobile?(n=wppaZoomData[a],o=t.touches[0].screenX-n.fsMaskLeft,t.touches[0].screenY-n.fsMaskTop):(o=t.offsetX,t.offsetY),{X:o,Y:e}}}
|
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.08.
|
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 = '7508'; // WPPA db version
|
27 |
-
global $wppa_api_version; $wppa_api_version = '7.5.08.
|
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.08.005
|
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 = '7508'; // WPPA db version
|
27 |
+
global $wppa_api_version; $wppa_api_version = '7.5.08.005'; // WPPA software version
|
28 |
|
29 |
/* Init page js data */
|
30 |
global $wppa_js_page_data; $wppa_js_page_data = '';
|