Ticket #6020: 6020_2.patch
File 6020_2.patch, 1.6 KB (added by , 13 years ago) |
---|
-
_source/plugins/clipboard/plugin.js
62 62 { 63 63 this.type = type; 64 64 this.canUndo = ( this.type == 'cut' ); // We can't undo copy to clipboard. 65 this.startDisabled = true; 65 66 }; 66 67 67 68 cutCopyCmd.prototype = … … 281 282 } 282 283 } 283 284 285 function setToolbarStates() 286 { 287 if ( this.mode != 'wysiwyg' ) 288 return; 289 290 var selection = this.getSelection(), 291 readOnly = selection.getCommonAncestor().isReadOnly(), 292 state = selection.getRanges()[0].collapsed ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF; 293 294 this.getCommand( 'cut' ).setState( readOnly ? CKEDITOR.TRISTATE_DISABLED : state ); 295 this.getCommand( 'copy' ).setState( state ); 296 } 297 284 298 // Register the plugin. 285 299 CKEDITOR.plugins.add( 'clipboard', 286 300 { … … 348 362 editor.on( 'contentDom', function() 349 363 { 350 364 var body = editor.document.getBody(); 351 body.on( ( ( mode == 'text' && CKEDITOR.env.ie ) || CKEDITOR.env.webkit ) ? 'paste' : 'beforepaste',365 body.on( ( ( mode == 'text' && CKEDITOR.env.ie ) || CKEDITOR.env.webkit ) ? 'paste' : 'beforepaste', 352 366 function( evt ) 353 367 { 354 368 if ( depressBeforeEvent ) … … 368 382 }); 369 383 370 384 body.on( 'beforecut', function() { !depressBeforeEvent && fixCut( editor ); } ); 385 386 body.on( 'mouseup', setToolbarStates, editor ); 387 editor.on( 'key', setToolbarStates, editor ); 371 388 }); 372 389 373 390 // If the "contextmenu" plugin is loaded, register the listeners.