Ticket #1715 (closed Bug: fixed)

Opened 4 months ago

Last modified 3 months ago

ShowDropDialog must be considered only when ForcePasteAsPlainText = true

Reported by: fredck Assigned to: fredck
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

1715.patch (1.9 kB) - added by fredck on 01/02/08 16:38:47.
Patch for trunk r1232
1715_2.patch (2.3 kB) - added by fredck on 01/24/08 19:16:02.

Change History

01/02/08 16:35:28 changed 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.

01/02/08 16:35:35 changed by fredck

  • status changed from new to assigned.

01/02/08 16:38:47 changed by fredck

  • attachment 1715.patch added.

Patch for trunk r1232

01/02/08 16:39:30 changed by fredck

  • keywords changed from Confirmed to Confirmed Review?.

01/12/08 23:18:24 changed 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() ;
	}
}

01/24/08 19:16:02 changed by fredck

  • attachment 1715_2.patch added.

01/24/08 19:18:56 changed 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.

01/25/08 23:19:59 changed by alfonsoml

  • keywords changed from Confirmed Review? to Confirmed Review+.

01/29/08 10:56:16 changed by fredck

  • status changed from assigned to closed.
  • resolution set to fixed.

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