PageSourceSearch

https://aimexpousa.com/wp-content/plugins/wp-photo-album-plus/js/wppa-flatpan.js?ver=260922-144502

js aimexpousa.com collected 2026-09-25 18:46:34 UTC 11,193 bytes, 50 lines download raw bytes

1var wppaJsFlatPanVersion='9.0.08.002';function wppaDoFlatPanorama(mocc,xdata){wppaFlatpanData[mocc]=xdata;var data=update(mocc,{image:document.getElementById("wppa-"+xdata.itemId)});data.ratio=data.slide?(1/wppaAspectRatio[mocc]):2;data.manualControl=false;data.deltaY=0;data.deltaFactor=1.0;data.run=data.deltaX?5:4;data.abort=false;data.div=jQuery("#wppa-pan-div-"+mocc);data.canvas=document.getElementById("wppa-pan-canvas-"+mocc);data.prevCanvas=document.getElementById("wppa-pan-prev-canvas-"+mocc);data.pctldiv=jQuery("#wppa-pctl-div-"+mocc);data.left=jQuery("#wppa-pctl-left-"+mocc);data.right=jQuery("#wppa-pctl-right-"+mocc);data.up=jQuery("#wppa-pctl-up-"+mocc);data.down=jQuery("#wppa-pctl-down-"+mocc);data.zoomin=jQuery("#wppa-pctl-zoomin-"+mocc);data.zoomout=jQuery("#wppa-pctl-zoomout-"+mocc);data.prev=jQuery("#wppa-pctl-prev-"+mocc);data.next=jQuery("#wppa-pctl-next-"+mocc);data.canvasWidth=jQuery(data.div).parent().width();data.canvasHeight=data.canvasWidth/data.ratio;data.savedCanvasX=0;data.savedCanvasY=0;data.fromHeight=data.image.height/data.ratio;data.fromWidth=data.fromHeight*data.ratio;data.fromX=(data.image.width-data.fromWidth)/data.ratio;data.fromY=(data.image.height-data.fromHeight)/data.ratio;data.centerX=data.fromX+data.fromWidth/data.ratio;data.centerY=data.fromY+data.fromHeight/data.ratio;data.wppaFlatLastRenderTime=0;data.right.on("touchstart",function(e){rightDown(mocc,e)});data.right.on("touchend",function(e){buttonUp(mocc,e)});data.left.on("touchstart",function(e){leftDown(mocc,e)});data.left.on("touchend",function(e){buttonUp(mocc,e)});data.up.on("touchstart",function(e){upDown(mocc,e)});data.up.on("touchend",function(e){buttonUp(mocc,e)});data.down.on("touchstart",function(e){downDown(mocc,e)});data.down.on("touchend",function(e){buttonUp(mocc,e)});data.zoomin.on("touchstart",function(e){zoomInDown(mocc,e)});data.zoomin.on("touchend",function(e){buttonUp(mocc,e)});data.zoomout.on("touchstart",function(e){zoomOutDown(mocc,e)});data.zoomout.on("touchend",function(e){buttonUp(mocc,e)});if(data.manual){data.canvas.addEventListener("mousedown",function(e){onCanvasMouseDown(mocc,e)});data.canvas.addEventListener("mousemove",function(e){onCanvasMouseMove(mocc,e)});data.canvas.addEventListener("mouseup",function(e){onCanvasMouseUp(mocc,e)});data.canvas.addEventListener("mouseout",function(e){onCanvasMouseUp(mocc,e)});document.getElementById("wppa-pan-canvas-"+mocc).addEventListener("wheel",function(e){onDivWheel(mocc,e)});if(data.prevCanvas){data.prevCanvas.addEventListener("mousedown",function(e){onCanvasMouseDown(mocc,e)});data.prevCanvas.addEventListener("mousemove",function(e){onPrevCanvasMouseMove(mocc,e)});data.prevCanvas.addEventListener("mouseup",function(e){onCanvasMouseUp(mocc,e)});data.prevCanvas.addEventListener("mouseout",function(e){onCanvasMouseUp(mocc,e)});}}
2data.right.on("mousedown",function(e){rightDown(mocc,e)});data.right.on("mouseup",function(e){buttonUp(mocc,e)});data.left.on("mousedown",function(e){leftDown(mocc,e)});data.left.on("mouseup",function(e){buttonUp(mocc,e)});data.up.on("mousedown",function(e){upDown(mocc,e)});data.up.on("mouseup",function(e){buttonUp(mocc,e)});data.down.on("mousedown",function(e){downDown(mocc,e)});data.down.on("mouseup",function(e){buttonUp(mocc,e)});data.zoomin.on("mousedown",function(e){zoomInDown(mocc,e)});data.zoomin.on("mouseup",function(e){buttonUp(mocc,e)});data.zoomout.on("mousedown",function(e){zoomOutDown(mocc,e)});data.zoomout.on("mouseup",function(e){buttonUp(mocc,e)});jQuery("body").on("quitimage",function(e,arg){if(typeof(arg)=='undefined'||arg==mocc)quitImage(mocc,e);});if(data.isLightbox){jQuery("#wppa-pctl-div-"+data.itemId).on("click",function(e){wppaKillEvent(e)});}
3if(data.isLightbox){jQuery(window).off("resize",wppaOvlShowSame);jQuery(window).on("resize",wppaOvlShowSame);}
4else{jQuery(window).on("resize",function(e){resize(mocc,e)});}
5update(mocc,data);resize(mocc);jQuery("#wppa-ovl-spin").hide();wppaProtect();function render(mocc){var data=update(mocc);if(!data.canvas){return;}
6if(data.isLightbox){if(!wppaOvlOpen){data.abort=true;}}
7else{if(!wppaIsElementInViewport(data.canvas)){setTimeout(function(){render(mocc)},200);return;}}
8if(data.abort){update(mocc,{ctx:null,prevctx:null});return;}
9if(data.run==0){return;}
10var curTime=timnow();if(data.autorun&&curTime<data.wppaFlatLastRenderTime+25){return;}
11data.wppaFlatLastRenderTime=curTime;if(!data.manualControl){data.fromX+=data.deltaX;data.fromY+=data.deltaY;var newHeight=data.fromHeight/data.deltaFactor;var newWidth=data.fromWidth/data.deltaFactor;if(data.deltaFactor!=1&&newHeight<=data.image.height&&newHeight>50){data.fromX-=(newWidth-data.fromWidth)/data.ratio;data.fromY-=(newHeight-data.fromHeight)/data.ratio;data.fromWidth=newWidth;data.fromHeight=newHeight;}}
12data.fromX=Math.max(0,Math.min(data.image.width-data.fromWidth,data.fromX));data.fromY=Math.max(0,Math.min(data.image.height-data.fromHeight,data.fromY));if(data.autorun){if(data.fromX==0||data.fromX==(data.image.width-data.fromWidth)){data.deltaX*=-1;}}
13var ctx=data.canvas.getContext("2d");ctx.drawImage(data.image,data.fromX,data.fromY,data.fromWidth,data.fromHeight,0,0,data.canvas.width,data.canvas.height);jQuery(data.canvas).css({display:'inline'});if(data.prevCanvas){var prevctx=data.prevCanvas.getContext("2d");prevctx.clearRect(0,0,data.prevCanvas.width,data.prevCanvas.height);prevctx.drawImage(data.image,0,0,data.image.width,data.image.height,0,0,data.prevCanvas.width,data.prevCanvas.height);jQuery(data.prevCanvas).css({display:'inline'});var factor=data.prevCanvas.width/data.image.width;prevctx.strokeRect(factor*data.fromX,factor*data.fromY,factor*data.fromWidth,factor*data.fromHeight);}
14if(data.run>0){timer=setTimeout(function(){render(mocc)},25);}
15if(data.run<5)data.run--;wppaHasControlbar=true;wppaAdjustControlbar(mocc);update(mocc,data);}
16function resize(mocc){var data=update(mocc);if(data.abort)return;if(data.isLightbox){jQuery("#wppa-overlay-fpc").css("display","");var widthIsLim,modeIsNormal=!wppaIsFs();var contWidth,contHeight;if(modeIsNormal){contWidth=window.innerWidth?window.innerWidth:screen.width;contHeight=window.innerHeight?window.innerHeight:screen.height;}
17else{contWidth=screen.width;contHeight=screen.height;}
18var topMarg,leftMarg,extraX=8,extraY=24+(data.controls?data.icsize:0)+contWidth*data.height/data.width+40;if(modeIsNormal){extraX+=2*data.padding;extraY+=2*data.padding;}
19widthIsLim=(contHeight>((contWidth/data.ratio)+extraY));if(widthIsLim){newWidth=contWidth-extraX;newHeight=newWidth/data.ratio;
19topMarg=(contHeight-newHeight-extraY)/2+20;}
20else{newWidth=data.ratio*(contHeight-(data.controls?data.icsize:0)-24-40)/(1+2*data.height/data.width);newHeight=newWidth/data.ratio;topMarg=20;}
21jQuery("#wppa-ovl-flatpan-container").css({top:topMarg,marginTop:0});data.canvas.width=newWidth;data.canvas.height=newHeight;if(data.prevCanvas){data.prevCanvas.width=newWidth;data.prevCanvas.height=newWidth*data.height/data.width;}
22if(modeIsNormal){jQuery("#wppa-ovl-flatpan-container").css({backgroundColor:data.backgroundColor,padding:data.padding,borderRadius:data.borderRadius,width:newWidth,marginLeft:0});if(widthIsLim){jQuery("#wppa-overlay-fpc").css({left:4});}
23else{jQuery("#wppa-overlay-fpc").css({left:(contWidth-newWidth)/2});}
24wppaAdjustControlbar(mocc);}
25else{jQuery("#wppa-overlay-fpc").css({marginLeft:0});jQuery("#wppa-ovl-flatpan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,width:newWidth,left:(contWidth-newWidth)/2});wppaAdjustControlbar(mocc);}
26data.run=(data.autorun?5:4);}
27else{if(data.slide){var cw=wppaGetContainerWidth(mocc);var pch=data.pancontrolheight;if(pch>0)pch+=5;var frameRatio=wppaAspectRatio[mocc];data.canvasWidth=cw;data.canvasHeight=cw*frameRatio-pch;jQuery(data.pctldiv).css({width:cw});jQuery('#slide_frame-'+mocc).css({height:(data.canvasHeight+pch)});}
28else{data.canvasWidth=jQuery(data.div).parent().width();data.canvasHeight=data.canvasWidth/data.ratio;}
29data.canvas.width=data.canvasWidth;data.canvas.height=data.canvasHeight;if(data.prevCanvas){data.prevCanvas.width=data.canvasWidth;data.prevCanvas.height=data.canvasWidth*data.height/data.width;}
30data.run=(data.autorun?5:4);}
31update(mocc,data);render(mocc);}
32function rightDown(mocc,e){update(mocc,{autorun:false,run:5,deltaX:3,deltaY:0});render(mocc);}
33function leftDown(mocc,e){update(mocc,{autorun:false,run:5,deltaX:-3,deltaY:0});render(mocc);}
34function upDown(mocc,e){update(mocc,{autorun:false,run:5,deltaX:0,deltaY:-3});render(mocc);}
35function downDown(mocc,e){update(mocc,{autorun:false,run:5,deltaX:0,deltaY:3});render(mocc);}
36function zoomInDown(mocc,e){update(mocc,{deltaX:0,deltaY:0,autorun:false,run:5,deltaFactor:1.005});render(mocc);}
37function zoomOutDown(mocc,e){update(mocc,{deltaX:0,deltaY:0,autorun:false,run:5,deltaFactor:0.995});render(mocc);}
38function onDivWheel(mocc,e){e.preventDefault();e.stopPropagation();var data=update(mocc);update(mocc,{deltaX:0,deltaY:0,autorun:false,run:4,deltaFactor:1+e.deltaY*data.zoomsensitivity/10000});render(mocc);setTimeout(function(){update(mocc,{deltaFactor:1});},25);}
39function buttonUp(mocc,e){e.preventDefault();update(mocc,{autorun:false,deltaX:0,deltaY:0,deltaFactor:1,run:4});}
40function onCanvasMouseDown(mocc,e){e.preventDefault();update(mocc,{manualControl:true,autorun:false,deltaX:0,savedCanvasX:e.offsetX,savedCanvasY:e.offsetY,run:5});render(mocc);}
41function onCanvasMouseMove(mocc,e){var data=update(mocc);if(data.manualControl){update(mocc,{autorun:false,deltaX:0});var factor=data.canvas.width/data.fromWidth;var x=(data.savedCanvasX-e.offsetX)/factor+data.fromX;var y=(data.savedCanvasY-e.offsetY)/factor+data.fromY;if(x>0&&y>0&&(x+data.fromWidth)<data.image.width&&(y+data.fromHeight)<data.image.height){update(mocc,{fromX:x,fromY:y,savedCanvasX:e.offsetX,savedCanvasY:e.offsetY});}}}
42function onPrevCanvasMouseMove(mocc,e){var data=update(mocc);var factor=data.prevCanvas.width/data.image.width;if(e.offsetX>factor*data.fromX&&e.offsetX<factor*(data.fromX+data.fromWidth)&&e.offsetY>factor*data.fromY&&e.offsetY<factor*(data.fromY+data.fromHeight)){jQuery(data.prevCanvas).css("cursor","grab");}
43else{jQuery(data.prevCanvas).css("cursor","default");}
44if(data.manualControl){data.autorun=false;data.deltaX=0;if(e.offsetX>factor*data.fromX&&e.offsetX<factor*(data.fromX+data.fromWidth)&&e.offsetY>factor*data.fromY&&e.offsetY<factor*(data.fromY+data.fromHeight)){data.fromX=(e.offsetX-data.savedCanvasX)/factor+data.fromX;data.fromY=(e.offsetY-data.savedCanvasY)/factor+data.fromY;data.savedCanvasX=e.offsetX;data.savedCanvasY=e.offsetY;}}
45update(mocc,data);}
46function onCanvasMouseUp(mocc,e){var data=update(mocc);if(data.manualControl){update(mocc,{run:4,manualControl:false});}}
47function update(mocc,data){if(!wppaFlatpanData[mocc])return false;
47if(data){for(var property in data){wppaFlatpanData[mocc][property]=data[property];}}
48return wppaFlatpanData[mocc];}
49function timnow(){d=new Date();return d.getTime();}
50function quitImage(mocc,e){clearTimeout(data.timer);wppaFlatpanData[mocc]=[];data=update(mocc,{abort:true,run:0,autorun:false});jQuery(data.canvas).html('');jQuery(data.prevCanvas).html('');jQuery("#wppa-pctl-div-"+mocc).html('');}}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.