Announcement

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

#1 2005-09-13 23:27:41

benew666
New member
Registered: 2005-09-13
Posts: 2

How to make "Toggle HTML source" out side of the pannel?

Hello.

I would like to make the "Toggle HTML source" feature out side of the pannel, such as

<a href="javascript: what shoud I put here????">Toggle HTML source</a>

Any help wil be apreciated.

Offline

#2 2005-09-14 06:59:53

mokhet
Xinha Authority
From: Paris, France
Registered: 2005-04-03
Posts: 105
Website

Re: How to make "Toggle HTML source" out side of the pannel?

If you have followed the NewbieGuide you may have a javascript variable named xinha_editor, let's assume you have it.

Now, let's say the textarea you have transformed was named myprettyarea

<form>
<textarea name="myprettyarea" id="myprettyarea">
</form>

In this case, you can use the javascript variable xinha_editor.myprettyarea. Which means, you can simply do this kind of thing :

<a href="#" onclick="xinha_editor.myprettyarea.setMode(); return false;">Toggle HTML and WYSIWYG</a><br>
<a href="#" onclick="xinha_editor.myprettyarea.setMode('text'); return false;">Set HTML mode</a><br>
<a href="#" onclick="xinha_editor.myprettyarea.setMode('wysiwyg'); return false;">Set WYSIWYG mode</a>

Offline

Board footer

Powered by FluxBB