Make WordPress Core

Changeset 8189


Ignore:
Timestamp:
06/24/2008 09:59:06 PM (18 years ago)
Author:
ryan
Message:

Insert image fixes from azaozz. fixes #7177

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r8172 r8189  
    6666        ?>
    6767<script type="text/javascript">
    68 <!--
    69 top.send_to_editor('<?php echo addslashes($html); ?>');
    70 top.tb_remove();
    71 -->
     68/* <![CDATA[ */
     69var win = window.dialogArguments || opener || parent || top;
     70win.send_to_editor('<?php echo addslashes($html); ?>');
     71/* ]]> */
    7272</script>
    7373        <?php
  • trunk/wp-admin/js/media-upload.js

    r7989 r8189  
    11// send html to the post editor
    22function send_to_editor(h) {
    3         var win = window.dialogArguments || opener || parent || top;
     3        if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
     4                ed.focus();
     5                if (tinymce.isIE)
     6                        ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
    47
    5         tinyMCE = win.tinyMCE;
    6         if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.getInstanceById('content') ) && !ed.isHidden() ) {
    7                 tinyMCE.selectedInstance.getWin().focus();
    8                 tinyMCE.execCommand('mceInsertContent', false, h);
     8                ed.execCommand('mceInsertContent', false, h);
    99        } else
    10                 win.edInsertContent(win.edCanvas, h);
     10                edInsertContent(edCanvas, h);
     11
     12        tb_remove();
    1113}
    1214
     
    3638                });
    3739        };
     40       
     41        jQuery('a.thickbox').click(function(){
     42                if ( typeof tinyMCE != 'undefined' &&  tinyMCE.activeEditor ) {
     43                        tinyMCE.get('content').focus();
     44                        tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
     45                }
     46        });
    3847
    3948        $(window).resize( function() { tb_position() } );
  • trunk/wp-includes/script-loader.php

    r8182 r8189  
    160160                ) );
    161161                $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080520' );
    162                 $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080523' );
     162                $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080624' );
    163163                $scripts->localize( 'upload', 'uploadL10n', array(
    164164                        'browseTitle' => attribute_escape(__('Browse your files')),
Note: See TracChangeset for help on using the changeset viewer.