Opened 12 years ago

Closed 7 years ago

#1482 closed Bug (wontfix)

IsDirty always true after loading content with anchors

Reported by: Rowen Owned by:
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.4.3
Keywords: Cc:

Description

On calling SetHTML/SetData with content containing an anchor, the isdirty flag is true even when resetDirtyFlag is passed as true. The reason appears to be that the onSetHTML event fires after the dirty flag is reset, which in turn calls process and processes the targets adding the 'FCKAnchorC' cssclass.

1: call setHTML (now appears to be setData) with sample content containing an anchor (e.g. <p>L<a href="#Fred">in</a>k2</p><p>P<a name="Fred">Fred</a></p>and resetIsDirty = true. 2: check to see if the fck editor isDirty flag is false.

A suggested solution is to modify the function '_FCK_EditingArea_OnLoad', and move the 'ResetIsDirty()' call to after the 'OnAfterSetHTML()' call.

function _FCK_EditingArea_OnLoad() {

Get the editor's window and document (DOM) FCK.EditorWindow = FCK.EditingArea.Window ; FCK.EditorDocument = FCK.EditingArea.Document ;

FCK.InitializeBehaviors() ;

Create the enter key handler if ( !FCKConfig.DisableEnterKeyHandler )

FCK.EnterKeyHandler = new FCKEnterKey( FCK.EditorWindow, FCKConfig.EnterMode, FCKConfig.ShiftEnterMode ) ;

Listen for keystroke events. FCK.KeystrokeHandler.AttachToElement( FCK.EditorDocument ) ;

This is a tricky thing for IE. In some cases, even if the cursor is blinking in the editing, the keystroke handler doesn't catch keyboard events. We must activate the editing area to make it work. (#142). if ( FCKBrowserInfo.IsIE && FCK.HasFocus )

FCK.EditorDocument.body.setActive() ;

FCK.OnAfterSetHTML() ;

moved to after OnAfterSetHTML so that anchor processing does not dirty content

if ( FCK._ForceResetIsDirty )

FCK.ResetIsDirty() ;

Check if it is not a startup call, otherwise complete the startup. if ( FCK.Status != FCK_STATUS_NOTLOADED )

return ;

FCK.SetStatus( FCK_STATUS_ACTIVE ) ;

}

Attachments (1)

1482.patch (755 bytes) - added by Artur Formella 11 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 12 years ago by Rowen

fyi: I'm using Windows vista,IE7 and windows xp, IE6

comment:2 Changed 11 years ago by Jon Håvard Gundersen

IsDirty also always returns true if the html contains lists.

Tested in nightly with ie6.

comment:3 Changed 11 years ago by Jon Håvard Gundersen

Version: FCKeditor 2.4.3FCKeditor 2.6.3 Beta

Adjusted the version so it won't be forgotten :)

comment:4 Changed 11 years ago by Frederico Caldeira Knabben

Version: FCKeditor 2.6.3 BetaFCKeditor 2.4.3

The version field is used to indicate the oldest version this bug has been confirmed on.

Changed 11 years ago by Artur Formella

Attachment: 1482.patch added

comment:5 Changed 11 years ago by Artur Formella

#2562 has been marked as DUP.

comment:6 Changed 7 years ago by Jakub Ś

Resolution: wontfix
Status: newclosed

FCKeditor was retired and is no longer supported. All active development was moved to its successor, CKEditor 3.x, that is a fully mature and far superior product. We recommend you upgrade as soon as possible since this issue is no longer a problem in current code base.

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