You are not logged in.
Pages: 1
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
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
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
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
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
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
Pages: 1