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.

* Added download.php that is Force Download script
 * Updated translations
This commit is contained in:
attosoft committed 2012-08-12 23:56:14 +00:00
1 parent f57309eeca
commit e07b3e8bb0
19 files changed
+188 -23

No files matched your search

+2
View File
@@ -155,6 +155,8 @@ class auto_thickbox_options {
<?php echo "{$this->texts['prev2']} / {$this->texts['next2']}"; ?></label>
<label class="item"><input type="radio" name="auto-thickbox-plus[click_img]" value="open"<?php $this->util->checked($this->options['click_img'], 'open'); ?> onclick="disableClickOption(this)" />
<?php echo $this->texts['open']; ?></label>
<label class="item"><input type="radio" name="auto-thickbox-plus[click_img]" value="download"<?php $this->util->checked($this->options['click_img'], 'download'); ?> onclick="disableClickOption(this)" />
<?php $this->util->_e('Download'); ?> (<?php $this->util->_e('beta'); ?>)</label>
</td>
</tr>
<tr>
+3
View File
@@ -152,6 +152,7 @@ class auto_thickbox {
case 'prev_next': $l10n['last'] = $this->texts['last']; // not break
case 'next': $l10n['first'] = $this->texts['first']; break;
case 'open': $l10n['open'] = $this->texts['open']; break;
case 'download': $l10n['download'] = $this->util->__('Download'); break;
}
wp_localize_script('thickbox', 'thickboxL10n', $l10n);
}
@@ -280,6 +281,8 @@ SCRIPT;
}
if ( !$this->is_default_options('click_img') )
$script .= "tb_options.click_img = '{$this->options['click_img']}';\n";
if ( $this->options['click_img'] == 'download' )
$script .= "tb_options.dl_file = '" . $this->util->plugins_url('download.php') . "';\n";
if ( !$this->is_default_options('click_end') )
$script .= "tb_options.click_end = '{$this->options['click_end']}';\n";
if ( !$this->is_default_options('click_bg') )
+85
View File
@@ -0,0 +1,85 @@
<?php
/*
* Force Download
* Copyright (C) 2012 attosoft <http://attosoft.info/en/>
* This file is distributed under the same license as the Auto ThickBox Plus package.
* attosoft <contact@attosoft.info>, 2012.
*/
/*
* Usage:
* * download.php?file=http://example.com/image.png
* * download.php?file=/home/username/www/image.png
*
* @see http://php.net/manual/function.header.php
* @see http://php.net/manual/function.readfile.php
*/
function force_download($file) {
if (empty($file)) {
die('Error: File not specified.'); return;
}
$file = sanitize_url($file);
if (!file_exists2($file)) {
die('Error: File not found. $file=' . $file); return;
}
if (headers_sent()) {
die('Error: Headers already sent.'); return;
}
if(ini_get('zlib.output_compression'))
ini_set('zlib.output_compression', 'Off');
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false);
switch (strtolower(pathinfo($file, PATHINFO_EXTENSION))) {
case 'jpg':
case 'jpe':
case 'jpeg': $type = 'image/jpeg'; break;
case 'gif': $type = 'image/gif'; break;
case 'png': $type = 'image/png'; break;
case 'bmp': $type = 'image/bmp'; break;
case 'tif':
case 'tiff': $type = 'image/tiff'; break;
case 'webp': $type = 'image/webp'; break;
default: die('Error: Unsupported file types. $file=' . $file); return; // download only images for security
}
header('Content-Description: File Transfer');
header('Content-Transfer-Encoding: binary');
header('Content-Type: ' . $type);
header('Content-Disposition: attachment; filename="' . unsanitized_basename($file) . '"');
header('Content-Length: ' . filesize2($file));
ob_clean();
flush();
readfile($file);
}
function file_exists2($file) {
// file_exists() cannnot accept such URL that starts with 'http://'
return preg_match('/^https?:\/\//i', $file) ? !!@fopen($file, 'r') : file_exists($file);
}
function filesize2($file) {
// filesize() cannnot accept such URL that starts with 'http://'
return preg_match('/^https?:\/\//i', $file) ? strlen(file_get_contents($file)) : filesize($file);
}
function sanitize_url($url) {
$url = str_replace(array('%', ' ', '\\'), array('%25', '%20', ''), $url);
$url = preg_replace('/\?.*$/i', '', $url); // remove url queries
return $url;
}
function unsanitized_basename($url) {
$url = str_replace(array('%25', '%20'), array('%', ' '), basename($url));
return basename($url);
}
force_download(str_replace(chr(0), '', $_GET['file'])); // for null byte injection
exit;
?>
+5
View File
@@ -84,6 +84,11 @@ msgstr ""
msgid "Mouse Click"
msgstr ""
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:161
msgid "Clickable Range"
msgstr ""
+5
View File
@@ -82,6 +82,11 @@ msgstr "Donar"
msgid "Mouse Click"
msgstr "Click de ratón"
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:161
msgid "Clickable Range"
msgstr "Área de click"
+5
View File
@@ -82,6 +82,11 @@ msgstr "کمک مالی"
msgid "Mouse Click"
msgstr "کلیک ماوس"
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:161
msgid "Clickable Range"
msgstr "محدوده قابل کلیک"
+5
View File
@@ -86,6 +86,11 @@ msgstr "Faire un don"
msgid "Mouse Click"
msgstr "Clic de la souris"
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:170
msgid "Clickable Range"
msgstr "Largeur clicable"
+5
View File
@@ -84,6 +84,11 @@ msgstr ""
msgid "Mouse Click"
msgstr ""
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:161
msgid "Clickable Range"
msgstr ""
+5
View File
@@ -85,6 +85,11 @@ msgstr ""
msgid "Mouse Click"
msgstr ""
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:161
msgid "Clickable Range"
msgstr ""
+5
View File
@@ -130,6 +130,11 @@ msgstr "usa thickbox.js/css nativo di WordPress (alcune funzioni extra saranno d
msgid "Mouse Click"
msgstr "Click mouse"
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:167
msgid "Loop"
msgstr "Loop"
Binary file not shown.
+10 -1
View File
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Auto ThickBox Plus 1.6\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tags/auto-thickbox-plus\n"
"POT-Creation-Date: 2012-06-06 13:24+0900\n"
"PO-Revision-Date: 2012-08-03 21:51+0900\n"
"PO-Revision-Date: 2012-08-12 09:50+0900\n"
"Last-Translator: attosoft <contact@attosoft.info>\n"
"Language-Team: attosoft <http://attosoft.info/en/>\n"
"MIME-Version: 1.0\n"
@@ -84,6 +84,11 @@ msgstr "寄付"
msgid "Mouse Click"
msgstr "マウスクリック"
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr "ダウンロード"
#: auto-thickbox-options.php:170
msgid "Clickable Range"
msgstr "クリック範囲"
@@ -344,3 +349,7 @@ msgstr "http://attosoft.info/blog/auto-thickbox-plus/"
msgid "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D2DLJNSUFBU4U"
msgstr "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CYWQWH7TN9THS"
#: auto-thickbox-options.php:205
msgid "Scale"
msgstr "拡大縮小"
+5
View File
@@ -85,6 +85,11 @@ msgstr "Doneer"
msgid "Mouse Click"
msgstr "Muisklik"
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:137
msgid "Clickable Range"
msgstr "Klikbaar deel"
+5
View File
@@ -84,6 +84,11 @@ msgstr ""
msgid "Mouse Click"
msgstr ""
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:161
msgid "Clickable Range"
msgstr ""
+5
View File
@@ -85,6 +85,11 @@ msgstr ""
msgid "Mouse Click"
msgstr ""
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:161
msgid "Clickable Range"
msgstr ""
+5
View File
@@ -82,6 +82,11 @@ msgstr ""
msgid "Mouse Click"
msgstr ""
#: auto-thickbox-options.php:159
#: auto-thickbox.php:155
msgid "Download"
msgstr ""
#: auto-thickbox-options.php:161
msgid "Clickable Range"
msgstr ""
+3 -1
View File
@@ -122,6 +122,7 @@ This is available options at Auto ThickBox Plus Options in 'Settings' menu. You
* Keyboard Shortcuts
* View
* Position
* Size
* Font Family & Weight
* Font Size
* Text Color
@@ -274,10 +275,11 @@ You can localize the plugin with [Poedit](http://www.poedit.net/). All you do is
= Latest Version =
* 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: "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: Uses spinner controls (input:number) instead of text fields (input:text) in options for entering numerical values. input:number is introduced in HTML5 so now it works only at Google Chrome, Opera and Safari.
* FIXED: "Mouse Wheel" actions do not work in Firefox since some time
* UPDATED: Added *Italian (it_IT) translation (props Gianni Diurno)*
* UPDATED: Added **Italian (it_IT) translation (props Gianni Diurno)**
= 1.7 =
* NEW: "General - Auto ThickBox - WordPress Filters/JavaScript/Disabled" option. Auto ThickBox had worked only in content, excerpt, comments and widget tests due to WordPress filters (hooks). Now using JavaScript, the feature can work in whole page such as front page, header/footer, contents output by themes or other plugins. And you can also disable it if unnecessary.
+9
View File
@@ -215,6 +215,8 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
TB_Image = "<a href='' id='TB_ImageOff' title='"+thickboxL10n.close+"'>" + TB_Image + "</a>";
else if (tb_options.click_img == "open")
TB_Image = "<a href='"+url+"' target='_blank' title='"+thickboxL10n.open+"'>" + TB_Image + "</a>";
else if (tb_options.click_img == "download")
TB_Image = "<a href='"+url+"' class='download' title='"+thickboxL10n.download+"'>" + TB_Image + "</a>";
TB_Caption = "<div id='TB_caption'>"+caption+"<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>";
if (tb_options.effect_cap != 'none')
TB_Caption = "<div id='TB_CaptionBar'>" + TB_Caption + "</div>";
@@ -351,6 +353,13 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
}
}
if (tb_options.click_img == "download") {
jQuery("#TB_window a.download").click(function() {
window.location = tb_options.dl_file + '?file=' + this.href;
return false;
});
}
jQuery(document).bind('keydown.thickbox', function(e){
e.stopImmediatePropagation();
+21 -21
View File
@@ -10,27 +10,27 @@ function tb_show(a,c,b){try{"undefined"===typeof document.body.style.maxHeight?(
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'>&nbsp;&nbsp;<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'>&nbsp;&nbsp;<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(){imgPreloader.onload=null;var d=c.replace(/^[^\?]+\??/,""),e=tb_parseQuery(d),g=tb_getPageSize(),d=g[0]-150,i=g[1]-150,l=e.width?Math.min(e.width*
1,imgPreloader.width):imgPreloader.width,g=e.height?Math.min(e.height*1,imgPreloader.height):imgPreloader.height;if(tb_options.auto_resize)if(l>d){g=g*(d/l);l=d;if(g>i){l=l*(i/g);g=i}}else if(g>i){l=l*(i/g);g=i;if(l>d){g=g*(d/l);l=d}}typeof a=="object"&&(a=tb_caption(a));TB_Image="<img id='TB_Image' src='"+c+"' width='"+l+"' height='"+g+"' alt='"+a+"'/>";tb_options.click_img=="close"||!b&&tb_options.click_end=="close"?TB_Image="<a href='' id='TB_ImageOff' title='"+thickboxL10n.close+"'>"+TB_Image+
"</a>":tb_options.click_img=="open"&&(TB_Image="<a href='"+c+"' target='_blank' title='"+thickboxL10n.open+"'>"+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>";tb_options.effect_cap!="none"&&(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");d=tb_getSize(jQuery("#TB_Image"),"margin");d[1]<g&&(d[1]=d[1]+g);TB_WIDTH=d[0];TB_HEIGHT=d[1]+tb_getSize(jQuery("#TB_closeWindow"),"margin")[1];if(TB_WIDTH<e.width*1){TB_WIDTH=e.width*1;jQuery("#TB_Image").css({marginLeft:"auto",
marginRight:"auto"})}TB_HEIGHT<e.height*1&&(TB_HEIGHT=e.height*1);e.modal=="true"&&jQuery("#TB_overlay").unbind();jQuery("#TB_closeWindowButton").click(tb_remove);if(TB_PrevHTML!==""){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_PrevCaption,TB_PrevURL,b);return false};jQuery("#TB_prev").click(k);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_FirstCaption,TB_FirstURL,b);return false}}if(TB_NextHTML!==""){var n=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 false};jQuery("#TB_next").click(n);var o=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 false}}if(b&&tb_options.click_img=="next"){var m,h,f;if(TB_NextHTML!=""){m="TB_ImageNext";h=thickboxL10n.next;f=n}else if(tb_options.click_end=="close"){m="TB_ImageClose";h=thickboxL10n.close;f=tb_remove}else if(tb_options.click_end=="loop"&&TB_PrevHTML!=""){m="TB_ImageFirst";h=thickboxL10n.first;f=p}if(m&&h&&f){d=d[1];jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+m+"' title='"+h+"' style='height:"+d+"px;'><span></span></a></div>");
jQuery("#"+m).click(f)}}else if(b&&tb_options.click_img=="prev_next"){var j,q,r;if(TB_PrevHTML!=""){m="TB_ImagePrev";h=thickboxL10n.prev;f=k}if(TB_NextHTML!=""){j="TB_ImageNext";q=thickboxL10n.next;r=n}if(TB_PrevHTML=="")if(tb_options.click_end=="close"){m="TB_ImageClose";h=thickboxL10n.close;f=tb_remove}else if(tb_options.click_end=="loop"&&TB_NextHTML!=""){m="TB_ImageLast";h=thickboxL10n.last;f=o}if(TB_NextHTML=="")if(tb_options.click_end=="close"){j="TB_ImageClose2";q=thickboxL10n.close;r=tb_remove}else if(tb_options.click_end==
"loop"&&TB_PrevHTML!=""){j="TB_ImageFirst";q=thickboxL10n.first;r=p}if(m&&h&&f||j&&q&&r){d=d[1];g=link2="";m&&(h&&f)&&(g="<a href='' id='"+m+"' class='TB_ImageLeft' title='"+h+"' style='height:"+d+"px;'></a>");j&&(q&&r)&&(link2="<a href='' id='"+j+"' class='TB_ImageRight' title='"+q+"' style='height:"+d+"px;'></a>");jQuery("#TB_window").append("<div id='TB_ImageClick'>"+g+link2+"</div>");g&&jQuery("#"+m).click(f);link2&&jQuery("#"+j).click(r);jQuery.browser.msie&&parseInt(jQuery.browser.version)<=
7&&jQuery("#TB_ImageClick > a").focus(function(){this.blur()})}}jQuery(document).bind("keydown.thickbox",function(a){a.stopImmediatePropagation();e.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!=""&&k():jQuery.inArray(a.which,tb_options.keys_next)!=
-1?TB_NextHTML!=""&&n():jQuery.inArray(a.which,tb_options.keys_first)!=-1?TB_PrevHTML!=""&&p():jQuery.inArray(a.which,tb_options.keys_last)!=-1&&TB_NextHTML!=""&&o();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!=""){k();
return false}}else if(b<0&&TB_NextHTML!=""){n();return false}}):b&&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);b=(jQuery.data(jQuery("#TB_window")[0],"scale")||1)+(b>0?0.1:-0.1);if(b>0){a="scale("+b+")";jQuery("#TB_window").css({"-ms-transform":a,"-moz-transform":a,"-webkit-transform":a,"-o-transform":a,
"-khtml-transform":a});jQuery.data(jQuery("#TB_window")[0],"scale",b)}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 t=c.replace(/^[^\?]+\??/,""),i=tb_parseQuery(t);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 o=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),u=tb_getSize(jQuery("#TB_ajaxContent"));TB_WIDTH+=o[0]-u[0];TB_HEIGHT+=o[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("#"+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 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,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(w){tb_options.debug&&
alert(w)}}
"</a>":tb_options.click_img=="open"?TB_Image="<a href='"+c+"' target='_blank' title='"+thickboxL10n.open+"'>"+TB_Image+"</a>":tb_options.click_img=="download"&&(TB_Image="<a href='"+c+"' class='download' title='"+thickboxL10n.download+"'>"+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>";
tb_options.effect_cap!="none"&&(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");d=tb_getSize(jQuery("#TB_Image"),
"margin");d[1]<g&&(d[1]=d[1]+g);TB_WIDTH=d[0];TB_HEIGHT=d[1]+tb_getSize(jQuery("#TB_closeWindow"),"margin")[1];if(TB_WIDTH<e.width*1){TB_WIDTH=e.width*1;jQuery("#TB_Image").css({marginLeft:"auto",marginRight:"auto"})}TB_HEIGHT<e.height*1&&(TB_HEIGHT=e.height*1);e.modal=="true"&&jQuery("#TB_overlay").unbind();jQuery("#TB_closeWindowButton").click(tb_remove);if(TB_PrevHTML!==""){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_PrevCaption,TB_PrevURL,b);return false};jQuery("#TB_prev").click(k);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_FirstCaption,TB_FirstURL,b);return false}}if(TB_NextHTML!==""){var n=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 false};jQuery("#TB_next").click(n);var o=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 false}}if(b&&tb_options.click_img=="next"){var m,h,f;if(TB_NextHTML!=""){m="TB_ImageNext";h=thickboxL10n.next;f=n}else if(tb_options.click_end=="close"){m="TB_ImageClose";h=thickboxL10n.close;f=tb_remove}else if(tb_options.click_end=="loop"&&TB_PrevHTML!=
""){m="TB_ImageFirst";h=thickboxL10n.first;f=p}if(m&&h&&f){d=d[1];jQuery("#TB_window").append("<div id='TB_ImageClick'><a href='' id='"+m+"' title='"+h+"' style='height:"+d+"px;'><span></span></a></div>");jQuery("#"+m).click(f)}}else if(b&&tb_options.click_img=="prev_next"){var j,q,r;if(TB_PrevHTML!=""){m="TB_ImagePrev";h=thickboxL10n.prev;f=k}if(TB_NextHTML!=""){j="TB_ImageNext";q=thickboxL10n.next;r=n}if(TB_PrevHTML=="")if(tb_options.click_end=="close"){m="TB_ImageClose";h=thickboxL10n.close;f=
tb_remove}else if(tb_options.click_end=="loop"&&TB_NextHTML!=""){m="TB_ImageLast";h=thickboxL10n.last;f=o}if(TB_NextHTML=="")if(tb_options.click_end=="close"){j="TB_ImageClose2";q=thickboxL10n.close;r=tb_remove}else if(tb_options.click_end=="loop"&&TB_PrevHTML!=""){j="TB_ImageFirst";q=thickboxL10n.first;r=p}if(m&&h&&f||j&&q&&r){d=d[1];g=link2="";m&&(h&&f)&&(g="<a href='' id='"+m+"' class='TB_ImageLeft' title='"+h+"' style='height:"+d+"px;'></a>");j&&(q&&r)&&(link2="<a href='' id='"+j+"' class='TB_ImageRight' title='"+
q+"' style='height:"+d+"px;'></a>");jQuery("#TB_window").append("<div id='TB_ImageClick'>"+g+link2+"</div>");g&&jQuery("#"+m).click(f);link2&&jQuery("#"+j).click(r);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=tb_options.dl_file+"?file="+this.href;return false});jQuery(document).bind("keydown.thickbox",function(a){a.stopImmediatePropagation();
e.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!=""&&k():jQuery.inArray(a.which,tb_options.keys_next)!=-1?TB_NextHTML!=""&&n():jQuery.inArray(a.which,tb_options.keys_first)!=-1?TB_PrevHTML!=""&&p():jQuery.inArray(a.which,tb_options.keys_last)!=-1&&
TB_NextHTML!=""&&o();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!=""){k();return false}}else if(b<0&&TB_NextHTML!=""){n();return false}}):b&&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);b=(jQuery.data(jQuery("#TB_window")[0],"scale")||1)+(b>0?0.1:-0.1);if(b>0){a="scale("+b+")";jQuery("#TB_window").css({"-ms-transform":a,"-moz-transform":a,"-webkit-transform":a,"-o-transform":a,"-khtml-transform":a});jQuery.data(jQuery("#TB_window")[0],"scale",b)}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 t=c.replace(/^[^\?]+\??/,""),i=tb_parseQuery(t);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 o=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),u=tb_getSize(jQuery("#TB_ajaxContent"));
TB_WIDTH+=o[0]-u[0];TB_HEIGHT+=o[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("#"+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 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,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(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))}