Ticket #29558: 29558.4.patch
File 29558.4.patch, 7.6 KB (added by , 10 years ago) |
---|
-
src/wp-includes/class-wp-editor.php
993 993 'Keyboard Shortcuts' => __( 'Keyboard Shortcuts' ), 994 994 'Toolbar Toggle' => __( 'Toolbar Toggle' ), 995 995 'Insert Read More tag' => __( 'Insert Read More tag' ), 996 'Insert Page Break tag' => __( 'Insert Page Break tag' ), 996 997 'Read more...' => __( 'Read more...' ), // Title on the placeholder inside the editor 997 998 'Distraction-free writing mode' => __( 'Distraction-free writing mode' ), 998 999 'No alignment' => __( 'No alignment' ), // Tooltip for the 'alignnone' button in the image toolbar 999 1000 'Remove' => __( 'Remove' ), // Tooltip for the 'remove' button in the image toolbar 1000 1001 'Edit ' => __( 'Edit' ), // Tooltip for the 'edit' button in the image toolbar 1002 'Focus shortcuts:' => __( 'Focus shortcuts:' ), 1003 'Image toolbar (when an image is selected)' => __( 'Image toolbar (when an image is selected)' ), 1004 'Editor menu (when enabled)' => __( 'Editor menu (when enabled)' ), 1005 'Editor toolbar' => __( 'Editor toolbar' ), 1006 'Elements path' => __( 'Elements path' ) 1001 1007 ); 1002 1008 1003 1009 /** -
src/wp-includes/css/editor.css
79 79 width: calc( 100% - 36px ); 80 80 } 81 81 82 .mce-wp-help .mce-window-head {83 border-bottom: none;84 }85 86 82 .mce-textbox, 87 83 .mce-checkbox i.mce-i-checkbox, 88 84 #wp-link .query-results { … … 104 100 box-shadow: 0 0 2px rgba(30,140,190,0.8); 105 101 } 106 102 103 .mce-container kbd { 104 font-family: monospace; 105 padding: 3px 5px 2px 5px; 106 margin: 0 1px; 107 background: #eaeaea; 108 background: rgba(0,0,0,0.07); 109 font-size: 13px; 110 } 111 112 .mce-wp-help { 113 height: 400px; 114 overflow: auto; 115 } 116 117 .mce-wp-help td { 118 padding: 5px; 119 } 120 107 121 /* TinyMCE menus */ 108 122 .mce-menu, 109 123 .mce-floatpanel.mce-popover { -
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,7 var DOM = tinymce.DOM, wpAdvButton, style, 8 8 last = 0; 9 9 10 10 if ( typeof window.jQuery !== 'undefined' ) { … … 188 188 }); 189 189 190 190 editor.addCommand( 'WP_Help', function() { 191 var each = tinymce.each, 192 column1 = [], 193 column2 = [], 194 rows, 195 i, 196 html = [], 197 meta = tinymce.Env.mac ? 'cmd' : 'ctrl', 198 access = tinymce.Env.mac ? 'ctrl + alt' : 'shift + alt', 199 __ = editor.editorManager.i18n.translate; 200 201 each( { 202 C: 'Copy', 203 X: 'Cut', 204 V: 'Paste', 205 A: 'Select all', 206 Z: 'Undo', 207 Y: 'Redo', 208 B: 'Bold', 209 I: 'Italic', 210 U: 'Underline', 211 K: 'Insert/edit link' 212 }, function( text, key ) { 213 column1.push( td( meta + ' + ' + key, text ) ); 214 } ); 215 216 each( [ 1, 2, 3, 4, 5, 6 ], function( key ) { 217 column1.push( td( access + ' + ' + key, 'Heading ' + key ) ); 218 } ); 219 220 each( { 221 L: 'Align left', 222 C: 'Align center', 223 R: 'Align right', 224 J: 'Justify', 225 D: 'Strikethrough', 226 Q: 'Blockquote', 227 U: 'Bullet list', 228 O: 'Numbered list', 229 A: 'Insert/edit link', 230 S: 'Remove link', 231 M: 'Insert/edit image', 232 T: 'Insert Read More tag', 233 H: 'Keyboard Shortcuts', 234 X: 'Code', 235 P: 'Insert Page Break tag', 236 W: 'Distraction-free writing mode', 237 N: 'Spellcheck' 238 }, function( text, key ) { 239 column2.push( td( access + ' + ' + key, text ) ); 240 } ); 241 242 function td( pattern, text ) { 243 return '<td>' + ( pattern ? '<kbd>' + pattern + '</kbd>' : '' ) + '</td><td>' + ( __( text ) || '' ) + '</td>'; 244 } 245 246 rows = Math.max( column1.length, column2.length ); 247 248 for ( i = 1; i <= rows; i++ ) { 249 html.push( '<tr>' + ( column1[ i ] || td() ) + ( column2[ i ] || td() ) + '</tr>' ); 250 } 251 252 html = ( 253 '<table>' + html.join( '' ) + '</table>' + 254 '<p>' + __( 'Focus shortcuts:' ) + '</p>' + 255 '<table>' + 256 '<tr>' + td( 'alt + F8', 'Image toolbar (when an image is selected)' ) + '</tr>' + 257 '<tr>' + td( 'alt + F9', 'Editor menu (when enabled)' ) + '</tr>' + 258 '<tr>' + td( 'alt + F10', 'Editor toolbar' ) + '</tr>' + 259 '<tr>' + td( 'alt + F11', 'Elements path' ) + '</tr>' + 260 '</table>' 261 ); 262 191 263 editor.windowManager.open({ 192 url: tinymce.baseURL + '/wp-mce-help.php',193 264 title: 'Keyboard Shortcuts', 194 width: 450, 195 height: 420, 196 classes: 'wp-help', 197 buttons: { text: 'Close', onclick: 'close' } 265 spacing: 10, 266 padding: 10, 267 items: { 268 type: 'container', 269 classes: 'wp-help', 270 html: html 271 }, 272 buttons: { 273 text: 'Close', 274 onclick: 'close' 275 } 198 276 }); 199 277 }); 200 278 … … 402 480 }); 403 481 404 482 editor.on( 'preInit', function() { 483 var i; 484 405 485 // Don't replace <i> with <em> and <b> with <strong> and don't remove them when empty 406 486 editor.schema.addValidElements( '@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b' ); 407 487 408 488 if ( tinymce.Env.iOS ) { 409 489 editor.settings.height = 300; 410 490 } 411 });412 491 413 // Add custom shortcuts 414 modKey = 'alt+shift'; 492 for ( i = 1; i <= 9; i++ ) { 493 editor.shortcuts.remove( 'meta+shift+' + i ); 494 } 415 495 416 editor.addShortcut( modKey + '+c', '', 'JustifyCenter' ); 417 editor.addShortcut( modKey + '+r', '', 'JustifyRight' ); 418 editor.addShortcut( modKey + '+l', '', 'JustifyLeft' ); 419 editor.addShortcut( modKey + '+j', '', 'JustifyFull' ); 420 editor.addShortcut( modKey + '+q', '', 'mceBlockQuote' ); 421 editor.addShortcut( modKey + '+u', '', 'InsertUnorderedList' ); 422 editor.addShortcut( modKey + '+o', '', 'InsertOrderedList' ); 423 editor.addShortcut( modKey + '+n', '', 'mceSpellCheck' ); 424 editor.addShortcut( modKey + '+s', '', 'unlink' ); 425 editor.addShortcut( modKey + '+m', '', 'WP_Medialib' ); 426 editor.addShortcut( modKey + '+z', '', 'WP_Adv' ); 427 editor.addShortcut( modKey + '+t', '', 'WP_More' ); 428 editor.addShortcut( modKey + '+d', '', 'Strikethrough' ); 429 editor.addShortcut( modKey + '+h', '', 'WP_Help' ); 430 editor.addShortcut( modKey + '+p', '', 'WP_Page' ); 431 editor.addShortcut( modKey + '+x', '', 'WP_Code' ); 432 editor.addShortcut( 'ctrl+s', '', function() { 433 if ( typeof wp !== 'undefined' && wp.autosave ) { 434 wp.autosave.server.triggerSave(); 496 for ( i = 1; i <= 6; i++ ) { 497 editor.shortcuts.add( 'access+' + i, '', [ 'FormatBlock', false, 'h' + i ] ); 435 498 } 436 }); 437 499 500 tinymce.each( { 501 c: 'JustifyCenter', 502 r: 'JustifyRight', 503 l: 'JustifyLeft', 504 j: 'JustifyFull', 505 q: 'mceBlockQuote', 506 u: 'InsertUnorderedList', 507 o: 'InsertOrderedList', 508 n: 'mceSpellCheck', 509 s: 'unlink', 510 m: 'WP_Medialib', 511 z: 'WP_Adv', 512 t: 'WP_More', 513 d: 'Strikethrough', 514 h: 'WP_Help', 515 p: 'WP_Page', 516 x: 'WP_Code' 517 }, function( command, key ) { 518 editor.shortcuts.add( 'access+' + key, '', command ); 519 } ); 520 521 editor.addShortcut( 'ctrl+s', '', function() { 522 if ( typeof wp !== 'undefined' && wp.autosave ) { 523 wp.autosave.server.triggerSave(); 524 } 525 } ); 526 } ); 527 438 528 /** 439 529 * Experimental: create a floating toolbar. 440 * This functionality will change in the next releases. Not recommen nded for use by plugins.441 */ 530 * This functionality will change in the next releases. Not recommended for use by plugins. 531 */ 442 532 ( function() { 443 533 var DOM = tinymce.DOM, 444 534 each = tinymce.each,