WordPress.org

Make WordPress Core

Changeset 17701


Ignore:
Timestamp:
04/25/11 22:49:22 (3 years ago)
Author:
azaozz
Message:

Fix image insertion in IE, fixes #17237

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/media-upload.dev.js

    r17639 r17701  
    44 
    55    if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) { 
    6         ed.focus(); 
     6        // restore caret position on IE 
     7        if ( tinymce.isIE && ed.windowManager.insertimagebookmark ) 
     8            ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark); 
    79 
    810        if ( h.indexOf('[caption') === 0 ) { 
     
    5658    $(window).resize(function(){ tb_position(); }); 
    5759 
     60    // store caret position in IE 
     61    $(document).ready(function($){  
     62        $('a.thickbox').click(function(){  
     63            var ed; 
     64 
     65            if ( typeof tinyMCE != 'undefined' && tinymce.isIE && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {   
     66                ed.focus(); 
     67                ed.windowManager.insertimagebookmark = ed.selection.getBookmark();  
     68            }  
     69        });  
     70    });  
     71 
    5872})(jQuery); 
  • trunk/wp-admin/js/media-upload.js

    r17639 r17701  
    1 function send_to_editor(b){var a;if(typeof tinyMCE!="undefined"&&(a=tinyMCE.activeEditor)&&!a.isHidden()){a.focus();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)}}else{if(b.indexOf("[embed")===0){if(a.plugins.wordpress){b=a.plugins.wordpress._setEmbed(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 f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()})})(jQuery); 
     1function send_to_editor(b){var a;if(typeof tinyMCE!="undefined"&&(a=tinyMCE.activeEditor)&&!a.isHidden()){if(tinymce.isIE&&a.windowManager.insertimagebookmark){a.selection.moveToBookmark(a.windowManager.insertimagebookmark)}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)}}else{if(b.indexOf("[embed")===0){if(a.plugins.wordpress){b=a.plugins.wordpress._setEmbed(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 f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a(document).ready(function(b){b("a.thickbox").click(function(){var c;if(typeof tinyMCE!="undefined"&&tinymce.isIE&&(c=tinyMCE.activeEditor)&&!c.isHidden()){c.focus();c.windowManager.insertimagebookmark=c.selection.getBookmark()}})})})(jQuery); 
  • trunk/wp-includes/script-loader.php

    r17697 r17701  
    368368        $scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ), '20110414' ); 
    369369 
    370         $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20110414' ); 
     370        $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20110425' ); 
    371371        $scripts->add_data( 'media-upload', 'group', 1 ); 
    372372 
Note: See TracChangeset for help on using the changeset viewer.