Fixed a bug that clickable range height won't be updated by auto resize when resizing the browser (See [605624])
This commit is contained in:
1 parent
eed5a8fd8d
commit
c3ffd017a5
2 files changed
+26
-26
No files matched your search
+5
-5
@@ -271,8 +271,7 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
|
||||
}
|
||||
}
|
||||
if (id && title && handler) {
|
||||
var height = tb_getSize(jQuery("#TB_Image"), "margin")[1];
|
||||
jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+id+"' title='"+title+"' style='height:"+height+"px;'><span></span></a></div>");
|
||||
jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+id+"' title='"+title+"'><span></span></a></div>");
|
||||
jQuery("#"+id).click(handler);
|
||||
}
|
||||
} else if (imageGroup && tb_options.click_img == "prev_next") {
|
||||
@@ -310,10 +309,9 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
|
||||
}
|
||||
}
|
||||
if ((id && title && handler) || (id2 && title2 && handler2)) {
|
||||
var height = tb_getSize(jQuery("#TB_Image"), "margin")[1];
|
||||
var link = link2 = "";
|
||||
if (id && title && handler) link = "<a href='' id='"+id+"' class='TB_ImageLeft' title='"+title+"' style='height:"+height+"px;'></a>";
|
||||
if (id2 && title2 && handler2) link2 = "<a href='' id='"+id2+"' class='TB_ImageRight' title='"+title2+"' style='height:"+height+"px;'></a>";
|
||||
if (id && title && handler) link = "<a href='' id='"+id+"' class='TB_ImageLeft' title='"+title+"'></a>";
|
||||
if (id2 && title2 && handler2) link2 = "<a href='' id='"+id2+"' class='TB_ImageRight' title='"+title2+"'></a>";
|
||||
jQuery("#TB_window").append("<div id='TB_ImageClick'>"+link+link2+"</div>");
|
||||
if (link) jQuery("#"+id).click(handler);
|
||||
if (link2) jQuery("#"+id2).click(handler2);
|
||||
@@ -784,6 +782,8 @@ function tb_reposition(params) {
|
||||
if (TB_HEIGHT < params['height']*1)
|
||||
TB_HEIGHT = params['height']*1;
|
||||
|
||||
jQuery("#TB_ImageClick > a").height(tb_getSize(jQuery("#TB_Image"), "margin")[1]);
|
||||
|
||||
tb_position();
|
||||
}
|
||||
|
||||
|
||||
Vendored
+21
-21
@@ -15,23 +15,23 @@ e/2),marginTop:Math.round(parseInt(jQuery("#TB_window").css("marginTop"))-r/2)})
|
||||
case "bottom":jQuery("#TB_window").append(TB_Image+TB_Caption).addClass("TB_imageContent TB_captionBottom");break;case "none":jQuery("#TB_window").append(TB_Image).addClass("TB_imageContent")}(!b||!a)&&jQuery("#TB_window").addClass("TB_singleLine");"true"==f.modal&&jQuery("#TB_overlay").unbind();jQuery("#TB_closeWindowButton").click(tb_remove);if(""!==TB_PrevHTML){var g=function(){jQuery(document).unbind(".thickbox");jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");
|
||||
tb_show(TB_PrevCaption,TB_PrevURL,b);return!1};jQuery("#TB_prev").click(g);var k=function(){jQuery(document).unbind(".thickbox");jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_FirstCaption,TB_FirstURL,b);return!1}}if(""!==TB_NextHTML){var p=function(){jQuery(document).unbind(".thickbox");jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_NextCaption,TB_NextURL,b);return!1};
|
||||
jQuery("#TB_next").click(p);var s=function(){jQuery(document).unbind(".thickbox");jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>");tb_show(TB_LastCaption,TB_LastURL,b);return!1}}if(b&&"next"==tb_options.click_img){var l,i,j;""!=TB_NextHTML?(l="TB_ImageNext",i=thickboxL10n.next,j=p):"close"==tb_options.click_end?(l="TB_ImageClose",i=thickboxL10n.close,j=tb_remove):"loop"==tb_options.click_end&&""!=TB_PrevHTML&&(l="TB_ImageFirst",i=thickboxL10n.first,
|
||||
j=k);l&&(i&&j)&&(e=tb_getSize(jQuery("#TB_Image"),"margin")[1],jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+l+"' title='"+i+"' style='height:"+e+"px;'><span></span></a></div>"),jQuery("#"+l).click(j))}else if(b&&"prev_next"==tb_options.click_img){var q,r,h;""!=TB_PrevHTML&&(l="TB_ImagePrev",i=thickboxL10n.prev,j=g);""!=TB_NextHTML&&(q="TB_ImageNext",r=thickboxL10n.next,h=p);""==TB_PrevHTML&&("close"==tb_options.click_end?(l="TB_ImageClose",i=thickboxL10n.close,j=tb_remove):
|
||||
"loop"==tb_options.click_end&&""!=TB_NextHTML&&(l="TB_ImageLast",i=thickboxL10n.last,j=s));""==TB_NextHTML&&("close"==tb_options.click_end?(q="TB_ImageClose2",r=thickboxL10n.close,h=tb_remove):"loop"==tb_options.click_end&&""!=TB_PrevHTML&&(q="TB_ImageFirst",r=thickboxL10n.first,h=k));if(l&&i&&j||q&&r&&h){var e=tb_getSize(jQuery("#TB_Image"),"margin")[1],m=link2="";l&&(i&&j)&&(m="<a href='' id='"+l+"' class='TB_ImageLeft' title='"+i+"' style='height:"+e+"px;'></a>");q&&(r&&h)&&(link2="<a href='' id='"+
|
||||
q+"' class='TB_ImageRight' title='"+r+"' style='height:"+e+"px;'></a>");jQuery("#TB_window").append("<div id='TB_ImageClick'>"+m+link2+"</div>");m&&jQuery("#"+l).click(j);link2&&jQuery("#"+q).click(h);jQuery.browser.msie&&7>=parseInt(jQuery.browser.version)&&jQuery("#TB_ImageClick > a").focus(function(){this.blur()})}}"download"==tb_options.click_img?jQuery("#TB_window a.download").click(function(){window.location=thickboxL10n.forceDL+"?file="+this.href;return!1}):"expand_shrink"==tb_options.click_img&&
|
||||
jQuery("#TB_window a.scalable").click(function(){tb_fitToWindow?d(imgPreloader.width,imgPreloader.height,thickboxL10n.fit):d(tb_fitWidth,tb_fitHeight,thickboxL10n.actual);tb_fitToWindow=!tb_fitToWindow;return!1});jQuery(document).bind("keydown.thickbox",function(a){a.stopImmediatePropagation();"true"!=f.modal&&-1!=jQuery.inArray(a.which,tb_options.keys_close)?jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove():-1!=jQuery.inArray(a.which,tb_options.keys_prev)||
|
||||
a.shiftKey&&-1!=jQuery.inArray(a.which,tb_options.keys_prev.shift)?""!=TB_PrevHTML&&g():-1!=jQuery.inArray(a.which,tb_options.keys_next)?""!=TB_NextHTML&&p():-1!=jQuery.inArray(a.which,tb_options.keys_first)?""!=TB_PrevHTML&&k():-1!=jQuery.inArray(a.which,tb_options.keys_last)&&""!=TB_NextHTML&&s();return!1});b&&"prev_next"==tb_options.wheel_img?jQuery("#TB_window").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){a.stopImmediatePropagation();var b=0,a=a.originalEvent;a.wheelDelta?b=
|
||||
a.wheelDelta:a.detail&&(b=-a.detail);jQuery(window).one("MozMousePixelScroll",function(){return!1});if(0<b){if(""!=TB_PrevHTML)return g(),!1}else if(0>b&&""!=TB_NextHTML)return p(),!1}):"scale"==tb_options.wheel_img?jQuery("#TB_window").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){if(a.ctrlKey)return!0;a.stopImmediatePropagation();var b=0,a=a.originalEvent;a.wheelDelta?b=a.wheelDelta:a.detail&&(b=-a.detail);a=1+(0<b?0.1:-0.1);b=Math.round(jQuery("#TB_Image").width()*a);a=Math.round(jQuery("#TB_Image").height()*
|
||||
a);100<b&&100<a&&d(b,a);return!1}):"none"==tb_options.wheel_img&&jQuery("#TB_window").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){a.stopImmediatePropagation();return!1});"none"==tb_options.wheel_bg&&jQuery("#TB_overlay").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){a.stopImmediatePropagation();return!1});tb_options.move_img&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,"image")});tb_options.resize_img&&(tb_resize_init(),jQuery("#TB_Resize").bind("mousedown.thickbox",
|
||||
function(a){return tb_resize(a,"image")}));"none"!=tb_options.effect_cap&&(jQuery("#TB_Image").css("margin",jQuery("#TB_Image").css("marginLeft")),"zoom"==tb_options.effect_cap&&jQuery("#TB_CaptionBar").css({left:"50%",marginLeft:-TB_WIDTH/2}),jQuery("#TB_window").bind("mouseenter.thickbox",function(){tb_hover(jQuery("#TB_CaptionBar"),tb_options.effect_cap)}).bind("mouseleave.thickbox",function(){tb_hover(jQuery("#TB_CaptionBar"),tb_options.effect_cap,!0)}));tb_reposition(f);jQuery(window).bind("resize.thickbox",
|
||||
function(){tb_reposition(f)});jQuery("#TB_load").remove();("close"==tb_options.click_img||!b&&"close"==tb_options.click_end)&&jQuery("#TB_ImageOff").click(tb_remove);tb_open()};imgPreloader.src=c}else{var k=c.replace(/^[^\?]+\??/,""),f=tb_parseQuery(k);TB_WIDTH=1*f.width||tb_options.win_width;TB_HEIGHT=1*f.height||tb_options.win_height;ajaxContentW=TB_WIDTH;ajaxContentH=TB_HEIGHT;"object"==typeof a&&(a=tb_caption(a,tb_options.ref_title));TB_Title="<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+
|
||||
a+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='"+tb_closeImage+"' /></a></div></div>";if(-1!=c.indexOf("TB_iframe"))if(ajaxContentW+=2*("\v"=="v"?10:8),ajaxContentH+=2*("\v"=="v"?15:8),urlNoQuery=c.split(/[?&]TB_/),jQuery("#TB_iframeContent").remove(),TB_Iframe="<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(1E3*Math.random())+"' onload='tb_showIframe()' style='width:"+
|
||||
ajaxContentW+"px;height:"+ajaxContentH+"px;'>"+thickboxL10n.noiframes+"</iframe>","true"!=f.modal)switch(tb_options.position_title){case "top":jQuery("#TB_window").append(TB_Title+TB_Iframe).addClass("TB_iframeContent TB_titleTop");break;case "bottom":jQuery("#TB_window").append(TB_Iframe+TB_Title).addClass("TB_iframeContent TB_titleBottom");break;case "none":jQuery("#TB_window").append(TB_Iframe).addClass("TB_iframeContent")}else jQuery("#TB_overlay").unbind(),jQuery("#TB_window").append(TB_Iframe).addClass("TB_iframeContent");
|
||||
else if("block"!=jQuery("#TB_window").css("display"))if(TB_Ajax="<div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>","true"!=f.modal)switch(tb_options.position_title){case "top":jQuery("#TB_window").append(TB_Title+TB_Ajax).addClass("TB_ajaxContent TB_titleTop");break;case "bottom":jQuery("#TB_window").append(TB_Ajax+TB_Title).addClass("TB_ajaxContent TB_titleBottom");break;case "none":jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent TB_titleNone")}else jQuery("#TB_overlay").unbind(),
|
||||
jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent"),jQuery("#TB_ajaxContent").addClass("TB_modal");else jQuery("#TB_ajaxContent")[0].style.width=ajaxContentW+"px",jQuery("#TB_ajaxContent")[0].style.height=ajaxContentH+"px",jQuery("#TB_ajaxContent")[0].scrollTop=0,jQuery("#TB_ajaxWindowTitle").html(a);if(-1!=c.indexOf("TB_iframe"))TB_WIDTH+=2*("\v"=="v"?10:8),TB_HEIGHT+=2*("\v"=="v"?15:8)+tb_getSize(jQuery("#TB_title"))[1];else{var s=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),u=tb_getSize(jQuery("#TB_ajaxContent"));
|
||||
TB_WIDTH+=s[0]-u[0];TB_HEIGHT+=s[1]-u[1]+tb_getSize(jQuery("#TB_title"))[1]}jQuery("#TB_closeWindowButton").click(tb_remove);if(-1!=c.indexOf("TB_inline"))jQuery("#TB_ajaxContent").append(jQuery("#"+f.inlineId).children()),jQuery("#TB_window").bind("tb_unload",function(){jQuery("#"+f.inlineId).append(jQuery("#TB_ajaxContent").children())}),tb_position(),jQuery("#TB_load").remove(),tb_open(),tb_roundCorner("iframe");else if(-1!=c.indexOf("TB_iframe"))tb_position(),(!("onload"in jQuery("#TB_iframeContent")[0])&&
|
||||
"function"!=typeof jQuery("#TB_iframeContent")[0].onload||".pdf"==g)&&tb_showIframe();else{var v=-1==c.indexOf("?")?"?":"&";jQuery("#TB_ajaxContent").load(c+=v+"random="+(new Date).getTime(),function(){tb_position();jQuery("#TB_load").remove();tb_open();tb_roundCorner("ajax")})}tb_options.move_content&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,-1!=c.indexOf("TB_iframe")?"iframe":"ajax")});tb_options.resize_content&&(tb_resize_init(),jQuery("#TB_Resize").bind("mousedown.thickbox",
|
||||
function(a){return tb_resize(a,-1!=c.indexOf("TB_iframe")?"iframe":"ajax")}));"none"!=tb_options.effect_title&&(jQuery("#TB_title").addClass("hover"),"zoom"==tb_options.effect_title&&jQuery("#TB_title").css({left:"50%",marginLeft:-TB_WIDTH/2}),jQuery("#TB_window").bind("mouseenter.thickbox",function(){tb_hover(jQuery("#TB_title"),tb_options.effect_title)}).bind("mouseleave.thickbox",function(){tb_hover(jQuery("#TB_title"),tb_options.effect_title,!0)}));"true"!=f.modal&&jQuery(document).bind("keyup.thickbox",
|
||||
function(a){if(-1!=jQuery.inArray(a.which,tb_options.keys_close))return a.stopImmediatePropagation(),jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove(),!1})}}catch(w){tb_options.debug&&alert(w)}}
|
||||
j=k);l&&(i&&j)&&(jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+l+"' title='"+i+"'><span></span></a></div>"),jQuery("#"+l).click(j))}else if(b&&"prev_next"==tb_options.click_img){var q,r,h;""!=TB_PrevHTML&&(l="TB_ImagePrev",i=thickboxL10n.prev,j=g);""!=TB_NextHTML&&(q="TB_ImageNext",r=thickboxL10n.next,h=p);""==TB_PrevHTML&&("close"==tb_options.click_end?(l="TB_ImageClose",i=thickboxL10n.close,j=tb_remove):"loop"==tb_options.click_end&&""!=TB_NextHTML&&(l="TB_ImageLast",i=thickboxL10n.last,
|
||||
j=s));""==TB_NextHTML&&("close"==tb_options.click_end?(q="TB_ImageClose2",r=thickboxL10n.close,h=tb_remove):"loop"==tb_options.click_end&&""!=TB_PrevHTML&&(q="TB_ImageFirst",r=thickboxL10n.first,h=k));if(l&&i&&j||q&&r&&h)e=link2="",l&&(i&&j)&&(e="<a href='' id='"+l+"' class='TB_ImageLeft' title='"+i+"'></a>"),q&&(r&&h)&&(link2="<a href='' id='"+q+"' class='TB_ImageRight' title='"+r+"'></a>"),jQuery("#TB_window").append("<div id='TB_ImageClick'>"+e+link2+"</div>"),e&&jQuery("#"+l).click(j),link2&&
|
||||
jQuery("#"+q).click(h),jQuery.browser.msie&&7>=parseInt(jQuery.browser.version)&&jQuery("#TB_ImageClick > a").focus(function(){this.blur()})}"download"==tb_options.click_img?jQuery("#TB_window a.download").click(function(){window.location=thickboxL10n.forceDL+"?file="+this.href;return!1}):"expand_shrink"==tb_options.click_img&&jQuery("#TB_window a.scalable").click(function(){tb_fitToWindow?d(imgPreloader.width,imgPreloader.height,thickboxL10n.fit):d(tb_fitWidth,tb_fitHeight,thickboxL10n.actual);tb_fitToWindow=
|
||||
!tb_fitToWindow;return!1});jQuery(document).bind("keydown.thickbox",function(a){a.stopImmediatePropagation();"true"!=f.modal&&-1!=jQuery.inArray(a.which,tb_options.keys_close)?jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove():-1!=jQuery.inArray(a.which,tb_options.keys_prev)||a.shiftKey&&-1!=jQuery.inArray(a.which,tb_options.keys_prev.shift)?""!=TB_PrevHTML&&g():-1!=jQuery.inArray(a.which,tb_options.keys_next)?""!=TB_NextHTML&&p():-1!=jQuery.inArray(a.which,
|
||||
tb_options.keys_first)?""!=TB_PrevHTML&&k():-1!=jQuery.inArray(a.which,tb_options.keys_last)&&""!=TB_NextHTML&&s();return!1});b&&"prev_next"==tb_options.wheel_img?jQuery("#TB_window").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){a.stopImmediatePropagation();var b=0,a=a.originalEvent;a.wheelDelta?b=a.wheelDelta:a.detail&&(b=-a.detail);jQuery(window).one("MozMousePixelScroll",function(){return!1});if(0<b){if(""!=TB_PrevHTML)return g(),!1}else if(0>b&&""!=TB_NextHTML)return p(),!1}):
|
||||
"scale"==tb_options.wheel_img?jQuery("#TB_window").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){if(a.ctrlKey)return!0;a.stopImmediatePropagation();var b=0,a=a.originalEvent;a.wheelDelta?b=a.wheelDelta:a.detail&&(b=-a.detail);a=1+(0<b?0.1:-0.1);b=Math.round(jQuery("#TB_Image").width()*a);a=Math.round(jQuery("#TB_Image").height()*a);100<b&&100<a&&d(b,a);return!1}):"none"==tb_options.wheel_img&&jQuery("#TB_window").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){a.stopImmediatePropagation();
|
||||
return!1});"none"==tb_options.wheel_bg&&jQuery("#TB_overlay").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){a.stopImmediatePropagation();return!1});tb_options.move_img&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,"image")});tb_options.resize_img&&(tb_resize_init(),jQuery("#TB_Resize").bind("mousedown.thickbox",function(a){return tb_resize(a,"image")}));"none"!=tb_options.effect_cap&&(jQuery("#TB_Image").css("margin",jQuery("#TB_Image").css("marginLeft")),
|
||||
"zoom"==tb_options.effect_cap&&jQuery("#TB_CaptionBar").css({left:"50%",marginLeft:-TB_WIDTH/2}),jQuery("#TB_window").bind("mouseenter.thickbox",function(){tb_hover(jQuery("#TB_CaptionBar"),tb_options.effect_cap)}).bind("mouseleave.thickbox",function(){tb_hover(jQuery("#TB_CaptionBar"),tb_options.effect_cap,!0)}));tb_reposition(f);jQuery(window).bind("resize.thickbox",function(){tb_reposition(f)});jQuery("#TB_load").remove();("close"==tb_options.click_img||!b&&"close"==tb_options.click_end)&&jQuery("#TB_ImageOff").click(tb_remove);
|
||||
tb_open()};imgPreloader.src=c}else{var k=c.replace(/^[^\?]+\??/,""),f=tb_parseQuery(k);TB_WIDTH=1*f.width||tb_options.win_width;TB_HEIGHT=1*f.height||tb_options.win_height;ajaxContentW=TB_WIDTH;ajaxContentH=TB_HEIGHT;"object"==typeof a&&(a=tb_caption(a,tb_options.ref_title));TB_Title="<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+a+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='"+tb_closeImage+"' /></a></div></div>";if(-1!=c.indexOf("TB_iframe"))if(ajaxContentW+=
|
||||
2*("\v"=="v"?10:8),ajaxContentH+=2*("\v"=="v"?15:8),urlNoQuery=c.split(/[?&]TB_/),jQuery("#TB_iframeContent").remove(),TB_Iframe="<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(1E3*Math.random())+"' onload='tb_showIframe()' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'>"+thickboxL10n.noiframes+"</iframe>","true"!=f.modal)switch(tb_options.position_title){case "top":jQuery("#TB_window").append(TB_Title+TB_Iframe).addClass("TB_iframeContent TB_titleTop");
|
||||
break;case "bottom":jQuery("#TB_window").append(TB_Iframe+TB_Title).addClass("TB_iframeContent TB_titleBottom");break;case "none":jQuery("#TB_window").append(TB_Iframe).addClass("TB_iframeContent")}else jQuery("#TB_overlay").unbind(),jQuery("#TB_window").append(TB_Iframe).addClass("TB_iframeContent");else if("block"!=jQuery("#TB_window").css("display"))if(TB_Ajax="<div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>","true"!=f.modal)switch(tb_options.position_title){case "top":jQuery("#TB_window").append(TB_Title+
|
||||
TB_Ajax).addClass("TB_ajaxContent TB_titleTop");break;case "bottom":jQuery("#TB_window").append(TB_Ajax+TB_Title).addClass("TB_ajaxContent TB_titleBottom");break;case "none":jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent TB_titleNone")}else jQuery("#TB_overlay").unbind(),jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent"),jQuery("#TB_ajaxContent").addClass("TB_modal");else jQuery("#TB_ajaxContent")[0].style.width=ajaxContentW+"px",jQuery("#TB_ajaxContent")[0].style.height=
|
||||
ajaxContentH+"px",jQuery("#TB_ajaxContent")[0].scrollTop=0,jQuery("#TB_ajaxWindowTitle").html(a);if(-1!=c.indexOf("TB_iframe"))TB_WIDTH+=2*("\v"=="v"?10:8),TB_HEIGHT+=2*("\v"=="v"?15:8)+tb_getSize(jQuery("#TB_title"))[1];else{var s=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),u=tb_getSize(jQuery("#TB_ajaxContent"));TB_WIDTH+=s[0]-u[0];TB_HEIGHT+=s[1]-u[1]+tb_getSize(jQuery("#TB_title"))[1]}jQuery("#TB_closeWindowButton").click(tb_remove);if(-1!=c.indexOf("TB_inline"))jQuery("#TB_ajaxContent").append(jQuery("#"+
|
||||
f.inlineId).children()),jQuery("#TB_window").bind("tb_unload",function(){jQuery("#"+f.inlineId).append(jQuery("#TB_ajaxContent").children())}),tb_position(),jQuery("#TB_load").remove(),tb_open(),tb_roundCorner("iframe");else if(-1!=c.indexOf("TB_iframe"))tb_position(),(!("onload"in jQuery("#TB_iframeContent")[0])&&"function"!=typeof jQuery("#TB_iframeContent")[0].onload||".pdf"==g)&&tb_showIframe();else{var v=-1==c.indexOf("?")?"?":"&";jQuery("#TB_ajaxContent").load(c+=v+"random="+(new Date).getTime(),
|
||||
function(){tb_position();jQuery("#TB_load").remove();tb_open();tb_roundCorner("ajax")})}tb_options.move_content&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,-1!=c.indexOf("TB_iframe")?"iframe":"ajax")});tb_options.resize_content&&(tb_resize_init(),jQuery("#TB_Resize").bind("mousedown.thickbox",function(a){return tb_resize(a,-1!=c.indexOf("TB_iframe")?"iframe":"ajax")}));"none"!=tb_options.effect_title&&(jQuery("#TB_title").addClass("hover"),"zoom"==tb_options.effect_title&&
|
||||
jQuery("#TB_title").css({left:"50%",marginLeft:-TB_WIDTH/2}),jQuery("#TB_window").bind("mouseenter.thickbox",function(){tb_hover(jQuery("#TB_title"),tb_options.effect_title)}).bind("mouseleave.thickbox",function(){tb_hover(jQuery("#TB_title"),tb_options.effect_title,!0)}));"true"!=f.modal&&jQuery(document).bind("keyup.thickbox",function(a){if(-1!=jQuery.inArray(a.which,tb_options.keys_close))return a.stopImmediatePropagation(),jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",
|
||||
cb:tb_remove}])||tb_remove(),!1})}}catch(w){tb_options.debug&&alert(w)}}
|
||||
function tb_open(){"hidden"==jQuery("#TB_window").css("visibility")&&jQuery("#TB_window").css("visibility","visible");var a=jQuery("#TB_window").is(".TB_Transition")?tb_options.effect_trans:tb_options.effect_open;tb_effectView(a,!1);var c=function(){tb_effectView(a)};switch(a){case "zoom":jQuery("#TB_window").height(jQuery("#TB_window").height());"undefined"==typeof document.body.style.maxHeight&&jQuery("#TB_window").css({marginTop:-jQuery("#TB_window").height()/2,top:jQuery(window).height()/2+jQuery(document).scrollTop()});
|
||||
jQuery("#TB_Image").hide().show(tb_options.effect_speed);jQuery("#TB_window").show(tb_options.effect_speed,c);break;case "slide":"undefined"==typeof document.body.style.maxHeight&&jQuery("#TB_window").css({marginTop:-jQuery("#TB_window").height()/2,top:jQuery(window).height()/2+jQuery(document).scrollTop()});jQuery("#TB_window").slideDown(tb_options.effect_speed,c);break;case "fade":jQuery("#TB_window").fadeIn(tb_options.effect_speed,c);break;default:jQuery("#TB_window").show()}"none"==jQuery("#TB_window").css("display")&&
|
||||
jQuery("#TB_window").css("display","block");jQuery("#TB_title").height(Math.max(jQuery("#TB_title").height(),jQuery("#TB_ajaxWindowTitle").height()+13))}
|
||||
@@ -45,16 +45,16 @@ function tb_position(){var a=TB_WIDTH+jQuery("#TB_window").outerWidth()-jQuery("
|
||||
"relative"==jQuery("body").css("position")&&(d=tb_getPageSize(),e&&(b=parseInt((d[0]-a)/2,10)+jQuery(document).scrollLeft(),d=parseInt((d[1]-c)/2,10)+jQuery(document).scrollTop(),jQuery("#TB_window").css({marginLeft:b+"px",marginTop:d+"px",top:"0",left:"0"})))}
|
||||
function tb_reposition(a){jQuery("#TB_window").width(jQuery(window).width());var c=tb_getSize(jQuery("#TB_window"),"border"),b=tb_getSize(jQuery("#TB_window")),d=tb_getSize(jQuery("#TB_Image"),"margin"),e=tb_getSize(jQuery("#TB_Image")),g=tb_getPageSize(),k=480>=g[0]||480>=g[1]?0:2*tb_options.margin_win,g=jQuery(window).width()-(c[0]-b[0]+d[0]-e[0])-k,c=jQuery(window).height()-(c[1]-e[1])-k,k=a.width?Math.min(1*a.width,imgPreloader.width):imgPreloader.width,f=a.height?Math.min(1*a.height,imgPreloader.height):
|
||||
imgPreloader.height;tb_fitWidth=g;tb_fitHeight=Math.round(f*(g/k));tb_fitHeight>c&&(tb_fitWidth=Math.round(tb_fitWidth*(c/tb_fitHeight)),tb_fitHeight=c);if(tb_fitToWindow=tb_options.auto_resize&&(k>g||f>c))k=tb_fitWidth,f=tb_fitHeight;jQuery("#TB_Image").attr("width",k).attr("height",f);0==jQuery("#TB_Image").height()&&jQuery("#TB_Image").height(f);TB_WIDTH=k+(d[0]-e[0]);TB_HEIGHT=f+(b[1]-e[1]);TB_WIDTH<1*a.width&&(TB_WIDTH=1*a.width,jQuery("#TB_Image").css({marginLeft:"auto",marginRight:"auto"}));
|
||||
TB_HEIGHT<1*a.height&&(TB_HEIGHT=1*a.height);tb_position()}function tb_parseQuery(a){var c={};if(!a)return c;for(var a=a.substring(a.indexOf("?")+1),a=a.split(/[;&]/),b=0;b<a.length;b++){var d=a[b].split("=");if(d&&2==d.length){var e=unescape(d[0]),d=unescape(d[1]),d=d.replace(/\+/g," ");c[e]=d}}return c}
|
||||
TB_HEIGHT<1*a.height&&(TB_HEIGHT=1*a.height);jQuery("#TB_ImageClick > a").height(tb_getSize(jQuery("#TB_Image"),"margin")[1]);tb_position()}function tb_parseQuery(a){var c={};if(!a)return c;for(var a=a.substring(a.indexOf("?")+1),a=a.split(/[;&]/),b=0;b<a.length;b++){var d=a[b].split("=");if(d&&2==d.length){var e=unescape(d[0]),d=unescape(d[1]),d=d.replace(/\+/g," ");c[e]=d}}return c}
|
||||
function tb_getPageSize(){var a=document.documentElement;return arrayPageSize=[window.innerWidth||self.innerWidth||a&&a.clientWidth||document.body.clientWidth,window.innerHeight||self.innerHeight||a&&a.clientHeight||document.body.clientHeight]}function tb_detectMacXFF(){var a=navigator.userAgent.toLowerCase();if(-1!=a.indexOf("mac")&&-1!=a.indexOf("firefox"))return!0}
|
||||
function tb_move(a,c){if("image"==c){if(jQuery(a.target).parent().is("#TB_prev, #TB_next, #TB_closeWindowButton"))return!0}else if(!jQuery(a.target).closest("#TB_title").length||jQuery(a.target).parent().is("#TB_closeWindowButton"))return!0;return tb_drag(a,c,"move")}
|
||||
function tb_resize(a,c){var b;switch(a.target.id){case "TB_ResizeN":b="n-resize";break;case "TB_ResizeE":b="e-resize";break;case "TB_ResizeW":b="w-resize";break;case "TB_ResizeS":b="s-resize";break;case "TB_ResizeNE":b="ne-resize";break;case "TB_ResizeNW":b="nw-resize";break;case "TB_ResizeSE":b="se-resize";break;case "TB_ResizeSW":b="sw-resize";break;default:return!0}return tb_drag(a,c,b)}
|
||||
function tb_resize_init(){jQuery("#TB_window").append("<div id='TB_Resize'><div id='TB_ResizeN'></div><div id='TB_ResizeE'></div><div id='TB_ResizeW'></div><div id='TB_ResizeS'></div><div id='TB_ResizeNE'></div><div id='TB_ResizeNW'></div><div id='TB_ResizeSE'></div><div id='TB_ResizeSW'></div></div>");"undefined"==typeof document.body.style.maxHeight&&jQuery("#TB_ResizeE, #TB_ResizeW").height(jQuery("#TB_window").height())}
|
||||
function tb_drag(a,c,b){if(1!=a.which)return!0;TB_THRESHOLD=5;MIN_WIDTH=MIN_HEIGHT=100;var d=jQuery("#TB_window").offset().left-parseInt(jQuery("#TB_window").css("marginLeft")),e=jQuery("#TB_window").offset().top-parseInt(jQuery("#TB_window").css("marginTop"));"undefined"!=typeof document.body.style.maxHeight&&"absolute"!=jQuery("#TB_window").css("position")&&(d-=jQuery(document).scrollLeft(),e-=jQuery(document).scrollTop());var g=a.clientX,k=a.clientY,f=!1,s=jQuery("#TB_window, #TB_overlay, "+("image"==
|
||||
c?"#TB_window a":"#TB_closeWindowButton")),u="move"==b||"w-resize"==b||"nw-resize"==b||"sw-resize"==b,v="move"==b||"n-resize"==b||"ne-resize"==b||"nw-resize"==b,w="move"!=b&&"n-resize"!=b&&"s-resize"!=b,B="move"!=b&&"e-resize"!=b&&"w-resize"!=b,y="ne-resize"==b||"nw-resize"==b||"se-resize"==b||"sw-resize"==b;if(y)var t=jQuery("#TB_window").width()/jQuery("#TB_window").height();if("move"!=b){var z=jQuery("#TB_window").width(),A=jQuery("#TB_window").height(),p=jQuery("image"==c?"#TB_Image":"iframe"==
|
||||
c?"#TB_iframeContent":"#TB_ajaxContent"),C=p.width(),l=p.height(),i="e-resize"==b||"ne-resize"==b||"se-resize"==b?1:-1,j="s-resize"==b||"se-resize"==b||"sw-resize"==b?1:-1;if("undefined"==typeof document.body.style.maxHeight)var q=jQuery("#TB_window").css("marginTop")}jQuery(document).bind("mousemove.thickbox",function(a,h,m){var h=h?h:a.clientX,m=m?m:a.clientY,a=h-g,n=m-k;if(!f&&(a=a>TB_THRESHOLD?a-TB_THRESHOLD:a<-TB_THRESHOLD?a+TB_THRESHOLD:0,n=n>TB_THRESHOLD?n-TB_THRESHOLD:n<-TB_THRESHOLD?n+TB_THRESHOLD:
|
||||
0,0<Math.abs(a)||0<Math.abs(n)))f=!0,g=h,k=m,s.css("cursor",b);if(f){y&&(h=z+a*i,m=A+n*j,h/=m,t>h?n=Math.round(a/t)*i*j:t<h&&(a=Math.round(n*t)*i*j));var x=skipMoveY=!1;w&&(h=z+a*i,h<MIN_WIDTH?x=!0:(jQuery("#TB_window").width(h),p.width(C+a*i)));B&&(m=A+n*j,m<MIN_HEIGHT?skipMoveY=!0:(jQuery("#TB_window").height(m),p.height(l+n*j),"image"==c&&jQuery("#TB_ImageClick > a").height(jQuery("#TB_Image").outerHeight(!0)),"undefined"==typeof document.body.style.maxHeight&&jQuery("#TB_window").css("marginTop",
|
||||
q)));u&&!x&&jQuery("#TB_window").css("left",d+a);v&&!skipMoveY&&jQuery("#TB_window").css("top",e+n)}return!1});jQuery(document).bind("mouseup.thickbox",function(a){jQuery(document).unbind("mousemove.thickbox mouseup.thickbox");"iframe"==c&&jQuery("#TB_iframeContent").contents().unbind("mousemove.thickbox mouseup.thickbox");if(!f)return!0;s.css("cursor","");if(jQuery.browser.opera)return!1;var b=jQuery(a.target);if(b.is("html"))return!1;b.is(".TB_ImageLeft, .TB_ImageRight")||(b=b.parent());if((a=b.data("events"))&&
|
||||
c?"#TB_iframeContent":"#TB_ajaxContent"),C=p.width(),l=p.height(),i="e-resize"==b||"ne-resize"==b||"se-resize"==b?1:-1,j="s-resize"==b||"se-resize"==b||"sw-resize"==b?1:-1;if("undefined"==typeof document.body.style.maxHeight)var q=jQuery("#TB_window").css("marginTop")}jQuery(document).bind("mousemove.thickbox",function(a,h,n){var h=h?h:a.clientX,n=n?n:a.clientY,a=h-g,m=n-k;if(!f&&(a=a>TB_THRESHOLD?a-TB_THRESHOLD:a<-TB_THRESHOLD?a+TB_THRESHOLD:0,m=m>TB_THRESHOLD?m-TB_THRESHOLD:m<-TB_THRESHOLD?m+TB_THRESHOLD:
|
||||
0,0<Math.abs(a)||0<Math.abs(m)))f=!0,g=h,k=n,s.css("cursor",b);if(f){y&&(h=z+a*i,n=A+m*j,h/=n,t>h?m=Math.round(a/t)*i*j:t<h&&(a=Math.round(m*t)*i*j));var x=skipMoveY=!1;w&&(h=z+a*i,h<MIN_WIDTH?x=!0:(jQuery("#TB_window").width(h),p.width(C+a*i)));B&&(n=A+m*j,n<MIN_HEIGHT?skipMoveY=!0:(jQuery("#TB_window").height(n),p.height(l+m*j),"image"==c&&jQuery("#TB_ImageClick > a").height(jQuery("#TB_Image").outerHeight(!0)),"undefined"==typeof document.body.style.maxHeight&&jQuery("#TB_window").css("marginTop",
|
||||
q)));u&&!x&&jQuery("#TB_window").css("left",d+a);v&&!skipMoveY&&jQuery("#TB_window").css("top",e+m)}return!1});jQuery(document).bind("mouseup.thickbox",function(a){jQuery(document).unbind("mousemove.thickbox mouseup.thickbox");"iframe"==c&&jQuery("#TB_iframeContent").contents().unbind("mousemove.thickbox mouseup.thickbox");if(!f)return!0;s.css("cursor","");if(jQuery.browser.opera)return!1;var b=jQuery(a.target);if(b.is("html"))return!1;b.is(".TB_ImageLeft, .TB_ImageRight")||(b=b.parent());if((a=b.data("events"))&&
|
||||
a.click){var d=[];jQuery.each(a.click,function(a,b){d[d.length]=b.handler||b})}b.unbind("click").one("click",function(a){a.stopImmediatePropagation();if(d)for(a=0;a<d.length;a++)b.click(d[a]);return!1});return!1});"iframe"==c&&jQuery("#TB_iframeContent").contents().bind("mousemove.thickbox",function(a){a.clientX+=jQuery("#TB_iframeContent").offset().left-jQuery(document).scrollLeft();a.clientY+=jQuery("#TB_iframeContent").offset().top-jQuery(document).scrollTop();jQuery(document).trigger("mousemove.thickbox",
|
||||
[a.clientX,a.clientY])}).bind("mouseup.thickbox",function(){jQuery(document).trigger("mouseup.thickbox")});return!1}
|
||||
function tb_getSize(a,c){var b,d,e=function(){switch(c){case "padding":b=a.innerWidth();d=a.innerHeight();break;case "border":b=a.outerWidth();d=a.outerHeight();break;case "margin":b=a.outerWidth(!0);d=a.outerHeight(!0);break;default:b=a.width(),d=a.height()}};"none"==jQuery("#TB_window").css("display")&&(0<tb_versionCompare("1.4.4")||0<tb_versionCompare("1.6.2")&&c)?jQuery.swap(jQuery("#TB_window")[0],{position:"absolute",visibility:"hidden",display:"block"},e):e();return[b,d]}
|
||||
|
||||
Reference in new issue
Block a user