NEW: "Mouse Wheel - Image - Scroll" option and "Mouse Wheel - Background - Scroll/None" option
This commit is contained in:
1 parent
b91ac43927
commit
2eb551d1f2
5 files changed
+44
-14
No files matched your search
@@ -198,17 +198,29 @@ class auto_thickbox_options {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php $this->util->_e('Mouse Wheel'); ?> (<?php $this->util->_e('Scroll'); ?>)</th>
|
||||
<th scope="row"><?php $this->util->_e('Mouse Wheel'); ?></th>
|
||||
<th scope="row"><?php echo $this->texts['image']; ?></th>
|
||||
<td>
|
||||
<label class="item"><input type="radio" name="auto-thickbox-plus[wheel_img]" value="prev_next"<?php $this->util->checked($this->options['wheel_img'], 'prev_next'); ?> />
|
||||
<?php echo "{$this->texts['prev2']} / {$this->texts['next2']}"; ?></label>
|
||||
<label class="item"><input type="radio" name="auto-thickbox-plus[wheel_img]" value="scale"<?php $this->util->checked($this->options['wheel_img'], 'scale'); ?> />
|
||||
<?php $this->util->_e('Scale'); ?></label>
|
||||
<label class="item"><input type="radio" name="auto-thickbox-plus[wheel_img]" value="scroll"<?php $this->util->checked($this->options['wheel_img'], 'scroll'); ?> />
|
||||
<?php $this->util->_e('Scroll'); ?></label>
|
||||
<label class="item"><input type="radio" name="auto-thickbox-plus[wheel_img]" value="none"<?php $this->util->checked($this->options['wheel_img'], 'none'); ?> />
|
||||
<?php echo $this->texts['none']; ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<th scope="row"><?php $this->util->_e('Background'); ?></th>
|
||||
<td>
|
||||
<label class="item"><input type="radio" name="auto-thickbox-plus[wheel_bg]" value="scroll"<?php $this->util->checked($this->options['wheel_bg'], 'scroll'); ?> />
|
||||
<?php $this->util->_e('Scroll'); ?></label>
|
||||
<label class="item"><input type="radio" name="auto-thickbox-plus[wheel_bg]" value="none"<?php $this->util->checked($this->options['wheel_bg'], 'none'); ?> />
|
||||
<?php echo $this->texts['none']; ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php $this->util->_e('Drag & Drop'); ?></th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (<?php echo $this->texts['image']; ?>)</th>
|
||||
|
||||
@@ -294,6 +294,8 @@ SCRIPT;
|
||||
$script .= "tb_options.click_bg = '{$this->options['click_bg']}';\n";
|
||||
if ( !$this->is_default_options('wheel_img') )
|
||||
$script .= "tb_options.wheel_img = '{$this->options['wheel_img']}';\n";
|
||||
if ( !$this->is_default_options('wheel_bg') )
|
||||
$script .= "tb_options.wheel_bg = '{$this->options['wheel_bg']}';\n";
|
||||
if ( !$this->is_default_options('drag_img_move') )
|
||||
$script .= "tb_options.move_img = " . var_export($this->options['drag_img_move'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('drag_img_resize') )
|
||||
@@ -590,6 +592,7 @@ SCRIPT;
|
||||
'click_range' => '35',
|
||||
'click_bg' => 'close',
|
||||
'wheel_img' => 'prev_next',
|
||||
'wheel_bg' => 'scroll',
|
||||
'drag_img_move' => 'off',
|
||||
'drag_img_resize' => 'off',
|
||||
'drag_content_move' => 'off',
|
||||
|
||||
@@ -277,6 +277,7 @@ You can localize the plugin with [Poedit](http://www.poedit.net/). All you do is
|
||||
* NEW: "Action - Mouse Click - Image - Open" option. You can click an image to open it in new tab/window.
|
||||
* NEW: "Action - Mouse Click - Image - Download (beta)" option. You can click an image to download it. This is experimental feature so I'm not sure whether it works on all server environments.
|
||||
* NEW: "Action - Mouse Click - Image - Expand / Shrink" option. You can expand an image to actual size then shrink it to fit window, and vice versa.
|
||||
* NEW: "Mouse Wheel - Image - Scroll" option and "Mouse Wheel - Background - Scroll/None" option
|
||||
* NEW: "View - Size - Window (Content) - Width/Height" option. You can change the default size of ThickBox window with non-image, and it can be overridden with `width`/`height` parameters in URL.
|
||||
* CHANGED: Modified "Mouse Wheel - Image - Scale" option. Uses calculated size instead of CSS3 transform so now it is not buggy in Drag & Drop action and it works at all browsers, and it scales only an image not ThickBox window.
|
||||
* CHANGED: Resizes ThickBox window with keeping aspect ratio when dragging corners. And resize handle is shown at the bottom right corner for usability.
|
||||
|
||||
+13
@@ -22,6 +22,7 @@ var tb_options = {
|
||||
click_end: "loop",
|
||||
click_bg: "close",
|
||||
wheel_img: "prev_next",
|
||||
wheel_bg: "scroll",
|
||||
keys_close: [27, 13], // Esc, Enter
|
||||
keys_prev: [188, 37], // < , Left
|
||||
keys_next: [190, 39], // > , Right
|
||||
@@ -454,6 +455,18 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
|
||||
setImageSize(width, height);
|
||||
return false;
|
||||
});
|
||||
} else if (tb_options.wheel_img == "none") {
|
||||
jQuery("#TB_window").bind('mousewheel.thickbox DOMMouseScroll.thickbox', function(e){
|
||||
e.stopImmediatePropagation();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
if (tb_options.wheel_bg == "none") {
|
||||
jQuery("#TB_overlay").bind('mousewheel.thickbox DOMMouseScroll.thickbox', function(e){
|
||||
e.stopImmediatePropagation();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
if (tb_options.move_img)
|
||||
|
||||
Vendored
+14
-13
@@ -1,6 +1,6 @@
|
||||
jQuery(document).ready(function(){"string"!=typeof tb_pathToImage&&(tb_pathToImage=thickboxL10n.loadingAnimation);"string"!=typeof tb_closeImage&&(tb_closeImage=thickboxL10n.closeImage)});
|
||||
var tb_options={auto_resize:!0,click_img:"close",click_end:"loop",click_bg:"close",wheel_img:"prev_next",keys_close:[27,13],keys_prev:[188,37],keys_next:[190,39],keys_first:[36],keys_last:[35],move_img:!1,move_content:!1,resize_img:!1,resize_content:!1,position_title:"top",position_cap:"bottom",win_width:600,win_height:400,ref_title:["link-title","link-name"],ref_cap:["link-title","link-name"],effect_open:"none",effect_close:"fade",effect_trans:"none",effect_title:"none",effect_cap:"none",effect_speed:"fast",
|
||||
debug:!1};jQuery(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox");imgLoader=new Image;imgLoader.src=tb_pathToImage});function tb_init(a){jQuery.isFunction(jQuery().live)?jQuery(a).live("click",tb_click):jQuery(a).bind("click",tb_click)}
|
||||
var tb_options={auto_resize:!0,click_img:"close",click_end:"loop",click_bg:"close",wheel_img:"prev_next",wheel_bg:"scroll",keys_close:[27,13],keys_prev:[188,37],keys_next:[190,39],keys_first:[36],keys_last:[35],move_img:!1,move_content:!1,resize_img:!1,resize_content:!1,position_title:"top",position_cap:"bottom",win_width:600,win_height:400,ref_title:["link-title","link-name"],ref_cap:["link-title","link-name"],effect_open:"none",effect_close:"fade",effect_trans:"none",effect_title:"none",effect_cap:"none",
|
||||
effect_speed:"fast",debug:!1};jQuery(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox");imgLoader=new Image;imgLoader.src=tb_pathToImage});function tb_init(a){jQuery.isFunction(jQuery().live)?jQuery(a).live("click",tb_click):jQuery(a).bind("click",tb_click)}
|
||||
function tb_click(){null!==document.getElementById("TB_window")&&(jQuery(document).unbind(".thickbox"),jQuery("#TB_window").trigger("tb_unload").remove(),jQuery("body").append("<div id='TB_window' class='TB_Transition'></div>"));tb_show(this,this.href||this.alt,this.rel||!1);this.blur();return!1}
|
||||
function tb_caption(a,c){for(var c=c||tb_options.ref_cap,b,e=0;e<c.length&&!b;e++)switch(c[e]){case "link-title":b=a.title;break;case "link-name":b=a.name;break;case "blank":return"";case "img-title":b=jQuery(a).children("img").attr("title");break;case "img-alt":b=jQuery(a).children("img").attr("alt");break;case "img-cap":b=jQuery(a).parent().is("dt.gallery-icon")?jQuery(a).parent().nextAll(".wp-caption-text").text().replace(/^\s+|\s+$/g,""):jQuery(a).nextAll(".wp-caption-text").text();break;case "img-desc":b=
|
||||
jQuery(a).children("img").attr("longdesc");break;case "img-name":b=jQuery(a).children("img").attr("name")}return b.replace(/(\r\n|[\n\r])/g,"<br />")}
|
||||
@@ -21,17 +21,18 @@ tb_remove}else if(tb_options.click_end=="loop"&&TB_NextHTML!=""){m="TB_ImageLast
|
||||
g+"' style='height:"+d+"px;'></a>");jQuery("#TB_window").append("<div id='TB_ImageClick'>"+j+link2+"</div>");j&&jQuery("#"+m).click(f);link2&&jQuery("#"+h).click(p);jQuery.browser.msie&&parseInt(jQuery.browser.version)<=7&&jQuery("#TB_ImageClick > a").focus(function(){this.blur()})}}tb_options.click_img=="download"?jQuery("#TB_window a.download").click(function(){window.location=thickboxL10n.forceDL+"?file="+this.href;return false}):tb_options.click_img=="expand_shrink"&&jQuery("#TB_window a.scalable").click(function(){tb_fitToWindow?
|
||||
e(imgPreloader.width,imgPreloader.height,thickboxL10n.fit):e(tb_fitWidth,tb_fitHeight,thickboxL10n.actual);tb_fitToWindow=!tb_fitToWindow;return false});jQuery(document).bind("keydown.thickbox",function(a){a.stopImmediatePropagation();l.modal!="true"&&jQuery.inArray(a.which,tb_options.keys_close)!=-1?jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove():jQuery.inArray(a.which,tb_options.keys_prev)!=-1||a.shiftKey&&jQuery.inArray(a.which,tb_options.keys_prev.shift)!=
|
||||
-1?TB_PrevHTML!=""&&s():jQuery.inArray(a.which,tb_options.keys_next)!=-1?TB_NextHTML!=""&&o():jQuery.inArray(a.which,tb_options.keys_first)!=-1?TB_PrevHTML!=""&&q():jQuery.inArray(a.which,tb_options.keys_last)!=-1&&TB_NextHTML!=""&&r();return false});b&&tb_options.wheel_img=="prev_next"?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 false});if(b>0){if(TB_PrevHTML!=""){s();return false}}else if(b<0&&TB_NextHTML!=""){o();return false}}):tb_options.wheel_img=="scale"&&jQuery("#TB_window").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){if(a.ctrlKey)return true;a.stopImmediatePropagation();var b=0,a=a.originalEvent;a.wheelDelta?b=a.wheelDelta:a.detail&&(b=-a.detail);a=1+(b>0?0.1:-0.1);b=Math.round(jQuery("#TB_Image").width()*a);a=Math.round(jQuery("#TB_Image").height()*a);b>100&&a>100&&e(b,a);return false});
|
||||
tb_options.move_img&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,"image")});if(tb_options.resize_img){tb_resize_init();jQuery("#TB_Resize").bind("mousedown.thickbox",function(a){return tb_resize(a,"image")})}if(tb_options.effect_cap!="none"){jQuery("#TB_Image").css("margin",jQuery("#TB_Image").css("marginLeft"));tb_options.effect_cap=="zoom"&&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,true)})}tb_position();jQuery("#TB_load").remove();(tb_options.click_img=="close"||!b&&tb_options.click_end=="close")&&jQuery("#TB_ImageOff").click(tb_remove);tb_open()};imgPreloader.src=c}else{var u=c.replace(/^[^\?]+\??/,""),i=tb_parseQuery(u);TB_WIDTH=1*i.width||tb_options.win_width;TB_HEIGHT=1*i.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"!=i.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"!=i.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 q=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),v=tb_getSize(jQuery("#TB_ajaxContent"));
|
||||
TB_WIDTH+=q[0]-v[0];TB_HEIGHT+=q[1]-v[1]+tb_getSize(jQuery("#TB_title"))[1]}jQuery("#TB_closeWindowButton").click(tb_remove);if(-1!=c.indexOf("TB_inline"))jQuery("#TB_ajaxContent").append(jQuery("#"+i.inlineId).children()),jQuery("#TB_window").bind("tb_unload",function(){jQuery("#"+i.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"==k)&&tb_showIframe();else{var w=-1==c.indexOf("?")?"?":"&";jQuery("#TB_ajaxContent").load(c+=w+"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,c.indexOf("TB_iframe")!=-1?"iframe":"ajax")});tb_options.resize_content&&(tb_resize_init(),jQuery("#TB_Resize").bind("mousedown.thickbox",
|
||||
function(a){return tb_resize(a,c.indexOf("TB_iframe")!=-1?"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,true)}));"true"!=i.modal&&jQuery(document).bind("keyup.thickbox",
|
||||
function(a){if(jQuery.inArray(a.which,tb_options.keys_close)!=-1){a.stopImmediatePropagation();jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove();return false}})}}catch(x){tb_options.debug&&alert(x)}}
|
||||
function(){return false});if(b>0){if(TB_PrevHTML!=""){s();return false}}else if(b<0&&TB_NextHTML!=""){o();return false}}):tb_options.wheel_img=="scale"?jQuery("#TB_window").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){if(a.ctrlKey)return true;a.stopImmediatePropagation();var b=0,a=a.originalEvent;a.wheelDelta?b=a.wheelDelta:a.detail&&(b=-a.detail);a=1+(b>0?0.1:-0.1);b=Math.round(jQuery("#TB_Image").width()*a);a=Math.round(jQuery("#TB_Image").height()*a);b>100&&a>100&&e(b,a);return false}):
|
||||
tb_options.wheel_img=="none"&&jQuery("#TB_window").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){a.stopImmediatePropagation();return false});tb_options.wheel_bg=="none"&&jQuery("#TB_overlay").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){a.stopImmediatePropagation();return false});tb_options.move_img&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,"image")});if(tb_options.resize_img){tb_resize_init();jQuery("#TB_Resize").bind("mousedown.thickbox",
|
||||
function(a){return tb_resize(a,"image")})}if(tb_options.effect_cap!="none"){jQuery("#TB_Image").css("margin",jQuery("#TB_Image").css("marginLeft"));tb_options.effect_cap=="zoom"&&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,true)})}tb_position();jQuery("#TB_load").remove();
|
||||
(tb_options.click_img=="close"||!b&&tb_options.click_end=="close")&&jQuery("#TB_ImageOff").click(tb_remove);tb_open()};imgPreloader.src=c}else{var u=c.replace(/^[^\?]+\??/,""),i=tb_parseQuery(u);TB_WIDTH=1*i.width||tb_options.win_width;TB_HEIGHT=1*i.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"!=i.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"!=i.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 q=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),v=tb_getSize(jQuery("#TB_ajaxContent"));TB_WIDTH+=q[0]-v[0];TB_HEIGHT+=
|
||||
q[1]-v[1]+tb_getSize(jQuery("#TB_title"))[1]}jQuery("#TB_closeWindowButton").click(tb_remove);if(-1!=c.indexOf("TB_inline"))jQuery("#TB_ajaxContent").append(jQuery("#"+i.inlineId).children()),jQuery("#TB_window").bind("tb_unload",function(){jQuery("#"+i.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"==k)&&tb_showIframe();else{var w=-1==c.indexOf("?")?"?":"&";jQuery("#TB_ajaxContent").load(c+=w+"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,c.indexOf("TB_iframe")!=-1?"iframe":"ajax")});tb_options.resize_content&&(tb_resize_init(),jQuery("#TB_Resize").bind("mousedown.thickbox",function(a){return tb_resize(a,c.indexOf("TB_iframe")!=
|
||||
-1?"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,true)}));"true"!=i.modal&&jQuery(document).bind("keyup.thickbox",function(a){if(jQuery.inArray(a.which,tb_options.keys_close)!=
|
||||
-1){a.stopImmediatePropagation();jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove();return false}})}}catch(x){tb_options.debug&&alert(x)}}
|
||||
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))}
|
||||
|
||||
Reference in new issue
Block a user