Make WordPress Core

Changeset 33127


Ignore:
Timestamp:
07/08/2015 07:42:59 PM (10 years ago)
Author:
azaozz
Message:

TinyMCE: add help for the text patterns to the shortcuts help popup.
See #31441.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

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

    r33048 r33127  
    10461046            'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' =>
    10471047                __( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ),
     1048            'When starting a new paragraph with one of these patterns followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' =>
     1049                __( 'When starting a new paragraph with one of these patterns followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ),
    10481050        );
    10491051
  • trunk/src/wp-includes/css/editor.css

    r33013 r33127  
    151151    font-weight: bold;
    152152    padding: 5px 0 0;
     153}
     154
     155.mce-window .wp-editor-help .wp-help-th-center th {
    153156    text-align: center;
    154157}
  • trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js

    r33013 r33127  
    206206            table1 = [],
    207207            table2 = [],
    208             header;
     208            header, html;
    209209
    210210        each( [
     
    251251        header = '<tr class="wp-help-header"><td>' + header.join( '</td><td>' ) + '</td></tr>';
    252252
     253        html = '<div class="wp-editor-help">';
     254
     255        // Main section, default and additional shortcuts
     256        html = html +
     257            '<p>' + __( 'Default shortcuts,' ) + ' ' + meta + '</p>' +
     258            '<table class="wp-help-th-center">' +
     259                header +
     260                table1.join('') +
     261            '</table>' +
     262            '<p>' + __( 'Additional shortcuts,' ) + ' ' + access + '</p>' +
     263            '<table class="wp-help-th-center">' +
     264                header +
     265                table2.join('') +
     266            '</table>';
     267
     268        if ( editor.plugins.wptextpattern ) {
     269            // Text pattern section
     270            html = html +
     271                '<p>' + __( 'When starting a new paragraph with one of these patterns followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ) + '</p>' +
     272                '<table>' +
     273                    tr({ '* or -':  'Bullet list' }) +
     274                    tr({ '1. or 1)':  'Numbered list' }) +
     275                    tr({ '>': 'Blockquote' }) +
     276                    tr({ '##': 'Heading 2' }) +
     277                    tr({ '###': 'Heading 3' }) +
     278                    tr({ '####': 'Heading 4' }) +
     279                    tr({ '#####': 'Heading 5' }) +
     280                    tr({ '######': 'Heading 6' }) +
     281                '</table>';
     282        }
     283
     284        // Focus management section
     285        html = html +
     286            '<p>' + __( 'Focus shortcuts:' ) + '</p>' +
     287            '<table>' +
     288                tr({ 'Alt + F8':  'Inline toolbar (when an image, link or preview is selected)' }) +
     289                tr({ 'Alt + F9':  'Editor menu (when enabled)' }) +
     290                tr({ 'Alt + F10': 'Editor toolbar' }) +
     291                tr({ 'Alt + F11': 'Elements path' }) +
     292            '</table>' +
     293            '<p>' + __( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ) + '</p>';
     294
     295        html += '</div>';
     296
    253297        editor.windowManager.open( {
    254298            title: 'Keyboard Shortcuts',
     
    256300                type: 'container',
    257301                classes: 'wp-help',
    258                 html: (
    259                     '<div class="wp-editor-help">' +
    260                     '<p>' + __( 'Default shortcuts,' ) + ' ' + meta + '</p>' +
    261                     '<table>' +
    262                         header +
    263                         table1.join('') +
    264                     '</table>' +
    265                     '<p>' + __( 'Additional shortcuts,' ) + ' ' + access + '</p>' +
    266                     '<table>' +
    267                         header +
    268                         table2.join('') +
    269                     '</table>' +
    270                     '<p>' + __( 'Focus shortcuts:' ) + '</p>' +
    271                     '<table>' +
    272                         tr({ 'Alt + F8':  'Inline toolbar (when an image, link or preview is selected)' }) +
    273                         tr({ 'Alt + F9':  'Editor menu (when enabled)' }) +
    274                         tr({ 'Alt + F10': 'Editor toolbar' }) +
    275                         tr({ 'Alt + F11': 'Elements path' }) +
    276                     '</table>' +
    277                     '<p>' + __( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ) + '</p>' +
    278                     '</div>'
    279                 )
     302                html: html
    280303            },
    281304            buttons: {
Note: See TracChangeset for help on using the changeset viewer.