Changeset 589
- Timestamp:
- 2007-07-30 06:38:36 (16 months ago)
- Location:
- FCKeditor/trunk/editor/_source
- Files:
-
- 4 modified
-
classes/fckdomrange_gecko.js (modified) (1 diff)
-
classes/fckeditingarea.js (modified) (1 diff)
-
internals/fck_gecko.js (modified) (3 diffs)
-
internals/fck_ie.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/_source/classes/fckdomrange_gecko.js
r444 r589 35 35 this._UpdateElementInfo() ; 36 36 } 37 else 38 this.MoveToElementStart( this.Window.document.body ) ; 37 39 } 38 40 -
FCKeditor/trunk/editor/_source/classes/fckeditingarea.js
r588 r589 170 170 if ( FCKBrowserInfo.IsIE ) 171 171 { 172 // The fiddling with UNSELECTABLE is a trick for fixing an IE browser bug, don't remove. 173 // See #523 for information about the bug. 172 174 oDoc.body.unselectable = "on" ; 173 175 oDoc.body.contentEditable = true ; -
FCKeditor/trunk/editor/_source/internals/fck_gecko.js
r587 r589 54 54 FCK.Events.FireEvent( "OnMouseUp",e ) ; 55 55 } 56 57 this._ExecDrop = function( evt ) 58 { 59 if ( FCKConfig.ForcePasteAsPlainText ) 60 { 61 if ( evt.dataTransfer ) 62 { 63 var text = evt.dataTransfer.getData( 'Text' ) ; 64 text = FCKTools.HTMLEncode( text ) ; 65 text = FCKTools.ProcessLineBreaks( window, FCKConfig, text ) ; 66 FCK.InsertHtml( text ) ; 67 } 68 else 69 FCK.PasteAsPlainText() ; 70 } 71 else 72 FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.Paste, 'dialog/fck_paste.html', 400, 330, 'Security' ) ; 73 evt.preventDefault() ; 74 evt.stopPropagation() ; 75 } 76 56 77 this.ExecOnSelectionChangeTimer = function() 57 78 { … … 83 104 this.EditorDocument.addEventListener( 'mouseup', this._ExecMouseUp, true ) ; 84 105 this.EditorDocument.addEventListener( 'mousemove', this._ExecMouseMove, true ) ; 106 107 // Hooks for data object drops 108 if ( FCKBrowserInfo.IsGecko ) 109 { 110 this.EditorWindow.captureEvents( Event.DRAGDROP ) ; 111 this.EditorWindow.addEventListener( 'dragdrop', this._ExecDrop, true ) ; 112 } 113 else if ( FCKBrowserInfo.IsSafari ) 114 { 115 var cancelHandler = function( evt ){ evt.returnValue = false ; } 116 this.EditorDocument.addEventListener( 'dragenter', cancelHandler, true ) ; 117 this.EditorDocument.addEventListener( 'dragover', cancelHandler, true ) ; 118 this.EditorDocument.addEventListener( 'drop', this._ExecDrop, true ) ; 119 } 85 120 86 121 // Reset the context menu. … … 191 226 var oRange = oSel.getRangeAt(0) ; 192 227 228 // If a range is not available ( occurs under Safari ) 229 // Append to the end of the editor document. 230 if ( ! oRange ) 231 { 232 oRange = this.EditorDocument.createRange() ; 233 oRange.selectNodeContents( this.EditorDocument.body ) ; 234 oRange.collapse( false ) ; 235 } 236 193 237 // Create a fragment with the input HTML. 194 238 var oFragment = oRange.createContextualFragment( html ) ; -
FCKeditor/trunk/editor/_source/internals/fck_ie.js
r587 r589 107 107 } 108 108 109 function Doc_OnDrop() 110 { 111 var evt = FCK.EditorWindow.event ; 112 if ( FCKConfig.ForcePasteAsPlainText ) 113 FCK.PasteAsPlainText( evt.dataTransfer.getData( 'Text' ) ) ; 114 else 115 FCKTools.RunFunction( FCKDialog.OpenDialog, FCKDialog, ['FCKDialog_Paste', FCKLang.Paste, 'dialog/fck_paste.html', 400, 330, 'Security'] ) ; 116 evt.returnValue = false ; 117 evt.cancelBubble = true ; 118 } 119 120 function Doc_CancelDefault() 121 { 122 FCK.EditorWindow.event.returnValue = false ; 123 } 124 109 125 FCK.InitializeBehaviors = function( dontReturn ) 110 126 { … … 115 131 // Intercept pasting operations 116 132 this.EditorDocument.body.attachEvent( 'onpaste', Doc_OnPaste ) ; 133 134 // Intercept drop operations 135 this.EditorDocument.body.attachEvent( 'ondragenter', Doc_CancelDefault ) ; 136 this.EditorDocument.body.attachEvent( 'ondragover', Doc_CancelDefault ) ; 137 this.EditorDocument.body.attachEvent( 'ondrop', Doc_OnDrop ) ; 117 138 118 139 // Reset the context menu. … … 251 272 } 252 273 253 FCK.PasteAsPlainText = function( )274 FCK.PasteAsPlainText = function( forceText ) 254 275 { 255 276 if ( !FCK._CheckIsPastingEnabled() ) … … 260 281 261 282 // Get the data available in the clipboard in text format. 262 var sText = clipboardData.getData("Text") ; 283 var sText = null ; 284 if ( ! forceText ) 285 sText = clipboardData.getData("Text") ; 286 else 287 sText = forceText ; 263 288 264 289 if ( sText && sText.length > 0 )