I'm currently using this to see if content of an FCKeditor has changed
if (oEditor.IsDirty()){
return true;
}
Then I open a form and typ some letters after some other text.
Then I use backspace and remove the newly typed letters.
Then I do something that trigger the test above (click a link in the form, not the save button).
And, as it should, the IsDirty return false.
Then I do the same as above, except that now I type only spaces. (and remove them in same way as above)
Why does the IsDirty now return true?
***********************************************
UPDATE (editor source example and more explanations:)
**********************************************
Okay, more tests shows that it (IsDirty) mostly works but allways on the source below:
What I found is this: If I place cursor after "This is another test" and hit spacebar some times, and then backspace to remove them
then IsDirty return true.
If I do the same after "This is a test" the IsDirty return false.
I also note that I get same result when hitting CR where I previously tried with spaces, and then removing with backspace as for previous tests... and get the same result.
And if I (said it before, but anyway).. just add some letters and remove them with backspace after "This is another test" then IsDirty returns false (as it should) ..... weird!!!!
As far as I can see, it looks like this is happening on text that does not have anything (letters, tags) follwing it (in source).
If I test on one text string only (with no tags after it), I get the buggy behaviour. If I then add a CR and save the record,
and then place cursor after last letter and add and remove spaces and/or CR then it works as expected.
Also found the following:
If I place cursor after "This is another test" and hit either spacebar or CR and then backspace to remove the newly inserted spaces or CR, and then click source button to get in source view, and click source button to get in normal view, and then
click a link or change URL of the page to trigger my code that uses IsDirty then the bug is gone.
So it looks like something is added to the source, which is cleaned up when entering source mode.
Weird.
************************************************
The above was tested in Firefox 2.0.0.7 (have now also tested in IE6 and IE7 and could not reproduce the bugs there).
Also note that I use this in fckconfig.js:
FCKConfig.EnterMode = 'br' ;
FCKConfig.ShiftEnterMode = 'br' ;
Is there a fix for the above issues?
Anybody that can help me out here?
if (oEditor.IsDirty()){
return true;
}
Then I open a form and typ some letters after some other text.
Then I use backspace and remove the newly typed letters.
Then I do something that trigger the test above (click a link in the form, not the save button).
And, as it should, the IsDirty return false.
Then I do the same as above, except that now I type only spaces. (and remove them in same way as above)
Why does the IsDirty now return true?
***********************************************
UPDATE (editor source example and more explanations:)
**********************************************
Okay, more tests shows that it (IsDirty) mostly works but allways on the source below:
What I found is this: If I place cursor after "This is another test" and hit spacebar some times, and then backspace to remove them
then IsDirty return true.
If I do the same after "This is a test" the IsDirty return false.
I also note that I get same result when hitting CR where I previously tried with spaces, and then removing with backspace as for previous tests... and get the same result.
And if I (said it before, but anyway).. just add some letters and remove them with backspace after "This is another test" then IsDirty returns false (as it should) ..... weird!!!!
As far as I can see, it looks like this is happening on text that does not have anything (letters, tags) follwing it (in source).
If I test on one text string only (with no tags after it), I get the buggy behaviour. If I then add a CR and save the record,
and then place cursor after last letter and add and remove spaces and/or CR then it works as expected.
This is a test<br /> <br /> This is another test
Also found the following:
If I place cursor after "This is another test" and hit either spacebar or CR and then backspace to remove the newly inserted spaces or CR, and then click source button to get in source view, and click source button to get in normal view, and then
click a link or change URL of the page to trigger my code that uses IsDirty then the bug is gone.
So it looks like something is added to the source, which is cleaned up when entering source mode.
Weird.
************************************************
The above was tested in Firefox 2.0.0.7 (have now also tested in IE6 and IE7 and could not reproduce the bugs there).
Also note that I use this in fckconfig.js:
FCKConfig.EnterMode = 'br' ;
FCKConfig.ShiftEnterMode = 'br' ;
Is there a fix for the above issues?
Anybody that can help me out here?
Re: Why oEditor.IsDirty not handle spaces and CR correctly, bug
Could not reproduce the bug in those browsers.
Would highly appreciate if someone in the FCKeditor project could verify this bug in Firefox (I used version 2.0.0.7)
and also please tell me where one should report bugs.
Cannot find any place to report bugs anymore! (Do I have to pay you in order to report bugs?)
Anyway.... Keep up the good work.