Announcement

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

#1 2005-03-10 20:55:44

gordon
New member
From: Australia
Registered: 2005-03-10
Posts: 4
Website

Starting and Stopping Xinha.

Hello,

I have had a request from some of my users, (Just so you know I am the developer of the htmlarea module for Drupal which allows Xinha or Htmlarea to run in Drupal).

Basically they want me to put a check box on the page that allows me to start and stop Xinha without a reload. Starting the editor I don't think will be too hard but stopping it after a start I am really not too sure how to do this, or even start working it out.

Thanks in advance.

Offline

#2 2005-03-11 01:37:46

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

Re: Starting and Stopping Xinha.

I think you'd find it fairly difficult to do.  All I can think of is perhaps if when you turned it "off" you actually just go to text mode, set the editors htmlarea div to display:none, then move the textarea out of the area so it is visible again.

just thinking out loud, something like...

editor.setMode('text');
editor._htmlArea.style.display = 'none';
var ta = editor._textArea;
ta.parentNode.removeChild(ta);
editor._htmlArea.parentNode.appendChild(ta);

and then reverse the process to turn it "on" again.


James Sleeman

Offline

#3 2005-03-11 03:05:20

gordon
New member
From: Australia
Registered: 2005-03-10
Posts: 4
Website

Re: Starting and Stopping Xinha.

Thanks for this, but it doesn't quite work. I did have to make some changes

editor.setMode('textmode');
editor._htmlArea.style.display = 'none';
var ta = editor._textArea;
var nc = editor._htmlArea.nextSibling;
ta.parentNode.removeChild(ta);
editor._htmlArea.parentNode.insertBefore(ta, nc);

This got it back to the correct position, but when it is displaying it is like the buttons around it aren't moving to make room, and the textarea is just displaying over it.

Any ideas

Offline

#4 2005-03-12 11:54:01

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

Re: Starting and Stopping Xinha.

Can you post the URL where I can see what you've done, I don't quite follow.


James Sleeman

Offline

#5 2005-03-12 21:07:38

gordon
New member
From: Australia
Registered: 2005-03-10
Posts: 4
Website

Re: Starting and Stopping Xinha.

take a look at http://www.heydon.com.au/xinha/examples/basic.php

The only php to to print the posted data, and at this stage it only turns it off. but you will get the idea.

Gordon.

Offline

#6 2005-03-19 00:28:11

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

Re: Starting and Stopping Xinha.

gordon wrote:

take a look at http://www.heydon.com.au/xinha/examples/basic.php

The only php to to print the posted data, and at this stage it only turns it off. but you will get the idea.

Hmm.  Create a ticket for this as a feature enhancement.  When time permits I'll look at creating a plugin to do what you want.


James Sleeman

Offline

#7 2005-03-19 02:25:32

gordon
New member
From: Australia
Registered: 2005-03-10
Posts: 4
Website

Re: Starting and Stopping Xinha.

thanks.

Offline

#8 2005-06-19 06:29:06

majid
New member
Registered: 2005-06-13
Posts: 3

Re: Starting and Stopping Xinha.

Hi, I have used the code above to stop xinha, and for starting it I write this code:

editor._htmlArea.parentNode.removeChild(xinha_editors.body._textArea);
editor._textArea.parentNode.appendChild(xinha_editors.body._textArea);
editor._htmlArea.style.display = 'inline';
editor.setMode('wysiwyg');

It works BUT when once I stop and then start xinha and I switch into TEXTMODE (by clicking <> button in the toolbar)
content(The text I have typed) of editor disappears and it locks, so I can't type anything.
Would you please help me,
thanks

Offline

Board footer

Powered by FluxBB