Oops, forgot to ask, how do we do it currently? I have searched the source and the FCKeditor help stuff but can’t find it.
Hmmm,
I’ll have to check with FCK
Quote from: Mark at Oct 13, 2005, 07:50 PM
Raymond?
Hi Mark,
This is truely long overdue
Here’s the updated code:
global $replace_richtexteditor;
$replace_richtexteditor[] = "introtext";
$html = '<script>'.
'document.mutate.introtext.style.height="100px";'.
'setTimeout("adJustIntrotextSize()",800);'.
'function adJustIntrotextSize(){'.
' var o = document.getElementById("introtext___Frame");'.
' if(o) {o.style.height="130px";o.style.width="300px"}'.
' if(o) {'.
' var oEditor = FCKeditorAPI.GetInstance("introtext");'.
' if(oEditor) oEditor.ToolbarSet.Collapse();'.
' }'.
'}'.
'</script>';
$modx->event->output($html);
Raymond, the collapse toolbar bit doesn’t seem to work at all.
Hmmm,
Try increasing the time from 800 to the following:
setTimeout("adJustIntrotextSize()",1200);
You’re correct Mark but we can’t use that feature as the Plugin is already making use of that function.
Here’s a quick work around
global $replace_richtexteditor;
$replace_richtexteditor[] = "introtext";
$html = '<script>'.
'var tick=0;'.
'document.mutate.introtext.style.height="100px";'.
'setTimeout("adJustIntrotextSize()",800);'.
'function adJustIntrotextSize(){'.
' if(!self.FCKeditorAPI) {tick++;setTimeout("adJustIntrotextSize()",800);return;}'.
' else if(tick>5) return;'.
' var o = document.getElementById("introtext___Frame");'.
' if(o) {o.style.height="130px";o.style.width="300px"}'.
' if(o) {'.
' var oEditor = FCKeditorAPI.GetInstance("introtext");'.
' if(oEditor) oEditor.ToolbarSet.Collapse();'.
' }'.
'}'.
'</script>';
$modx->event->output($html);