From 73caf3b30b0524ac3a9ae34eb0104467f747e479 Mon Sep 17 00:00:00 2001 From: azaozz Date: Thu, 15 Jan 2009 14:56:52 +0000 Subject: [PATCH] Fix Thickbox position for browsers pretending to be IE6 git-svn-id: http://svn.automattic.com/wordpress/trunk@10365 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/media-upload.dev.js | 3 ++- wp-admin/js/media-upload.js | 2 +- wp-admin/js/theme-preview.dev.js | 9 ++++++--- wp-admin/js/theme-preview.js | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-admin/js/media-upload.dev.js b/wp-admin/js/media-upload.dev.js index 46fd9039b5..870a0fe413 100644 --- a/wp-admin/js/media-upload.dev.js +++ b/wp-admin/js/media-upload.dev.js @@ -27,8 +27,9 @@ function send_to_editor(h) { } // thickbox settings +var tb_position; (function($) { - var tb_position = function() { + tb_position = function() { var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width; if ( tbWindow.size() ) { diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js index ec229e1bca..95e0d97f9f 100644 --- a/wp-admin/js/media-upload.js +++ b/wp-admin/js/media-upload.js @@ -1 +1 @@ -function send_to_editor(b){var a;if(typeof tinyMCE!="undefined"&&(a=tinyMCE.activeEditor)&&!a.isHidden()){a.focus();if(tinymce.isIE){a.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark)}if(b.indexOf("[caption")===0){if(a.plugins.wpeditimage){b=a.plugins.wpeditimage._do_shcode(b)}}else{if(b.indexOf("[gallery")===0){if(a.plugins.wpgallery){b=a.plugins.wpgallery._do_gallery(b)}}}a.execCommand("mceInsertContent",false,b)}else{if(typeof edInsertContent=="function"){edInsertContent(edCanvas,b)}else{jQuery(edCanvas).val(jQuery(edCanvas).val()+b)}}tb_remove()}(function(b){var a=function(){var f=b("#TB_window"),e=b(window).width(),d=b(window).height(),c=(720'+e+"");b("#TB_iframeContent").width("100%");return false});b(window).resize(function(){a()})}); \ No newline at end of file +var thickDims;jQuery(document).ready(function(a){thickDims=function(){var d=a("#TB_window"),c=a(window).height(),b=a(window).width();if(d.size()){d.width(b-90).height(c-60);a("#TB_iframeContent").width(b-90).height(c-90);d.css({"margin-left":"-"+parseInt(((b-90)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){d.css({top:"30px","margin-top":"0"})}}return a("a.thickbox").each(function(){var e=a(this).parents(".available-theme").find(".previewlink").attr("href");if(!e){return}e=e.replace(/&width=[0-9]+/g,"");e=e.replace(/&height=[0-9]+/g,"");a(this).attr("href",e+"&width="+(b-110)+"&height="+(c-100))})};thickDims().click(function(){var c=a(this).parents(".available-theme").find(".activatelink"),b=c.attr("href"),d=c.html();a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_closeAjaxWindow").css({"float":"left"});a("#TB_ajaxWindowTitle").css({"float":"right"}).append(' '+d+"");a("#TB_iframeContent").width("100%");return false});a(window).resize(function(){thickDims()})});function tb_position(){thickDims()}; \ No newline at end of file