Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-04-17 05:04:19

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Remote control Xinha

Hi folks.

I have Xinha loading in an iframe called "editor", and I try to control it from another iframe. I have it working when I load Xinha the oldfashioned "HTMLArea-" way.

I have these functions in the other iframe :

<script>
function getinnet() { // get the html in the editor
  var D = parent.frames['editor'].editor.getInnerHTML();
// do something with D
}
function replace() { // replace selection with "blablabla"
  var D = 'blablabla';
parent.frames['editor'].editor.insertHTML("blablabla");
}
function fill() { // fill the editor with "blablabla"
  var D = 'blablabla';
parent.frames['editor'].editor.setHTML("blablabla");
}
</script>

which I control with these buttons :

<input type="button" value="get" onclick="getinnet();">
<input type="button" value="insert" onclick="replace();">
<input type="button" value="fill" onclick="fill();">

but again this only works when I load Xinha the old fashioned way, using "editor = new HTMLArea("ta"); editor.generate();".

Can anyone tell me the name(s) the editor(s) get when we load Xinha the new way, with "HTMLArea.startEditors(xinha_editors);" ? I don't know how to reach them.

Cheers,
Ecco

Offline

#2 2005-04-17 09:58:18

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Remote control Xinha

xinha_editors.myEditorNameHere.whatever()


James Sleeman

Offline

#3 2005-04-19 16:56:33

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: Remote control Xinha

Fantastic, many thanks.

If you're working with many documents like I do, it really saves time to just give and take Xinha the content instead of constantly reloading the editor. So write it down people smile

var D = parent.xinha_editors.myTextArea.getInnerHTML();

Offline

Board footer

Powered by FluxBB