NEW: Enhanced Auto Resize feature so that it works even when showing iframe/ajax/inline content. Changed "Enabled" option to "Image/Content" option at "General - Auto Resize" setting, and added "View - Margin - Window (Content)" option.
This commit is contained in:
1 parent
55ad3dc08d
commit
9fb49e5820
5 files changed
+84
-42
No files matched your search
@@ -112,8 +112,10 @@ class auto_thickbox_options {
|
||||
<tr>
|
||||
<th scope="row"><?php $this->util->_e('Auto Resize'); ?></th>
|
||||
<td>
|
||||
<label><input type="checkbox" name="auto-thickbox-plus[auto_resize]"<?php $this->util->checked($this->options['auto_resize'], 'on'); ?> />
|
||||
<?php $this->util->_e('Enabled'); ?></label>
|
||||
<label class="item"><input type="checkbox" name="auto-thickbox-plus[auto_resize]"<?php $this->util->checked($this->options['auto_resize'], 'on'); ?> />
|
||||
<?php echo $this->texts['image']; ?></label>
|
||||
<label class="item"><input type="checkbox" name="auto-thickbox-plus[auto_resize_content]"<?php $this->util->checked($this->options['auto_resize_content'], 'on'); ?> />
|
||||
<?php $this->util->_e('Content'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -502,11 +504,18 @@ class auto_thickbox_options {
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><a href="<?php $this->util->_e('https://developer.mozilla.org/en/CSS/margin'); ?>" target="_blank"><?php $this->util->_e('Margin'); ?></a></th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?></th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (<?php echo $this->texts['image']; ?>)</th>
|
||||
<td>
|
||||
<input type="number" min="0" name="auto-thickbox-plus[margin_win]" value="<?php echo $this->options['margin_win']; ?>" class="small-text" /> px
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (<?php $this->util->_e('Content'); ?>)</th>
|
||||
<td>
|
||||
<input type="number" min="0" name="auto-thickbox-plus[margin_win_content]" value="<?php echo $this->options['margin_win_content']; ?>" class="small-text" /> px
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<th scope="row"><?php echo $this->texts['image']; ?></th>
|
||||
@@ -926,7 +935,7 @@ class auto_thickbox_options {
|
||||
register_setting( $this->option_group, 'auto-thickbox-plus', array(&$this, 'options_callback') );
|
||||
}
|
||||
|
||||
var $checkboxes_on = array('wp_gallery', 'thickbox_text', 'auto_resize',
|
||||
var $checkboxes_on = array('wp_gallery', 'thickbox_text', 'auto_resize', 'auto_resize_content',
|
||||
'key_close_esc', 'key_close_enter',
|
||||
'key_prev_angle', 'key_prev_left',
|
||||
'key_next_angle', 'key_next_right',
|
||||
|
||||
@@ -270,6 +270,8 @@ SCRIPT;
|
||||
|
||||
if ( !$this->is_default_options('auto_resize') )
|
||||
$script .= "tb_options.auto_resize = " . var_export($this->options['auto_resize'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('auto_resize_content') )
|
||||
$script .= "tb_options.auto_resize_content = " . var_export($this->options['auto_resize_content'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('effect_open') )
|
||||
$script .= "tb_options.effect_open = '{$this->options['effect_open']}';\n";
|
||||
if ( !$this->is_default_options('effect_close') )
|
||||
@@ -348,6 +350,8 @@ SCRIPT;
|
||||
$script .= "tb_options.win_height = {$this->options['win_height']};\n";
|
||||
if ( !$this->is_default_options('margin_win') )
|
||||
$script .= "tb_options.margin_win = {$this->options['margin_win']};\n";
|
||||
if ( !$this->is_default_options('margin_win_content') )
|
||||
$script .= "tb_options.margin_win_content = {$this->options['margin_win_content']};\n";
|
||||
|
||||
if ( !$this->is_default_options('ref_title') )
|
||||
$script .= "tb_options.ref_title = [{$this->options['ref_title']}];\n";
|
||||
@@ -583,6 +587,7 @@ SCRIPT;
|
||||
'thickbox_target' => 'off',
|
||||
'no_thickbox' => 'nothickbox no_thickbox ',
|
||||
'auto_resize' => 'on',
|
||||
'auto_resize_content' => 'off',
|
||||
'builtin_res' => 'off',
|
||||
'script_place' => 'header',
|
||||
'mobile_support' => 'no_margin',
|
||||
@@ -640,6 +645,7 @@ SCRIPT;
|
||||
'bgcolor_bg' => 'black',
|
||||
'margin_img' => '15',
|
||||
'margin_win' => '15',
|
||||
'margin_win_content' => '30',
|
||||
'border_win' => '1px solid #555',
|
||||
'border_width_win' => '1',
|
||||
'border_style_win' => 'solid',
|
||||
|
||||
+2
-2
@@ -277,9 +277,9 @@ You can localize the plugin with [Poedit](http://www.poedit.net/) and "languages
|
||||
|
||||
= Latest Version =
|
||||
* NEW: Mobile support for small-screen devices such as iPhone, Android, Symbian, BlackBerry and Windows Phone
|
||||
* NEW: Auto Resize feature works even when resizing browser window
|
||||
* NEW: Enhanced Auto Resize feature so that it works even when resizing browser window, even when showing iframe/ajax/inline content. Changed "Enabled" option to "Image/Content" option at "General - Auto Resize" setting.
|
||||
* NEW: "General - Mobile Support" options that has "No Window Margin"/"No ThickBox" option and "Width"/"Height" option
|
||||
* NEW: "View - Margin - Window" option
|
||||
* NEW: "View - Margin - Window (Image/Content)" option
|
||||
* CHANGED: Removed CSS hacks for IE6. Replaced CSS Expression with JavaScript.
|
||||
* FIXED: Invalid positioning. some mobile browsers, such as older iOS (iPhone/iPad/iPod touch) and older Android, do not support `position:fixed` style.
|
||||
* FIXED: Gallery images cannot be displayed in gallery style with [Cleaner Gallery](http://wordpress.org/extend/plugins/cleaner-gallery/)
|
||||
|
||||
+29
-6
@@ -18,6 +18,7 @@ jQuery(document).ready(function(){ // delay for combined JS
|
||||
|
||||
var tb_options = {
|
||||
auto_resize: true,
|
||||
auto_resize_content: false,
|
||||
click_img: "close",
|
||||
click_end: "loop",
|
||||
click_bg: "close",
|
||||
@@ -40,6 +41,7 @@ var tb_options = {
|
||||
win_width: 600,
|
||||
win_height: 400,
|
||||
margin_win: 15,
|
||||
margin_win_content: 30,
|
||||
ref_title: ['link-title', 'link-name'],
|
||||
ref_cap: ['link-title', 'link-name'],
|
||||
effect_open: "none",
|
||||
@@ -550,12 +552,14 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
|
||||
jQuery("#TB_window").bind('tb_unload', function () {
|
||||
jQuery('#' + params['inlineId']).append( jQuery("#TB_ajaxContent").children() ); // move elements back when you're finished
|
||||
});
|
||||
tb_position_html(url, params);
|
||||
tb_reposition_html(url, params);
|
||||
jQuery(window).bind('resize.thickbox', function() { tb_reposition_html(url, params); });
|
||||
jQuery("#TB_load").remove();
|
||||
tb_open();
|
||||
tb_roundCorner("iframe");
|
||||
}else if(url.indexOf('TB_iframe') != -1){
|
||||
tb_position_html(url, params);
|
||||
tb_reposition_html(url, params);
|
||||
jQuery(window).bind('resize.thickbox', function() { tb_reposition_html(url, params); });
|
||||
if ((!("onload" in jQuery("#TB_iframeContent")[0]) && (typeof jQuery("#TB_iframeContent")[0]["onload"] != "function")) // not support iframe onload - http://kangax.github.com/iseventsupported/
|
||||
|| urlType == '.pdf') { // XXX: Not wait for loading to complete because "onload" event won't triggered in IE and Firefox
|
||||
tb_showIframe();
|
||||
@@ -563,7 +567,8 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
|
||||
}else{
|
||||
var sign = (url.indexOf('?') == -1) ? '?' : '&';
|
||||
jQuery("#TB_ajaxContent").load(url += sign + "random=" + (new Date().getTime()),function(){//to do a post change this load method
|
||||
tb_position_html(url, params);
|
||||
tb_reposition_html(url, params);
|
||||
jQuery(window).bind('resize.thickbox', function() { tb_reposition_html(url, params); });
|
||||
jQuery("#TB_load").remove();
|
||||
tb_open();
|
||||
tb_roundCorner("ajax")
|
||||
@@ -809,9 +814,27 @@ function tb_reposition(params) {
|
||||
tb_position();
|
||||
}
|
||||
|
||||
function tb_position_html(url, params) {
|
||||
TB_WIDTH = (params['width']*1) || tb_options.win_width; //defaults to 600 if no paramaters were added to URL
|
||||
TB_HEIGHT = (params['height']*1) || tb_options.win_height; //defaults to 400 if no paramaters were added to URL
|
||||
function tb_reposition_html(url, params) {
|
||||
var winBorderSize = tb_getSize(jQuery("#TB_window"), "border");
|
||||
var winSize = tb_getSize(jQuery("#TB_window"));
|
||||
|
||||
var pageSize = tb_getPageSize();
|
||||
var winMargin = (pageSize[0] <= tb_options.small_width || pageSize[1] <= tb_options.small_height) ? 0 : tb_options.margin_win_content * 2;
|
||||
|
||||
var x = jQuery(window).width() - (winBorderSize[0] - winSize[0]) - winMargin;
|
||||
var y = jQuery(window).height() - (winBorderSize[1] - winSize[1]) - winMargin;
|
||||
if(url.indexOf('TB_iframe') != -1) {
|
||||
x -= ('\v'=='v' ? 10 : 8) * 2; // subtract default body margin (IE or not)
|
||||
y -= ('\v'=='v' ? 15 : 8) * 2 + tb_getSize(jQuery("#TB_title"))[1]; // subtract body margin and title bar height
|
||||
} else {
|
||||
var innerSize = tb_getSize(jQuery("#TB_ajaxContent"), "padding");
|
||||
var size = tb_getSize(jQuery("#TB_ajaxContent"));
|
||||
x -= innerSize[0] - size[0]; // subtract content padding
|
||||
y -= innerSize[1] - size[1] + tb_getSize(jQuery("#TB_title"))[1];
|
||||
}
|
||||
|
||||
TB_WIDTH = params['width'] ? Math.min(params['width']*1, x) : (tb_options.auto_resize_content ? x : tb_options.win_width); //defaults to 600 if no paramaters were added to URL
|
||||
TB_HEIGHT = params['height'] ? Math.min(params['height']*1, y) : (tb_options.auto_resize_content ? y : tb_options.win_height); //defaults to 400 if no paramaters were added to URL
|
||||
ajaxContentW = TB_WIDTH;
|
||||
ajaxContentH = TB_HEIGHT;
|
||||
|
||||
|
||||
Vendored
+34
-30
@@ -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",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",mobile_support:"no_margin",small_width:480,small_height:480,win_width:600,win_height:400,margin_win:15,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};
|
||||
var tb_options={auto_resize:!0,auto_resize_content:!1,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",mobile_support:"no_margin",small_width:480,small_height:480,win_width:600,win_height:400,margin_win:15,margin_win_content:30,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;var a,c=navigator.userAgent,b=(a=c.match(/AppleWebKit\/([0-9]+)/))&&534>a[1],d=(a=c.match(/Opera Mobi\/([0-9]+)/))&&7458>a[1],e=(a=c.match(/Fennec\/([0-9]+)/))&&6>a[1];notSupportedPositionFixed="undefined"==typeof document.body.style.maxHeight||/(iPhone|iPod|iPad)/.test(navigator.platform)&&b||-1<c.indexOf("Android")&&b||window.operamini&&"[object OperaMini]"===Object.prototype.toString.call(window.operamini)||
|
||||
d||e||window.palmGetResource&&b||-1<c.indexOf("MeeGo")&&-1<c.indexOf("NokiaBrowser/8.5.0")});function tb_init(a){jQuery.isFunction(jQuery().live)?jQuery(a).live("click",tb_click):jQuery(a).bind("click",tb_click)}
|
||||
function tb_click(){if("no_thickbox"==tb_options.mobile_support){var a=tb_getPageSize();if(a[0]<=tb_options.small_width||a[1]<=tb_options.small_height)return!0}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}
|
||||
@@ -11,31 +11,31 @@ height:(document.body.scrollHeight>document.body.offsetHeight?document.body.scro
|
||||
2)+(TBWindowMargin=document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop)+"px"});0==parseInt(jQuery("#TB_load").css("marginLeft"))&&jQuery("#TB_load").css("marginLeft",-jQuery("#TB_load").outerWidth()/2);0==parseInt(jQuery("#TB_load").css("marginTop"))&&jQuery("#TB_load").css("marginTop",-jQuery("#TB_load").outerHeight()/2);jQuery("#TB_load").show();var d=c;-1!==c.indexOf("?")&&(d=c.substr(0,c.indexOf("?")));-1!==c.indexOf("#")&&(d=c.substr(0,c.indexOf("#")));var e=
|
||||
/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$|\.webp$|\.pdf$/,g=d.toLowerCase().match(e);if(".jpg"==g||".jpeg"==g||".png"==g||".gif"==g||".bmp"==g||".webp"==g){TB_imageCount=TB_NextHTML=TB_NextURL=TB_NextCaption=TB_PrevHTML=TB_PrevURL=TB_PrevCaption="";TB_FoundURL=!1;TB_LastURL=TB_LastCaption=TB_FirstURL=TB_FirstCaption="";if(b){TB_TempArray=jQuery("a[rel="+b+"]").get();for(TB_Counter=0;TB_Counter<TB_TempArray.length&&""===TB_NextHTML;TB_Counter++)TB_TempArray[TB_Counter].href.toLowerCase().match(e),("object"==
|
||||
typeof a?TB_TempArray[TB_Counter]!=a:TB_TempArray[TB_Counter].href!=c)?TB_FoundURL?(TB_NextCaption=TB_TempArray[TB_Counter],TB_NextURL=TB_TempArray[TB_Counter].href,TB_NextHTML="<span id='TB_next'> <a href='#'>"+thickboxL10n.next+"</a></span>"):(TB_PrevCaption=TB_TempArray[TB_Counter],TB_PrevURL=TB_TempArray[TB_Counter].href,TB_PrevHTML="<span id='TB_prev'> <a href='#'>"+thickboxL10n.prev+"</a></span>"):(TB_FoundURL=!0,TB_imageCount=thickboxL10n.image+" "+(TB_Counter+1)+" "+
|
||||
thickboxL10n.of+" "+TB_TempArray.length);TB_FirstCaption=TB_TempArray[0];TB_FirstURL=TB_TempArray[0].href;TB_LastCaption=TB_TempArray[TB_TempArray.length-1];TB_LastURL=TB_TempArray[TB_TempArray.length-1].href}imgPreloader=new Image;imgPreloader.onload=function(){function d(a,b,c){var e=a-jQuery("#TB_Image").width(),r=b-jQuery("#TB_Image").height();jQuery("#TB_window").css({marginLeft:Math.round(parseInt(jQuery("#TB_window").css("marginLeft"))-e/2),marginTop:Math.round(parseInt(jQuery("#TB_window").css("marginTop"))-
|
||||
r/2)});jQuery("#TB_window").width(jQuery("#TB_window").width()+e).height("auto");jQuery("#TB_Image").width(a).height(b);c&&jQuery("#TB_window a.scalable").attr("title",c)}imgPreloader.onload=null;var e=c.replace(/^[^\?]+\??/,""),f=tb_parseQuery(e);"object"==typeof a&&(a=tb_caption(a));TB_Image="<img id='TB_Image' src='"+c+"' width='"+imgPreloader.width+"' height='"+imgPreloader.height+"' alt='"+a+"'/>";"close"==tb_options.click_img||!b&&"close"==tb_options.click_end?TB_Image="<a href='' id='TB_ImageOff' title='"+
|
||||
thickboxL10n.of+" "+TB_TempArray.length);TB_FirstCaption=TB_TempArray[0];TB_FirstURL=TB_TempArray[0].href;TB_LastCaption=TB_TempArray[TB_TempArray.length-1];TB_LastURL=TB_TempArray[TB_TempArray.length-1].href}imgPreloader=new Image;imgPreloader.onload=function(){function d(a,b,c){var e=a-jQuery("#TB_Image").width(),f=b-jQuery("#TB_Image").height();jQuery("#TB_window").css({marginLeft:Math.round(parseInt(jQuery("#TB_window").css("marginLeft"))-e/2),marginTop:Math.round(parseInt(jQuery("#TB_window").css("marginTop"))-
|
||||
f/2)});jQuery("#TB_window").width(jQuery("#TB_window").width()+e).height("auto");jQuery("#TB_Image").width(a).height(b);c&&jQuery("#TB_window a.scalable").attr("title",c)}imgPreloader.onload=null;var e=c.replace(/^[^\?]+\??/,""),f=tb_parseQuery(e);"object"==typeof a&&(a=tb_caption(a));TB_Image="<img id='TB_Image' src='"+c+"' width='"+imgPreloader.width+"' height='"+imgPreloader.height+"' alt='"+a+"'/>";"close"==tb_options.click_img||!b&&"close"==tb_options.click_end?TB_Image="<a href='' id='TB_ImageOff' title='"+
|
||||
thickboxL10n.close+"'>"+TB_Image+"</a>":"open"==tb_options.click_img?TB_Image="<a href='"+c+"' target='_blank' title='"+thickboxL10n.open+"'>"+TB_Image+"</a>":"download"==tb_options.click_img?TB_Image="<a href='"+c+"' class='download' title='"+thickboxL10n.download+"'>"+TB_Image+"</a>":"expand_shrink"==tb_options.click_img&&(TB_Image="<a href='' class='scalable' title='"+(tb_fitToWindow?thickboxL10n.actual:thickboxL10n.fit)+"'>"+TB_Image+"</a>");TB_Caption="<div id='TB_caption'>"+a+"<div id='TB_secondLine'>"+
|
||||
TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='"+tb_closeImage+"' /></a></div>";"none"!=tb_options.effect_cap&&(TB_Caption="<div id='TB_CaptionBar'>"+TB_Caption+"</div>");switch(tb_options.position_cap){case "top":jQuery("#TB_window").append(TB_Caption+TB_Image).addClass("TB_imageContent TB_captionTop");break;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 l=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 k=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(k);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 m,i,j;""!=TB_NextHTML?(m="TB_ImageNext",i=thickboxL10n.next,j=k):"close"==tb_options.click_end?(m="TB_ImageClose",i=thickboxL10n.close,j=tb_remove):"loop"==tb_options.click_end&&""!=TB_PrevHTML&&(m="TB_ImageFirst",i=thickboxL10n.first,j=l);m&&(i&&j)&&(jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+m+"' title='"+i+"'><span></span></a></div>"),jQuery("#"+m).click(j))}else if(b&&"prev_next"==
|
||||
tb_options.click_img){var q,r,h;""!=TB_PrevHTML&&(m="TB_ImagePrev",i=thickboxL10n.prev,j=g);""!=TB_NextHTML&&(q="TB_ImageNext",r=thickboxL10n.next,h=k);""==TB_PrevHTML&&("close"==tb_options.click_end?(m="TB_ImageClose",i=thickboxL10n.close,j=tb_remove):"loop"==tb_options.click_end&&""!=TB_NextHTML&&(m="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=l));if(m&&i&&j||q&&r&&h)e=link2="",m&&(i&&j)&&(e="<a href='' id='"+m+"' 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("#"+m).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?
|
||||
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 j=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 i=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(i);var t=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 h,l,m;""!=TB_NextHTML?(h="TB_ImageNext",l=thickboxL10n.next,m=i):"close"==tb_options.click_end?(h="TB_ImageClose",l=thickboxL10n.close,m=tb_remove):"loop"==tb_options.click_end&&""!=TB_PrevHTML&&(h="TB_ImageFirst",l=thickboxL10n.first,m=j);h&&(l&&m)&&(jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+h+"' title='"+l+"'><span></span></a></div>"),jQuery("#"+h).click(m))}else if(b&&"prev_next"==
|
||||
tb_options.click_img){var n,q,s;""!=TB_PrevHTML&&(h="TB_ImagePrev",l=thickboxL10n.prev,m=g);""!=TB_NextHTML&&(n="TB_ImageNext",q=thickboxL10n.next,s=i);""==TB_PrevHTML&&("close"==tb_options.click_end?(h="TB_ImageClose",l=thickboxL10n.close,m=tb_remove):"loop"==tb_options.click_end&&""!=TB_NextHTML&&(h="TB_ImageLast",l=thickboxL10n.last,m=t));""==TB_NextHTML&&("close"==tb_options.click_end?(n="TB_ImageClose2",q=thickboxL10n.close,s=tb_remove):"loop"==tb_options.click_end&&""!=TB_PrevHTML&&(n="TB_ImageFirst",
|
||||
q=thickboxL10n.first,s=j));if(h&&l&&m||n&&q&&s)e=link2="",h&&(l&&m)&&(e="<a href='' id='"+h+"' class='TB_ImageLeft' title='"+l+"'></a>"),n&&(q&&s)&&(link2="<a href='' id='"+n+"' class='TB_ImageRight' title='"+q+"'></a>"),jQuery("#TB_window").append("<div id='TB_ImageClick'>"+e+link2+"</div>"),e&&jQuery("#"+h).click(m),link2&&jQuery("#"+n).click(s),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&&k():-1!=jQuery.inArray(a.which,tb_options.keys_first)?""!=TB_PrevHTML&&l():-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 k(),!1}):"scale"==tb_options.wheel_img?jQuery("#TB_window").bind("mousewheel.thickbox DOMMouseScroll.thickbox",function(a){if(a.ctrlKey)return!0;a.stopImmediatePropagation();
|
||||
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&&i():-1!=jQuery.inArray(a.which,tb_options.keys_first)?""!=TB_PrevHTML&&j():-1!=jQuery.inArray(a.which,tb_options.keys_last)&&""!=TB_NextHTML&&t();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 i(),!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 l=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),s=tb_getSize(jQuery("#TB_ajaxContent"));
|
||||
TB_WIDTH+=l[0]-s[0];TB_HEIGHT+=l[1]-s[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());notSupportedPositionFixed&&"relative"!=jQuery("body").css("position")&&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":notSupportedPositionFixed&&"relative"!=jQuery("body").css("position")&&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"==
|
||||
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 j=c.replace(/^[^\?]+\??/,""),f=tb_parseQuery(j);"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(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()'>"+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'></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].scrollTop=0,jQuery("#TB_ajaxWindowTitle").html(a);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_reposition_html(c,f),jQuery(window).bind("resize.thickbox",function(){tb_reposition_html(c,f)}),jQuery("#TB_load").remove(),tb_open(),tb_roundCorner("iframe");
|
||||
else if(-1!=c.indexOf("TB_iframe"))tb_reposition_html(c,f),jQuery(window).bind("resize.thickbox",function(){tb_reposition_html(c,f)}),(!("onload"in jQuery("#TB_iframeContent")[0])&&"function"!=typeof jQuery("#TB_iframeContent")[0].onload||".pdf"==g)&&tb_showIframe();else{var i=-1==c.indexOf("?")?"?":"&";jQuery("#TB_ajaxContent").load(c+=i+"random="+(new Date).getTime(),function(){tb_reposition_html(c,f);jQuery(window).bind("resize.thickbox",function(){tb_reposition_html(c,f)});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(v){tb_options.debug&&
|
||||
alert(v)}}
|
||||
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());notSupportedPositionFixed&&"relative"!=jQuery("body").css("position")&&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":notSupportedPositionFixed&&"relative"!=jQuery("body").css("position")&&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));notSupportedPositionFixed&&jQuery("#TB_window").css({position:"absolute",marginTop:-parseInt(jQuery("#TB_window")[0].offsetHeight/2)+(TBWindowMargin=document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop)+"px"})}
|
||||
function tb_roundCorner(a){var c=jQuery("#TB_window")[0].currentStyle||document.defaultView.getComputedStyle(jQuery("#TB_window")[0],""),b=c.borderTopLeftRadius;if(0<parseInt(b))if("transparent"!=jQuery("#TB_window").css("backgroundColor")&&"rgba(0, 0, 0, 0)"!=jQuery("#TB_window").css("backgroundColor")&&jQuery("#TB_window").css("backgroundColor",0<parseInt(c.borderTopWidth)?c.borderTopColor:"transparent"),"iframe"==a){if(jQuery.browser.safari||jQuery.browser.webkit){var c=jQuery("#TB_iframeContent"),
|
||||
d=jQuery("#TB_iframeContent").contents(),a=0==d.length||c.width()<d.width(),c=0==d.length||c.height()<d.height();("top"==tb_options.position_title||"none"==tb_options.position_title)&&(a||c)&&jQuery("#TB_iframeContent").css("paddingBottom",b);("bottom"==tb_options.position_title||"none"==tb_options.position_title)&&c&&jQuery("#TB_iframeContent").css("paddingTop",b)}}else if("ajax"==a){c=jQuery("#TB_ajaxContent")[0];a=c.scrollWidth>c.clientWidth;c=c.scrollHeight>c.clientHeight;if(("top"==tb_options.position_title||
|
||||
@@ -45,18 +45,22 @@ function tb_remove(){tb_effectView(tb_options.effect_close,!1);var a=function(){
|
||||
a);break;case "fade":jQuery("#TB_window").fadeOut(tb_options.effect_speed,a);break;default:a()}jQuery("#TB_load").remove();jQuery(document).add(window).unbind(".thickbox");return!1}
|
||||
function tb_position(){var a=TB_WIDTH+jQuery("#TB_window").outerWidth()-jQuery("#TB_window").width(),c=TB_HEIGHT+jQuery("#TB_window").outerHeight()-jQuery("#TB_window").height(),b=-parseInt(a/2,10),d=-parseInt(c/2,10),e=notSupportedPositionFixed;!e&&"absolute"==jQuery("#TB_window").css("position")&&(b+=jQuery(document).scrollLeft(),d+=jQuery(document).scrollTop());jQuery("#TB_window").css({marginLeft:b+"px",width:TB_WIDTH+"px"});e||jQuery("#TB_window").css({marginTop:d+"px"});"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=0==jQuery("#TB_Image").height();c&&jQuery("#TB_Image").height(imgPreloader.height);var b=tb_getSize(jQuery("#TB_window"),"border"),d=tb_getSize(jQuery("#TB_window")),e=tb_getSize(jQuery("#TB_Image"),"margin"),g=tb_getSize(jQuery("#TB_Image")),k=tb_getPageSize(),f=k[0]<=tb_options.small_width||k[1]<=tb_options.small_height?0:2*tb_options.margin_win,k=jQuery(window).width()-(b[0]-d[0]+e[0]-g[0])-f,b=jQuery(window).height()-
|
||||
(b[1]-g[1])-f,f=a.width?Math.min(1*a.width,imgPreloader.width):imgPreloader.width,l=a.height?Math.min(1*a.height,imgPreloader.height):imgPreloader.height;tb_fitWidth=k;tb_fitHeight=Math.round(l*(k/f));tb_fitHeight>b&&(tb_fitWidth=Math.round(tb_fitWidth*(b/tb_fitHeight)),tb_fitHeight=b);if(tb_fitToWindow=tb_options.auto_resize&&(f>k||l>b))f=tb_fitWidth,l=tb_fitHeight;jQuery("#TB_Image").attr("width",f).attr("height",l);c&&jQuery("#TB_Image").height(l);TB_WIDTH=f+(e[0]-g[0]);TB_HEIGHT=l+(d[1]-g[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);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_reposition(a){jQuery("#TB_window").width(jQuery(window).width());var c=0==jQuery("#TB_Image").height();c&&jQuery("#TB_Image").height(imgPreloader.height);var b=tb_getSize(jQuery("#TB_window"),"border"),d=tb_getSize(jQuery("#TB_window")),e=tb_getSize(jQuery("#TB_Image"),"margin"),g=tb_getSize(jQuery("#TB_Image")),j=tb_getPageSize(),f=j[0]<=tb_options.small_width||j[1]<=tb_options.small_height?0:2*tb_options.margin_win,j=jQuery(window).width()-(b[0]-d[0]+e[0]-g[0])-f,b=jQuery(window).height()-
|
||||
(b[1]-g[1])-f,f=a.width?Math.min(1*a.width,imgPreloader.width):imgPreloader.width,i=a.height?Math.min(1*a.height,imgPreloader.height):imgPreloader.height;tb_fitWidth=j;tb_fitHeight=Math.round(i*(j/f));tb_fitHeight>b&&(tb_fitWidth=Math.round(tb_fitWidth*(b/tb_fitHeight)),tb_fitHeight=b);if(tb_fitToWindow=tb_options.auto_resize&&(f>j||i>b))f=tb_fitWidth,i=tb_fitHeight;jQuery("#TB_Image").attr("width",f).attr("height",i);c&&jQuery("#TB_Image").height(i);TB_WIDTH=f+(e[0]-g[0]);TB_HEIGHT=i+(d[1]-g[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);jQuery("#TB_ImageClick > a").height(tb_getSize(jQuery("#TB_Image"),"margin")[1]);tb_position()}
|
||||
function tb_reposition_html(a,c){var b=tb_getSize(jQuery("#TB_window"),"border"),d=tb_getSize(jQuery("#TB_window")),e=tb_getPageSize(),g=e[0]<=tb_options.small_width||e[1]<=tb_options.small_height?0:2*tb_options.margin_win_content,e=jQuery(window).width()-(b[0]-d[0])-g,b=jQuery(window).height()-(b[1]-d[1])-g;-1!=a.indexOf("TB_iframe")?(e-=2*("\v"=="v"?10:8),b-=2*("\v"=="v"?15:8)+tb_getSize(jQuery("#TB_title"))[1]):(d=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),g=tb_getSize(jQuery("#TB_ajaxContent")),
|
||||
e-=d[0]-g[0],b-=d[1]-g[1]+tb_getSize(jQuery("#TB_title"))[1]);TB_WIDTH=c.width?Math.min(1*c.width,e):tb_options.auto_resize_content?e:tb_options.win_width;TB_HEIGHT=c.height?Math.min(1*c.height,b):tb_options.auto_resize_content?b:tb_options.win_height;ajaxContentW=TB_WIDTH;ajaxContentH=TB_HEIGHT;-1!=a.indexOf("TB_iframe")?(ajaxContentW+=2*("\v"=="v"?10:8),ajaxContentH+=2*("\v"=="v"?15:8),jQuery("#TB_iframeContent").attr("style","width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;")):"block"!=jQuery("#TB_window").css("display")?
|
||||
jQuery("#TB_ajaxContent").attr("style","width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;"):(jQuery("#TB_ajaxContent")[0].style.width=ajaxContentW+"px",jQuery("#TB_ajaxContent")[0].style.height=ajaxContentH+"px");-1!=a.indexOf("TB_iframe")?(TB_WIDTH+=2*("\v"=="v"?10:8),TB_HEIGHT+=2*("\v"=="v"?15:8)+tb_getSize(jQuery("#TB_title"))[1]):(d=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),g=tb_getSize(jQuery("#TB_ajaxContent")),TB_WIDTH+=d[0]-g[0],TB_HEIGHT+=d[1]-g[1]+tb_getSize(jQuery("#TB_title"))[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>");notSupportedPositionFixed&&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"));!notSupportedPositionFixed&&"absolute"!=jQuery("#TB_window").css("position")&&(d-=jQuery(document).scrollLeft(),e-=jQuery(document).scrollTop());var g=a.clientX,k=a.clientY,f=!1,l=jQuery("#TB_window, #TB_overlay, "+("image"==c?"#TB_window a":
|
||||
"#TB_closeWindowButton")),s="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(),u=jQuery("image"==c?"#TB_Image":"iframe"==c?"#TB_iframeContent":
|
||||
"#TB_ajaxContent"),C=u.width(),m=u.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(notSupportedPositionFixed)var q=jQuery("#TB_window").css("marginTop")}jQuery(document).bind("mousemove.thickbox",function(a,h,p){var h=h?h:a.clientX,p=p?p:a.clientY,a=h-g,n=p-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=p,l.css("cursor",b);if(f){y&&(h=z+a*i,p=A+n*j,h/=p,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),u.width(C+a*i)));B&&(p=A+n*j,p<MIN_HEIGHT?skipMoveY=!0:(jQuery("#TB_window").height(p),u.height(m+n*j),"image"==c&&jQuery("#TB_ImageClick > a").height(jQuery("#TB_Image").outerHeight(!0)),notSupportedPositionFixed&&jQuery("#TB_window").css("marginTop",q)));s&&!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;l.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,
|
||||
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"));!notSupportedPositionFixed&&"absolute"!=jQuery("#TB_window").css("position")&&(d-=jQuery(document).scrollLeft(),e-=jQuery(document).scrollTop());var g=a.clientX,j=a.clientY,f=!1,i=jQuery("#TB_window, #TB_overlay, "+("image"==c?"#TB_window a":
|
||||
"#TB_closeWindowButton")),v="move"==b||"w-resize"==b||"nw-resize"==b||"sw-resize"==b,z="move"==b||"n-resize"==b||"ne-resize"==b||"nw-resize"==b,A="move"!=b&&"n-resize"!=b&&"s-resize"!=b,B="move"!=b&&"e-resize"!=b&&"w-resize"!=b,x="ne-resize"==b||"nw-resize"==b||"se-resize"==b||"sw-resize"==b;if(x)var u=jQuery("#TB_window").width()/jQuery("#TB_window").height();if("move"!=b){var y=jQuery("#TB_window").width(),t=jQuery("#TB_window").height(),h=jQuery("image"==c?"#TB_Image":"iframe"==c?"#TB_iframeContent":
|
||||
"#TB_ajaxContent"),l=h.width(),m=h.height(),n="e-resize"==b||"ne-resize"==b||"se-resize"==b?1:-1,q="s-resize"==b||"se-resize"==b||"sw-resize"==b?1:-1;if(notSupportedPositionFixed)var s=jQuery("#TB_window").css("marginTop")}jQuery(document).bind("mousemove.thickbox",function(a,k,r){var k=k?k:a.clientX,r=r?r:a.clientY,a=k-g,p=r-j;if(!f&&(a=a>TB_THRESHOLD?a-TB_THRESHOLD:a<-TB_THRESHOLD?a+TB_THRESHOLD:0,p=p>TB_THRESHOLD?p-TB_THRESHOLD:p<-TB_THRESHOLD?p+TB_THRESHOLD:0,0<Math.abs(a)||0<Math.abs(p)))f=!0,
|
||||
g=k,j=r,i.css("cursor",b);if(f){x&&(k=y+a*n,r=t+p*q,k/=r,u>k?p=Math.round(a/u)*n*q:u<k&&(a=Math.round(p*u)*n*q));var w=skipMoveY=!1;A&&(k=y+a*n,k<MIN_WIDTH?w=!0:(jQuery("#TB_window").width(k),h.width(l+a*n)));B&&(r=t+p*q,r<MIN_HEIGHT?skipMoveY=!0:(jQuery("#TB_window").height(r),h.height(m+p*q),"image"==c&&jQuery("#TB_ImageClick > a").height(jQuery("#TB_Image").outerHeight(!0)),notSupportedPositionFixed&&jQuery("#TB_window").css("marginTop",s)));v&&!w&&jQuery("#TB_window").css("left",d+a);z&&!skipMoveY&&
|
||||
jQuery("#TB_window").css("top",e+p)}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;i.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