Make WordPress Core

Ticket #38063: 38063.patch

File 38063.patch, 5.1 KB (added by mor10, 10 years ago)

Proof of concept

  • wp-includes/class-wp-editor.php

    From 61e6217663fa1c81d89b9a996faec2a3012878c8 Mon Sep 17 00:00:00 2001
    From: Morten Rand-Hendriksen <morten@pinkandyellow.com>
    Date: Thu, 15 Sep 2016 18:04:30 -0700
    Subject: [PATCH] Add keyboard shortcuts (when available) to tooltips in editor
     toolbar.
    
    ---
     wp-includes/class-wp-editor.php | 42 ++++++++++++++++++++---------------------
     1 file changed, 21 insertions(+), 21 deletions(-)
    
    diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php
    index 6e6fecc..bd24298 100644
    a b final class _WP_Editors {  
    833833                        /* translators: block tags */
    834834                        'Blocks' => _x( 'Blocks', 'TinyMCE' ),
    835835                        'Paragraph' => __( 'Paragraph' ),
    836                         'Blockquote' => __( 'Blockquote' ),
     836                        'Blockquote' => __( 'Blockquote (> in editor)' ),
    837837                        'Div' => _x( 'Div', 'HTML tag' ),
    838838                        'Pre' => _x( 'Pre', 'HTML tag' ),
    839839                        'Preformatted' => _x( 'Preformatted', 'HTML tag' ),
    840840                        'Address' => _x( 'Address', 'HTML tag' ),
    841841
    842842                        'Inline' => _x( 'Inline', 'HTML elements' ),
    843                         'Underline' => __( 'Underline' ),
    844                         'Strikethrough' => __( 'Strikethrough' ),
     843                        'Underline' => __( 'Underline (Ctrl + u)' ),
     844                        'Strikethrough' => __( 'Strikethrough (Alt + Shift + d)' ),
    845845                        'Subscript' => __( 'Subscript' ),
    846846                        'Superscript' => __( 'Superscript' ),
    847847                        'Clear formatting' => __( 'Clear formatting' ),
    848                         'Bold' => __( 'Bold' ),
    849                         'Italic' => __( 'Italic' ),
    850                         'Code' => __( 'Code' ),
     848                        'Bold' => __( 'Bold (Ctrl + b)' ),
     849                        'Italic' => __( 'Italic (Ctrl + i)' ),
     850                        'Code' => __( 'Code (Alt + Shift + x)' ),
    851851                        'Source code' => __( 'Source code' ),
    852852                        'Font Family' => __( 'Font Family' ),
    853853                        'Font Sizes' => __( 'Font Sizes' ),
    854854
    855                         'Align center' => __( 'Align center' ),
    856                         'Align right' => __( 'Align right' ),
    857                         'Align left' => __( 'Align left' ),
    858                         'Justify' => __( 'Justify' ),
     855                        'Align center' => __( 'Align center (Alt + Shift + c)' ),
     856                        'Align right' => __( 'Align right (Alt + Shift + r)' ),
     857                        'Align left' => __( 'Align left (Alt + Shift + l)' ),
     858                        'Justify' => __( 'Justify (Alt + Shift + j)' ),
    859859                        'Increase indent' => __( 'Increase indent' ),
    860860                        'Decrease indent' => __( 'Decrease indent' ),
    861861
    final class _WP_Editors {  
    863863                        'Copy' => __( 'Copy' ),
    864864                        'Paste' => __( 'Paste' ),
    865865                        'Select all' => __( 'Select all' ),
    866                         'Undo' => __( 'Undo' ),
    867                         'Redo' => __( 'Redo' ),
     866                        'Undo' => __( 'Undo (Ctrl + z)' ),
     867                        'Redo' => __( 'Redo (Ctrl + y)' ),
    868868
    869869                        'Ok' => __( 'OK' ),
    870870                        'Cancel' => __( 'Cancel' ),
    871871                        'Close' => __( 'Close' ),
    872872                        'Visual aids' => __( 'Visual aids' ),
    873873
    874                         'Bullet list' => __( 'Bulleted list' ),
    875                         'Numbered list' => __( 'Numbered list' ),
     874                        'Bullet list' => __( 'Bulleted list (Alt + Shift + u)' ),
     875                        'Numbered list' => __( 'Numbered list (Alt + Shift + o)' ),
    876876                        'Square' => _x( 'Square', 'list style' ),
    877877                        'Default' => _x( 'Default', 'list style' ),
    878878                        'Circle' => _x( 'Circle', 'list style' ),
    final class _WP_Editors {  
    924924                        'Emoticons' => __( 'Emoticons' ),
    925925                        'Nonbreaking space' => __( 'Nonbreaking space' ),
    926926                        'Page break' => __( 'Page break' ),
    927                         'Paste as text' => __( 'Paste as text' ),
     927                        'Paste as text' => __( 'Paste as text (Ctrl + v)' ),
    928928                        'Preview' => __( 'Preview' ),
    929929                        'Print' => __( 'Print' ),
    930930                        'Save' => __( 'Save' ),
    931931                        'Fullscreen' => __( 'Fullscreen' ),
    932                         'Horizontal line' => __( 'Horizontal line' ),
     932                        'Horizontal line' => __( 'Horizontal line (--- in editor)' ),
    933933                        'Horizontal space' => __( 'Horizontal space' ),
    934934                        'Restore last draft' => __( 'Restore last draft' ),
    935                         'Insert/edit link' => __( 'Insert/edit link' ),
    936                         'Remove link' => __( 'Remove link' ),
     935                        'Insert/edit link' => __( 'Insert/edit link (Ctrl + k)' ),
     936                        'Remove link' => __( 'Remove link (Alt + Shift + s)' ),
    937937
    938938                        'Color' => __( 'Color' ),
    939939                        'Custom color' => __( 'Custom color' ),
    final class _WP_Editors {  
    952952                        'Find' => _x( 'Find', 'find/replace' ),
    953953                        'Replace all' => _x( 'Replace all', 'find/replace' ),
    954954                        'Match case' => __( 'Match case' ),
    955                         'Spellcheck' => __( 'Check Spelling' ),
     955                        'Spellcheck' => __( 'Check Spelling (Alt + Shift + n)' ),
    956956                        'Finish' => _x( 'Finish', 'spellcheck' ),
    957957                        'Ignore all' => _x( 'Ignore all', 'spellcheck' ),
    958958                        'Ignore' => _x( 'Ignore', 'spellcheck' ),
    final class _WP_Editors {  
    10381038
    10391039                        // WordPress strings
    10401040                        'Toolbar Toggle' => __( 'Toolbar Toggle' ),
    1041                         'Insert Read More tag' => __( 'Insert Read More tag' ),
     1041                        'Insert Read More tag' => __( 'Insert Read More tag (Alt + Shift + t)' ),
    10421042                        'Insert Page Break tag' => __( 'Insert Page Break tag' ),
    10431043                        'Read more...' => __( 'Read more...' ), // Title on the placeholder inside the editor (no ellipsis)
    1044                         'Distraction-free writing mode' => __( 'Distraction-free writing mode' ),
     1044                        'Distraction-free writing mode' => __( 'Distraction-free writing mode (Alt + Shift + w)' ),
    10451045                        'No alignment' => __( 'No alignment' ), // Tooltip for the 'alignnone' button in the image toolbar
    10461046                        'Remove' => __( 'Remove' ), // Tooltip for the 'remove' button in the image toolbar
    10471047                        'Edit ' => __( 'Edit' ), // Tooltip for the 'edit' button in the image toolbar