Opened 9 years ago

Closed 9 years ago

#1715 closed Bug (fixed)

ShowDropDialog must be considered only when ForcePasteAsPlainText = true

Reported by: fredck Owned by: fredck
Priority: Normal Milestone: FCKeditor 2.6
Component: General Version: FCKeditor 2.5
Keywords: Confirmed Review+ Cc:


For #338, we have introduced a new feature which guarantees that dropped text will respect the ForcePasteAsPlainText setting, not allowing dropping rich contents in that case.

The solution used is trying to transform the dropped data to simple text on the fly (IE only), showing a dialog to which dropping is possible, or even disable dropping all the way. To disable it, the ShowDropDialog can be set to "false".

But, the current implementation makes it impossible to have the normal dropping behavior because the editor always looks for the ShowDropDialog, even if ForcePasteAsPlainText = false. It should not happen instead.

Attachments (2)

1715.patch (1.9 KB) - added by fredck 9 years ago.
Patch for trunk r1232
1715_2.patch (2.3 KB) - added by fredck 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 9 years ago by fredck

Probably this is related to a misinterpretation of my comments in #338, like:

"we have two options here: block the drop or display a dialog where the text can be dragged into again"

My fault. As that ticket is related to ForcePasteAsPlainText, I thought it was clear that I was talking about it. I'll try to be clearer from now on.

comment:2 Changed 9 years ago by fredck

  • Status changed from new to assigned

Changed 9 years ago by fredck

Patch for trunk r1232

comment:3 Changed 9 years ago by fredck

  • Keywords Review? added

comment:4 Changed 9 years ago by alfonsoml

Wouldn't it be better if the gecko code followed the same logic than the IE and instead of using return it cancels the event only if ForcePasteAsPlainText is enabled?

	if ( FCKConfig.ForcePasteAsPlainText )
		if ( evt.dataTransfer )
			var text = evt.dataTransfer.getData( 'Text' ) ;
			text = FCKTools.HTMLEncode( text ) ;
			text = FCKTools.ProcessLineBreaks( window, FCKConfig, text ) ;
			FCK.InsertHtml( text ) ;
		else if ( FCKConfig.ShowDropDialog )
			FCK.PasteAsPlainText() ;

		evt.preventDefault() ;
		evt.stopPropagation() ;

Changed 9 years ago by fredck

comment:5 Changed 9 years ago by fredck

You comment is correct Alfonso. Feel free to mark "Review-" in those cases. If I think I did it well, I'll explain it and call "Review?" again.

That "else return" call was useless. There was also a small fix for IE (moving the evt declaration inside the if).

The new patch fixes both things.

comment:6 Changed 9 years ago by alfonsoml

  • Keywords Review+ added; Review? removed

comment:7 Changed 9 years ago by fredck

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with [1449]. Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy