Hi, I'd like to integrate FCK into mambo.
To do that, I need to dinamically 'hide' a textarea and overlap it with the corresponding iframe generated by FCK.
This type of behaviour should be made in Create() function, and the iFrame should be positioned over the corresponding textarea.
Is it possible to do that with FCK?
Any help will be **VERY** appreciated.
Regards, Dariush.
To do that, I need to dinamically 'hide' a textarea and overlap it with the corresponding iframe generated by FCK.
This type of behaviour should be made in Create() function, and the iFrame should be positioned over the corresponding textarea.
Is it possible to do that with FCK?
Any help will be **VERY** appreciated.
Regards, Dariush.
RE: Using FCKEditor instead of a textarea
RE: Using FCKEditor instead of a textarea
of course, I've downloaded fck.
My problem is that the editor must substitute a textarea that is defined in the page that is calling the editor (the parent).
Suppose that your page has defined a textarea with name='test'; what I need is that creating an fck editor named 'test', this editor overlap the 'test' textarea.
So, I'm modifing the fckeditor.js to create the iframe into the original textarea.
I don't know if it's clear, maybe It should be more clear looking at the mechanism implemented in mambo to load the wysisyg editor.
BTW, I'll send you asap my modified code for fckeditor.js.
Regards, Dariush.
RE: Using FCKEditor instead of a textarea
here there's my code modification in fckeditor.js,
let me know if it makes sense for you.
original:
document.write('<IFRAME src="' + sLink + '" width="' + this.Width + '" height="' + this.Height + '" frameborder="no" scrolling="no" name="iframe-'+this.instanceName+'"></IFRAME>') ;
modified:
//I get the textarea obj I need to replace
var currentTextArea =document.getElementById(this.InstanceName);
//hiding
currentTextArea.style.display = "none";
//creating a new div element
var htmlarea = document.createElement("div");
//it's an htmlarea
htmlarea.className = "htmlarea";
// inserting the editor before the textarea.
currentTextArea.parentNode.insertBefore(htmlarea, currentTextArea);
//creating a new iframe
var iframe = document.createElement("iframe");
iframe.width = 700;
iframe.height = 400;
//assigning the url to fckeditor.html
iframe.src= sLink;
//adding iframe into the htmlarea
htmlarea.appendChild(iframe);
It works for my needs,
hope this can help also you.
Ciao, Dariush.