Javascript Error in Source Checkbox
Status: Inactive
Brought to you by:
third_of_five
To reproduce:
1. Go to
http://richtext.cs.ramesys.com/rt-0.2/test_embedded.asp
2. Delete the default content
3. Insert a horizontal bar, by clicking on the
Horizontal Bar icon in the tool bar
4. On the next line, type: aaaa
5. Check the Source Checkbox. The HTML code shown in
the editor should be:
<P>
<HR>
aaaa</P>
<P>&nbsp;</P>
4. Now uncheck the Source Checkbox to go back to text.
Javascript error is given.
Logged In: YES
user_id=224032
Hey!
I think it's not a bug of the RTE. The bug comes from
Microsoft.
I've developed and/or modify other dhtml-editors and tested a
lot of other samples of dhtml-editors for MS-Internetexplorer,
and this dhtml-editors have the same problems.
I've written an crash code, wich does not allow your sample
code at the top of content, it gives an alert-msg.
Logged In: YES
user_id=224032
Hey!
I've patched this little bug on experimental modifictaion of the
RTE for my webwites and with this little modification of the
function "doStyle(s)" the bug is gone:
/** Replace the function doStyle(s) with the function below */
function doStyle(s){
if(!RichEditor.txtView) return; /* Disabled in View Source
mode */
DBG(1, 'doStyle(' + s + ')');
checkRange();
if(s!='InsertHorizontalRule'){
/* what command string? */
document.execCommand(s);
}else if(s=='InsertHorizontalRule'){
/* if s=='InsertHorizontalRule then use this command */
document.execCommand(s,false, null);
/* Note:
In your source view the <HR> has an ID like this
<HR id=null>
*/
}
reset();
saveHistory(); /* Record undo information */
}
Best regards.
I love the RTE :)
Michael
Logged In: YES
user_id=537776
The patch Michael posted has been added to the code.
Thanks for your help Michael.