Make WordPress Core

Ticket #21976: 21976.patch

File 21976.patch, 5.9 KB (added by azaozz, 13 years ago)
  • wp-includes/class-wp-editor.php

     
    167167                                self::$baseurl = includes_url('js/tinymce');
    168168                                self::$mce_locale = $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); // only ISO 639-1
    169169                                $no_captions = (bool) apply_filters( 'disable_captions', '' );
    170                                 $plugins = array( 'inlinepopups', 'spellchecker', 'tabfocus', 'paste', 'media', 'fullscreen', 'wordpress', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' );
    171170                                $first_run = true;
    172171                                $ext_plugins = '';
     172                                $plugins = array( 'inlinepopups', 'spellchecker', 'tabfocus', 'paste', 'media', 'wordpress', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' );
    173173
     174                                if ( $set['dfw'] )
     175                                        $plugins[] = 'wpfullscreen';
     176
    174177                                if ( $set['teeny'] ) {
    175178                                        self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array('inlinepopups', 'fullscreen', 'wordpress', 'wplink', 'wpdialogs'), $editor_id );
    176179                                } else {
     
    254257                                        $plugins = array_unique( apply_filters('tiny_mce_plugins', $plugins) );
    255258                                }
    256259
    257                                 if ( $set['dfw'] )
    258                                         $plugins[] = 'wpfullscreen';
    259 
    260260                                self::$plugins = $plugins;
    261261                                self::$ext_plugins = $ext_plugins;
    262262
     
    362362                                $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'separator', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
    363363                                $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
    364364                        } else {
    365                                 $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id);
     365                                $mce_buttons = array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'wp_adv' );
     366
     367                                if ( $set['dfw'] )
     368                                        array_splice($mce_buttons, -1, 0, 'wp_fullscreen');
     369
     370                                $mce_buttons = apply_filters('mce_buttons', $mce_buttons, $editor_id);
    366371                                $mce_buttons_2 = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' ), $editor_id);
    367372                                $mce_buttons_3 = apply_filters('mce_buttons_3', array(), $editor_id);
    368373                                $mce_buttons_4 = apply_filters('mce_buttons_4', array(), $editor_id);
     
    378383                                unset($set['tinymce']['body_class']);
    379384                        }
    380385
    381                         if ( $set['dfw'] ) {
    382                                 // replace the first 'fullscreen' with 'wp_fullscreen'
    383                                 if ( ($key = array_search('fullscreen', $mce_buttons)) !== false )
    384                                         $mce_buttons[$key] = 'wp_fullscreen';
    385                                 elseif ( ($key = array_search('fullscreen', $mce_buttons_2)) !== false )
    386                                         $mce_buttons_2[$key] = 'wp_fullscreen';
    387                                 elseif ( ($key = array_search('fullscreen', $mce_buttons_3)) !== false )
    388                                         $mce_buttons_3[$key] = 'wp_fullscreen';
    389                                 elseif ( ($key = array_search('fullscreen', $mce_buttons_4)) !== false )
    390                                         $mce_buttons_4[$key] = 'wp_fullscreen';
    391                         }
    392 
    393386                        $mceInit = array (
    394387                                'elements' => $editor_id,
    395388                                'wpautop' => (bool) $set['wpautop'],
  • wp-includes/js/tinymce/langs/wp-langs-en.js

     
    170170unload_msg:"The changes you made will be lost if you navigate away from this page."
    171171},
    172172fullscreen:{
    173 desc:"Toggle fullscreen mode (Alt + Shift + G)"
     173desc:"Toggle fullscreen mode"
    174174},
    175175media:{
    176176desc:"Insert / edit embedded media",
  • wp-includes/js/tinymce/langs/wp-langs.php

     
    207207                ),
    208208
    209209                'fullscreen' => array(
    210                         'desc' => __('Toggle fullscreen mode (Alt + Shift + G)')
     210                        'desc' => __('Toggle fullscreen mode')
    211211                ),
    212212
    213213                'media' => array(
  • wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js

     
    272272                        ed.addShortcut(mod_key + '+p', 'wordpress.wp_page_desc', 'WP_Page');
    273273                        ed.addShortcut('ctrl+s', 'save_desc', function(){if('function'==typeof autosave)autosave();});
    274274
    275                         if ( /\bwpfullscreen\b/.test(ed.settings.plugins) )
     275                        if ( /\bwpfullscreen\b/.test(ed.settings.plugins) && ed.id != 'mce_fullscreen' )
    276276                                ed.addShortcut(mod_key + '+w', 'wordpress.wp_fullscreen_desc', 'wpFullScreen');
    277                         else if ( /\bfullscreen\b/.test(ed.settings.plugins) )
    278                                 ed.addShortcut(mod_key + '+g', 'fullscreen.desc', 'mceFullScreen');
    279277
    280278                        // popup buttons for images and the gallery
    281279                        ed.onInit.add(function(ed) {
  • wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js

     
    9494                        });
    9595
    9696                        ed.addCommand('wpFullScreen', function() {
    97                                 if ( typeof(fullscreen) == 'undefined' )
     97                                if ( typeof(fullscreen) == 'undefined' || tinymce.get('mce_fullscreen') ) // don't open DFW if the TInyMCE fullscreen is currently open
    9898                                        return;
    9999
    100100                                if ( 'wp_mce_fullscreen' == ed.id )