Ignore:
Timestamp:
Nov 11, 2011, 12:10:02 AM (12 years ago)
Author:
grum
Message:

feature:2499 - compatibility with Piwigo 2.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/gally/gally-default/js/gallyjs-tpp.min.js

    r10972 r12592  
    1 /* file: gally-tpp.js - v1.4.0 | minified on 2011/05/01 with http://jscompress.com/ */
    2 var gallyPP=null;$(document).ready(function()
    3 {gallyPP=new GallyPP();});function GallyPP(){var tabs={show:'n',current:-1,selected:-1},interface={visible:false,initialized:0,timerDelay:null},image={isScrollable:false,highWidth:0,highHeight:0,leftPos:0,zoomMode:''},container=null,init=function()
    4 {var regexp=/[1234567]\./i;if(jQuery.browser.msie&&jQuery.browser.version.match(regexp))
    5 {options.interfaceAnimated="none";options.imageAutoScroll=false;}
    6 if(options.imageAutoScroll)
    7 {$("html").css("overflow-x","hidden");}
    8 else
    9 {$("html").css("overflow-x","scroll");}
    10 if(options.imageCenterTopBorder=="imageHeaderBar")
    11 {options.imageCenterTopMin+=$("#imageHeaderBar").get(0).offsetTop+$("#imageHeaderBar").get(0).offsetHeight;}
    12 if(!options.interfaceCanSwitch)
    13 {options.interfaceHidden=false;}
    14 image.zoomMode=options.defaultZoomSize;switchInterface('0',true);initializeImageMode("init");if((options.interfaceOnImage=="always"||(options.interfaceOnImage=="noscroll"&&!image.isScrollable))&&options.interfaceCanSwitch)
    15 {$("#theImg").bind("mouseenter",function(){switchInterface('y',true);}).bind("mouseleave",function(){switchInterface('n',true);}).bind("mousemove",function(){switchInterface('y',true);});}
    16 if(options.interfaceCanSwitch)
    17 {$("#imageHeaderBar").bind("mouseenter",function(){switchInterface('y',false);}).bind("mousemove",function(){switchInterface('y',false);});$("#imageToolBar").bind("mouseenter",function(){switchInterface('y',true);}).bind("mouseleave",function(){switchInterface('n',true);}).bind("mousemove",function(){switchInterface('y',true);});$("#navThumbPrev").bind("mouseenter",function(){switchInterface('Y',true);}).bind("mouseleave",function(){switchInterface('n',true);}).bind("mousemove",function(){switchInterface('y',true);});$("#navThumbNext").bind("mouseenter",function(){switchInterface('Y',true);}).bind("mouseleave",function(){switchInterface('n',true);}).bind("mousemove",function(){switchInterface('y',true);});}
    18 $("#navThumbPrev").css("top",$("#navThumbPrev").attr("offsetTop")+$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight")+"px");$("#navThumbNext").css("top",$("#navThumbNext").attr("offsetTop")+$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight")+"px");$("#theImage").css("top",$("#theImage").attr("offsetTop")+$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight")+"px");$("#contentid").attr("rows",options.commentRows);if(options.animateDelay>0)
    19 {$("#theTabs").tabs({fx:{opacity:'toggle',duration:options.animateDelay}});}
    20 else
    21 {$("#theTabs").tabs();}
    22 switchTabs('n');if(options.interfaceCanSwitch)
    23 {$('#theTabsContainer').bind("mouseenter",function(){switchInterface('Y',false);}).bind("mouseleave",function(){switchInterface('n');}).bind("mousemove",function(){switchInterface('y',false);});}
    24 $("#theTabs").bind('tabsselect',function(event,ui)
    25 {tabs.selected=ui.index;});$('.tab a').click(function()
    26 {$(this).get(0).blur();if(tabs.selected==tabs.current)
    27 {if(tabs.current!=-1)switchTabs('n');tabs.current=-1;tabs.selected=-1;}
    28 else
    29 {if(tabs.current==-1)switchTabs('y');tabs.current=tabs.selected;}});$(window).resize(function(){initializeImageMode("resize");});interface.initialized=1;$(document).trigger('gallyInterfaceReady');},simulateHighRes=function()
    30 {if(image.isScrollable&&options.imageHaveHighRes==false&&options.imageSimulateHighRes)
    31 {$('#theImgContainer').bind('click',function()
    32 {openDisplayHigh($('#theImg').attr('src'));}).addClass('pointer');}},initializeImageMode=function(mode)
    33 {var thumbWidth=0,imgTop=0,cssValues=new Object;if(mode=="init")
    34 {theHeaderHeight=$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight");$("#imageToolBar").css("top",$("#imageToolBar").attr("offsetTop")+theHeaderHeight+$("#imageHeaderBar").attr("offsetHeight")+"px");if(options.tabsPosition=="bottom")
    35 {copyrightArea=$("#copyright").attr("clientHeight")+1;$("#theTabsContainer").css("bottom",copyrightArea+"px");}
    36 else if(options.tabsPosition=="top")
    37 {toolBarArea=$("#imageToolBar").attr("offsetTop")+$("#imageToolBar").attr("offsetHeight");$("#theTabsContainer").css("top",toolBarArea+"px");}
    38 if($("#navThumbPrev").length>0)
    39 {$("#navThumbPrev").css("height",$("#copyright").attr("offsetTop")-$("#navThumbPrev").attr("offsetTop")-options.tabsHidden+"px");}
    40 if($("#navThumbNext").length>0)
    41 {$("#navThumbNext").css("height",$("#copyright").attr("offsetTop")-$("#navThumbNext").attr("offsetTop")-options.tabsHidden+"px");}}
    42 cssValues.height=$("#theImg").attr("height")+"px";if(options.imageAutoScroll&&($("#theImg").attr("scrollWidth")>($("#theImage").attr("clientWidth")-2*options.marginContainer)))
    43 {cssValues.width=($("#theImage").attr("clientWidth")-2*(options.marginContainer+options.paddingContainer))+"px";$("#theImage").bind("mousemove",function(event){if($("#navThumbPrev").length>0)thumbWidth=$("#navThumbPrev").attr("clientWidth");deadArea=Math.max(options.imageScrollMinDeadArea,thumbWidth*1.2);mouse=Math.max(Math.min(event.clientX-image.leftPos,this.clientWidth-deadArea),deadArea);$("#theImg").css("left",Math.round(($("#theImg").attr("scrollWidth")-this.clientWidth)*-(mouse-deadArea)/(this.clientWidth-2*deadArea))+"px").trigger('scrolled');});image.isScrollable=true;}
    44 else
    45 {$("#theImage").unbind("mousemove");$("#theImg").css("left","0px");cssValues.width=$("#theImg").attr("scrollWidth")+"px";image.isScrollable=false;}
    46 $("#theImgContainer").css(cssValues);if($("#copyright").css("position")=="fixed")
    47 {$("#theImage").css("padding-bottom",$("#copyright").attr("offsetHeight")+"px");}
    48 switch(options.imageCenterMode)
    49 {case"img":imgTop=$("#theImgContainer").attr('offsetHeight');break;case"all":imgTop=$("#theImage").attr('offsetHeight');break;default:imgTop=-10000;break;}
    50 imgTop=($("#copyright").attr("offsetTop")-($("#imageHeaderBar").attr("offsetTop")+$("#imageHeaderBar").attr("offsetHeight"))-imgTop)/2+options.imageCenterOffset;if(imgTop<options.imageCenterTopMin)
    51 {imgTop=options.imageCenterTopMin;}
    52 imgTop=imgTop+"px";$("#theImage").css("top",imgTop);image.leftPos=$('#theImage').offset().left;simulateHighRes();},switchInterface=function(show,resetTimer)
    53 {if((interface.initialized==1)&&(options.interfaceHidden))
    54 {interface.initialized=2;if(show=="Y")return('');}
    55 if(!options.interfaceHidden&&show=="0"){show="1";}
    56 if(options.interfaceAnimated=="fade")
    57 {switch(show)
    58 {case'0':$(".uiImg").css({opacity:0,visibility:"hidden"});interface.visible=false;break;case'1':if(!interface.visible)$(".uiImg").css({opacity:1,visibility:"visible"});interface.visible=true;if(resetTimer)resetInterfaceTimer();break;case'2':case'Y':case'y':if(!interface.visible)$(".uiImg").css("visibility","visible").stop(true,false).fadeTo(options.animateDelay,1);interface.visible=true;if(resetTimer)resetInterfaceTimer();break;default:$(".uiImg").stop(true,false).fadeTo(options.animateDelay,0,function()
    59 {this.style.visibility="hidden";interface.visible=false;});clearInterfaceTimer();break;}}
    60 else
    61 {switch(show)
    62 {case'y':case'Y':case'1':case'2':if(!interface.visible)$(".uiImg").css("visibility","visible");interface.visible=true;if(resetTimer)resetInterfaceTimer();break;default:$(".uiImg").css("visibility","hidden");interface.visible=false;clearInterfaceTimer();break;}}},switchTabs=function(show)
    63 {if(show!='')
    64 {tabs.show=show;}
    65 else
    66 {if(tabs.show!='n')
    67 {tabs.show='n';}
    68 else
    69 {tabs.show='y';}}
    70 if(options.tabsAnimated)
    71 {if(tabs.show=='y')
    72 {$("#theTabsContainer").animate({height:options.tabsVisible+"px"},options.animateDelay).trigger('resize');}
    73 else
    74 {$('#theTabs div.tabPanel').addClass("ui-tabs-hide").css("display","");$('#theTabs li').removeClass("ui-tabs-selected");$("#theTabsContainer").animate({height:options.tabsHidden+"px"},options.animateDelay).trigger('resize');}}
    75 else
    76 {if(tabs.show=='y')
    77 {$("#theTabsContainer").css({height:options.tabsVisible+"px"}).trigger('resize');}
    78 else
    79 {$('#theTabs div.tabPanel').addClass("ui-tabs-hide").css("display","");$('#theTabs li').removeClass("ui-tabs-selected");$("#theTabsContainer").css({height:options.tabsHidden+"px"}).trigger('resize');}}},clearInterfaceTimer=function()
    80 {if(interface.timerDelay!=null)
    81 {window.clearInterval(interface.timerDelay);interface.timerDelay=null;}},resetInterfaceTimer=function()
    82 {clearInterfaceTimer();if(options.interfaceTimerDelay>0&&options.interfaceCanSwitch)interface.timerDelay=window.setInterval(switchInterface,options.interfaceTimerDelay,"n",false);},openDisplayHigh=function(url)
    83 {$('#theImageHigh').css({width:$("html").get(0).scrollWidth+"px",height:$("html").get(0).scrollHeight+"px",display:"block"});if($("#theImgHigh").attr('src')=="")
    84 {p=new Object();p.left=(($(window).width()-$("#theImgHighContainer").attr("clientWidth")-options.paddingContainer*2)/2)+"px";p.top=(($(window).height()-$("#theImgHighContainer").attr("clientHeight")-options.paddingContainer*2)/2)+"px";$('#theImgHighContainer').css({left:p.left,top:p.top,padding:options.paddingContainer+"px"});$("#theImgHigh").load(function()
    85 {image.highWidth=$("#theImgHigh").width();image.highHeight=$("#theImgHigh").height();p=calcImgHighPositionAndSize(image.zoomMode);$('#theImgHighContainer').css("background-image","none");displayZoomHigh();$("#theImgHigh").css({display:"block"});}).attr('src',url);if(options.highResClickMode=='close')
    86 {$("#theImgHigh").bind('click',closeDisplayHigh);}
    87 else
    88 {$("#theImgHigh").bind('click',switchZoomHigh);}}
    89 else
    90 {p=calcImgHighPositionAndSize(image.zoomMode);$('#theImgHighContainer').css({left:p.left+"px",top:p.top+"px",width:p.width+"px",height:p.height+"px"});}},calcImgHighPositionAndSize=function(zoom)
    91 {var p={left:options.marginContainer,top:options.marginContainer,width:0,height:0},margins=(options.marginContainer+options.paddingContainer)*2;if(zoom=='full')
    92 {p.width=$("html").get(0).clientWidth-margins;p.height=$("html").get(0).clientHeight-margins;}
    93 else
    94 {ratioImg=image.highWidth/image.highHeight;ratioPage=$("html").get(0).clientWidth/$("html").get(0).clientHeight;if((ratioPage>1&&(ratioPage>ratioImg))||(ratioPage<1&&(ratioPage<ratioImg)))
    95 {p.height=$("html").get(0).clientHeight-margins;p.width=p.height*ratioImg;}
    96 else
    97 {p.width=$("html").get(0).clientWidth-margins;p.height=p.width/ratioImg;}
    98 p.left=($("html").get(0).clientWidth-p.width)/2-options.paddingContainer;p.top=($("html").get(0).clientHeight-p.height)/2-options.paddingContainer;}
    99 if(p.width>image.highWidth)
    100 {p.width=image.highWidth;p.left=($("html").get(0).clientWidth-p.width)/2;}
    101 if(p.height>image.highHeight)
    102 {p.height=image.highHeight;p.top=($("html").get(0).clientHeight-p.height)/2;}
    103 return(p);},displayZoomHigh=function()
    104 {var container=calcImgHighPositionAndSize(image.zoomMode);$('#theImgHighContainer').css({left:container.left+"px",top:container.top+"px",width:container.width+"px",height:container.height+"px"});if(image.zoomMode=="full")
    105 {$("#theImgHigh").css({width:image.highWidth+"px",height:image.highHeight+"px"});$('#theImgHighContainer').bind("mousemove",function(event)
    106 {var deadArea=Math.max(options.marginContainer*2,options.imageScrollMinDeadArea)
    107 mouseX=Math.max(Math.min(event.clientX-container.left,container.width-deadArea),deadArea),mouseY=Math.max(Math.min(event.clientY-container.top,container.height-deadArea),deadArea);$("#theImgHigh").css("left",Math.round((image.highWidth-container.width)*-(mouseX-deadArea)/(container.width-2*deadArea))+"px").css("top",Math.round((image.highHeight-container.height)*-(mouseY-deadArea)/(container.height-2*deadArea))+"px");});}
    108 else
    109 {$("#theImgHigh").css({width:container.width+"px",height:container.height+"px",left:"0px",top:"0px"});$('#theImgHighContainer').unbind("mousemove");}},closeDisplayHigh=function()
    110 {$('#theImageHigh').css('display','none');},switchZoomHigh=function()
    111 {if(image.zoomMode=='full')
    112 {image.zoomMode="fit";}
    113 else
    114 {image.zoomMode="full";}
    115 $("#theImgHighZoomButton").toggleClass('full').toggleClass('fit');displayZoomHigh();};this.closeDisplayHigh=function(){closeDisplayHigh();};this.switchZoomHigh=function(){switchZoomHigh();};this.getImageProp=function(){return image;};this.getInterfaceProp=function(){return interface;};this.getTabsProp=function(){return tabs;};this.openDisplayHigh=function(url){openDisplayHigh(url);};init();}
     1/* file: gally-tpp.js - v1.4.4 | minified on 2011/11/09 with http://jscompress.com/ */
     2function GallyPP(){var a={show:"n",current:-1,selected:-1},b={visible:false,initialized:0,timerDelay:null},c={isScrollable:false,highWidth:0,highHeight:0,leftPos:0,zoomMode:""},d=null,e=function(){var d=/[1234567]\./i;if(jQuery.browser.msie&&jQuery.browser.version.match(d)){options.interfaceAnimated="none";options.imageAutoScroll=false}if(options.imageAutoScroll){$("html").css("overflow-x","hidden")}else{$("html").css("overflow-x","scroll")}if(options.imageCenterTopBorder=="imageHeaderBar"){options.imageCenterTopMin+=$("#imageHeaderBar").get(0).offsetTop+$("#imageHeaderBar").get(0).offsetHeight}if(!options.interfaceCanSwitch){options.interfaceHidden=false}c.zoomMode=options.defaultZoomSize;h("0",true);g("init");if((options.interfaceOnImage=="always"||options.interfaceOnImage=="noscroll"&&!c.isScrollable)&&options.interfaceCanSwitch){$("#theMainImage").bind("mouseenter",function(){h("y",true)}).bind("mouseleave",function(){h("n",true)}).bind("mousemove",function(){h("y",true)})}if(options.interfaceCanSwitch){$("#imageHeaderBar").bind("mouseenter",function(){h("y",false)}).bind("mousemove",function(){h("y",false)});$("#imageToolBar").bind("mouseenter",function(){h("y",true)}).bind("mouseleave",function(){h("n",true)}).bind("mousemove",function(){h("y",true)});$("#navThumbPrev").bind("mouseenter",function(){h("Y",true)}).bind("mouseleave",function(){h("n",true)}).bind("mousemove",function(){h("y",true)});$("#navThumbNext").bind("mouseenter",function(){h("Y",true)}).bind("mouseleave",function(){h("n",true)}).bind("mousemove",function(){h("y",true)})}$("#navThumbPrev").css("top",$("#navThumbPrev").prop("offsetTop")+$("#theHeader").prop("offsetHeight")+$("#theHeaderAlt").prop("offsetHeight")+"px");$("#navThumbNext").css("top",$("#navThumbNext").prop("offsetTop")+$("#theHeader").prop("offsetHeight")+$("#theHeaderAlt").prop("offsetHeight")+"px");$("#theImage").css("top",$("#theImage").prop("offsetTop")+$("#theHeader").prop("offsetHeight")+$("#theHeaderAlt").prop("offsetHeight")+"px");$("#contentid").attr("rows",options.commentRows);if(options.animateDelay>0){$("#theTabs").tabs({fx:{opacity:"toggle",duration:options.animateDelay}})}else{$("#theTabs").tabs()}i("n");if(options.interfaceCanSwitch){$("#theTabsContainer").bind("mouseenter",function(){h("Y",false)}).bind("mouseleave",function(){h("n")}).bind("mousemove",function(){h("y",false)})}$("#theTabs").bind("tabsselect",function(b,c){a.selected=c.index});$(".tab a").click(function(){$(this).get(0).blur();if(a.selected==a.current){if(a.current!=-1)i("n");a.current=-1;a.selected=-1}else{if(a.current==-1)i("y");a.current=a.selected}});$(window).resize(function(){g("resize")});b.initialized=1;$(document).trigger("gallyInterfaceReady")},f=function(){if(c.isScrollable&&options.imageHaveHighRes==false&&options.imageSimulateHighRes){$("#theImgContainer").bind("click",function(){l($("#theMainImage").attr("src"))}).addClass("pointer")}},g=function(a){var b=0,d=0,e=new Object;e.height=$("#theMainImage").prop("height")+"px";if(options.imageAutoScroll&&$("#theMainImage").prop("scrollWidth")>$("#theImage").prop("clientWidth")-2*options.marginContainer){e.width=$("#theImage").prop("clientWidth")-2*(options.marginContainer+options.paddingContainer)+"px";$("#theImage").bind("mousemove",function(a){if($("#navThumbPrev").length>0)b=$("#navThumbPrev").prop("clientWidth");deadArea=Math.max(options.imageScrollMinDeadArea,b*1.2);mouse=Math.max(Math.min(a.clientX-c.leftPos,this.clientWidth-deadArea),deadArea);$("#theMainImage").css("left",Math.round(($("#theMainImage").prop("scrollWidth")-this.clientWidth)*-(mouse-deadArea)/(this.clientWidth-2*deadArea))+"px").trigger("scrolled")});c.isScrollable=true}else{$("#theImage").unbind("mousemove");$("#theMainImage").css("left","0px");e.width=$("#theMainImage").prop("scrollWidth")+"px";c.isScrollable=false}$("#theImgContainer").css(e);if($("#copyright").css("position")=="fixed"){$("#theImage").css("padding-bottom",$("#copyright").prop("offsetHeight")+"px")}switch(options.imageCenterMode){case"img":d=$("#theImgContainer").prop("offsetHeight");break;case"all":d=$("#theImage").prop("offsetHeight");break;default:d=-1e4;break}d=($("#copyright").prop("offsetTop")-($("#imageHeaderBar").prop("offsetTop")+$("#imageHeaderBar").prop("offsetHeight"))-d)/2+options.imageCenterOffset;switch($("#theImage").css("position")){case"static":$("#theImage").css("padding-top",d);break;default:if(d<options.imageCenterTopMin){d=options.imageCenterTopMin}d=d+"px";$("#theImage").css("top",d);break}c.leftPos=$("#theImage").offset().left;if(a=="init"){theHeaderHeight=$("#theHeader").prop("offsetHeight")+$("#theHeaderAlt").prop("offsetHeight");$("#imageToolBar").css("top",$("#imageToolBar").prop("offsetTop")+theHeaderHeight+$("#imageHeaderBar").prop("offsetHeight")+"px");if($("#navThumbPrev").length>0){$("#navThumbPrev").css("height",$("#copyright").prop("offsetTop")-$("#navThumbPrev").prop("offsetTop")-options.tabsHidden+"px")}if($("#navThumbNext").length>0){$("#navThumbNext").css("height",$("#copyright").prop("offsetTop")-$("#navThumbNext").prop("offsetTop")-options.tabsHidden+"px")}}switch(options.tabsPosition){case"top":toolBarArea=$("#imageToolBar").prop("offsetTop")+$("#imageToolBar").prop("offsetHeight");$("#theTabsContainer").css("top",toolBarArea+"px");break;case"bottom":copyrightArea=$("#copyright").prop("clientHeight")+1;$("#theTabsContainer").css("bottom",copyrightArea+"px");break;case"pictureTop":$("#theTabsContainer").css({top:$("#theMainImage").prop("offsetTop")+"px",left:$("#theMainImage").prop("offsetLeft")+"px",width:$("#theImgContainer").innerWidth()+"px"});break;case"pictureBottom":pictureArea=$("#theMainImage").prop("offsetTop")+$("#theMainImage").prop("offsetHeight");$("#theTabsContainer").css({top:pictureArea+"px",left:$("#theMainImage").prop("offsetLeft")+"px",width:$("#theMainImage").prop("offsetWidth")+"px"});break}f()},h=function(a,c){if(b.initialized==1&&options.interfaceHidden){b.initialized=2;if(a=="Y")return""}if(!options.interfaceHidden&&a=="0"){a="1"}if(options.interfaceAnimated=="fade"){switch(a){case"0":$(".uiImg").css({opacity:0,visibility:"hidden"});b.visible=false;break;case"1":if(!b.visible)$(".uiImg").css({opacity:1,visibility:"visible"});b.visible=true;if(c)k();break;case"2":case"Y":case"y":if(!b.visible)$(".uiImg").css("visibility","visible").stop(true,false).fadeTo(options.animateDelay,1);b.visible=true;if(c)k();break;default:$(".uiImg").stop(true,false).fadeTo(options.animateDelay,0,function(){this.style.visibility="hidden";b.visible=false});j();break}}else{switch(a){case"y":case"Y":case"1":case"2":if(!b.visible)$(".uiImg").css("visibility","visible");b.visible=true;if(c)k();break;default:$(".uiImg").css("visibility","hidden");b.visible=false;j();break}}},i=function(b){if(b!=""){a.show=b}else{if(a.show!="n"){a.show="n"}else{a.show="y"}}if(options.tabsAnimated){if(a.show=="y"){$("#theTabsContainer").animate({height:options.tabsVisible+"px"},options.animateDelay).trigger("resize")}else{$("#theTabs div.tabPanel").addClass("ui-tabs-hide").css("display","");$("#theTabs li").removeClass("ui-tabs-selected");$("#theTabsContainer").animate({height:options.tabsHidden+"px"},options.animateDelay).trigger("resize")}}else{if(a.show=="y"){$("#theTabsContainer").css({height:options.tabsVisible+"px"}).trigger("resize")}else{$("#theTabs div.tabPanel").addClass("ui-tabs-hide").css("display","");$("#theTabs li").removeClass("ui-tabs-selected");$("#theTabsContainer").css({height:options.tabsHidden+"px"}).trigger("resize")}}},j=function(){if(b.timerDelay!=null){window.clearInterval(b.timerDelay);b.timerDelay=null}},k=function(){j();if(options.interfaceTimerDelay>0&&options.interfaceCanSwitch)b.timerDelay=window.setInterval(h,options.interfaceTimerDelay,"n",false)},l=function(a){$("#theImageHigh").css({width:$("html").get(0).scrollWidth+"px",height:$("html").get(0).scrollHeight+"px",display:"block"});if($("#theImgHigh").attr("src")==""){p=new Object;p.left=($(window).width()-$("#theImgHighContainer").prop("clientWidth")-options.paddingContainer*2)/2+"px";p.top=($(window).height()-$("#theImgHighContainer").prop("clientHeight")-options.paddingContainer*2)/2+"px";$("#theImgHighContainer").css({left:p.left,top:p.top,padding:options.paddingContainer+"px"});$("#theImgHigh").load(function(){c.highWidth=$("#theImgHigh").width();c.highHeight=$("#theImgHigh").height();p=m(c.zoomMode);$("#theImgHighContainer").css("background-image","none");n();$("#theImgHigh").css({display:"block"})}).attr("src",a);if(options.highResClickMode=="close"){$("#theImgHigh").bind("click",o)}else{$("#theImgHigh").bind("click",q)}}else{p=m(c.zoomMode);$("#theImgHighContainer").css({left:p.left+"px",top:p.top+"px",width:p.width+"px",height:p.height+"px"})}},m=function(a){var b={left:options.marginContainer,top:options.marginContainer,width:0,height:0},d=(options.marginContainer+options.paddingContainer)*2;if(a=="full"){b.width=$("html").get(0).clientWidth-d;b.height=$("html").get(0).clientHeight-d}else{ratioImg=c.highWidth/c.highHeight;ratioPage=$("html").get(0).clientWidth/$("html").get(0).clientHeight;if(ratioPage>1&&ratioPage>ratioImg||ratioPage<1&&ratioPage<ratioImg){b.height=$("html").get(0).clientHeight-d;b.width=b.height*ratioImg}else{b.width=$("html").get(0).clientWidth-d;b.height=b.width/ratioImg}b.left=($("html").get(0).clientWidth-b.width)/2-options.paddingContainer;b.top=($("html").get(0).clientHeight-b.height)/2-options.paddingContainer}if(b.width>c.highWidth){b.width=c.highWidth;b.left=($("html").get(0).clientWidth-b.width)/2}if(b.height>c.highHeight){b.height=c.highHeight;b.top=($("html").get(0).clientHeight-b.height)/2}return b},n=function(){var a=m(c.zoomMode);$("#theImgHighContainer").css({left:a.left+"px",top:a.top+"px",width:a.width+"px",height:a.height+"px"});if(c.zoomMode=="full"){$("#theImgHigh").css({width:c.highWidth+"px",height:c.highHeight+"px"});$("#theImgHighContainer").bind("mousemove",function(b){var d=Math.max(options.marginContainer*2,options.imageScrollMinDeadArea);mouseX=Math.max(Math.min(b.clientX-a.left,a.width-d),d),mouseY=Math.max(Math.min(b.clientY-a.top,a.height-d),d);$("#theImgHigh").css("left",Math.round((c.highWidth-a.width)*-(mouseX-d)/(a.width-2*d))+"px").css("top",Math.round((c.highHeight-a.height)*-(mouseY-d)/(a.height-2*d))+"px")})}else{$("#theImgHigh").css({width:a.width+"px",height:a.height+"px",left:"0px",top:"0px"});$("#theImgHighContainer").unbind("mousemove")}},o=function(){$("#theImageHigh").css("display","none")},q=function(){if(c.zoomMode=="full"){c.zoomMode="fit"}else{c.zoomMode="full"}$("#theImgHighZoomButton").toggleClass("full").toggleClass("fit");n()};this.closeDisplayHigh=function(){o()};this.switchZoomHigh=function(){q()};this.getImageProp=function(){return c};this.getInterfaceProp=function(){return b};this.getTabsProp=function(){return a};this.openDisplayHigh=function(a){l(a)};e()}var gallyPP=null;$(document).ready(function(){gallyPP=new GallyPP})
Note: See TracChangeset for help on using the changeset viewer.