Fix Thickbox position for browsers pretending to be IE6
git-svn-id: http://svn.automattic.com/wordpress/trunk@10365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
45c7401c79
commit
73caf3b30b
|
@ -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() ) {
|
||||
|
|
|
@ -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)?720:e;if(f.size()){f.width(c-50).height(d-45);b("#TB_iframeContent").width(c-50).height(d-75);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:"20px","margin-top":"0"})}}return b("a.thickbox").each(function(){var g=b(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");b(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85))})};b("a.thickbox").click(function(){if(typeof tinyMCE!="undefined"&&tinyMCE.activeEditor){tinyMCE.get("content").focus();tinyMCE.activeEditor.windowManager.bookmark=tinyMCE.activeEditor.selection.getBookmark("simple")}});b(window).resize(function(){a()});b(document).ready(function(){a()})})(jQuery);
|
||||
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()}var tb_position;(function(a){tb_position=function(){var e=a("#TB_window"),d=a(window).width(),c=a(window).height(),b=(720<d)?720:d;if(e.size()){e.width(b-50).height(c-45);a("#TB_iframeContent").width(b-50).height(c-75);e.css({"margin-left":"-"+parseInt(((b-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){e.css({top:"20px","margin-top":"0"})}}return a("a.thickbox").each(function(){var f=a(this).attr("href");if(!f){return}f=f.replace(/&width=[0-9]+/g,"");f=f.replace(/&height=[0-9]+/g,"");a(this).attr("href",f+"&width="+(b-80)+"&height="+(c-85))})};a("a.thickbox").click(function(){if(typeof tinyMCE!="undefined"&&tinyMCE.activeEditor){tinyMCE.get("content").focus();tinyMCE.activeEditor.windowManager.bookmark=tinyMCE.activeEditor.selection.getBookmark("simple")}});a(window).resize(function(){tb_position()});a(document).ready(function(){tb_position()})})(jQuery);
|
|
@ -1,9 +1,8 @@
|
|||
|
||||
var thickDims;
|
||||
jQuery(document).ready(function($) {
|
||||
if ( 'undefined' == typeof $.fn.pngFix )
|
||||
$.fn.pngFix = function() { return this; }
|
||||
|
||||
var thickDims = function() {
|
||||
thickDims = function() {
|
||||
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width();
|
||||
|
||||
if ( tbWindow.size() ) {
|
||||
|
@ -38,3 +37,7 @@ jQuery(document).ready(function($) {
|
|||
|
||||
$(window).resize( function() { thickDims() } );
|
||||
});
|
||||
|
||||
function tb_position() {
|
||||
thickDims();
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(document).ready(function(b){if("undefined"==typeof b.fn.pngFix){b.fn.pngFix=function(){return this}}var a=function(){var e=b("#TB_window"),d=b(window).height(),c=b(window).width();if(e.size()){e.width(c-90).height(d-60);b("#TB_iframeContent").width(c-90).height(d-90);e.css({"margin-left":"-"+parseInt(((c-90)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){e.css({top:"30px","margin-top":"0"})}}return b("a.thickbox").each(function(){var f=b(this).parents(".available-theme").find(".previewlink").attr("href");if(!f){return}f=f.replace(/&width=[0-9]+/g,"");f=f.replace(/&height=[0-9]+/g,"");b(this).attr("href",f+"&width="+(c-110)+"&height="+(d-100))})};a().click(function(){var d=b(this).parents(".available-theme").find(".activatelink"),c=d.attr("href"),e=d.html();b("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});b("#TB_closeAjaxWindow").css({"float":"left"});b("#TB_ajaxWindowTitle").css({"float":"right"}).append(' <a href="'+c+'" target="_top" class="tb-theme-preview-link">'+e+"</a>");b("#TB_iframeContent").width("100%");return false});b(window).resize(function(){a()})});
|
||||
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(' <a href="'+b+'" target="_top" class="tb-theme-preview-link">'+d+"</a>");a("#TB_iframeContent").width("100%");return false});a(window).resize(function(){thickDims()})});function tb_position(){thickDims()};
|
Loading…
Reference in New Issue