Ticket #6011: 6011_2.patch
File 6011_2.patch, 5.2 KB (added by , 14 years ago) |
---|
-
_source/plugins/clipboard/plugin.js
284 284 // Register the plugin. 285 285 CKEDITOR.plugins.add( 'clipboard', 286 286 { 287 requires : [ ' dialog', 'htmldataprocessor' ],287 requires : [ 'htmldataprocessor' ], 288 288 init : function( editor ) 289 289 { 290 290 // Inserts processed data into the editor at the end of the … … 304 304 setTimeout( function() 305 305 { 306 306 // Open default paste dialog. 307 editor.openDialog ( 'paste' );307 editor.openDialog && editor.openDialog( 'paste' ); 308 308 }, 0 ); 309 309 }); 310 310 … … 336 336 addButtonCommand( 'Copy', 'copy', new cutCopyCmd( 'copy' ), 4 ); 337 337 addButtonCommand( 'Paste', 'paste', pasteCmd, 8 ); 338 338 339 CKEDITOR.dialog.add( 'paste', CKEDITOR.getUrl( this.path + 'dialogs/paste.js' ) ); 339 // Add dialog if plugin is available. 340 if ( CKEDITOR.dialog ) 341 CKEDITOR.dialog.add( 'paste', CKEDITOR.getUrl( this.path + 'dialogs/paste.js' ) ); 340 342 341 343 editor.on( 'key', onKey, editor ); 342 344 -
_source/plugins/pastetext/plugin.js
27 27 28 28 if ( !clipboardText ) // Clipboard access privilege is not granted. 29 29 { 30 editor.openDialog ( 'pastetext' );30 editor.openDialog && editor.openDialog( 'pastetext' ); 31 31 return false; 32 32 } 33 33 else … … 65 65 command : commandName 66 66 }); 67 67 68 CKEDITOR.dialog.add( commandName, CKEDITOR.getUrl( this.path + 'dialogs/pastetext.js' ) ); 68 // Add dialog if plugin is available. 69 if ( CKEDITOR.dialog ) 70 CKEDITOR.dialog.add( commandName, CKEDITOR.getUrl( this.path + 'dialogs/pastetext.js' ) ); 69 71 70 72 if ( editor.config.forcePasteAsPlainText ) 71 73 { -
_source/plugins/contextmenu/plugin.js
139 139 } 140 140 141 141 // Don't show context menu with zero items. 142 menu.items.length && menu.show( offsetParent, corner || ( editor.lang.dir == 'rtl' ? 2 : 1 ), offsetX, offsetY );143 142 } 144 143 }, 145 144 -
_source/plugins/menubutton/plugin.js
5 5 6 6 CKEDITOR.plugins.add( 'menubutton', 7 7 { 8 requires : [ 'button', ' contextmenu' ],8 requires : [ 'button', 'menu' ], 9 9 beforeInit : function( editor ) 10 10 { 11 11 editor.ui.addHandler( CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler ); … … 23 23 { 24 24 var clickFn = function( editor ) 25 25 { 26 var _ = this._; 26 var _ = this._, 27 selection; 27 28 28 29 // Do nothing if this button is disabled. 29 30 if ( _.state === CKEDITOR.TRISTATE_DISABLED ) … … 33 34 34 35 // Check if we already have a menu for it, otherwise just create it. 35 36 var menu = _.menu; 36 if ( !menu ) 37 38 if ( menu ) 37 39 { 38 menu = _.menu = new CKEDITOR.plugins.contextMenu( editor ); 39 menu.definition.panel.attributes[ 'aria-label' ] = editor.lang.common.options; 40 menu.hide(); 41 menu.removeAll(); 42 } 43 else 44 { 45 menu = _.menu = new CKEDITOR.menu( editor, 46 { 47 panel: 48 { 49 className : editor.skinClass, 50 attributes : { 'aria-label' : editor.lang.common.options } 51 } 52 }); 40 53 41 54 menu.onHide = CKEDITOR.tools.bind( function() 42 55 { 56 menu.onHide = null; 57 58 if ( CKEDITOR.env.ie ) 59 { 60 var selection = editor.getSelection(); 61 selection && selection.unlock(); 62 } 63 43 64 this.setState( _.previousState ); 44 65 }, 45 66 this ); 46 67 47 // Initialize the menu items at this point. 48 if ( this.onMenu ) 49 { 50 menu.addListener( this.onMenu ); 51 } 52 } 68 menu.onEscape = function( keystroke ) 69 { 70 if ( keystroke == 27 ) 71 { 72 this.hide(); 73 editor.focus(); 74 } 75 return false; 76 }; 77 78 menu.onClick = CKEDITOR.tools.bind( function( item ) 79 { 80 menu.hide(); 81 82 if ( item.onClick ) 83 item.onClick(); 84 else if ( item.command ) 85 editor.execCommand( item.command ); 86 87 }, this ); 88 } 89 90 // Initialize the menu items at this point. 91 if ( this.onMenu ) 92 { 93 var element = selection && selection.getStartElement(); 94 selection = editor.getSelection(); 95 96 var listenerItems = this.onMenu( element, selection ); 97 98 if ( listenerItems ) 99 { 100 for ( var itemName in listenerItems ) 101 { 102 var item = editor.getMenuItem( itemName ); 103 104 if ( item ) 105 { 106 item.state = listenerItems[ itemName ]; 107 menu.add( item ); 108 } 109 } 110 } 111 } 53 112 54 113 if ( _.on ) 55 114 { … … 59 118 60 119 this.setState( CKEDITOR.TRISTATE_ON ); 61 120 121 // Selection will be unavailable after context menu shows up 122 // in IE, lock it now. 123 if ( CKEDITOR.env.ie ) 124 { 125 selection = editor.getSelection(); 126 selection && selection.lock(); 127 } 128 62 129 menu.show( CKEDITOR.document.getById( this._.id ), 4 ); 63 130 }; 64 131