Make WordPress Core

Ticket #38315: 38315.patch

File 38315.patch, 3.4 KB (added by azaozz, 9 years ago)
  • src/wp-includes/class-wp-editor.php

     
    600600                                $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
    601601                                $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
    602602                        } else {
    603                                 $mce_buttons = array( 'bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker' );
     603                                $mce_buttons = array( 'bold', 'italic', 'strikethrough', 'wp_mark', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker' );
    604604
    605605                                if ( ! wp_is_mobile() ) {
    606606                                        if ( $set['_content_editor_dfw'] ) {
     
    622622                                 */
    623623                                $mce_buttons = apply_filters( 'mce_buttons', $mce_buttons, $editor_id );
    624624
    625                                 $mce_buttons_2 = array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo' );
     625                                $mce_buttons_2 = array( 'formatselect', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo' );
    626626
    627627                                if ( ! wp_is_mobile() ) {
    628628                                        $mce_buttons_2[] = 'wp_help';
     
    10491049                        'Apply'  => __( 'Apply' ), // Tooltip for the 'apply' button in the inline link dialog
    10501050                        'Link options'  => __( 'Link options' ), // Tooltip for the 'link options' button in the inline link dialog
    10511051
     1052                        /* translators: as in marking/highlighting text */
     1053                        'Mark' => _x( 'Mark', 'TinyMCE button' ),
     1054
    10521055                        // Shortcuts help modal
    10531056                        'Keyboard Shortcuts' => __( 'Keyboard Shortcuts' ),
    10541057                        'Default shortcuts,' => __( 'Default shortcuts,' ),
  • src/wp-includes/css/editor.css

     
    888888i.mce-i-wp_page,
    889889i.mce-i-hr,
    890890i.mce-i-wp_code,
     891i.mce-i-wp_mark,
    891892i.mce-i-dashicon,
    892893i.mce-i-remove {
    893894        font: normal 20px/1 dashicons;
     
    10411042        content: "\f475";
    10421043}
    10431044
     1045i.mce-i-wp_mark:before {
     1046        content: "\f540";
     1047}
     1048
    10441049/* RTL button icons */
    10451050.rtl i.mce-i-outdent:before {
    10461051        content: "\f222";
  • src/wp-includes/js/tinymce/plugins/wordpress/plugin.js

     
    222222                editor.formatter.toggle('code');
    223223        });
    224224
     225        editor.addCommand( 'WP_Mark', function() {
     226                editor.formatter.toggle('mark');
     227        });
     228
    225229        editor.addCommand( 'WP_Page', function() {
    226230                editor.execCommand( 'WP_More', 'nextpage' );
    227231        });
     
    389393                stateSelector: 'code'
    390394        });
    391395
     396        editor.addButton( 'wp_mark', {
     397                tooltip: 'Mark',
     398                cmd: 'WP_Mark',
     399                stateSelector: 'mark'
     400        });
     401
    392402        // Menubar
    393403        // Insert->Add Media
    394404        if ( wp && wp.media && wp.media.editor ) {
     
    521531                                });
    522532                        });
    523533                }
     534
     535                editor.formatter.register({
     536                        mark: { inline: 'mark' }
     537                });
    524538        });
    525539
    526540        editor.on( 'SaveContent', function( event ) {