Ticket #1482 (new Bug)

Opened 10 months ago

Last modified 5 weeks ago

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 ) ;

}

Change History

Changed 10 months ago by rowen

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

Changed 5 weeks ago by jonhg

IsDirty also always returns true if the html contains lists.

Tested in nightly with ie6.

Changed 5 weeks ago by jonhg

  • version changed from FCKeditor 2.4.3 to FCKeditor 2.6.3 Beta

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

Changed 5 weeks ago by fredck

  • version changed from FCKeditor 2.6.3 Beta to FCKeditor 2.4.3

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

Note: See TracTickets for help on using tickets.