Ticket #36781: 36781.1.diff
File 36781.1.diff, 2.2 KB (added by , 9 years ago) |
---|
-
src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
540 540 q: 'mceBlockQuote', 541 541 u: 'InsertUnorderedList', 542 542 o: 'InsertOrderedList', 543 s: 'unlink',544 543 m: 'WP_Medialib', 545 544 z: 'WP_Adv', 546 545 t: 'WP_More', -
src/wp-includes/js/tinymce/plugins/wplink/plugin.js
300 300 if ( ! editToolbar.tempHide ) { 301 301 inputInstance.reset(); 302 302 removePlaceholders(); 303 editor.focus();304 editToolbar.tempHide = false;305 303 } 306 304 } ); 307 305 308 // WP default shortcut 306 editor.addCommand( 'wp_unlink', function() { 307 editor.execCommand( 'unlink' ); 308 editToolbar.tempHide = false; 309 editor.execCommand( 'wp_link_cancel' ); 310 } ); 311 312 // WP default shortcuts 309 313 editor.addShortcut( 'access+a', '', 'WP_Link' ); 314 editor.addShortcut( 'access+s', '', 'wp_unlink' ); 310 315 // The "de-facto standard" shortcut, see #27305 311 316 editor.addShortcut( 'meta+k', '', 'WP_Link' ); 312 317 … … 367 372 // When doing undo and redo with keyboard shortcuts (Ctrl|Cmd+Z, Ctrl|Cmd+Shift+Z, Ctrl|Cmd+Y), 368 373 // set a flag to not focus the inline dialog. The editor has to remain focused so the users can do consecutive undo/redo. 369 374 editor.on( 'keydown', function( event ) { 375 if ( event.keyCode === 27 ) { // Esc 376 editor.execCommand( 'wp_link_cancel' ); 377 } 378 370 379 if ( event.altKey || ( tinymce.Env.mac && ( ! event.metaKey || event.ctrlKey ) ) || 371 380 ( ! tinymce.Env.mac && ! event.ctrlKey ) ) { 372 381 … … 560 569 toolbar.$el.find( '.wp-link-preview a' ).removeClass( 'wplink-url-error' ).attr( 'title', null ); 561 570 } 562 571 } 572 } else { 573 editor.execCommand( 'wp_link_cancel' ); 563 574 } 564 575 } ); 565 576 … … 572 583 editor.addButton( 'wp_link_remove', { 573 584 tooltip: 'Remove', 574 585 icon: 'dashicon dashicons-no', 575 cmd: ' unlink'586 cmd: 'wp_unlink' 576 587 } ); 577 588 578 589 editor.addButton( 'wp_link_advanced', {