Opened 10 years ago

Closed 9 years ago

#1715 closed Bug (fixed)

ShowDropDialog must be considered only when ForcePasteAsPlainText = true

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

Description

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 Frederico Caldeira Knabben 10 years ago.
Patch for trunk r1232
1715_2.patch (2.3 KB) - added by Frederico Caldeira Knabben 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 10 years ago by Frederico Caldeira Knabben

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 10 years ago by Frederico Caldeira Knabben

Status: newassigned

Changed 10 years ago by Frederico Caldeira Knabben

Attachment: 1715.patch added

Patch for trunk r1232

comment:3 Changed 10 years ago by Frederico Caldeira Knabben

Keywords: Review? added

comment:4 Changed 10 years ago by Alfonso Martínez de Lizarrondo

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 Frederico Caldeira Knabben

Attachment: 1715_2.patch added

comment:5 Changed 9 years ago by Frederico Caldeira Knabben

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 Alfonso Martínez de Lizarrondo

Keywords: Review+ added; Review? removed

comment:7 Changed 9 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: assignedclosed

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

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