TinyMCE: replace the editor iframe title on MacOS to fix the help shortcut.

Props afercia, azaozz.
Fixes #36863.

git-svn-id: https://develop.svn.wordpress.org/trunk@38110 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2016-07-20 01:38:12 +00:00
parent 79e7fca981
commit 616d4416e2
2 changed files with 7 additions and 1 deletions

View File

@ -1023,7 +1023,8 @@ final class _WP_Editors {
/* translators: word count */
'Words: {0}' => sprintf( __( 'Words: %s' ), '{0}' ),
'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' => __( 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' ) . "\n\n" . __( 'If you’re looking to paste rich content from Microsoft Word, try turning this option off. The editor will clean up text pasted from Word automatically.' ),
'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' => __( 'Rich Text Area. Press Alt-Shift-H for help' ),
'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' => __( 'Rich Text Area. Press Alt-Shift-H for help.' ),
'Rich Text Area. Press Control-Option-H for help.' => __( 'Rich Text Area. Press Control-Option-H for help.' ),
'You have unsaved changes are you sure you want to navigate away?' => __( 'The changes you made will be lost if you navigate away from this page.' ),
'Your browser doesn\'t support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.' => __( 'Your browser does not support direct access to the clipboard. Please use keyboard shortcuts or your browser’s edit menu instead.' ),

View File

@ -579,6 +579,11 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
if ( window.getUserSetting( 'editor_plain_text_paste_warning' ) > 1 ) {
editor.settings.paste_plaintext_inform = false;
}
// Change the editor iframe title on MacOS, add the correct help shortcut.
if ( tinymce.Env.mac ) {
tinymce.$( editor.iframeElement ).attr( 'title', __( 'Rich Text Area. Press Control-Option-H for help.' ) );
}
} );
editor.on( 'PastePlainTextToggle', function( event ) {