My install of FCKeditor was producing double Editors. There was only one textarea, but two editor iframes.
The first frame worked and the second one was ignored, since the javascript found the first one first ...
I'm working on Drupal 5.6 with the 5.x-2.2-beta2 module of FCKeditor.
I hacked my modules/fckeditor/fckeditor/fckeditor.js to remove the ungainly siamese twin editor by modifying the code for
FCKeditor.ReplaceTextarea().
(Excuse my formating changes, I can't think about code that's not formatted right -- to me) here's the code:
I submit that the protective if statement should be in the code. No reason to add an iframe if you already have one there.
I hope this helps someone.
Jeff
The first frame worked and the second one was ignored, since the javascript found the first one first ...
I'm working on Drupal 5.6 with the 5.x-2.2-beta2 module of FCKeditor.
I hacked my modules/fckeditor/fckeditor/fckeditor.js to remove the ungainly siamese twin editor by modifying the code for
FCKeditor.ReplaceTextarea().
(Excuse my formating changes, I can't think about code that's not formatted right -- to me) here's the code:
FCKeditor.prototype.ReplaceTextarea = function() { if ((!this.CheckBrowser) || (this._IsCompatibleBrowser())) { /* ** ********************************************************************* ** first of all attempt to find the iframe we will create. if the ** iframe already exists, bail out. -- protective if statement */ var oIFrame = document.getElementById(this.InstanceName + '___Frame'); if (!oIFrame) { /* ** end of protective if statement open ** ******************************************************************* */ // We must check the elements firstly using the Id and then the name. var oTextarea = document.getElementById(this.InstanceName); var colElementsByName = document.getElementsByName(this.InstanceName); var i = 0; while ((oTextarea) || (i == 0)) { if ((oTextarea) && ('textarea' == oTextarea.tagName.toLowerCase())) { break; } oTextarea = colElementsByName[i++]; } if (!oTextarea) { alert( 'Error: The TEXTAREA with id or name set to "' + this.InstanceName + '" was not found'); return; } oTextarea.style.display = 'none'; if (oTextarea.tabIndex) { this.TabIndex = oTextarea.tabIndex; } this._InsertHtmlBefore(this._GetConfigHtml(), oTextarea); this._InsertHtmlBefore(this._GetIFrameHtml(), oTextarea); } /* ** ********************************************************************* ** start of protective if statement close */ } /* ** end of protective if statement close ** *********************************************************************** */ }
I submit that the protective if statement should be in the code. No reason to add an iframe if you already have one there.
I hope this helps someone.
Jeff