Ticket #29558: 29558.patch
File 29558.patch, 4.3 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
4 4 tinymce.ui.FloatPanel.zIndex = 100100; 5 5 6 6 tinymce.PluginManager.add( 'wordpress', function( editor ) { 7 var DOM = tinymce.DOM, wpAdvButton, modKey, style, 8 last = 0; 7 var DOM = tinymce.DOM, 8 each = tinymce.each, 9 last = 0, 10 wpAdvButton, 11 style; 9 12 10 13 if ( typeof window.jQuery !== 'undefined' ) { 11 14 window.jQuery( document ).triggerHandler( 'tinymce-editor-setup', [ editor ] ); … … 29 32 state = 'hide'; 30 33 } 31 34 32 tinymce.each( toolbars, function( toolbar, i ) {35 each( toolbars, function( toolbar, i ) { 33 36 if ( i > 0 ) { 34 37 if ( state === 'hide' ) { 35 38 toolbar.hide(); … … 309 312 310 313 bodyClass.push('wp-editor'); 311 314 312 tinymce.each( bodyClass, function( cls ) {315 each( bodyClass, function( cls ) { 313 316 if ( cls ) { 314 317 dom.addClass( doc.body, cls ); 315 318 } … … 351 354 352 355 editor.on( 'PastePostProcess', function( event ) { 353 356 // Remove empty paragraphs 354 tinymce.each( dom.select( 'p', event.node ), function( node ) {357 each( dom.select( 'p', event.node ), function( node ) { 355 358 if ( dom.isEmpty( node ) ) { 356 359 dom.remove( node ); 357 360 } … … 408 411 } 409 412 }); 410 413 411 // Add custom shortcuts 412 modKey = 'alt+shift'; 414 each( { 415 c: 'JustifyCenter', 416 r: 'JustifyRight', 417 l: 'JustifyLeft', 418 j: 'JustifyFull', 419 q: 'mceBlockQuote', 420 u: 'InsertUnorderedList', 421 o: 'InsertOrderedList', 422 n: 'mceSpellCheck', 423 s: 'unlink', 424 m: 'WP_Medialib', 425 z: 'WP_Adv', 426 t: 'WP_More', 427 d: 'Strikethrough', 428 h: 'WP_Help', 429 p: 'WP_Page', 430 x: 'WP_Code' 431 }, function( command, key ) { 432 editor.addShortcut( 'access+' + key, '', command ); 433 } ); 413 434 414 editor.addShortcut( modKey + '+c', '', 'JustifyCenter' );415 editor.addShortcut( modKey + '+r', '', 'JustifyRight' );416 editor.addShortcut( modKey + '+l', '', 'JustifyLeft' );417 editor.addShortcut( modKey + '+j', '', 'JustifyFull' );418 editor.addShortcut( modKey + '+q', '', 'mceBlockQuote' );419 editor.addShortcut( modKey + '+u', '', 'InsertUnorderedList' );420 editor.addShortcut( modKey + '+o', '', 'InsertOrderedList' );421 editor.addShortcut( modKey + '+n', '', 'mceSpellCheck' );422 editor.addShortcut( modKey + '+s', '', 'unlink' );423 editor.addShortcut( modKey + '+m', '', 'WP_Medialib' );424 editor.addShortcut( modKey + '+z', '', 'WP_Adv' );425 editor.addShortcut( modKey + '+t', '', 'WP_More' );426 editor.addShortcut( modKey + '+d', '', 'Strikethrough' );427 editor.addShortcut( modKey + '+h', '', 'WP_Help' );428 editor.addShortcut( modKey + '+p', '', 'WP_Page' );429 editor.addShortcut( modKey + '+x', '', 'WP_Code' );430 435 editor.addShortcut( 'ctrl+s', '', function() { 431 436 if ( typeof wp !== 'undefined' && wp.autosave ) { 432 437 wp.autosave.server.triggerSave(); -
src/wp-includes/js/tinymce/plugins/wplink/plugin.js
1 1 /* global tinymce */ 2 2 tinymce.PluginManager.add( 'wplink', function( editor ) { 3 var linkButton; 3 var shortcut = 'meta+k', 4 linkButton; 4 5 5 6 // Register a command so that it can be invoked by using tinyMCE.activeEditor.execCommand( 'WP_Link' ); 6 7 editor.addCommand( 'WP_Link', function() { … … 9 10 } 10 11 }); 11 12 12 // WP default shortcut 13 editor.addShortcut( 'alt+shift+a', '', 'WP_Link' ); 14 // The "de-facto standard" shortcut, see #27305 15 editor.addShortcut( 'ctrl+k', '', 'WP_Link' ); 13 editor.addShortcut( shortcut, '', 'WP_Link' ); 16 14 17 15 function setState( button, node ) { 18 16 var parent = editor.dom.getParent( node, 'a' ), … … 25 23 editor.addButton( 'link', { 26 24 icon: 'link', 27 25 tooltip: 'Insert/edit link', 28 shortcut: 'Alt+Shift+A',26 shortcut: shortcut, 29 27 cmd: 'WP_Link', 30 28 31 29 onPostRender: function() { … … 53 51 54 52 editor.addMenuItem( 'link', { 55 53 icon: 'link', 56 text: 'Insert link',57 shortcut: 'Alt+Shift+A',54 text: 'Insert/edit link', 55 shortcut: shortcut, 58 56 cmd: 'WP_Link', 59 57 stateSelector: 'a[href]', 60 58 context: 'insert',