TinyMCE: Fix the keyboard shortcut (Alt+Shift+H) to not open the default Block Editor help modal and change the title of the help modal to "Classic Block Keyboard Shortcuts" in the Classic BLock. Also remove Alt+Shift+Z in the Classic Block as it conflicts with the Block Editor.
Fixes #45365. Built from https://develop.svn.wordpress.org/branches/5.0@43915 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5e278d5892
commit
f979e79d54
|
@ -1268,6 +1268,7 @@ final class _WP_Editors {
|
||||||
|
|
||||||
// Shortcuts help modal
|
// Shortcuts help modal
|
||||||
'Keyboard Shortcuts' => array( __( 'Keyboard Shortcuts' ), 'accessH' ),
|
'Keyboard Shortcuts' => array( __( 'Keyboard Shortcuts' ), 'accessH' ),
|
||||||
|
'Classic Block Keyboard Shortcuts' => __( 'Classic Block Keyboard Shortcuts' ),
|
||||||
'Default shortcuts,' => __( 'Default shortcuts,' ),
|
'Default shortcuts,' => __( 'Default shortcuts,' ),
|
||||||
'Additional shortcuts,' => __( 'Additional shortcuts,' ),
|
'Additional shortcuts,' => __( 'Additional shortcuts,' ),
|
||||||
'Focus shortcuts:' => __( 'Focus shortcuts:' ),
|
'Focus shortcuts:' => __( 'Focus shortcuts:' ),
|
||||||
|
|
|
@ -370,7 +370,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
dialog = editor.windowManager.open( {
|
dialog = editor.windowManager.open( {
|
||||||
title: 'Keyboard Shortcuts',
|
title: editor.settings.classic_block_editor ? 'Classic Block Keyboard Shortcuts' : 'Keyboard Shortcuts',
|
||||||
items: {
|
items: {
|
||||||
type: 'container',
|
type: 'container',
|
||||||
classes: 'wp-help',
|
classes: 'wp-help',
|
||||||
|
@ -652,10 +652,8 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||||
u: 'InsertUnorderedList',
|
u: 'InsertUnorderedList',
|
||||||
o: 'InsertOrderedList',
|
o: 'InsertOrderedList',
|
||||||
m: 'WP_Medialib',
|
m: 'WP_Medialib',
|
||||||
z: 'WP_Adv',
|
|
||||||
t: 'WP_More',
|
t: 'WP_More',
|
||||||
d: 'Strikethrough',
|
d: 'Strikethrough',
|
||||||
h: 'WP_Help',
|
|
||||||
p: 'WP_Page',
|
p: 'WP_Page',
|
||||||
x: 'WP_Code'
|
x: 'WP_Code'
|
||||||
}, function( command, key ) {
|
}, function( command, key ) {
|
||||||
|
@ -668,6 +666,23 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// Alt+Shift+Z removes a block in the Block Editor, don't add it to the Classic Block.
|
||||||
|
if ( ! editor.settings.classic_block_editor ) {
|
||||||
|
editor.addShortcut( 'access+z', '', 'WP_Adv' );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Workaround for not triggering the global help modal in the Block Editor by the Classic Block shortcut.
|
||||||
|
editor.on( 'keydown', function( event ) {
|
||||||
|
if ( event.shiftKey && event.altKey && event.code === 'KeyH' ) {
|
||||||
|
editor.execCommand( 'WP_Help' );
|
||||||
|
event.stopPropagation();
|
||||||
|
event.stopImmediatePropagation();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
if ( window.getUserSetting( 'editor_plain_text_paste_warning' ) > 1 ) {
|
if ( window.getUserSetting( 'editor_plain_text_paste_warning' ) > 1 ) {
|
||||||
editor.settings.paste_plaintext_inform = false;
|
editor.settings.paste_plaintext_inform = false;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-beta5-43914';
|
$wp_version = '5.0-beta5-43915';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue