Ticket #29558: 29558.7.patch
File 29558.7.patch, 4.7 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, 7 var DOM = tinymce.DOM, 8 each = tinymce.each, 9 __ = editor.editorManager.i18n.translate, 10 wpAdvButton, style, 8 11 last = 0; 9 12 10 13 if ( typeof window.jQuery !== 'undefined' ) { … … 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(); … … 91 94 92 95 if ( e.content ) { 93 96 if ( e.content.indexOf( '<!--more' ) !== -1 ) { 94 title = editor.editorManager.i18n.translate( 'Read more...' );97 title = __( 'Read more...' ); 95 98 96 99 e.content = e.content.replace( /<!--more(.*?)-->/g, function( match, moretext ) { 97 100 return '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="more" data-wp-more-text="' + moretext + '" ' + … … 100 103 } 101 104 102 105 if ( e.content.indexOf( '<!--nextpage-->' ) !== -1 ) { 103 title = editor.editorManager.i18n.translate( 'Page break' );106 title = __( 'Page break' ); 104 107 105 108 e.content = e.content.replace( /<!--nextpage-->/g, 106 109 '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="nextpage" class="wp-more-tag mce-wp-nextpage" ' + … … 149 152 tag = tag || 'more'; 150 153 classname += ' mce-wp-' + tag; 151 154 title = tag === 'more' ? 'Read more...' : 'Next page'; 152 title = editor.editorManager.i18n.translate( title );155 title = __( title ); 153 156 html = '<img src="' + tinymce.Env.transparentSrc + '" title="' + title + '" class="' + classname + '" ' + 154 157 'data-wp-more="' + tag + '" data-mce-resize="false" data-mce-placeholder="1" />'; 155 158 … … 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 if ( tinymce.Env.iOS ) { 409 412 editor.settings.height = 300; 410 413 } 411 });412 414 413 // Add custom shortcuts 414 modKey = 'alt+shift'; 415 each( { 416 c: 'JustifyCenter', 417 r: 'JustifyRight', 418 l: 'JustifyLeft', 419 j: 'JustifyFull', 420 q: 'mceBlockQuote', 421 u: 'InsertUnorderedList', 422 o: 'InsertOrderedList', 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.shortcuts.add( 'access+' + key, '', command ); 433 } ); 415 434 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(); 435 } 436 }); 437 435 editor.addShortcut( 'ctrl+s', '', function() { 436 if ( typeof wp !== 'undefined' && wp.autosave ) { 437 wp.autosave.server.triggerSave(); 438 } 439 } ); 440 } ); 441 438 442 /** 439 443 * Experimental: create a floating toolbar. 440 * This functionality will change in the next releases. Not recommen nded for use by plugins.441 */ 444 * This functionality will change in the next releases. Not recommended for use by plugins. 445 */ 442 446 ( function() { 443 var DOM = tinymce.DOM, 444 each = tinymce.each, 445 Factory = tinymce.ui.Factory, 447 var Factory = tinymce.ui.Factory, 446 448 settings = editor.settings, 447 449 currentToolbar, 448 450 currentSelection;