Ticket #1344: 1344_3.patch
File 1344_3.patch, 4.3 KB (added by , 16 years ago) |
---|
-
_whatsnew.html
146 146 FCKConfig.RemoveAttributes.</li> 147 147 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1596">#1596</a>] On Safari, 148 148 dialogs have now rigth-to-left layout when it runs a RTL language, like Arabic.</li> 149 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1344">#1344</a>] Added warning message on 150 Copy and Cut operation failure on IE due to paste permission settings.</li> 149 151 </ul> 150 152 <p> 151 153 <a href="_whatsnew_history.html">See previous versions history</a> -
editor/_source/commandclasses/fck_othercommands.js
396 396 } 397 397 } ; 398 398 399 // FCKC opyCommand400 var FCKC opyCommand = function()399 // FCKCutCopyCommand 400 var FCKCutCopyCommand = function( isCut ) 401 401 { 402 this.Name = 'Copy' ;402 this.Name = isCut ? 'Cut' : 'Copy' ; 403 403 } 404 404 405 FCKC opyCommand.prototype =405 FCKCutCopyCommand.prototype = 406 406 { 407 407 Execute : function() 408 408 { 409 FCK.ExecuteNamedCommand( this.Name ) ; 409 var enabled = false ; 410 411 if ( FCKBrowserInfo.IsIE ) 412 { 413 // The following seems to be the only reliable way to detect that 414 // cut/copy is enabled in IE. It will fire the oncut/oncopy event 415 // only if the security settings enabled the command to execute. 416 417 var onEvent = function() 418 { 419 enabled = true ; 420 } ; 421 422 var eventName = 'on' + this.Name.toLowerCase() ; 423 424 FCK.EditorDocument.body.attachEvent( eventName, onEvent ) ; 425 FCK.ExecuteNamedCommand( this.Name ) ; 426 FCK.EditorDocument.body.detachEvent( eventName, onEvent ) ; 427 } 428 else 429 { 430 try 431 { 432 // Other browsers throw an error if the command is disabled. 433 FCK.ExecuteNamedCommand( this.Name ) ; 434 enabled = true ; 435 } 436 catch(e){} 437 } 438 439 if ( !enabled ) 440 alert( FCKLang[ 'PasteError' + this.Name ] ) ; 410 441 }, 411 442 412 443 GetState : function() 413 444 { 414 if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ) 415 return FCK_TRISTATE_DISABLED ; 416 // Strangely, the cut command happens to have the correct states for both Copy and Cut in all browsers. 417 return FCK.GetNamedCommandState( 'Cut' ) ; 445 // Strangely, the Cut command happens to have the correct states for 446 // both Copy and Cut in all browsers. 447 return FCK.EditMode != FCK_EDITMODE_WYSIWYG ? 448 FCK_TRISTATE_DISABLED : 449 FCK.GetNamedCommandState( 'Cut' ) ; 418 450 } 419 451 }; 420 452 -
editor/_source/internals/fck_gecko.js
301 301 FCK.RedirectNamedCommands = 302 302 { 303 303 Print : true, 304 Paste : true, 305 306 Cut : true, 307 Copy : true 304 Paste : true 308 305 } ; 309 306 310 307 // ExecuteNamedCommand overload for Gecko. … … 327 324 } 328 325 catch (e) { FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.Paste, 'dialog/fck_paste.html', 400, 330, 'Security' ) ; } 329 326 break ; 330 case 'Cut' :331 try { FCK.ExecuteNamedCommand( 'Cut', null, true ) ; }332 catch (e) { alert(FCKLang.PasteErrorCut) ; }333 break ;334 case 'Copy' :335 try { FCK.ExecuteNamedCommand( 'Copy', null, true ) ; }336 catch (e) { alert(FCKLang.PasteErrorCopy) ; }337 break ;338 327 default : 339 328 FCK.ExecuteNamedCommand( commandName, commandParameter ) ; 340 329 } -
editor/_source/internals/fckcommands.js
126 126 127 127 case 'Undo' : oCommand = new FCKUndoCommand() ; break ; 128 128 case 'Redo' : oCommand = new FCKRedoCommand() ; break ; 129 case 'Copy' : oCommand = new FCKCopyCommand() ; break ; 129 case 'Copy' : oCommand = new FCKCutCopyCommand( false ) ; break ; 130 case 'Cut' : oCommand = new FCKCutCopyCommand( true ) ; break ; 130 131 131 132 case 'SelectAll' : oCommand = new FCKSelectAllCommand() ; break ; 132 133 case 'InsertOrderedList' : oCommand = new FCKListCommand( 'insertorderedlist', 'ol' ) ; break ;