diff --git a/auto-thickbox.php b/auto-thickbox.php index 2003144..878ac83 100644 --- a/auto-thickbox.php +++ b/auto-thickbox.php @@ -133,7 +133,7 @@ class auto_thickbox { if ( $this->options['thickbox_type'] == 'modified' ) { wp_deregister_script('thickbox'); $in_footer = $this->options['script_place'] == 'footer'; - wp_register_script('thickbox', $this->util->plugins_url(WP_DEBUG ? 'thickbox.js' :'thickbox.min.js'), array('jquery'), AUTO_THICKBOX_PLUS_VER, $in_footer); + wp_register_script('thickbox', $this->util->plugins_url('thickbox.min.js'), array('jquery'), AUTO_THICKBOX_PLUS_VER, $in_footer); } wp_enqueue_script('thickbox'); if ( $this->options['thickbox_type'] == 'modified' ) { @@ -153,7 +153,7 @@ class auto_thickbox { case 'open': $l10n['open'] = $this->texts['open']; break; case 'download': $l10n['download'] = $this->util->__('Download'); - $l10n['forceDL'] = $this->util->plugins_url('download.php'); + $l10n['forceDL'] = $this->util->plugins_url('download.min.php'); break; case 'expand_shrink': $l10n['actual'] = $this->util->__('Actual Size', 'Original Size'); @@ -172,7 +172,7 @@ class auto_thickbox { function styles() { if ( $this->options['thickbox_type'] == 'modified' ) { wp_deregister_style('thickbox'); - wp_register_style('thickbox', $this->util->plugins_url(WP_DEBUG ? 'thickbox.css' : 'thickbox.min.css'), false, AUTO_THICKBOX_PLUS_VER); + wp_register_style('thickbox', $this->util->plugins_url('thickbox.min.css'), false, AUTO_THICKBOX_PLUS_VER); } wp_enqueue_style('thickbox'); } # styles() diff --git a/download.min.php b/download.min.php new file mode 100644 index 0000000..c2c6d95 --- /dev/null +++ b/download.min.php @@ -0,0 +1,2 @@ + - * This file is distributed under the same license as the Auto ThickBox Plus package. - * attosoft , 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); - - $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION)); - switch ($ext) { - 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 type. $ext=' . $ext); 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; -?> \ No newline at end of file diff --git a/thickbox.css b/thickbox.css deleted file mode 100644 index bb6fd8e..0000000 --- a/thickbox.css +++ /dev/null @@ -1,213 +0,0 @@ - -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -#TB_window { - font: 12px "Lucida Grande", Verdana, Arial, sans-serif; - color: #333333; -} - -#TB_secondLine { - font: 11px "Lucida Grande", Verdana, Arial, sans-serif; - color:#666666; -} - -#TB_secondLine a:link {color: #666666;} -#TB_secondLine a:visited {color: #666666;} -#TB_secondLine a:hover {color: #000;} -#TB_secondLine a:active {color: #666666;} -#TB_secondLine a:focus{color: #666666;} - -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -#TB_overlay { - position: fixed; - z-index:10100; - top: 0px; - left: 0px; - height:100%; - width:100%; -} - -.TB_overlayMacFFBGHack {background: url(images/macFFBgHack.png) repeat;} -.TB_overlayBG { - background-color:#000; - -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=75)"; - filter:alpha(opacity=75); - -moz-opacity: 0.75; - opacity: 0.75; -} - -#TB_window { - position: fixed; - background: #ffffff; - z-index: 10102 !important; /* !important is for NextGEN Gallery 1.9.5 */ - color:#000000; - display: none; - text-align:left; - top:50%; - left:50%; - border: 1px solid #555; - -moz-box-shadow: rgba(0,0,0,1) 0 4px 30px; - -webkit-box-shadow: rgba(0,0,0,1) 0 4px 30px; - -khtml-box-shadow: rgba(0,0,0,1) 0 4px 30px; - box-shadow: rgba(0,0,0,1) 0 4px 30px; -} - -#TB_window img#TB_Image { - display:block; - margin: 15px; - border-right: 1px solid #ccc; - border-bottom: 1px solid #ccc; - border-top: 1px solid #666; - border-left: 1px solid #666; -} -#TB_window.TB_captionTop img#TB_Image { margin-top: 0; } -#TB_window.TB_captionBottom img#TB_Image { margin-bottom: 0; } - -#TB_CaptionBar { - background: inherit; -} -#TB_CaptionBar, #TB_title.hover { - position: absolute; - width: 100%; - -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; - filter:alpha(opacity=85); - -moz-opacity: 0.85; - opacity: 0.85; -} -#TB_window.TB_captionTop #TB_CaptionBar, .TB_titleTop #TB_title.hover { top: 0; } -#TB_window.TB_captionBottom #TB_CaptionBar, .TB_titleBottom #TB_title.hover { bottom: 0; } - -#TB_ImageClick a { - display: block; - position: absolute; - top: 0; - width: 100%; - background: url(images/blank.gif) no-repeat left; /* blank.gif is for IE6/7/8 hack */ - outline: none; -} -.TB_captionTop #TB_ImageClick a { top: auto; bottom: 0; } -#TB_ImageClick a.TB_ImageLeft { left: 0; width: 35%; background-position: left; } -#TB_ImageClick a.TB_ImageRight { right: 0; width: 35%; background-position: right; } -#TB_ImageClick a#TB_ImagePrev:hover { background-image: url(images/tb-prev.png); } -#TB_ImageClick a#TB_ImageNext:hover { background-image: url(images/tb-next.png); } -#TB_ImageClick a#TB_ImageFirst:hover { background-image: url(images/tb-first.png); } -#TB_ImageClick a#TB_ImageLast:hover { background-image: url(images/tb-last.png); } -#TB_ImageClick a#TB_ImageClose:hover, #TB_ImageClick a#TB_ImageClose2:hover { background-image: url(images/tb-close.png); } -#TB_ImageClick a span { display: block; height: 100%; background: inherit; background-position: right; } - -#TB_caption{ - padding:3px 10px; - margin:4px 0 0 15px; - float:left; -} - -#TB_secondLine { margin-top: 3px; } - -#TB_closeWindow{ - height:15px; - padding:15px 10px 15px 0; - margin-right:15px; - float:right; -} -.TB_singleLine #TB_closeWindow{ - padding-top:8px; - padding-bottom:8px; -} - -#TB_closeAjaxWindow{ - padding:6px 10px 0; - text-align:right; - float:right; -} - -#TB_ajaxWindowTitle{ - float:left; - padding:6px 10px 0; -} - -#TB_title{ - background-color:#e8e8e8; - height:27px; -} - -#TB_ajaxContent{ - clear:both; - padding:15px; - overflow:auto; - text-align:left; - line-height:1.4em; - background: #ffffff; -} - -#TB_ajaxContent p{ - padding:5px 0px 5px 0px; -} - -#TB_load{ - position: fixed; - display:none; - z-index:10103; - top: 50%; - left: 50%; - background-color: #E8E8E8; - border: 1px solid #555; - margin: -46px 0pt 0pt -119px; - padding: 40px 15px 15px; -} - -#TB_HideSelect{ - z-index:10099; - position:fixed; - top: 0; - left: 0; - background-color:#fff; - border:none; - filter:alpha(opacity=0); - -moz-opacity: 0; - opacity: 0; - height:100%; - width:100%; -} - -#TB_iframeContent{ - clear:both; - border:none; - margin-bottom:-2px; - /margin-bottom:0; /* ie6/7 hack */ - background: #ffffff; -} -#TB_iframeContent, x:-moz-any-link { margin-bottom: -3px; } /* Firefox hack */ -:root #TB_iframeContent { margin-bottom:-3px \0/IE9; } /* IE9/10 hack */ -#TB_ajaxContentMarginTop { top:0; position:absolute; width:100%; background:white; } -#TB_ajaxContentMarginBottom { bottom:0; position:absolute; width:100%; background:white; } - -.TB_titleTop #TB_title, .TB_titleBottom #TB_ajaxContent, .TB_titleBottom #TB_iframeContent { - -moz-border-radius-bottomleft:0; -moz-border-radius-bottomright:0; - -webkit-border-bottom-left-radius:0; -webkit-border-bottom-right-radius:0; - -khtml-border-bottom-left-radius:0; -khtml-border-bottom-right-radius:0; - border-bottom-left-radius:0; border-bottom-right-radius:0; -} -.TB_titleBottom #TB_title, .TB_titleTop #TB_ajaxContent, .TB_titleTop #TB_iframeContent { - -moz-border-radius-topleft:0; -moz-border-radius-topright:0; - -webkit-border-top-left-radius:0; -webkit-border-top-right-radius:0; - -khtml-border-top-left-radius:0; -khtml-border-top-right-radius:0; - border-top-left-radius:0; border-top-right-radius:0; -} - -#TB_Resize div { - position: absolute; - width: 5px; - height: 5px; -} -#TB_Resize div#TB_ResizeN { cursor: n-resize; margin-top: -3px; top: 0; left: 0; width: 100%; } -#TB_Resize div#TB_ResizeE { cursor: e-resize; margin-right: -3px; top: 0; right: 0; height: 100%; } -#TB_Resize div#TB_ResizeW { cursor: w-resize; margin-left: -3px; top: 0; left: 0; height: 100%; } -#TB_Resize div#TB_ResizeS { cursor: s-resize; margin-bottom: -3px; bottom: 0; left: 0; width: 100%; } -#TB_Resize div#TB_ResizeNE { cursor: ne-resize; margin: -3px -3px 0 0; top: 0; right: 0; } -#TB_Resize div#TB_ResizeNW { cursor: nw-resize; margin: -3px 0 0 -3px; top: 0; left: 0; } -#TB_Resize div#TB_ResizeSE { cursor: se-resize; margin: 0 -3px -3px 0; bottom: 0; right: 0; width: 15px; height: 15px; background: url(images/resize-handle.gif) no-repeat; } -#TB_Resize div#TB_ResizeSW { cursor: sw-resize; margin: 0 0 -3px -3px; bottom: 0; left: 0; } -#TB_Resize div#TB_ResizeNE, #TB_Resize div#TB_ResizeNW, #TB_Resize div#TB_ResizeSW { width: 8px; height: 8px; } diff --git a/thickbox.js b/thickbox.js deleted file mode 100644 index 8cf4737..0000000 --- a/thickbox.js +++ /dev/null @@ -1,1171 +0,0 @@ -/* - * Thickbox 3.1 - One Box To Rule Them All. - * By Cody Lindley (http://www.codylindley.com) - * Copyright (c) 2007 cody lindley - * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php -*/ - -jQuery(document).ready(function(){ // delay for combined JS - if ( typeof tb_pathToImage != 'string' ) { - tb_pathToImage = thickboxL10n.loadingAnimation; - } - if ( typeof tb_closeImage != 'string' ) { - tb_closeImage = thickboxL10n.closeImage; - } -}); - -/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ - -var tb_options = { - auto_resize_img: true, - auto_resize_html: false, - click_img: "close", - 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 - keys_first: [36], // Home - keys_last: [35], // End - move_img: false, - move_html: false, - resize_img: false, - resize_html: false, - position_title: "top", - position_cap: "bottom", - mobile_support: "no_margin", - small_width: 480, - small_height: 480, - win_width: 600, - win_height: 400, - margin_win_img: 15, - margin_win_html: 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: false -}; - -//on page load call tb_init -jQuery(document).ready(function(){ - tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox - imgLoader = new Image();// preload image - imgLoader.src = tb_pathToImage; - - var result, ua = navigator.userAgent; - var webKitMatch = (result = ua.match(/AppleWebKit\/([0-9]+)/)) && result[1] < 534; - var operaMobiMatch = (result = ua.match(/Opera Mobi\/([0-9]+)/)) && result[1] < 7458; - var fennecMatch = (result = ua.match(/Fennec\/([0-9]+)/)) && result[1] < 6; - - notSupportedPositionFixed = typeof document.body.style.maxHeight == 'undefined' // IE < 7 - || (/(iPhone|iPod|iPad)/.test(navigator.platform) && webKitMatch) // iOS < 5 (iPhone/iPad/iPod touch) - || (ua.indexOf("Android") > -1 && webKitMatch) // Android < 3.0 - || (window.operamini && Object.prototype.toString.call(window.operamini) === "[object OperaMini]") // Opera Mini - || operaMobiMatch // Opera Mobile < 11.0 - || fennecMatch // Firefox for Mobile < 6.0 - || (window.palmGetResource && webKitMatch) // HP webOS < 3.0 - || (ua.indexOf("MeeGo") > -1 && ua.indexOf("NokiaBrowser/8.5.0") > -1); // MeeGo -}); - -//add thickbox to href & area elements that have a class of .thickbox -function tb_init(domChunk){ - if (jQuery.isFunction(jQuery().live)) - jQuery(domChunk).live('click', tb_click); - else - jQuery(domChunk).bind('click', tb_click); -} - -function tb_click(){ - if (tb_options.mobile_support == 'no_thickbox') { - var pageSize = tb_getPageSize(); - if (pageSize[0] <= tb_options.small_width || pageSize[1] <= tb_options.small_height) - return true; - } - - if (document.getElementById("TB_window") !== null) { - jQuery(document).unbind('.thickbox'); - jQuery("#TB_window").trigger("tb_unload").remove(); - jQuery("body").append("
"); - } - - var t = this; - var a = this.href || this.alt; - var g = this.rel || false; - tb_show(t,a,g); - this.blur(); - return false; -} - -function tb_caption(elem, refs) { - refs = refs || tb_options.ref_cap; - var caption; - for (var i = 0; i < refs.length && !caption; i++) { - switch (refs[i]) { - case "link-title": caption = elem.title; break; - case "link-name": caption = elem.name; break; - case "blank": return ""; - case "img-title": caption = jQuery(elem).children("img").attr("title"); break; - case "img-alt": caption = jQuery(elem).children("img").attr("alt"); break; - case "img-cap": caption = jQuery(elem).parent().is('dt.gallery-icon') // for WordPress - ? jQuery(elem).parent().nextAll(".wp-caption-text").text().replace(/^\s+|\s+$/g, '') // trim() - : jQuery(elem).nextAll(".wp-caption-text").text(); break; - case "img-desc": caption = jQuery(elem).children("img").attr("longdesc"); break; - case "img-name": caption = jQuery(elem).children("img").attr("name"); break; - } - } - return caption.replace(/(\r\n|[\n\r])/g, '
'); -} - -function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link - try { - if (notSupportedPositionFixed) {//if IE 6 - jQuery("body","html").css({height: "100%", width: "100%"}); - jQuery("html").css("overflow","hidden"); - if (typeof document.body.style.maxHeight == "undefined" && document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 - jQuery("body").append(""); - } - } - if(document.getElementById("TB_overlay") === null){ - jQuery("body").append("
"); - if (notSupportedPositionFixed) { - jQuery("#TB_overlay, #TB_HideSelect").css({ - position: 'absolute', - height: (document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight) + 'px' - }); - } - if (tb_options.click_bg == "close") - jQuery("#TB_overlay").click(tb_remove); - } - - if(tb_detectMacXFF()){ - jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash - }else{ - jQuery("#TB_overlay").addClass("TB_overlayBG");//use background and opacity - } - - jQuery("body").append("
");//add loader to the page - if (notSupportedPositionFixed) { - jQuery("#TB_load").css({ - position: 'absolute', - marginTop: (-parseInt(jQuery("#TB_load")[0].offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop)) + 'px' - }); - } - if (parseInt(jQuery('#TB_load').css('marginLeft')) == 0) - jQuery('#TB_load').css('marginLeft', -jQuery('#TB_load').outerWidth() / 2); - if (parseInt(jQuery('#TB_load').css('marginTop')) == 0) - jQuery('#TB_load').css('marginTop', -jQuery('#TB_load').outerHeight() / 2); - jQuery('#TB_load').show();//show loader - - var baseURL = url; - if(url.indexOf("?")!==-1){ //ff there is a query string involved - baseURL = url.substr(0, url.indexOf("?")); - } - if(url.indexOf("#")!==-1){ - baseURL = url.substr(0, url.indexOf("#")); - } - - var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$|\.webp$|\.pdf$/; - var urlType = baseURL.toLowerCase().match(urlString); - - if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp' || urlType == '.webp'){//code to show images - TB_PrevCaption = ""; - TB_PrevURL = ""; - TB_PrevHTML = ""; - TB_NextCaption = ""; - TB_NextURL = ""; - TB_NextHTML = ""; - TB_imageCount = ""; - TB_FoundURL = false; - TB_FirstCaption = ""; - TB_FirstURL = ""; - TB_LastCaption = ""; - TB_LastURL = ""; - if(imageGroup){ - TB_TempArray = jQuery("a[rel="+imageGroup+"]").get(); - for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { - var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); - if ((typeof caption == "object") ? !(TB_TempArray[TB_Counter] == caption) : !(TB_TempArray[TB_Counter].href == url)) { - if (TB_FoundURL) { - TB_NextCaption = TB_TempArray[TB_Counter]; - TB_NextURL = TB_TempArray[TB_Counter].href; - TB_NextHTML = "  "+thickboxL10n.next+""; - } else { - TB_PrevCaption = TB_TempArray[TB_Counter]; - TB_PrevURL = TB_TempArray[TB_Counter].href; - TB_PrevHTML = "  "+thickboxL10n.prev+""; - } - } else { - TB_FoundURL = true; - 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; - - // width/height/modal parameters - var queryString = url.replace(/^[^\?]+\??/,''); - var params = tb_parseQuery( queryString ); - - if (typeof caption == "object") caption = tb_caption(caption); - TB_Image = ""+caption+""; - if (tb_options.click_img == "close" || (!imageGroup && tb_options.click_end == "close")) - TB_Image = "" + TB_Image + ""; - else if (tb_options.click_img == "open") - TB_Image = "" + TB_Image + ""; - else if (tb_options.click_img == "download") - TB_Image = "" + TB_Image + ""; - else if (tb_options.click_img == "expand_shrink") - TB_Image = "" + TB_Image + ""; - TB_Caption = "
"+caption+"
" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "
"; - if (tb_options.effect_cap != 'none') - TB_Caption = "
" + TB_Caption + "
"; - 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"); break; - } - if (!imageGroup || !caption) - jQuery("#TB_window").addClass("TB_singleLine"); - - if (params['modal'] == "true") - jQuery("#TB_overlay").unbind(); - - jQuery("#TB_closeWindowButton").click(tb_remove); - - if (!(TB_PrevHTML === "")) { - function goPrev(){ - jQuery(document).unbind('.thickbox'); - jQuery("#TB_window").remove(); - jQuery("body").append("
"); - tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); - return false; - } - jQuery("#TB_prev").click(goPrev); - - function goFirst(){ - jQuery(document).unbind('.thickbox'); - jQuery("#TB_window").remove(); - jQuery("body").append("
"); - tb_show(TB_FirstCaption, TB_FirstURL, imageGroup); - return false; - } - } - - if (!(TB_NextHTML === "")) { - function goNext(){ - jQuery(document).unbind('.thickbox'); - jQuery("#TB_window").remove(); - jQuery("body").append("
"); - tb_show(TB_NextCaption, TB_NextURL, imageGroup); - return false; - } - jQuery("#TB_next").click(goNext); - - function goLast(){ - jQuery(document).unbind('.thickbox'); - jQuery("#TB_window").remove(); - jQuery("body").append("
"); - tb_show(TB_LastCaption, TB_LastURL, imageGroup); - return false; - } - } - - if (imageGroup && tb_options.click_img == "next") { - var id, title, handler; - if (!(TB_NextHTML == "")) { - id = "TB_ImageNext"; - title = thickboxL10n.next; - handler = goNext; - } else { - if (tb_options.click_end == "close") { - id = "TB_ImageClose"; - title = thickboxL10n.close; - handler = tb_remove; - } else if (tb_options.click_end == "loop" && !(TB_PrevHTML == "")) { - id = "TB_ImageFirst"; - title = thickboxL10n.first; - handler = goFirst; - } - } - if (id && title && handler) { - jQuery("#TB_window").append("
"); - jQuery("#"+id).click(handler); - } - } else if (imageGroup && tb_options.click_img == "prev_next") { - var id, title, handler, id2, title2, handler2; - if (!(TB_PrevHTML == "")) { - id = "TB_ImagePrev"; - title = thickboxL10n.prev; - handler = goPrev; - } - if (!(TB_NextHTML == "")) { - id2 = "TB_ImageNext"; - title2 = thickboxL10n.next; - handler2 = goNext; - } - if (TB_PrevHTML == "") { - if (tb_options.click_end == "close") { - id = "TB_ImageClose"; - title = thickboxL10n.close; - handler = tb_remove; - } else if (tb_options.click_end == "loop" && !(TB_NextHTML == "")) { - id = "TB_ImageLast"; - title = thickboxL10n.last; - handler = goLast; - } - } - if (TB_NextHTML == "") { - if (tb_options.click_end == "close") { - id2 = "TB_ImageClose2"; - title2 = thickboxL10n.close; - handler2 = tb_remove; - } else if (tb_options.click_end == "loop" && !(TB_PrevHTML == "")) { - id2 = "TB_ImageFirst"; - title2 = thickboxL10n.first; - handler2 = goFirst; - } - } - if ((id && title && handler) || (id2 && title2 && handler2)) { - var link = link2 = ""; - if (id && title && handler) link = ""; - if (id2 && title2 && handler2) link2 = ""; - jQuery("#TB_window").append("
"+link+link2+"
"); - if (link) jQuery("#"+id).click(handler); - if (link2) jQuery("#"+id2).click(handler2); - if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 7) // jQuery.browser is deprecated - jQuery("#TB_ImageClick > a").focus(function() { this.blur(); }); // hide dotted lines around anchor - } - } - - if (tb_options.click_img == "download") { - jQuery("#TB_window a.download").click(function() { - window.location = thickboxL10n.forceDL + '?file=' + this.href; - return false; - }); - } else if (tb_options.click_img == "expand_shrink") { - jQuery("#TB_window a.scalable").click(function() { - if (tb_fitToWindow) - setImageSize(imgPreloader.width, imgPreloader.height, thickboxL10n.fit); - else - setImageSize(tb_fitWidth, tb_fitHeight, thickboxL10n.actual); - tb_fitToWindow = !tb_fitToWindow; - return false; - }); - } - - function setImageSize(width, height, title) { - var diffWidth = width - jQuery("#TB_Image").width(); - var diffHeight = height - jQuery("#TB_Image").height(); - jQuery("#TB_window").css({ - marginLeft: Math.round(parseInt(jQuery("#TB_window").css("marginLeft")) - (diffWidth / 2)), - marginTop: Math.round(parseInt(jQuery("#TB_window").css("marginTop")) - (diffHeight / 2)) - }); - jQuery("#TB_window").width(jQuery("#TB_window").width() + diffWidth).height('auto'); - jQuery("#TB_Image").width(width).height(height); - if (title) - jQuery("#TB_window a.scalable").attr("title", title); - } - - jQuery(document).bind('keydown.thickbox', function(e){ - if ( params['modal'] != 'true' && jQuery.inArray(e.which, tb_options.keys_close) != -1 ){ // close - if ( ! jQuery(document).triggerHandler( 'wp_CloseOnEscape', [{ event: e, what: 'thickbox', cb: tb_remove }] ) ) - tb_remove(); - } else if ( jQuery.inArray(e.which, tb_options.keys_prev) != -1 // display previous image - || (e.shiftKey && jQuery.inArray(e.which, tb_options.keys_prev['shift']) != -1) ){ // check e.shiftKey ahead - if(!(TB_PrevHTML == "")){ - goPrev(); - } - } else if ( jQuery.inArray(e.which, tb_options.keys_next) != -1 ){ // display next image - if(!(TB_NextHTML == "")){ - goNext(); - } - } else if ( jQuery.inArray(e.which, tb_options.keys_first) != -1 ) { // display first image - if(!(TB_PrevHTML == "")){ - goFirst(); - } - } else if ( jQuery.inArray(e.which, tb_options.keys_last) != -1 ) { // display last image - if(!(TB_NextHTML == "")){ - goLast(); - } - } else { - return true; // unconsumed key events - } - e.stopImmediatePropagation(); - return false; - }); - - if (imageGroup && tb_options.wheel_img == "prev_next") { - jQuery("#TB_window").bind('mousewheel.thickbox DOMMouseScroll.thickbox', function(e){ - e.stopImmediatePropagation(); - - var delta = 0; - var event = e.originalEvent; - - if (event.wheelDelta) { - delta = event.wheelDelta; - } else if (event.detail) { // Firefox - delta = -event.detail; // minus sign - } - - // workaround for a issue that page scroll occurs in Firefox when the handler returns false - jQuery(window).one('MozMousePixelScroll', function() { return false; }); - - if (delta > 0) { // display previous image - if(!(TB_PrevHTML == "")){ - goPrev(); - return false; - } - } else if (delta < 0) { // display next image - if(!(TB_NextHTML == "")){ - goNext(); - return false; - } - } - }); - } else if (tb_options.wheel_img == "scale") { - jQuery("#TB_window").bind('mousewheel.thickbox DOMMouseScroll.thickbox', function(e){ - if (e.ctrlKey) return true; - e.stopImmediatePropagation(); - - var delta = 0; - var event = e.originalEvent; - - if (event.wheelDelta) { - delta = event.wheelDelta; - } else if (event.detail) { // Firefox - delta = -event.detail; // minus sign - } - - var scale = 1.0 + (delta > 0 ? 0.1 : -0.1); - var width = Math.round(jQuery("#TB_Image").width() * scale); - var height = Math.round(jQuery("#TB_Image").height() * scale); - if (width > 100 && height > 100) // minimum size (100x100) - 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) - jQuery("#TB_window").bind("mousedown.thickbox", function (e) { return tb_move(e, "image"); }); - if (tb_options.resize_img) { - tb_resize_init(); - jQuery("#TB_Resize").bind("mousedown.thickbox", function (e) { return tb_resize(e, "image"); }); - } - - if (tb_options.effect_cap != 'none') { - jQuery('#TB_Image').css('margin', jQuery('#TB_Image').css('marginLeft')); - 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_reposition(params); - jQuery(window).bind('resize.thickbox orientationchange.thickbox', function() { tb_reposition(params); }); - jQuery("#TB_load").remove(); - if (tb_options.click_img == "close" || (!imageGroup && tb_options.click_end == "close")) - jQuery("#TB_ImageOff").click(tb_remove); - tb_open(); - }; // imgPreloader.onload - - imgPreloader.src = url; - }else{//code to show html - var queryString = url.replace(/^[^\?]+\??/,''); - var params = tb_parseQuery( queryString ); - - if (typeof caption == "object") caption = tb_caption(caption, tb_options.ref_title); - TB_Title = "
"+caption+"
"; - - if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window - urlNoQuery = url.split(/[?&]TB_/); - jQuery("#TB_iframeContent").remove(); - TB_Iframe = ""; - if(params['modal'] != "true"){//iframe no 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"); break; - } - }else{//iframe modal - jQuery("#TB_overlay").unbind(); - jQuery("#TB_window").append(TB_Iframe).addClass("TB_iframeContent"); - } - }else{// not an iframe, ajax - if(jQuery("#TB_window").css("display") != "block"){ - TB_Ajax = "
"; - if(params['modal'] != "true"){//ajax no 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"); break; - } - }else{//ajax modal - jQuery("#TB_overlay").unbind(); - jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent"); - jQuery("#TB_ajaxContent").addClass("TB_modal"); - } - }else{//this means the window is already up, we are just loading new content via ajax - jQuery("#TB_ajaxContent")[0].scrollTop = 0; - jQuery("#TB_ajaxWindowTitle").html(caption); - } - } - - jQuery("#TB_closeWindowButton").click(tb_remove); - - if(url.indexOf('TB_inline') != -1){ - jQuery("#TB_ajaxContent").append(jQuery('#' + params['inlineId']).children()); - jQuery("#TB_window").bind('tb_unload', function () { - jQuery('#' + params['inlineId']).append( jQuery("#TB_ajaxContent").children() ); // move elements back when you're finished - }); - tb_reposition_html(url, params); - jQuery(window).bind('resize.thickbox orientationchange.thickbox', function() { tb_reposition_html(url, params); }); - jQuery("#TB_load").remove(); - tb_open(); - tb_roundCorner("iframe"); - }else if(url.indexOf('TB_iframe') != -1){ - tb_reposition_html(url, params); - jQuery(window).bind('resize.thickbox orientationchange.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(); - } - }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_reposition_html(url, params); - jQuery(window).bind('resize.thickbox orientationchange.thickbox', function() { tb_reposition_html(url, params); }); - jQuery("#TB_load").remove(); - tb_open(); - tb_roundCorner("ajax") - }); - } - - if (tb_options.move_html) - jQuery("#TB_window").bind("mousedown.thickbox", function (e) { return tb_move(e, url.indexOf('TB_iframe') != -1 ? "iframe" : "ajax"); }); - if (tb_options.resize_html) { - tb_resize_init(); - jQuery("#TB_Resize").bind("mousedown.thickbox", function (e) { return tb_resize(e, url.indexOf('TB_iframe') != -1 ? "iframe" : "ajax"); }); - } - - if (tb_options.effect_title != 'none') { - jQuery('#TB_title').addClass('hover'); - 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); }); - } - - if(params['modal'] != 'true'){ - jQuery(document).bind('keyup.thickbox', function(e){ - if ( jQuery.inArray(e.which, tb_options.keys_close) != -1 ){ // close - e.stopImmediatePropagation(); - if ( ! jQuery(document).triggerHandler( 'wp_CloseOnEscape', [{ event: e, what: 'thickbox', cb: tb_remove }] ) ) - tb_remove(); - - return false; - } - }); - } - } - } catch(e) { - //nothing here - if (tb_options.debug) alert(e); - } -} - -//helper functions below -function tb_open() { - if (jQuery("#TB_window").css("visibility") == "hidden") // for safety - jQuery("#TB_window").css("visibility", "visible"); - - var effect_type = jQuery("#TB_window").is(".TB_Transition") ? tb_options.effect_trans : tb_options.effect_open; - tb_effectView(effect_type, false); - var callback = function() { tb_effectView(effect_type); } - switch (effect_type) { - case "zoom": - jQuery("#TB_window").height(jQuery("#TB_window").height()); // for image - if (notSupportedPositionFixed && jQuery("body").css("position") != "relative") - 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, callback); - break; - case "slide": - if (notSupportedPositionFixed && jQuery("body").css("position") != "relative") - 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, callback); - break; - case "fade": - jQuery("#TB_window").fadeIn(tb_options.effect_speed, callback); - break; - default: - jQuery("#TB_window").show(); - break; - } - - if (jQuery("#TB_window").css("display") == "none") // for safety - jQuery("#TB_window").css("display", "block"); - - jQuery("#TB_title").height(Math.max(jQuery("#TB_title").height(), jQuery("#TB_ajaxWindowTitle").height() + 13)); // TODO: workaround code for the height of multiline title (to be modified) - - if (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(source) { - var style = jQuery("#TB_window")[0].currentStyle || document.defaultView.getComputedStyle(jQuery("#TB_window")[0], ''); - var radius = style.borderTopLeftRadius; - if (parseInt(radius) > 0) { - if (jQuery("#TB_window").css("backgroundColor") != "transparent" && jQuery("#TB_window").css("backgroundColor") != "rgba(0, 0, 0, 0)") - jQuery("#TB_window").css("backgroundColor", parseInt(style.borderTopWidth) > 0 ? style.borderTopColor : "transparent"); // fill see-through background - - if (source == "iframe") { - if (jQuery.browser.safari || jQuery.browser.webkit) { // iframe scroll bar is not rounded in WebKit - var iframe = jQuery("#TB_iframeContent"); - var iframeSrc = jQuery("#TB_iframeContent").contents(); - var hScroll = iframeSrc.length == 0 || iframe.width() < iframeSrc.width(); // external domain or has scroll bar - var vScroll = iframeSrc.length == 0 || iframe.height() < iframeSrc.height(); - if ((tb_options.position_title == "top" || tb_options.position_title == "none") && (hScroll || vScroll)) - jQuery("#TB_iframeContent").css("paddingBottom", radius); - if ((tb_options.position_title == "bottom" || tb_options.position_title == "none") && vScroll) - jQuery("#TB_iframeContent").css("paddingTop", radius); - } - } else if (source == "ajax") { - var ajax = jQuery("#TB_ajaxContent")[0]; - var hScroll = ajax.scrollWidth > ajax.clientWidth; // has scroll bar - var vScroll = ajax.scrollHeight > ajax.clientHeight; - if ((tb_options.position_title == "top" || tb_options.position_title == "none") && (hScroll || vScroll)) { - jQuery("#TB_ajaxContent").css("marginBottom", radius).after("
"); - if (tb_options.position_title == "none" && hScroll) - jQuery("#TB_ajaxContent").css({borderBottomLeftRadius: 0, borderBottomRightRadius: 0}); - else - jQuery("#TB_ajaxContent").css("borderRadius", 0); - jQuery("#TB_ajaxContentMarginBottom").css({height: radius, borderBottomLeftRadius: radius, borderBottomRightRadius: radius}); // cover bottom margin of ajaxContent - } - if ((tb_options.position_title == "bottom" || tb_options.position_title == "none") && vScroll) { - jQuery("#TB_ajaxContent").css({marginTop: radius, borderRadius: 0}).after("
"); - jQuery("#TB_ajaxContentMarginTop").css({height: radius, borderTopLeftRadius: radius, borderTopRightRadius: radius}); // cover top margin of ajaxContent - } - } - } -} - -function tb_effectView(type, show) { - show = typeof show == 'boolean' ? show : true; - - if (type != "none") { - if (show) - jQuery("#TB_ImageClick").show(); - else - jQuery("#TB_ImageClick").hide(); - } -} - -function tb_showIframe(){ - jQuery("#TB_load").remove(); - tb_open(); - tb_roundCorner("iframe") -} - -function tb_remove() { - tb_effectView(tb_options.effect_close, false); - var callback = function() { - jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("tb_unload").unbind().remove(); - if (notSupportedPositionFixed) {//if IE 6 - jQuery("body","html").css({height: "auto", width: "auto"}); - jQuery("html").css("overflow",""); - } - } - switch (tb_options.effect_close) { - case "zoom": - jQuery("#TB_Image").hide(tb_options.effect_speed); - jQuery("#TB_window").hide(tb_options.effect_speed, callback); - break; - case "slide": - jQuery("#TB_window").slideUp(tb_options.effect_speed, callback); - break; - case "fade": - jQuery("#TB_window").fadeOut(tb_options.effect_speed, callback); - break; - default: - callback(); - break; - } - jQuery("#TB_load").remove(); - jQuery(document).add(window).unbind('.thickbox'); - return false; -} - -function tb_position() { - jQuery("#TB_window").css({width: '', height: '', left: '', top: ''}); - - var width = TB_WIDTH + jQuery("#TB_window").outerWidth() - jQuery("#TB_window").width(); // add border-width & padding - var height = TB_HEIGHT + jQuery("#TB_window").outerHeight() - jQuery("#TB_window").height(); - var marginLeft = -parseInt((width / 2),10); - var marginTop = -parseInt((height / 2),10); - var isIE6 = notSupportedPositionFixed; - if (!isIE6 && jQuery("#TB_window").css("position") == "absolute") { - marginLeft += jQuery(document).scrollLeft(); - marginTop += jQuery(document).scrollTop(); - } - jQuery("#TB_window").css({marginLeft: marginLeft + 'px', width: TB_WIDTH + 'px'}); - if ( ! isIE6 ) { // take away IE6 - jQuery("#TB_window").css({marginTop: marginTop + 'px'}); - } - - // workaround for "body { position: relative; }" style - if (jQuery("body").css("position") == "relative") { - var pagesize = tb_getPageSize(); - if (!isIE6) { - // do nothing - } else { - marginLeft = parseInt((pagesize[0] - width) / 2, 10) + jQuery(document).scrollLeft(); - marginTop = parseInt((pagesize[1] - height) / 2, 10) + jQuery(document).scrollTop(); - jQuery("#TB_window").css({marginLeft: marginLeft + 'px', marginTop: marginTop + 'px', top: '0', left: '0'}); - } - } else { - if (isIE6) { - jQuery("#TB_window").css({ - marginTop: (-parseInt(jQuery("#TB_window")[0].offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop)) + 'px' - }); - } - } -} - -function tb_reposition(params) { - jQuery("#TB_window").width(jQuery(window).width()); // ThickBox windows height will be reset to appropriate value - if (jQuery("#TB_Image").height() == 0) // workaround for "img { height: auto; }" style - jQuery("#TB_Image").height(imgPreloader.height); - - var winBorderSize = tb_getSize(jQuery("#TB_window"), "border"); - var winSize = tb_getSize(jQuery("#TB_window")); - var imgMarginSize = tb_getSize(jQuery("#TB_Image"), "margin"); - var imgSize = tb_getSize(jQuery("#TB_Image")); - - var pageSize = tb_getPageSize(); - var winMargin = (pageSize[0] <= tb_options.small_width || pageSize[1] <= tb_options.small_height) ? 0 : tb_options.margin_win_img * 2; - - // Resizing large images - orginal by Christian Montoya edited by me. - var x = jQuery(window).width() - (winBorderSize[0] - winSize[0] + imgMarginSize[0] - imgSize[0]) - winMargin; - var y = jQuery(window).height() - (winBorderSize[1] - imgSize[1]) - winMargin; - var imageWidth = params['width'] ? Math.min(params['width']*1, imgPreloader.width) : imgPreloader.width; - var imageHeight = params['height'] ? Math.min(params['height']*1, imgPreloader.height) : imgPreloader.height; - tb_fitWidth = x; - tb_fitHeight = Math.round(imageHeight * (x / imageWidth)); - if (tb_fitHeight > y) { - tb_fitWidth = Math.round(tb_fitWidth * (y / tb_fitHeight)); - tb_fitHeight = y; - } - tb_fitToWindow = tb_options.auto_resize_img && (imageWidth > x || imageHeight > y); - if (tb_fitToWindow) { - imageWidth = tb_fitWidth; - imageHeight = tb_fitHeight; - jQuery("#TB_window a.scalable").attr("title", thickboxL10n.actual); - } - // End Resizing - - jQuery("#TB_Image").width(imageWidth).height(imageHeight); - - TB_WIDTH = imageWidth + (imgMarginSize[0] - imgSize[0]); - TB_HEIGHT = imageHeight + (winSize[1] - imgSize[1]); - - if (TB_WIDTH < params['width']*1) { - TB_WIDTH = params['width']*1; - jQuery('#TB_Image').css({marginLeft: 'auto', marginRight: 'auto'}); - } - if (TB_HEIGHT < params['height']*1) - TB_HEIGHT = params['height']*1; - - jQuery("#TB_ImageClick > a").height(tb_getSize(jQuery("#TB_Image"), "margin")[1]); - - tb_position(); -} - -function tb_reposition_html(url, params) { - var winBorderSize = tb_getSize(jQuery("#TB_window"), "border"); - var winSize = tb_getSize(jQuery("#TB_window")); - var titleHeight = tb_options.effect_title == 'none' ? tb_getSize(jQuery("#TB_title"))[1] : 0; - - var pageSize = tb_getPageSize(); - var winMargin = (pageSize[0] <= tb_options.small_width || pageSize[1] <= tb_options.small_height) ? 0 : tb_options.margin_win_html * 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 + titleHeight; // 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] + titleHeight; - } - - TB_WIDTH = params['width'] ? Math.min(params['width']*1, x) : (tb_options.auto_resize_html ? 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_html ? y : tb_options.win_height); //defaults to 400 if no paramaters were added to URL - ajaxContentW = TB_WIDTH; - ajaxContentH = TB_HEIGHT; - - if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window - ajaxContentW += ('\v'=='v' ? 10 : 8) * 2; // add default body margin (IE or not) - ajaxContentH += ('\v'=='v' ? 15 : 8) * 2; - jQuery("#TB_iframeContent").attr("style", "width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;"); - }else{// not an iframe, ajax - if(jQuery("#TB_window").css("display") != "block"){ - jQuery("#TB_ajaxContent").attr("style", "width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;"); - }else{//this means the window is already up, we are just loading new content via ajax - jQuery("#TB_ajaxContent")[0].style.width = ajaxContentW +"px"; - jQuery("#TB_ajaxContent")[0].style.height = ajaxContentH +"px"; - } - } - - if(url.indexOf('TB_iframe') != -1) { - TB_WIDTH += ('\v'=='v' ? 10 : 8) * 2; // add default body margin (IE or not) - TB_HEIGHT += ('\v'=='v' ? 15 : 8) * 2 + titleHeight; // add body margin and title bar height - } else { - var innerSize = tb_getSize(jQuery("#TB_ajaxContent"), "padding"); - var size = tb_getSize(jQuery("#TB_ajaxContent")); - TB_WIDTH += innerSize[0] - size[0]; // add content padding - TB_HEIGHT += innerSize[1] - size[1] + titleHeight; - } - - tb_position(); -} - -function tb_parseQuery ( query ) { - var Params = {}; - if ( ! query ) {return Params;}// return empty object - - // If query contains '?', extract string from index of '?' to the end. - query = query.substring(query.indexOf('?') + 1); - // URL: http://example.com/page.php?foo=bar#TB_inline?inlineId=id - // query: "foo=bar#TB_inline?inlineId=id" => "inlineId=id" - - var Pairs = query.split(/[;&]/); - for ( var i = 0; i < Pairs.length; i++ ) { - var KeyVal = Pairs[i].split('='); - if ( ! KeyVal || KeyVal.length != 2 ) {continue;} - var key = unescape( KeyVal[0] ); - var val = unescape( KeyVal[1] ); - val = val.replace(/\+/g, ' '); - Params[key] = val; - } - return Params; -} - -function tb_getPageSize(){ - var de = document.documentElement; - var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; - var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; - arrayPageSize = [w,h]; - return arrayPageSize; -} - -function tb_detectMacXFF() { - var userAgent = navigator.userAgent.toLowerCase(); - if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) { - return true; - } -} - -function tb_move(event, source) { - if (source == "image") { - if (jQuery(event.target).parent().is("#TB_prev, #TB_next, #TB_closeWindowButton")) - return true; - } else { - if (!jQuery(event.target).closest("#TB_title").length || jQuery(event.target).parent().is("#TB_closeWindowButton")) - return true; - } - return tb_drag(event, source, "move"); -} - -function tb_resize(event, source) { - var action; - switch (event.target.id) { - case "TB_ResizeN": - action = "n-resize"; break; - case "TB_ResizeE": - action = "e-resize"; break; - case "TB_ResizeW": - action = "w-resize"; break; - case "TB_ResizeS": - action = "s-resize"; break; - case "TB_ResizeNE": - action = "ne-resize"; break; - case "TB_ResizeNW": - action = "nw-resize"; break; - case "TB_ResizeSE": - action = "se-resize"; break; - case "TB_ResizeSW": - action = "sw-resize"; break; - default: - return true; - } - return tb_drag(event, source, action); -} - -function tb_resize_init() { - jQuery("#TB_window").append("
"); - if (notSupportedPositionFixed) // height:100% on position:absolute does not work in IE6 - jQuery("#TB_ResizeE, #TB_ResizeW").height(jQuery("#TB_window").height()); -} - -// @param source "image", "iframe" or "ajax" (inline) -// @param action "move" or "(n|e|w|s|ne|nw|se|sw)-resize" (same as CSS cursor propery) -function tb_drag(event, source, action) { - if (event.which != 1) return true; // not left button - - TB_THRESHOLD = 5; // regarded as not drag - MIN_WIDTH = MIN_HEIGHT = 100; - var offsetLeft = jQuery("#TB_window").offset().left - parseInt(jQuery("#TB_window").css("marginLeft")); // cancel negative margin - var offsetTop = jQuery("#TB_window").offset().top - parseInt(jQuery("#TB_window").css("marginTop")); - if (!notSupportedPositionFixed && jQuery("#TB_window").css("position") != "absolute") { // IE6 has no scroll bar (width/height: 100%) - offsetLeft -= jQuery(document).scrollLeft(); - offsetTop -= jQuery(document).scrollTop(); - } - var startX = event.clientX; - var startY = event.clientY; - var startDrag = false; - var cursorTargets = jQuery("#TB_window, #TB_overlay, " + (source == "image" ? "#TB_window a" : "#TB_closeWindowButton")); - - var moveX = action == "move" || action == "w-resize" || action == "nw-resize" || action == "sw-resize"; // move or west (northwest, southwest) - var moveY = action == "move" || action == "n-resize" || action == "ne-resize" || action == "nw-resize"; // move or north (northwest, northeast) - var resizeWidth = action != "move" && action != "n-resize" && action != "s-resize"; // not move, north and south - var resizeHeight = action != "move" && action != "e-resize" && action != "w-resize"; // not move, east and west - var keepRatio = action == "ne-resize" || action == "nw-resize" || action == "se-resize" || action == "sw-resize"; - if (keepRatio) - var ratio = jQuery("#TB_window").width() / jQuery("#TB_window").height(); - if (action != "move") { - var startWidth = jQuery("#TB_window").width(); - var startHeight = jQuery("#TB_window").height(); - var resizeTarget = jQuery(source == "image" ? "#TB_Image" : (source == "iframe" ? "#TB_iframeContent" : "#TB_ajaxContent")); - var startWidth2 = resizeTarget.width(); - var startHeight2 = resizeTarget.height(); - var signX = (action == "e-resize" || action == "ne-resize" || action == "se-resize") ? +1 : -1; // east (northeast, southeast) or not - var signY = (action == "s-resize" || action == "se-resize" || action == "sw-resize") ? +1 : -1; // south (southeast, southwest) or not - if (notSupportedPositionFixed) - var startMarginTop = jQuery("#TB_window").css("marginTop"); - } - - jQuery(document).bind("mousemove.thickbox", function (e, clientX, clientY) { - clientX = clientX ? clientX : e.clientX; - clientY = clientY ? clientY : e.clientY; - var offsetX = clientX - startX; - var offsetY = clientY - startY; - if (!startDrag) { - offsetX = offsetX > TB_THRESHOLD ? offsetX - TB_THRESHOLD : (offsetX < -TB_THRESHOLD ? offsetX + TB_THRESHOLD : 0); - offsetY = offsetY > TB_THRESHOLD ? offsetY - TB_THRESHOLD : (offsetY < -TB_THRESHOLD ? offsetY + TB_THRESHOLD : 0); - if (Math.abs(offsetX) > 0 || Math.abs(offsetY) > 0) { - startDrag = true; - startX = clientX; // for smooth drag - startY = clientY; - cursorTargets.css("cursor", action); - } - } - if (startDrag) { - if (keepRatio) { - var newWidth = startWidth + offsetX * signX; - var newHeight = startHeight + offsetY * signY; - var newRatio = newWidth / newHeight; - if (ratio > newRatio) - offsetY = Math.round(offsetX / ratio) * signX * signY; - else if (ratio < newRatio) - offsetX = Math.round(offsetY * ratio) * signX * signY; - } - - var skipMoveX = skipMoveY = false; - if (resizeWidth) { - var newWidth = startWidth + offsetX * signX; - if (newWidth < MIN_WIDTH) { - skipMoveX = true; - } else { - jQuery("#TB_window").width(newWidth); - resizeTarget.width(startWidth2 + offsetX * signX); - } - } - if (resizeHeight) { - var newHeight = startHeight + offsetY * signY; - if (newHeight < MIN_HEIGHT) { - skipMoveY = true; - } else { - jQuery("#TB_window").height(newHeight); - resizeTarget.height(startHeight2 + offsetY * signY); - if (source == "image") - jQuery("#TB_ImageClick > a").height(jQuery("#TB_Image").outerHeight(true)); - if (notSupportedPositionFixed) // undo rewritten marginTop in IE6 - jQuery("#TB_window").css("marginTop", startMarginTop); - } - } - if (moveX && !skipMoveX) - jQuery("#TB_window").css("left", offsetLeft + offsetX); - if (moveY && !skipMoveY) - jQuery("#TB_window").css("top", offsetTop + offsetY); - } - return false; - }); - - jQuery(document).bind("mouseup.thickbox", function (e) { - jQuery(document).unbind("mousemove.thickbox mouseup.thickbox"); - if (source == "iframe") - jQuery("#TB_iframeContent").contents().unbind("mousemove.thickbox mouseup.thickbox"); - - if (!startDrag) return true; - - cursorTargets.css("cursor", ""); - - // prevent click event from being fired after mouseup event - if (jQuery.browser.opera) return false; // click event is not fired in Opera - var target = jQuery(e.target); - if (target.is("html")) return false; // mouse up outside browser window - if (!target.is(".TB_ImageLeft, .TB_ImageRight")) - target = target.parent(); // e.g. #TB_ImageOff, #TB_prev, #TB_next, #TB_closeWindowButton - var events = target.data("events"); - if (events && events.click) { - var handlers = []; - // XXX: Event handlers are stored as object property, or stored within array since v1.4.2 - jQuery.each(events.click, function(index, value) { - handlers[handlers.length] = value.handler || value; - }); - } - target.unbind("click").one("click", function (e) { // prevent anchor jump - e.stopImmediatePropagation(); - if (handlers) { - for (var i = 0; i < handlers.length; i++) - target.click(handlers[i]); // rebind - } - return false; - }); - return false; - }); - - if (source == "iframe") { - jQuery("#TB_iframeContent").contents() - .bind("mousemove.thickbox", function (e) { - e.clientX += jQuery("#TB_iframeContent").offset().left - jQuery(document).scrollLeft(); - e.clientY += jQuery("#TB_iframeContent").offset().top - jQuery(document).scrollTop(); - jQuery(document).trigger("mousemove.thickbox", [e.clientX, e.clientY]); - }) - .bind("mouseup.thickbox", function (e) { - jQuery(document).trigger("mouseup.thickbox"); - }); - } - - return false; -} - -// @param $obj jQuery object -// @param include 'padding', 'border' or 'margin' [optional] -// @see tb_getPageSize() -// @note workaround for jQuery width/height issues in old versions -function tb_getSize($obj, include) { - var w, h; - - var setter = function() { - switch (include) { - case "padding": - w = $obj.innerWidth(); - h = $obj.innerHeight(); - break; - case "border": - w = $obj.outerWidth(); - h = $obj.outerHeight(); - break; - case "margin": - w = $obj.outerWidth(true); - h = $obj.outerHeight(true); - break; - default: - w = $obj.width(); - h = $obj.height(); - break; - } - }; - - // XXX: On display:none, width/innerWidth/outerWidth() returns 0, outerWidth(true) returns only margin in v1.4.3 or earlier - // XXX: On display:none, innerWidth/outerWidth() returns width(), outerWidth(true) returns only margin in v1.6.1 or earlier - if (jQuery("#TB_window").css("display") == "none" && - (tb_versionCompare('1.4.4') > 0 || (tb_versionCompare('1.6.2') > 0 && include))) - jQuery.swap(jQuery("#TB_window")[0], {position: "absolute", visibility: "hidden", display: "block"}, setter); - else - setter(); - - var arraySize = [w, h]; - return arraySize; -} - -// @param version1 jQuery.fn.jquery string (one digit, ends with non-zero) -// @param version2 default is jQuery.fn.jquery [optional] -// @see PHP version_compare($version1, $version2) -function tb_versionCompare(version1, version2) { - version2 = version2 || jQuery.fn.jquery; - if (version1 != version2) { - var v1 = version1.split('.'); - var v2 = version2.split('.'); - for (var i = 0; i < v1.length || i < v2.length; i++) { - if ((v1[i] && !v2[i]) || (v1[i] > v2[i])) - return 1; - else if ((!v1[i] && v2[i]) || (v1[i] < v2[i])) - return -1; - } - } - return 0; -} - -// @param $obj jQuery object -// @param effect 'zoom', 'slide', 'fade' or 'none' -// @param hide hide or show (false, default) -function tb_hover($obj, effect, hide) { - if (!hide && $obj.css('visibility') != 'visible') // TODO: workaround code for the height of title - $obj.css({visibility: 'visible', display: 'none'}); - - switch (effect) { - case "zoom": - if (!hide) $obj.show(tb_options.effect_speed); - else $obj.hide(tb_options.effect_speed); - break; - case "slide": - if (!hide) $obj.slideDown(tb_options.effect_speed); - else $obj.slideUp(tb_options.effect_speed); - break; - case "fade": - if (!hide) $obj.fadeIn(tb_options.effect_speed); - else $obj.fadeOut(tb_options.effect_speed); - break; - } -} \ No newline at end of file diff --git a/thickbox.min.css b/thickbox.min.css index 3ad86cc..c425230 100644 --- a/thickbox.min.css +++ b/thickbox.min.css @@ -1,56 +1,2 @@ -#TB_window{font:12px "Lucida Grande", Verdana, Arial, sans-serif;color:#333333;} -#TB_secondLine{font:11px "Lucida Grande", Verdana, Arial, sans-serif;color:#666666;} -#TB_secondLine a:link{color:#666666;} -#TB_secondLine a:visited{color:#666666;} -#TB_secondLine a:hover{color:#000;} -#TB_secondLine a:active{color:#666666;} -#TB_secondLine a:focus{color:#666666;} -#TB_overlay{position:fixed;z-index:10100;top:0px;left:0px;height:100%;width:100%;} -.TB_overlayMacFFBGHack{background:url(images/macFFBgHack.png) repeat;} -.TB_overlayBG{background-color:#000;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=75)";filter:alpha(opacity=75);-moz-opacity:0.75;opacity:0.75;} -#TB_window{position:fixed;background:#ffffff;z-index:10102 !important;color:#000000;display:none;text-align:left;top:50%;left:50%;border:1px solid #555;-moz-box-shadow:rgba(0,0,0,1) 0 4px 30px;-webkit-box-shadow:rgba(0,0,0,1) 0 4px 30px;-khtml-box-shadow:rgba(0,0,0,1) 0 4px 30px;box-shadow:rgba(0,0,0,1) 0 4px 30px;} -#TB_window img#TB_Image{display:block;margin:15px;border-right:1px solid #ccc;border-bottom:1px solid #ccc;border-top:1px solid #666;border-left:1px solid #666;} -#TB_window.TB_captionTop img#TB_Image{margin-top:0;} -#TB_window.TB_captionBottom img#TB_Image{margin-bottom:0;} -#TB_CaptionBar{background:inherit;} -#TB_CaptionBar, #TB_title.hover{position:absolute;width:100%;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";filter:alpha(opacity=85);-moz-opacity:0.85;opacity:0.85;} -#TB_window.TB_captionTop #TB_CaptionBar, .TB_titleTop #TB_title.hover{top:0;} -#TB_window.TB_captionBottom #TB_CaptionBar, .TB_titleBottom #TB_title.hover{bottom:0;} -#TB_ImageClick a{display:block;position:absolute;top:0;width:100%;background:url(images/blank.gif) no-repeat left;outline:none;} -.TB_captionTop #TB_ImageClick a{top:auto;bottom:0;} -#TB_ImageClick a.TB_ImageLeft{left:0;width:35%;background-position:left;} -#TB_ImageClick a.TB_ImageRight{right:0;width:35%;background-position:right;} -#TB_ImageClick a#TB_ImagePrev:hover{background-image:url(images/tb-prev.png);} -#TB_ImageClick a#TB_ImageNext:hover{background-image:url(images/tb-next.png);} -#TB_ImageClick a#TB_ImageFirst:hover{background-image:url(images/tb-first.png);} -#TB_ImageClick a#TB_ImageLast:hover{background-image:url(images/tb-last.png);} -#TB_ImageClick a#TB_ImageClose:hover, #TB_ImageClick a#TB_ImageClose2:hover{background-image:url(images/tb-close.png);} -#TB_ImageClick a span{display:block;height:100%;background:inherit;background-position:right;} -#TB_caption{padding:3px 10px;margin:4px 0 0 15px;float:left;} -#TB_secondLine{margin-top:3px;} -#TB_closeWindow{height:15px;padding:15px 10px 15px 0;margin-right:15px;float:right;} -.TB_singleLine #TB_closeWindow{padding-top:8px;padding-bottom:8px;} -#TB_closeAjaxWindow{padding:6px 10px 0;text-align:right;float:right;} -#TB_ajaxWindowTitle{float:left;padding:6px 10px 0;} -#TB_title{background-color:#e8e8e8;height:27px;} -#TB_ajaxContent{clear:both;padding:15px;overflow:auto;text-align:left;line-height:1.4em;background:#ffffff;} -#TB_ajaxContent p{padding:5px 0px 5px 0px;} -#TB_load{position:fixed;display:none;z-index:10103;top:50%;left:50%;background-color:#E8E8E8;border:1px solid #555;margin:-46px 0pt 0pt -119px;padding:40px 15px 15px;} -#TB_HideSelect{z-index:10099;position:fixed;top:0;left:0;background-color:#fff;border:none;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;height:100%;width:100%;} -#TB_iframeContent{clear:both;border:none;margin-bottom:-2px;/margin-bottom:0;background:#ffffff;} -#TB_iframeContent, x:-moz-any-link{margin-bottom:-3px;} -:root #TB_iframeContent{margin-bottom:-3px \0/IE9;} -#TB_ajaxContentMarginTop{top:0;position:absolute;width:100%;background:white;} -#TB_ajaxContentMarginBottom{bottom:0;position:absolute;width:100%;background:white;} -.TB_titleTop #TB_title, .TB_titleBottom #TB_ajaxContent, .TB_titleBottom #TB_iframeContent{-moz-border-radius-bottomleft:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0;} -.TB_titleBottom #TB_title, .TB_titleTop #TB_ajaxContent, .TB_titleTop #TB_iframeContent{-moz-border-radius-topleft:0;-moz-border-radius-topright:0;-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:0;-khtml-border-top-left-radius:0;-khtml-border-top-right-radius:0;border-top-left-radius:0;border-top-right-radius:0;} -#TB_Resize div{position:absolute;width:5px;height:5px;} -#TB_Resize div#TB_ResizeN{cursor:n-resize;margin-top:-3px;top:0;left:0;width:100%;} -#TB_Resize div#TB_ResizeE{cursor:e-resize;margin-right:-3px;top:0;right:0;height:100%;} -#TB_Resize div#TB_ResizeW{cursor:w-resize;margin-left:-3px;top:0;left:0;height:100%;} -#TB_Resize div#TB_ResizeS{cursor:s-resize;margin-bottom:-3px;bottom:0;left:0;width:100%;} -#TB_Resize div#TB_ResizeNE{cursor:ne-resize;margin:-3px -3px 0 0;top:0;right:0;} -#TB_Resize div#TB_ResizeNW{cursor:nw-resize;margin:-3px 0 0 -3px;top:0;left:0;} -#TB_Resize div#TB_ResizeSE{cursor:se-resize;margin:0 -3px -3px 0;bottom:0;right:0;width:15px;height:15px;background:url(images/resize-handle.gif) no-repeat;} -#TB_Resize div#TB_ResizeSW{cursor:sw-resize;margin:0 0 -3px -3px;bottom:0;left:0;} -#TB_Resize div#TB_ResizeNE, #TB_Resize div#TB_ResizeNW, #TB_Resize div#TB_ResizeSW{width:8px;height:8px;} \ No newline at end of file +/* Modified ThickBox based on ThickBox 3.1 by Cody Lindley | thickbox.net | MIT License */ +#TB_window{font:12px "Lucida Grande",Verdana,Arial,sans-serif;color:#333}#TB_secondLine{font:11px "Lucida Grande",Verdana,Arial,sans-serif;color:#666}#TB_secondLine a:link{color:#666}#TB_secondLine a:visited{color:#666}#TB_secondLine a:hover{color:#000}#TB_secondLine a:active{color:#666}#TB_secondLine a:focus{color:#666}#TB_overlay{position:fixed;z-index:10100;top:0;left:0;height:100%;width:100%}.TB_overlayMacFFBGHack{background:url(images/macFFBgHack.png) repeat}.TB_overlayBG{background-color:#000;-ms-filter:"alpha(opacity=75)";filter:alpha(opacity=75);-moz-opacity:.75;opacity:.75}#TB_window{position:fixed;background:#fff;z-index:10102!important;color:#000;display:none;text-align:left;top:50%;left:50%;border:1px solid #555;-moz-box-shadow:rgba(0,0,0,1) 0 4px 30px;-webkit-box-shadow:rgba(0,0,0,1) 0 4px 30px;-khtml-box-shadow:rgba(0,0,0,1) 0 4px 30px;box-shadow:rgba(0,0,0,1) 0 4px 30px}#TB_window img#TB_Image{display:block;margin:15px;border-right:1px solid #ccc;border-bottom:1px solid #ccc;border-top:1px solid #666;border-left:1px solid #666}#TB_window.TB_captionTop img#TB_Image{margin-top:0}#TB_window.TB_captionBottom img#TB_Image{margin-bottom:0}#TB_CaptionBar{background:inherit}#TB_CaptionBar,#TB_title.hover{position:absolute;width:100%;-ms-filter:"alpha(opacity=85)";filter:alpha(opacity=85);-moz-opacity:.85;opacity:.85}#TB_window.TB_captionTop #TB_CaptionBar,.TB_titleTop #TB_title.hover{top:0}#TB_window.TB_captionBottom #TB_CaptionBar,.TB_titleBottom #TB_title.hover{bottom:0}#TB_ImageClick a{display:block;position:absolute;top:0;width:100%;background:url(images/blank.gif) no-repeat left;outline:0}.TB_captionTop #TB_ImageClick a{top:auto;bottom:0}#TB_ImageClick a.TB_ImageLeft{left:0;width:35%;background-position:left}#TB_ImageClick a.TB_ImageRight{right:0;width:35%;background-position:right}#TB_ImageClick a#TB_ImagePrev:hover{background-image:url(images/tb-prev.png)}#TB_ImageClick a#TB_ImageNext:hover{background-image:url(images/tb-next.png)}#TB_ImageClick a#TB_ImageFirst:hover{background-image:url(images/tb-first.png)}#TB_ImageClick a#TB_ImageLast:hover{background-image:url(images/tb-last.png)}#TB_ImageClick a#TB_ImageClose:hover,#TB_ImageClick a#TB_ImageClose2:hover{background-image:url(images/tb-close.png)}#TB_ImageClick a span{display:block;height:100%;background:inherit;background-position:right}#TB_caption{padding:3px 10px;margin:4px 0 0 15px;float:left}#TB_secondLine{margin-top:3px}#TB_closeWindow{height:15px;padding:15px 10px 15px 0;margin-right:15px;float:right}.TB_singleLine #TB_closeWindow{padding-top:8px;padding-bottom:8px}#TB_closeAjaxWindow{padding:6px 10px 0;text-align:right;float:right}#TB_ajaxWindowTitle{float:left;padding:6px 10px 0}#TB_title{background-color:#e8e8e8;height:27px}#TB_ajaxContent{clear:both;padding:15px;overflow:auto;text-align:left;line-height:1.4em;background:#fff}#TB_ajaxContent p{padding:5px 0 5px 0}#TB_load{position:fixed;display:none;z-index:10103;top:50%;left:50%;background-color:#e8e8e8;border:1px solid #555;margin:-46px 0 0 -119px;padding:40px 15px 15px}#TB_HideSelect{z-index:10099;position:fixed;top:0;left:0;background-color:#fff;border:0;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;height:100%;width:100%}#TB_iframeContent{clear:both;border:0;margin-bottom:-2px;/margin-bottom:0;background:#fff}#TB_iframeContent,x:-moz-any-link{margin-bottom:-3px}:root #TB_iframeContent{margin-bottom:-3px \0/IE9}#TB_ajaxContentMarginTop{top:0;position:absolute;width:100%;background:white}#TB_ajaxContentMarginBottom{bottom:0;position:absolute;width:100%;background:white}.TB_titleTop #TB_title,.TB_titleBottom #TB_ajaxContent,.TB_titleBottom #TB_iframeContent{-moz-border-radius-bottomleft:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.TB_titleBottom #TB_title,.TB_titleTop #TB_ajaxContent,.TB_titleTop #TB_iframeContent{-moz-border-radius-topleft:0;-moz-border-radius-topright:0;-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:0;-khtml-border-top-left-radius:0;-khtml-border-top-right-radius:0;border-top-left-radius:0;border-top-right-radius:0}#TB_Resize div{position:absolute;width:5px;height:5px}#TB_Resize div#TB_ResizeN{cursor:n-resize;margin-top:-3px;top:0;left:0;width:100%}#TB_Resize div#TB_ResizeE{cursor:e-resize;margin-right:-3px;top:0;right:0;height:100%}#TB_Resize div#TB_ResizeW{cursor:w-resize;margin-left:-3px;top:0;left:0;height:100%}#TB_Resize div#TB_ResizeS{cursor:s-resize;margin-bottom:-3px;bottom:0;left:0;width:100%}#TB_Resize div#TB_ResizeNE{cursor:ne-resize;margin:-3px -3px 0 0;top:0;right:0}#TB_Resize div#TB_ResizeNW{cursor:nw-resize;margin:-3px 0 0 -3px;top:0;left:0}#TB_Resize div#TB_ResizeSE{cursor:se-resize;margin:0 -3px -3px 0;bottom:0;right:0;width:15px;height:15px;background:url(images/resize-handle.gif) no-repeat}#TB_Resize div#TB_ResizeSW{cursor:sw-resize;margin:0 0 -3px -3px;bottom:0;left:0}#TB_Resize div#TB_ResizeNE,#TB_Resize div#TB_ResizeNW,#TB_Resize div#TB_ResizeSW{width:8px;height:8px} \ No newline at end of file diff --git a/thickbox.min.js b/thickbox.min.js index 17a55ae..85d32d6 100644 --- a/thickbox.min.js +++ b/thickbox.min.js @@ -1,3 +1,4 @@ +/* Modified ThickBox based on ThickBox 3.1 by Cody Lindley | thickbox.net | MIT License */ 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_img:!0,auto_resize_html:!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_html:!1,resize_img:!1,resize_html:!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_img:15,margin_win_html: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};