Announcement

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

#1 2005-03-17 21:21:28

speterson
Xinha Community Member
Registered: 2005-03-17
Posts: 12

Adapting Xinha to default to textmode

I was hoping to add a feature to xinha in which it would start up in either textmode or wysiwyg rather than always wysiwyg.  My plan was to add a startupMode field to the Config object, then set _editMode in the constructor to be the value of this startupMode field.  After I wade through the gotchas that I am sure are gonna get me with this approach, who would I submit this update to?

Offline

#2 2005-03-18 05:50:55

adamp
Xinha Pro
Registered: 2005-03-14
Posts: 77

Re: Adapting Xinha to default to textmode

I haven't got round to doing anything for Xinha yet, but for the HTMLArea beta I wrote a function to run in onLoad that cycled through textarea objects and turned them into HTMLAreas unless they apepared in a 'nowysiwyg' array.
After that, I just had to add one line of javascript for each textarea I didn't want to be a wysiwyg:

<script language="JavaScript1.2">
dontwysi[dontwysi.length] = 'f1code';
</script>
<textarea name="f1code" class="standardta"></textarea>

The reverse could easily be done (only make textareas wysiwyg if they DO appear in the aray). I'll post the code if anyone wants it, though I warn that my lack of javascript knowledge means there's probably a cleaner way of doing it.

Offline

#3 2005-03-19 01:38:13

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

Re: Adapting Xinha to default to textmode

speterson wrote:

I was hoping to add a feature to xinha in which it would start up in either textmode or wysiwyg rather than always wysiwyg.  My plan was to add a startupMode field to the Config object, then set _editMode in the constructor to be the value of this startupMode field.  After I wade through the gotchas that I am sure are gonna get me with this approach, who would I submit this update to?

Hmm.  I'd sugest making a very simple plugin, which has an "onGenerate" function that just does setMode('text') on the editor.

It may interfere with other plugins however if they expect the editor to be in gui mode.


James Sleeman

Offline

Board footer

Powered by FluxBB