Version Description
= 8.1.06 =
- This version addresses various bug fixes, feature requests and security fixes.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 8.1.06.005 |
Comparing to | |
See all releases |
Code changes from version 8.1.06.004 to 8.1.06.005
- changelog.txt +1 -0
- js/wppa-all.js +2 -2
- js/wppa-spheric.js +17 -2
- js/wppa-spheric.min.js +1 -1
- js/wppa-zoom.js +8 -29
- js/wppa-zoom.min.js +1 -1
- wppa.php +2 -2
changelog.txt
CHANGED
@@ -6,6 +6,7 @@ WP Photo Album Plus Changelog
|
|
6 |
* Fixed shortcode types acount and pcount for multiple albums/parents.
|
7 |
* Fixed maintenances procs Custom album proc and Custom photo proc.
|
8 |
* Improved behaviour of pan buttons on zoomable images. Improved touch moving of zoomed images.
|
|
|
9 |
|
10 |
= 8.1.05 =
|
11 |
|
6 |
* Fixed shortcode types acount and pcount for multiple albums/parents.
|
7 |
* Fixed maintenances procs Custom album proc and Custom photo proc.
|
8 |
* Improved behaviour of pan buttons on zoomable images. Improved touch moving of zoomed images.
|
9 |
+
* Improved stability of displaying panorama and zoomable images.
|
10 |
|
11 |
= 8.1.05 =
|
12 |
|
js/wppa-all.js
CHANGED
@@ -13,6 +13,6 @@ var wppaJsPopupVersion="8.0.07.004";function wppaPopUp(p,t,i,e,a,n,o,r,d,s){wppa
|
|
13 |
// wppa-touch
|
14 |
var wppaJsTouchVersion="8.0.01006";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()),wppaFingerCount=p.touches.length,1==wppaFingerCount?(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))),wppaSwipeLength>=wppaMinLength&&(wppaCalculateAngle(),wppaDetermineSwipeDirection(),wppaProcessingRoutine())),wppaTouchCancel()}function wppaTouchCancel(){wppaFingerCount=0,wppaStartX=0,wppaStartY=0,wppaCurX=0,wppaCurY=0,wppaDeltaX=0,wppaDeltaY=0,wppaHorzDiff=0,wppaVertDiff=0,wppaSwipeLength=0,wppaSwipeAngle=null,wppaSwipeDirection=null,wppaTriggerElementID=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=0}function wppaCalculateAngle(){var p=wppaStartX-wppaCurX,e=wppaCurY-wppaStartY,p=(Math.round(Math.sqrt(Math.pow(p,2)+Math.pow(e,2))),Math.atan2(e,p));wppaSwipeAngle=Math.round(180*p/Math.PI),wppaSwipeAngle<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)}else"up"==wppaSwipeDirection||wppaSwipeDirection}wppaTouchCancel()}
|
15 |
// wppa-zoom
|
16 |
-
var wppaJsZoomVersion="8.1.06.
|
17 |
// wppa-spheric
|
18 |
-
var wppaJsSphericVersion="8.1.06.
|
13 |
// wppa-touch
|
14 |
var wppaJsTouchVersion="8.0.01006";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()),wppaFingerCount=p.touches.length,1==wppaFingerCount?(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))),wppaSwipeLength>=wppaMinLength&&(wppaCalculateAngle(),wppaDetermineSwipeDirection(),wppaProcessingRoutine())),wppaTouchCancel()}function wppaTouchCancel(){wppaFingerCount=0,wppaStartX=0,wppaStartY=0,wppaCurX=0,wppaCurY=0,wppaDeltaX=0,wppaDeltaY=0,wppaHorzDiff=0,wppaVertDiff=0,wppaSwipeLength=0,wppaSwipeAngle=null,wppaSwipeDirection=null,wppaTriggerElementID=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=0}function wppaCalculateAngle(){var p=wppaStartX-wppaCurX,e=wppaCurY-wppaStartY,p=(Math.round(Math.sqrt(Math.pow(p,2)+Math.pow(e,2))),Math.atan2(e,p));wppaSwipeAngle=Math.round(180*p/Math.PI),wppaSwipeAngle<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)}else"up"==wppaSwipeDirection||wppaSwipeDirection}wppaTouchCancel()}
|
15 |
// wppa-zoom
|
16 |
+
var wppaJsZoomVersion="8.1.06.005";function wppaDoZoomPan(n,t){var h=jQuery;t&&(wppaZoomData[n]=t);var o=l(n);function p(t){var a,n,o,e,i,s=l(t);s.canvas&&(z()<s.time+10||(l(t,{time:z()}),(s.isLightbox&&!wppaOvlOpen||!s.isLightbox&&wppaOvlOpen)&&(s=l(0,{abort:!0})),s.abort?l(t,{manual:!1,buttondown:!1,pause:!1,ctx:null}):s.busy||(wppaDebugCounter++,e=(s=l(t,{busy:!0})).fromX,i=s.fromY,s.manual||(s.fromX+=s.deltaX,s.fromY+=s.deltaY,a=s.fromHeight/s.deltaFactor,n=s.fromWidth/s.deltaFactor,50<a&&(wppaIsFs()||a<=s.image.height)?(s.fromX-=(n-s.fromWidth)/2,s.fromY-=(a-s.fromHeight)/2,s.fromWidth=n,s.fromHeight=a):s.buttondown=!1),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==s.fromX&&i==s.fromY&&1==s.deltaFactor&&(s.buttondown=!1),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,wppaIsElementInViewport(s.canvas)||(s.buttondown=!1),l(t,s),s.pause||!s.manual&&!s.buttondown||setTimeout(function(){p(t)},10),s.pause&&l(t,{pause:!1}))))}function a(t,a){var n,o=l(t);if(o){if(o.isLightbox){h("#wppa-overlay-zpc").css("display","");var e,i,s,r=!wppaIsFs(),c=r?(e=window.innerWidth||screen.width,window.innerHeight||screen.height):(e=screen.width,screen.height),d=0,u=8,m=8+(o.controls?o.icsize+10:0)+10;r?(u+=2*o.borderWidth,m+=2*o.borderWidth):u=40,n=r?c-m>(e-u)/o.imageRatio:(screenRatio=screen.width/screen.height,screenRatio<o.imageRatio),r&&n&&(d=(c-(s=(i=e-u)/o.imageRatio)-m)/2+20),r&&!n&&(s=(i=o.imageRatio*(c-(o.controls?o.icsize:0)-48))/o.imageRatio,d=20),!r&&n&&(i=(s=screen.height)*o.imageRatio,d=0),r||n||(s=(i=screen.width)/o.imageRatio,d=(screen.height-s)/2),h("#wppa-ovl-zoom-container").css({top:d}),h("#wppa-overlay-zpc").css({top:0,left:0}),o.canvasWidth=i,o.canvasHeight=s,o.canvas.width=o.canvasWidth,o.canvas.height=o.canvasHeight,r?(h("#wppa-ovl-zoom-container").css({backgroundColor:o.backgroundColor,padding:o.padding,borderRadius:o.borderRadius+"px",borderWidth:o.borderWidth+"px",width:i,marginLeft:0}),n?h("#wppa-overlay-zpc").css({left:4}):h("#wppa-overlay-zpc").css({left:(e-i)/2})):(h("#wppa-overlay-zpc").css({marginLeft:0}),h("#wppa-ovl-zoom-container").css({backgroundColor:"transparent",padding:0,borderRadius:"0px",borderWidth:"0px",width:i,left:(e-i)/2,position:"fixed"})),o.ctrlbarUpdate=!0}else{if("force"!=a&&o.canvasWidth==h(o.div).parent().width())return;o.canvasWidth=h(o.div).parent().width(),o.canvasHeight=o.canvasWidth/o.imageRatio,o.canvas.width=o.canvasWidth,o.canvas.height=o.canvasHeight,o.ctrlbarUpdate=!0}l(t,o),setTimeout(function(){p(t)},1),h("#wppa-ovl-zoom-container").show()}}function e(t){var a=l(t),a=a.image.naturalWidth/a.canvas.width;a<1.5&&(a=1.5),l(t,{deltaX:a*=1.5,buttondown:!0,manual:!1}),p(t)}function i(t){var a=l(t),a=a.image.naturalWidth/a.canvas.width;a<1.5&&(a=1.5),l(t,{deltaX:-(a*=1.5),buttondown:!0,manual:!1}),p(t)}function s(t){var a=l(t),a=a.image.naturalHeight/a.canvas.height;a<1.5&&(a=1.5),l(t,{deltaY:-(a*=1.5),buttondown:!0,manual:!1}),p(t)}function r(t){var a=l(t),a=a.image.naturalHeight/a.canvas.height;a<1.5&&(a=1.5),l(t,{deltaY:a*=1.5,buttondown:!0,manual:!1}),p(t)}function c(t){l(t,{deltaFactor:1.005,buttondown:!0,manual:!1}),p(t)}function u(t){l(t,{deltaFactor:.995,buttondown:!0,manual:!1}),p(t)}function m(t){l(t,{deltaX:0,deltaY:0,deltaFactor:1,buttondown:!1})}function f(t,a){var n=l(t),o=g(a).X,e=g(a).Y;if(wppaIsFs()&&n.isLightbox&&(o<n.fsMaskLeft||o>n.fsMaskRight||e<n.fsMaskTop||e>n.fsMaskBottom))return l(0,{abort:!0}),void jQuery("#wppa-overlay-bg").trigger("click");n.enableManual&&(l(t,{manual:!0,savedCanvasX:o=b(t,a).X,savedCanvasY:e=b(t,a).Y,buttondown:!1}),p(t))}function w(t,a){a.preventDefault(),a.stopPropagation();var n,o=l(t),e=b(t,a).X,i=b(t,a).Y;o.manual&&(n=o.canvas.width/o.fromWidth,a=(o.savedCanvasX-e)/n+o.fromX,n=(o.savedCanvasY-i)/n+o.fromY,0<a&&0<n&&a+o.fromWidth<o.image.width&&n+o.fromHeight<o.image.height&&l(t,{fromX:a,fromY:n,savedCanvasX:e,savedCanvasY:i}))}function v(t){l(t,{manual:!1})}function l(t,a){if(!wppaZoomData[t])return!1;if(a)for(var n in a)wppaZoomData[t][n]=a[n];return wppaZoomData[t]}function g(t){var a;return t=t.touches?(a=t.touches[0].screenX,t.touches[0].screenY):(a=t.screenX,t.screenY),{X:a,Y:t}}function b(t,a){var n;return a=a.touches?(t=l(t),n=a.touches[0].screenX-t.fsMaskLeft,a.touches[0].screenY-t.fsMaskTop):(n=a.offsetX,a.offsetY),{X:n,Y:a}}function z(){return d=new Date,d.getTime()}o.initialized||o.abort||(o.isLightbox&&(h("#wppa-ovl-spin").show(),h("#wppa-ovl-zoom-container").hide()),o.image.complete?(h(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=h("#wppa-pan-div-"+o.itemId),o.canvas=document.getElementById("wppa-pan-canvas-"+o.itemId),o.left=h("#wppa-pctl-left-"+o.itemId),o.right=h("#wppa-pctl-right-"+o.itemId),o.up=h("#wppa-pctl-up-"+o.itemId),o.down=h("#wppa-pctl-down-"+o.itemId),o.zoomin=h("#wppa-pctl-zoomin-"+o.itemId),o.zoomout=h("#wppa-pctl-zoomout-"+o.itemId),o.prev=h("#wppa-pctl-prev-"+o.itemId),o.next=h("#wppa-pctl-next-"+o.itemId),o.exit=h("#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,o.right.on("touchstart",function(t){e(n)}),o.right.on("touchend",function(t){m(n)}),o.left.on("touchstart",function(t){i(n)}),o.left.on("touchend",function(t){m(n)}),o.up.on("touchstart",function(t){s(n)}),o.up.on("touchend",function(t){m(n)}),o.down.on("touchstart",function(t){r(n)}),o.down.on("touchend",function(t){m(n)}),o.zoomin.on("touchstart",function(t){c(n)}),o.zoomin.on("touchend",function(t){m(n)}),o.zoomout.on("touchstart",function(t){u(n)}),o.zoomout.on("touchend",function(t){m(n)}),o.canvas&&(o.canvas.addEventListener("touchstart",function(t){f(n,t)}),o.canvas.addEventListener("touchmove",function(t){w(n,t)}),o.canvas.addEventListener("touchend",function(t){v(n)})),o.canvas&&(o.canvas.addEventListener("mousedown",function(t){f(n,t)}),o.canvas.addEventListener("mousemove",function(t){w(n,t)}),o.canvas.addEventListener("mouseup",function(t){v(n)}),o.canvas.addEventListener("mouseleave",function(t){(o=l(n)).manual&&l(n,{pause:!0})}),o.canvas.addEventListener("mouseenter",function(t){var a;l(a=n,{pause:!1}).manual&&p(a)}),document.getElementById("wppa-pan-canvas-"+o.itemId).addEventListener("wheel",function(t){var a;a=n,(t=t).preventDefault(),t.stopPropagation(),o=l(a),l(a,{deltaFactor:1+t.deltaY*o.zoomsensitivity/1e4,manual:!1,burrondown:!1}),p(a),setTimeout(function(){l(a,{deltaFactor:1})},25)})),o.right.on("mousedown",function(t){e(n)}),o.right.on("mouseup",function(t){m(n)}),o.left.on("mousedown",function(t){i(n)}),o.left.on("mouseup",function(t){m(n)}),o.up.on("mousedown",function(t){s(n)}),o.up.on("mouseup",function(t){m(n)}),o.down.on("mousedown",function(t){r(n)}),o.down.on("mouseup",function(t){m(n)}),o.zoomin.off("mousedown"),o.zoomin.on("mousedown",function(t){c(n)}),o.zoomin.off("mouseup"),o.zoomin.on("mouseup",function(t){m(n)}),o.zoomout.on("mousedown",function(t){u(n)}),o.zoomout.on("mouseup",function(t){m(n)}),o.isLightbox&&(h("body").on("quitimage",function(t){o=l(n,{abort:!0}),h(o.canvas).hide(),h("#wppa-pctl-div-"+o.itemId).hide(),h("#wppa-ovl-zoom-container").hide()}),h("#wppa-pctl-div-"+o.itemId).on("click",function(t){wppaKillEvent(t)})),o.isLightbox?(h(window).off("resize",wppaOvlShowSame),h(window).on("resize",wppaOvlShowSame)):h(window).on("wpparesizeend",function(t){a(n,t)}),a(n,"force"),o.initialized=!0,l(n,o),h("#wppa-ovl-spin").hide(),wppaProtect()):setTimeout(function(){wppaDoZoomPan(n)},200))}
|
17 |
// wppa-spheric
|
18 |
+
var wppaJsSphericVersion="8.1.06.005";function wppaDoSphericPan(n,e){var t=new Image;t.src=e.url,t.onload=function(){_wppaDoSphericPan(n,e)}}function _wppaDoSphericPan(t,n){var s=jQuery;n&&(wppaSphericData[t]=n);var w=f(t,w);function l(n){var e=f(n);!e.manCtrl&&b()<e.time+25||(f(n,{time:b()}),e.isLightbox&&(!wppaOvlOpen||wppaOvlActivePanorama!=e.id||wppaGlobalOvlPanoramaId>e.uId)&&(abort=!0),e.abort||((e.butDown||e.manCtrl)&&e.autorun&&(e.autorun=!1,e.dX=0),0==e.dX&&0==e.dY&&0==e.dFov&&(e.pause=!0),e.butDown&&(e.pause=!1),e.fov+=e.dFov,e.fov=Math.max(20,Math.min(120,e.fov)),e.wppaCamera=new THREE.PerspectiveCamera(e.fov,e.aspect,1,1e3),e.wppaCamera.target=new THREE.Vector3(0,0,0),e.lon+=e.dX,e.lat+=e.dY,e.lat=Math.max(-85,Math.min(85,e.lat)),e.wppaCamera.target.x=500*Math.sin(THREE.Math.degToRad(90-e.lat))*Math.cos(THREE.Math.degToRad(e.lon)),e.wppaCamera.target.y=500*Math.cos(THREE.Math.degToRad(90-e.lat)),e.wppaCamera.target.z=500*Math.sin(THREE.Math.degToRad(90-e.lat))*Math.sin(THREE.Math.degToRad(e.lon)),e.wppaCamera.lookAt(e.wppaCamera.target),e.wppaRenderer&&e.wppaRenderer.render(e.wppaScene,e.wppaCamera),wppaAdjustControlbar(),s("#wppa-ovl-spin").hide(),e.manCtrl,(e.autorun||!e.pause&&(e.manCtrl||e.butDown))&&e.wppaRenderer&&(e.timer=setTimeout(function(){l(n)},25)),f(n,e)))}function e(n,e){var t=!wppaIsFs();if(w=f(n)){if(w.isLightbox){if(!wppaOvlOpen)return;s("#wppa-overlay-pc").show(),s("#wppa-overlay-pc").css("width","");var a,o,p=(t=!wppaIsFs())?(o=window.innerWidth||screen.width,window.innerHeight||screen.height):(o=screen.width,screen.height),i=8,r=8+(w.controls?w.icsize+10:0)+30;t&&(i+=2*w.borderWidth,r+=2*w.borderWidth),a=(o-i)/2+r<p,r=t?a?(p-(c=(u=o-i)/2)-r)/2+20:(u=2*(c=p-r),20):(u=screen.width,c=screen.height,0),w.aspect=u/c,s("#wppa-ovl-sphericpan-container").css({top:r}),s("#wppa-overlay-pc").css({top:0}),t?(s("#wppa-ovl-sphericpan-container").css({backgroundColor:w.backgroundColor,padding:w.padding+"px",borderRadius:w.borderRadius+"px",width:u}),a?s("#wppa-overlay-pc").css({left:4}):s("#wppa-overlay-pc").css({left:(o-u)/2})):s("#wppa-ovl-sphericpan-container").css({backgroundColor:"transparent",padding:0,borderRadius:"0px",width:u,left:(o-u)/2}),w.wppaRenderer.setSize(u,c)}else{if("force"!=e&&0<w.width&&w.width==u&&w.height==c)return;var u=s(w.div).parent().width(),c=parseInt(u/2);if(!w.wppaRenderer)return;w.wppaRenderer.setSize(u,c)}w.width=u,w.height=c,f(n,w),w.timer=setTimeout(function(){l(n)},250)}}function a(n,e){e.preventDefault(),e.stopPropagation(),w=f(n,{manCtrl:!0,butDown:!1,autorun:!1,dX:0}),e.touches?f(n,{sX:e.touches[0].clientX,sY:e.touches[0].clientY}):f(n,{sX:e.clientX,sY:e.clientY}),f(n,{sLon:w.lon,sLat:w.lat}),l(n)}function o(n,e){e.preventDefault(),e.stopPropagation(),(w=f(n)).manCtrl&&(e.touches?f(n,{lon:.1*(w.sX-e.touches[0].clientX)+w.sLon,lat:.1*(e.touches[0].clientY-w.sY)+w.sLat,pause:!1}):f(n,{lon:.1*(w.sX-e.clientX)+w.sLon,lat:.1*(e.clientY-w.sY)+w.sLat,pause:!1}),l(n))}function p(n){f(n,{manCtrl:!1})}function i(n){w=f(n),f(n,{dFov:-.4*w.mFakt,butDown:!0}),l(n)}function r(n){w=f(n),f(n,{dFov:.4*w.mFakt,butDown:!0}),l(n)}function u(n){w=f(n),f(n,{dX:.2*w.mFakt,butDown:!0}),l(n)}function c(n){w=f(n),f(n,{dX:-.2*w.mFakt,butDown:!0}),l(n)}function h(n){w=f(n),f(n,{dY:.2*w.mFakt,butDown:!0}),l(n)}function m(n){w=f(n),f(n,{dY:-.2*w.mFakt,butDown:!0}),l(n)}function v(n){w=f(n),f(n,{dX:0,dY:0,dFov:0,butDown:!1,manCtrl:!1})}function f(n,e){if(!wppaSphericData[n])return!1;if(e)for(var t in e)wppaSphericData[n][t]=e[t];return wppaSphericData[n]}function b(){return d=new Date,d.getTime()}w.initialized||w.abort||w.isLightbox&&!wppaOvlOpen||(w.wppaRenderer&&(w.wppaRenderer.state.reset(),w.wppaSphere.dispose(),w.wppaSphereMaterial.dispose(),w.texture.dispose()),w.isLightbox&&wppaOvlOpen&&(s("#wppa-ovl-spin").show(),s("#wppa-overlay-ic").html("")),w.manCtrl=!1,w.butDown=!1,w.lon=180,w.lat=0,w.dFov=0,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||(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.applyMatrix4((new THREE.Matrix4).makeScale(-1,1,1)),w.texture=(new THREE.TextureLoader).load(w.url),w.wppaSphereMaterial=new THREE.MeshBasicMaterial({map:w.texture}),w.wppaSphereMesh=new THREE.Mesh(w.wppaSphere,w.wppaSphereMaterial),w.wppaScene.add(w.wppaSphereMesh),w.right.on("touchstart",function(n){u(t)}),w.right.on("touchend",function(n){v(t)}),w.left.on("touchstart",function(n){c(t)}),w.left.on("touchend",function(n){v(t)}),w.up.on("touchstart",function(n){h(t)}),w.up.on("touchend",function(n){v(t)}),w.down.on("touchstart",function(n){m(t)}),w.down.on("touchend",function(n){v(t)}),w.zoomin.on("touchstart",function(n){i(t)}),w.zoomin.on("touchend",function(n){v(t)}),w.zoomout.on("touchstart",function(n){r(t)}),w.zoomout.on("touchend",function(n){v(t)}),w.enableManual&&0<s("#wppa-pan-div-"+t+" canvas").length&&(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){o(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){v(t)}),w.left.on("mousedown",function(n){c(t)}),w.left.on("mouseup",function(n){v(t)}),w.up.on("mousedown",function(n){h(t)}),w.up.on("mouseup",function(n){v(t)}),w.down.on("mousedown",function(n){m(t)}),w.down.on("mouseup",function(n){v(t)}),w.zoomin.off("mousedown"),w.zoomin.on("mousedown",function(n){i(t)}),w.zoomin.off("mouseup"),w.zoomin.on("mouseup",function(n){v(t)}),w.zoomout.on("mousedown",function(n){r(t)}),w.zoomout.on("mouseup",function(n){v(t)}),w.enableManual&&0<s("#wppa-pan-div-"+t+" canvas").length&&(s("#wppa-pan-div-"+t+" canvas").on("mousedown",function(n){a(t,n)}),s("#wppa-pan-div-"+t+" canvas").on("mousemove",function(n){o(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 e;e=t,(n=n).preventDefault(),n.stopPropagation(),w=f(e),f(e,{manCtrl:!1,butDown:!1,autorun:!1,dX:0,dFov:-n.deltaY*w.zoomsensitivity/60}),l(e),setTimeout(function(){f(e,{dFov:0})},25)})),w.isLightbox&&(s("body").on("quitimage",function(n){var e;w=f(e=t,{abort:!0,autorun:!1}),clearTimeout(w.timer),clearInterval(w.intervalTimer),s("#wppa-pan-div-"+e+" canvas").hide(),s("#wppa-pctl-div-"+e).hide(),s("#wppa-overlay-pc").hide()}),s("#wppa-pctl-div-"+t).on("click",function(n){wppaKillEvent(n)})),f(t,w),s(window).on("wpparesizeend",function(n){e(t,n)}),wppaProtect(),s(document).on("tabbychange",function(n){var e;e=t,w.wppaRenderer.state.reset(),w=f(e,{initialized:!1,abort:!0}),setTimeout(function(){f(e,{abort:!1}),wppaDoSphericPan(e)},200)}),e(t,"force"))}
|
js/wppa-spheric.js
CHANGED
@@ -2,10 +2,18 @@
|
|
2 |
//
|
3 |
// contains wppa functions for simple zoomable photos
|
4 |
//
|
5 |
-
var wppaJsSphericVersion = '8.1.06.
|
6 |
|
7 |
// The main proccedure
|
8 |
function wppaDoSphericPan(mocc, xdata) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
var $ = jQuery;
|
11 |
if ( xdata ) wppaSphericData[mocc] = xdata;
|
@@ -139,7 +147,7 @@ function wppaDoSphericPan(mocc, xdata) {
|
|
139 |
// Redo when visible again due to tabby change tab
|
140 |
$(document).on("tabbychange",function(e){tabbyChange(mocc,e)});
|
141 |
|
142 |
-
resize(mocc);
|
143 |
|
144 |
function render(mocc){
|
145 |
|
@@ -301,6 +309,13 @@ function wppaDoSphericPan(mocc, xdata) {
|
|
301 |
// Not lightbox
|
302 |
else {
|
303 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
var containerwidth = $(data.div).parent().width();
|
305 |
newWidth = containerwidth;
|
306 |
newHeight = parseInt( newWidth / 2 ); // * data.height / data.width;
|
2 |
//
|
3 |
// contains wppa functions for simple zoomable photos
|
4 |
//
|
5 |
+
var wppaJsSphericVersion = '8.1.06.005';
|
6 |
|
7 |
// The main proccedure
|
8 |
function wppaDoSphericPan(mocc, xdata) {
|
9 |
+
var img = new Image();
|
10 |
+
img.src = xdata.url;
|
11 |
+
img.onload = function () {
|
12 |
+
_wppaDoSphericPan(mocc, xdata);
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
function _wppaDoSphericPan(mocc, xdata) {
|
17 |
|
18 |
var $ = jQuery;
|
19 |
if ( xdata ) wppaSphericData[mocc] = xdata;
|
147 |
// Redo when visible again due to tabby change tab
|
148 |
$(document).on("tabbychange",function(e){tabbyChange(mocc,e)});
|
149 |
|
150 |
+
resize(mocc,'force');
|
151 |
|
152 |
function render(mocc){
|
153 |
|
309 |
// Not lightbox
|
310 |
else {
|
311 |
|
312 |
+
// See if new sizes differ
|
313 |
+
if (e != 'force') {
|
314 |
+
if (data.width > 0 && data.width == newWidth && data.height == newHeight) {
|
315 |
+
return;
|
316 |
+
}
|
317 |
+
}
|
318 |
+
|
319 |
var containerwidth = $(data.div).parent().width();
|
320 |
newWidth = containerwidth;
|
321 |
newHeight = parseInt( newWidth / 2 ); // * data.height / data.width;
|
js/wppa-spheric.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wppaJsSphericVersion="8.1.06.
|
1 |
+
var wppaJsSphericVersion="8.1.06.005";function wppaDoSphericPan(n,e){var t=new Image;t.src=e.url,t.onload=function(){_wppaDoSphericPan(n,e)}}function _wppaDoSphericPan(t,n){var s=jQuery;n&&(wppaSphericData[t]=n);var w=f(t,w);function l(n){var e=f(n);!e.manCtrl&&b()<e.time+25||(f(n,{time:b()}),e.isLightbox&&(!wppaOvlOpen||wppaOvlActivePanorama!=e.id||wppaGlobalOvlPanoramaId>e.uId)&&(abort=!0),e.abort||((e.butDown||e.manCtrl)&&e.autorun&&(e.autorun=!1,e.dX=0),0==e.dX&&0==e.dY&&0==e.dFov&&(e.pause=!0),e.butDown&&(e.pause=!1),e.fov+=e.dFov,e.fov=Math.max(20,Math.min(120,e.fov)),e.wppaCamera=new THREE.PerspectiveCamera(e.fov,e.aspect,1,1e3),e.wppaCamera.target=new THREE.Vector3(0,0,0),e.lon+=e.dX,e.lat+=e.dY,e.lat=Math.max(-85,Math.min(85,e.lat)),e.wppaCamera.target.x=500*Math.sin(THREE.Math.degToRad(90-e.lat))*Math.cos(THREE.Math.degToRad(e.lon)),e.wppaCamera.target.y=500*Math.cos(THREE.Math.degToRad(90-e.lat)),e.wppaCamera.target.z=500*Math.sin(THREE.Math.degToRad(90-e.lat))*Math.sin(THREE.Math.degToRad(e.lon)),e.wppaCamera.lookAt(e.wppaCamera.target),e.wppaRenderer&&e.wppaRenderer.render(e.wppaScene,e.wppaCamera),wppaAdjustControlbar(),s("#wppa-ovl-spin").hide(),e.manCtrl,(e.autorun||!e.pause&&(e.manCtrl||e.butDown))&&e.wppaRenderer&&(e.timer=setTimeout(function(){l(n)},25)),f(n,e)))}function e(n,e){var t=!wppaIsFs();if(w=f(n)){if(w.isLightbox){if(!wppaOvlOpen)return;s("#wppa-overlay-pc").show(),s("#wppa-overlay-pc").css("width","");var a,o,p=(t=!wppaIsFs())?(o=window.innerWidth||screen.width,window.innerHeight||screen.height):(o=screen.width,screen.height),i=8,r=8+(w.controls?w.icsize+10:0)+30;t&&(i+=2*w.borderWidth,r+=2*w.borderWidth),a=(o-i)/2+r<p,r=t?a?(p-(c=(u=o-i)/2)-r)/2+20:(u=2*(c=p-r),20):(u=screen.width,c=screen.height,0),w.aspect=u/c,s("#wppa-ovl-sphericpan-container").css({top:r}),s("#wppa-overlay-pc").css({top:0}),t?(s("#wppa-ovl-sphericpan-container").css({backgroundColor:w.backgroundColor,padding:w.padding+"px",borderRadius:w.borderRadius+"px",width:u}),a?s("#wppa-overlay-pc").css({left:4}):s("#wppa-overlay-pc").css({left:(o-u)/2})):s("#wppa-ovl-sphericpan-container").css({backgroundColor:"transparent",padding:0,borderRadius:"0px",width:u,left:(o-u)/2}),w.wppaRenderer.setSize(u,c)}else{if("force"!=e&&0<w.width&&w.width==u&&w.height==c)return;var u=s(w.div).parent().width(),c=parseInt(u/2);if(!w.wppaRenderer)return;w.wppaRenderer.setSize(u,c)}w.width=u,w.height=c,f(n,w),w.timer=setTimeout(function(){l(n)},250)}}function a(n,e){e.preventDefault(),e.stopPropagation(),w=f(n,{manCtrl:!0,butDown:!1,autorun:!1,dX:0}),e.touches?f(n,{sX:e.touches[0].clientX,sY:e.touches[0].clientY}):f(n,{sX:e.clientX,sY:e.clientY}),f(n,{sLon:w.lon,sLat:w.lat}),l(n)}function o(n,e){e.preventDefault(),e.stopPropagation(),(w=f(n)).manCtrl&&(e.touches?f(n,{lon:.1*(w.sX-e.touches[0].clientX)+w.sLon,lat:.1*(e.touches[0].clientY-w.sY)+w.sLat,pause:!1}):f(n,{lon:.1*(w.sX-e.clientX)+w.sLon,lat:.1*(e.clientY-w.sY)+w.sLat,pause:!1}),l(n))}function p(n){f(n,{manCtrl:!1})}function i(n){w=f(n),f(n,{dFov:-.4*w.mFakt,butDown:!0}),l(n)}function r(n){w=f(n),f(n,{dFov:.4*w.mFakt,butDown:!0}),l(n)}function u(n){w=f(n),f(n,{dX:.2*w.mFakt,butDown:!0}),l(n)}function c(n){w=f(n),f(n,{dX:-.2*w.mFakt,butDown:!0}),l(n)}function h(n){w=f(n),f(n,{dY:.2*w.mFakt,butDown:!0}),l(n)}function m(n){w=f(n),f(n,{dY:-.2*w.mFakt,butDown:!0}),l(n)}function v(n){w=f(n),f(n,{dX:0,dY:0,dFov:0,butDown:!1,manCtrl:!1})}function f(n,e){if(!wppaSphericData[n])return!1;if(e)for(var t in e)wppaSphericData[n][t]=e[t];return wppaSphericData[n]}function b(){return d=new Date,d.getTime()}w.initialized||w.abort||w.isLightbox&&!wppaOvlOpen||(w.wppaRenderer&&(w.wppaRenderer.state.reset(),w.wppaSphere.dispose(),w.wppaSphereMaterial.dispose(),w.texture.dispose()),w.isLightbox&&wppaOvlOpen&&(s("#wppa-ovl-spin").show(),s("#wppa-overlay-ic").html("")),w.manCtrl=!1,w.butDown=!1,w.lon=180,w.lat=0,w.dFov=0,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||(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.applyMatrix4((new THREE.Matrix4).makeScale(-1,1,1)),w.texture=(new THREE.TextureLoader).load(w.url),w.wppaSphereMaterial=new THREE.MeshBasicMaterial({map:w.texture}),w.wppaSphereMesh=new THREE.Mesh(w.wppaSphere,w.wppaSphereMaterial),w.wppaScene.add(w.wppaSphereMesh),w.right.on("touchstart",function(n){u(t)}),w.right.on("touchend",function(n){v(t)}),w.left.on("touchstart",function(n){c(t)}),w.left.on("touchend",function(n){v(t)}),w.up.on("touchstart",function(n){h(t)}),w.up.on("touchend",function(n){v(t)}),w.down.on("touchstart",function(n){m(t)}),w.down.on("touchend",function(n){v(t)}),w.zoomin.on("touchstart",function(n){i(t)}),w.zoomin.on("touchend",function(n){v(t)}),w.zoomout.on("touchstart",function(n){r(t)}),w.zoomout.on("touchend",function(n){v(t)}),w.enableManual&&0<s("#wppa-pan-div-"+t+" canvas").length&&(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){o(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){v(t)}),w.left.on("mousedown",function(n){c(t)}),w.left.on("mouseup",function(n){v(t)}),w.up.on("mousedown",function(n){h(t)}),w.up.on("mouseup",function(n){v(t)}),w.down.on("mousedown",function(n){m(t)}),w.down.on("mouseup",function(n){v(t)}),w.zoomin.off("mousedown"),w.zoomin.on("mousedown",function(n){i(t)}),w.zoomin.off("mouseup"),w.zoomin.on("mouseup",function(n){v(t)}),w.zoomout.on("mousedown",function(n){r(t)}),w.zoomout.on("mouseup",function(n){v(t)}),w.enableManual&&0<s("#wppa-pan-div-"+t+" canvas").length&&(s("#wppa-pan-div-"+t+" canvas").on("mousedown",function(n){a(t,n)}),s("#wppa-pan-div-"+t+" canvas").on("mousemove",function(n){o(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 e;e=t,(n=n).preventDefault(),n.stopPropagation(),w=f(e),f(e,{manCtrl:!1,butDown:!1,autorun:!1,dX:0,dFov:-n.deltaY*w.zoomsensitivity/60}),l(e),setTimeout(function(){f(e,{dFov:0})},25)})),w.isLightbox&&(s("body").on("quitimage",function(n){var e;w=f(e=t,{abort:!0,autorun:!1}),clearTimeout(w.timer),clearInterval(w.intervalTimer),s("#wppa-pan-div-"+e+" canvas").hide(),s("#wppa-pctl-div-"+e).hide(),s("#wppa-overlay-pc").hide()}),s("#wppa-pctl-div-"+t).on("click",function(n){wppaKillEvent(n)})),f(t,w),s(window).on("wpparesizeend",function(n){e(t,n)}),wppaProtect(),s(document).on("tabbychange",function(n){var e;e=t,w.wppaRenderer.state.reset(),w=f(e,{initialized:!1,abort:!0}),setTimeout(function(){f(e,{abort:!1}),wppaDoSphericPan(e)},200)}),e(t,"force"))}
|
js/wppa-zoom.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
//
|
3 |
// contains wppa functions for simple zoomable photos
|
4 |
//
|
5 |
-
var wppaJsZoomVersion = '8.1.06.
|
6 |
|
7 |
// The main proccedure
|
8 |
function wppaDoZoomPan(mocc, xdata) {
|
@@ -129,11 +129,11 @@ function wppaDoZoomPan(mocc, xdata) {
|
|
129 |
$(window).on("resize",wppaOvlShowSame);
|
130 |
}
|
131 |
else {
|
132 |
-
$(window).on("
|
133 |
}
|
134 |
|
135 |
// Resize
|
136 |
-
resize(mocc);
|
137 |
|
138 |
// We did initialize this occ
|
139 |
data.initialized = true;
|
@@ -297,6 +297,7 @@ function wppaDoZoomPan(mocc, xdata) {
|
|
297 |
function resize(mocc, e){
|
298 |
|
299 |
var data = update(mocc);
|
|
|
300 |
if ( ! data ) return;
|
301 |
|
302 |
if ( data.isLightbox ) {
|
@@ -419,7 +420,6 @@ function wppaDoZoomPan(mocc, xdata) {
|
|
419 |
left:(contWidth-newWidth)/2,
|
420 |
position:"fixed"
|
421 |
});
|
422 |
-
// $("#wppa-pctl-div-" + data.itemId ).css({marginLeft:0});
|
423 |
}
|
424 |
|
425 |
data.ctrlbarUpdate = true;
|
@@ -427,6 +427,9 @@ function wppaDoZoomPan(mocc, xdata) {
|
|
427 |
|
428 |
// Not lightbox
|
429 |
else {
|
|
|
|
|
|
|
430 |
data.canvasWidth = $(data.div).parent().width();
|
431 |
data.canvasHeight = data.canvasWidth / data.imageRatio;
|
432 |
data.canvas.width = data.canvasWidth;
|
@@ -436,35 +439,11 @@ function wppaDoZoomPan(mocc, xdata) {
|
|
436 |
|
437 |
// Save data and render
|
438 |
update(mocc, data);
|
439 |
-
setTimeout(function(){render(mocc)},
|
440 |
|
441 |
$("#wppa-ovl-zoom-container").show();
|
442 |
}
|
443 |
-
/*
|
444 |
-
// Previous in lightbox
|
445 |
-
function panPrev(e) {
|
446 |
-
|
447 |
-
$("#wppa-ovl-spin").show();
|
448 |
-
update(0,{abort:true});
|
449 |
-
wppaOvlShowPrev();
|
450 |
-
}
|
451 |
-
|
452 |
-
// Next in lightbox
|
453 |
-
function panNext(e) {
|
454 |
|
455 |
-
$("#wppa-ovl-spin").show();
|
456 |
-
update(0,{abort:true});
|
457 |
-
wppaOvlShowNext();
|
458 |
-
}
|
459 |
-
|
460 |
-
// Exit lightbox
|
461 |
-
function panExit(e) {
|
462 |
-
|
463 |
-
$("#wppa-ovl-spin").hide();
|
464 |
-
update(0,{abort:true});
|
465 |
-
wppaOvlHide();
|
466 |
-
}
|
467 |
-
*/
|
468 |
// Horizontal movement right by button
|
469 |
function rightDown(mocc, e){
|
470 |
|
2 |
//
|
3 |
// contains wppa functions for simple zoomable photos
|
4 |
//
|
5 |
+
var wppaJsZoomVersion = '8.1.06.005';
|
6 |
|
7 |
// The main proccedure
|
8 |
function wppaDoZoomPan(mocc, xdata) {
|
129 |
$(window).on("resize",wppaOvlShowSame);
|
130 |
}
|
131 |
else {
|
132 |
+
$(window).on("wpparesizeend",function(e){resize(mocc,e)});
|
133 |
}
|
134 |
|
135 |
// Resize
|
136 |
+
resize(mocc,'force');
|
137 |
|
138 |
// We did initialize this occ
|
139 |
data.initialized = true;
|
297 |
function resize(mocc, e){
|
298 |
|
299 |
var data = update(mocc);
|
300 |
+
var oldData = data; // make copy for later
|
301 |
if ( ! data ) return;
|
302 |
|
303 |
if ( data.isLightbox ) {
|
420 |
left:(contWidth-newWidth)/2,
|
421 |
position:"fixed"
|
422 |
});
|
|
|
423 |
}
|
424 |
|
425 |
data.ctrlbarUpdate = true;
|
427 |
|
428 |
// Not lightbox
|
429 |
else {
|
430 |
+
if (e != 'force' && data.canvasWidth == $(data.div).parent().width()) {
|
431 |
+
return;
|
432 |
+
}
|
433 |
data.canvasWidth = $(data.div).parent().width();
|
434 |
data.canvasHeight = data.canvasWidth / data.imageRatio;
|
435 |
data.canvas.width = data.canvasWidth;
|
439 |
|
440 |
// Save data and render
|
441 |
update(mocc, data);
|
442 |
+
setTimeout(function(){render(mocc)},1);
|
443 |
|
444 |
$("#wppa-ovl-zoom-container").show();
|
445 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
447 |
// Horizontal movement right by button
|
448 |
function rightDown(mocc, e){
|
449 |
|
js/wppa-zoom.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wppaJsZoomVersion="8.1.06.
|
1 |
+
var wppaJsZoomVersion="8.1.06.005";function wppaDoZoomPan(n,t){var h=jQuery;t&&(wppaZoomData[n]=t);var o=l(n);function p(t){var a,n,o,e,i,s=l(t);s.canvas&&(z()<s.time+10||(l(t,{time:z()}),(s.isLightbox&&!wppaOvlOpen||!s.isLightbox&&wppaOvlOpen)&&(s=l(0,{abort:!0})),s.abort?l(t,{manual:!1,buttondown:!1,pause:!1,ctx:null}):s.busy||(wppaDebugCounter++,e=(s=l(t,{busy:!0})).fromX,i=s.fromY,s.manual||(s.fromX+=s.deltaX,s.fromY+=s.deltaY,a=s.fromHeight/s.deltaFactor,n=s.fromWidth/s.deltaFactor,50<a&&(wppaIsFs()||a<=s.image.height)?(s.fromX-=(n-s.fromWidth)/2,s.fromY-=(a-s.fromHeight)/2,s.fromWidth=n,s.fromHeight=a):s.buttondown=!1),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==s.fromX&&i==s.fromY&&1==s.deltaFactor&&(s.buttondown=!1),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,wppaIsElementInViewport(s.canvas)||(s.buttondown=!1),l(t,s),s.pause||!s.manual&&!s.buttondown||setTimeout(function(){p(t)},10),s.pause&&l(t,{pause:!1}))))}function a(t,a){var n,o=l(t);if(o){if(o.isLightbox){h("#wppa-overlay-zpc").css("display","");var e,i,s,r=!wppaIsFs(),c=r?(e=window.innerWidth||screen.width,window.innerHeight||screen.height):(e=screen.width,screen.height),d=0,u=8,m=8+(o.controls?o.icsize+10:0)+10;r?(u+=2*o.borderWidth,m+=2*o.borderWidth):u=40,n=r?c-m>(e-u)/o.imageRatio:(screenRatio=screen.width/screen.height,screenRatio<o.imageRatio),r&&n&&(d=(c-(s=(i=e-u)/o.imageRatio)-m)/2+20),r&&!n&&(s=(i=o.imageRatio*(c-(o.controls?o.icsize:0)-48))/o.imageRatio,d=20),!r&&n&&(i=(s=screen.height)*o.imageRatio,d=0),r||n||(s=(i=screen.width)/o.imageRatio,d=(screen.height-s)/2),h("#wppa-ovl-zoom-container").css({top:d}),h("#wppa-overlay-zpc").css({top:0,left:0}),o.canvasWidth=i,o.canvasHeight=s,o.canvas.width=o.canvasWidth,o.canvas.height=o.canvasHeight,r?(h("#wppa-ovl-zoom-container").css({backgroundColor:o.backgroundColor,padding:o.padding,borderRadius:o.borderRadius+"px",borderWidth:o.borderWidth+"px",width:i,marginLeft:0}),n?h("#wppa-overlay-zpc").css({left:4}):h("#wppa-overlay-zpc").css({left:(e-i)/2})):(h("#wppa-overlay-zpc").css({marginLeft:0}),h("#wppa-ovl-zoom-container").css({backgroundColor:"transparent",padding:0,borderRadius:"0px",borderWidth:"0px",width:i,left:(e-i)/2,position:"fixed"})),o.ctrlbarUpdate=!0}else{if("force"!=a&&o.canvasWidth==h(o.div).parent().width())return;o.canvasWidth=h(o.div).parent().width(),o.canvasHeight=o.canvasWidth/o.imageRatio,o.canvas.width=o.canvasWidth,o.canvas.height=o.canvasHeight,o.ctrlbarUpdate=!0}l(t,o),setTimeout(function(){p(t)},1),h("#wppa-ovl-zoom-container").show()}}function e(t){var a=l(t),a=a.image.naturalWidth/a.canvas.width;a<1.5&&(a=1.5),l(t,{deltaX:a*=1.5,buttondown:!0,manual:!1}),p(t)}function i(t){var a=l(t),a=a.image.naturalWidth/a.canvas.width;a<1.5&&(a=1.5),l(t,{deltaX:-(a*=1.5),buttondown:!0,manual:!1}),p(t)}function s(t){var a=l(t),a=a.image.naturalHeight/a.canvas.height;a<1.5&&(a=1.5),l(t,{deltaY:-(a*=1.5),buttondown:!0,manual:!1}),p(t)}function r(t){var a=l(t),a=a.image.naturalHeight/a.canvas.height;a<1.5&&(a=1.5),l(t,{deltaY:a*=1.5,buttondown:!0,manual:!1}),p(t)}function c(t){l(t,{deltaFactor:1.005,buttondown:!0,manual:!1}),p(t)}function u(t){l(t,{deltaFactor:.995,buttondown:!0,manual:!1}),p(t)}function m(t){l(t,{deltaX:0,deltaY:0,deltaFactor:1,buttondown:!1})}function f(t,a){var n=l(t),o=g(a).X,e=g(a).Y;if(wppaIsFs()&&n.isLightbox&&(o<n.fsMaskLeft||o>n.fsMaskRight||e<n.fsMaskTop||e>n.fsMaskBottom))return l(0,{abort:!0}),void jQuery("#wppa-overlay-bg").trigger("click");n.enableManual&&(l(t,{manual:!0,savedCanvasX:o=b(t,a).X,savedCanvasY:e=b(t,a).Y,buttondown:!1}),p(t))}function w(t,a){a.preventDefault(),a.stopPropagation();var n,o=l(t),e=b(t,a).X,i=b(t,a).Y;o.manual&&(n=o.canvas.width/o.fromWidth,a=(o.savedCanvasX-e)/n+o.fromX,n=(o.savedCanvasY-i)/n+o.fromY,0<a&&0<n&&a+o.fromWidth<o.image.width&&n+o.fromHeight<o.image.height&&l(t,{fromX:a,fromY:n,savedCanvasX:e,savedCanvasY:i}))}function v(t){l(t,{manual:!1})}function l(t,a){if(!wppaZoomData[t])return!1;if(a)for(var n in a)wppaZoomData[t][n]=a[n];return wppaZoomData[t]}function g(t){var a;return t=t.touches?(a=t.touches[0].screenX,t.touches[0].screenY):(a=t.screenX,t.screenY),{X:a,Y:t}}function b(t,a){var n;return a=a.touches?(t=l(t),n=a.touches[0].screenX-t.fsMaskLeft,a.touches[0].screenY-t.fsMaskTop):(n=a.offsetX,a.offsetY),{X:n,Y:a}}function z(){return d=new Date,d.getTime()}o.initialized||o.abort||(o.isLightbox&&(h("#wppa-ovl-spin").show(),h("#wppa-ovl-zoom-container").hide()),o.image.complete?(h(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=h("#wppa-pan-div-"+o.itemId),o.canvas=document.getElementById("wppa-pan-canvas-"+o.itemId),o.left=h("#wppa-pctl-left-"+o.itemId),o.right=h("#wppa-pctl-right-"+o.itemId),o.up=h("#wppa-pctl-up-"+o.itemId),o.down=h("#wppa-pctl-down-"+o.itemId),o.zoomin=h("#wppa-pctl-zoomin-"+o.itemId),o.zoomout=h("#wppa-pctl-zoomout-"+o.itemId),o.prev=h("#wppa-pctl-prev-"+o.itemId),o.next=h("#wppa-pctl-next-"+o.itemId),o.exit=h("#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,o.right.on("touchstart",function(t){e(n)}),o.right.on("touchend",function(t){m(n)}),o.left.on("touchstart",function(t){i(n)}),o.left.on("touchend",function(t){m(n)}),o.up.on("touchstart",function(t){s(n)}),o.up.on("touchend",function(t){m(n)}),o.down.on("touchstart",function(t){r(n)}),o.down.on("touchend",function(t){m(n)}),o.zoomin.on("touchstart",function(t){c(n)}),o.zoomin.on("touchend",function(t){m(n)}),o.zoomout.on("touchstart",function(t){u(n)}),o.zoomout.on("touchend",function(t){m(n)}),o.canvas&&(o.canvas.addEventListener("touchstart",function(t){f(n,t)}),o.canvas.addEventListener("touchmove",function(t){w(n,t)}),o.canvas.addEventListener("touchend",function(t){v(n)})),o.canvas&&(o.canvas.addEventListener("mousedown",function(t){f(n,t)}),o.canvas.addEventListener("mousemove",function(t){w(n,t)}),o.canvas.addEventListener("mouseup",function(t){v(n)}),o.canvas.addEventListener("mouseleave",function(t){(o=l(n)).manual&&l(n,{pause:!0})}),o.canvas.addEventListener("mouseenter",function(t){var a;l(a=n,{pause:!1}).manual&&p(a)}),document.getElementById("wppa-pan-canvas-"+o.itemId).addEventListener("wheel",function(t){var a;a=n,(t=t).preventDefault(),t.stopPropagation(),o=l(a),l(a,{deltaFactor:1+t.deltaY*o.zoomsensitivity/1e4,manual:!1,burrondown:!1}),p(a),setTimeout(function(){l(a,{deltaFactor:1})},25)})),o.right.on("mousedown",function(t){e(n)}),o.right.on("mouseup",function(t){m(n)}),o.left.on("mousedown",function(t){i(n)}),o.left.on("mouseup",function(t){m(n)}),o.up.on("mousedown",function(t){s(n)}),o.up.on("mouseup",function(t){m(n)}),o.down.on("mousedown",function(t){r(n)}),o.down.on("mouseup",function(t){m(n)}),o.zoomin.off("mousedown"),o.zoomin.on("mousedown",function(t){c(n)}),o.zoomin.off("mouseup"),o.zoomin.on("mouseup",function(t){m(n)}),o.zoomout.on("mousedown",function(t){u(n)}),o.zoomout.on("mouseup",function(t){m(n)}),o.isLightbox&&(h("body").on("quitimage",function(t){o=l(n,{abort:!0}),h(o.canvas).hide(),h("#wppa-pctl-div-"+o.itemId).hide(),h("#wppa-ovl-zoom-container").hide()}),h("#wppa-pctl-div-"+o.itemId).on("click",function(t){wppaKillEvent(t)})),o.isLightbox?(h(window).off("resize",wppaOvlShowSame),h(window).on("resize",wppaOvlShowSame)):h(window).on("wpparesizeend",function(t){a(n,t)}),a(n,"force"),o.initialized=!0,l(n,o),h("#wppa-ovl-spin").hide(),wppaProtect()):setTimeout(function(){wppaDoZoomPan(n)},200))}
|
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: 8.1.06.
|
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_api_version;
|
27 |
-
$wppa_api_version = '8.1.06.
|
28 |
global $wppa_revno;
|
29 |
$wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
|
30 |
|
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: 8.1.06.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_api_version;
|
27 |
+
$wppa_api_version = '8.1.06.005'; // WPPA software version
|
28 |
global $wppa_revno;
|
29 |
$wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
|
30 |
|