Changeset 27449
- Timestamp:
- 03/07/2014 03:09:00 AM (11 years ago)
- Location:
- trunk/src/wp-includes/js/tinymce/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
r27372 r27449 421 421 editor.addShortcut( modKey + '+o', '', 'InsertOrderedList' ); 422 422 editor.addShortcut( modKey + '+n', '', 'mceSpellCheck' ); 423 editor.addShortcut( modKey + '+a', '', 'WP_Link' );424 423 editor.addShortcut( modKey + '+s', '', 'unlink' ); 425 424 editor.addShortcut( modKey + '+m', '', 'WP_Medialib' ); -
trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js
r27447 r27449 1 1 /* global tinymce */ 2 2 tinymce.PluginManager.add( 'wplink', function( editor ) { 3 var linkButton; 4 3 5 // Register a command so that it can be invoked by using tinyMCE.activeEditor.execCommand( 'WP_Link' ); 4 6 editor.addCommand( 'WP_Link', function() { 5 if ( typeof window.wpLink !== 'undefined' ) {7 if ( ( ! linkButton || ! linkButton.disabled() ) && typeof window.wpLink !== 'undefined' ) { 6 8 window.wpLink.open( editor.id ); 7 9 } 8 10 }); 11 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' ); 9 16 10 17 editor.addButton( 'link', { … … 15 22 16 23 onPostRender: function() { 17 var ctrl= this;24 linkButton = this; 18 25 19 26 editor.on( 'nodechange', function( event ) { 20 27 var node = event.element; 21 28 22 ctrl.disabled( editor.selection.isCollapsed() && node.nodeName !== 'A' );23 ctrl.active( node.nodeName === 'A' && ! node.name );29 linkButton.disabled( editor.selection.isCollapsed() && node.nodeName !== 'A' ); 30 linkButton.active( node.nodeName === 'A' && ! node.name ); 24 31 }); 25 32 }
Note: See TracChangeset
for help on using the changeset viewer.