Make WordPress Core


Ignore:
Timestamp:
08/06/2011 01:35:02 AM (15 years ago)
Author:
azaozz
Message:

Fix send_to_editor() and Insert/Upload buttons URLs, see #17144

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-editor.php

    r18511 r18516  
    430430
    431431        add_thickbox();
     432        wp_enqueue_script('media-upload');
    432433    }
    433434
     
    526527
    527528                    if ( mce )
    528                         try{tinymce.init(init);}catch(e){}
     529                        try { tinymce.init(init); } catch(e){}
    529530                }
    530531            }
     
    532533            if ( typeof(QTags) == 'function' ) {
    533534                for ( qt in tinyMCEPreInit.qtInit ) {
    534                     try{quicktags(tinyMCEPreInit.qtInit[qt]);}catch(e){}
     535                    try { quicktags( tinyMCEPreInit.qtInit[qt] ); } catch(e){}
    535536                }
    536537            }
     
    539540        var wpActiveEditor;
    540541
    541         jQuery('.wp-editor-wrap').click(function(e){
     542        jQuery('.wp-editor-wrap').mousedown(function(e){
    542543            wpActiveEditor = this.id.slice(3, -5);
    543544        });
    544545
    545         function send_to_editor(h) {
    546             var ed;
    547 
    548             if ( typeof(tinymce) != 'undefined' && wpActiveEditor )
    549                 ed = tinymce.get(wpActiveEditor);
    550 
    551             if ( ed && !ed.isHidden() ) {
    552                 // restore caret position on IE
    553                 if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
    554                     ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
    555 
    556                 if ( h.indexOf('[caption') === 0 ) {
    557                     if ( ed.plugins.wpeditimage )
    558                         h = ed.plugins.wpeditimage._do_shcode(h);
    559                 } else if ( h.indexOf('[gallery') === 0 ) {
    560                     if ( ed.plugins.wpgallery )
    561                         h = ed.plugins.wpgallery._do_gallery(h);
    562                 } else if ( h.indexOf('[embed') === 0 ) {
    563                     if ( ed.plugins.wordpress )
    564                         h = ed.plugins.wordpress._setEmbed(h);
    565                 }
    566 
    567                 ed.execCommand('mceInsertContent', false, h);
    568             } else if ( typeof quicktags != 'undefined' ) {
    569                 QTags.insertContent(wpActiveEditor, h);
    570             } else {
    571                 jQuery('#'+wpActiveEditor).val( jQuery('#'+wpActiveEditor).val() + h );
    572             }
    573 
    574             tb_remove();
    575         }
    576546<?php
    577547
Note: See TracChangeset for help on using the changeset viewer.