Changeset 32059
- Timestamp:
- 04/06/2015 10:50:28 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
r31878 r32059 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 … … 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' ) { … … 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 ) { … … 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, … … 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" />'; … … 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 ); … … 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 ); … … 409 412 editor.settings.height = 300; 410 413 } 411 }); 412 413 // Add custom shortcuts 414 modKey = 'alt+shift'; 415 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 414 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 } ); 434 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,
Note: See TracChangeset
for help on using the changeset viewer.