Announcement

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

#1 2005-12-16 14:35:13

dfaber
New member
Registered: 2005-12-15
Posts: 1

Enable/Disable Xinha TextArea

I am new to Xinha and have not seen a sample where the TextArea is disabled.  Is there a way to disable/enable the Xinhas text area?   I would like the users of my application to be able to click an 'Edit' button and then have the Textarea enabled.  When they click 'Save' I want the Textarea disabled.  Is this possible?

Offline

#2 2005-12-18 09:02:30

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

Re: Enable/Disable Xinha TextArea

Search the forums, this has been asked and answered recently


James Sleeman

Offline

#3 2010-01-19 12:15:21

funtymeeee
New member
Registered: 2010-01-19
Posts: 3

Re: Enable/Disable Xinha TextArea

I have modified the xhinaConfig.js file so that editor is loaded when the user clicks a link and not when the page loads.

Download and reference the Jquery library,  I have tested with version 1.2.6

Then modify the XinhaConfig.js file:

/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */
/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */
/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk … aConfig.js */
xinha_editors=null;
xinha_init=null;
xinha_config=null;
xinha_plugins=null;
xinha_init=xinha_init?xinha_init:function(){
xinha_editors=xinha_editors?xinha_editors:["myTextArea"];
xinha_plugins=xinha_plugins?xinha_plugins:["CharacterMap","ContextMenu","SmartReplace","Stylist","Linker","SuperClean","TableOperations"];
if(!Xinha.loadPlugins(xinha_plugins,xinha_init)){
return;
}
xinha_config=xinha_config?xinha_config():new Xinha.Config();
xinha_config.pageStyleSheets=[_editor_url+"examples/full_example.css"];
xinha_editors=Xinha.makeEditors(xinha_editors,xinha_config,xinha_plugins);
Xinha.startEditors(xinha_editors);
};


$(document).ready(function(){

$("#start").click(function () {
      $("#blue").css("visibility","visible");
      $(document).ready(xinha_init);
    });

$("#end").click(function () {
      $("#blue").css("visibility","hidden");
    });
});


On the page where you have your text area and wish to use the editor add the following:

<div id="controls">
    <span id="start">Start</span>
    <span id="end">end</span>
</div>

That’s it in its basic form, you can build upon this as you like, in our final solution we have used radio buttons to toggle and activate the text editor.

There may be better ways to do this, but I’m sure this will help noobs like myself get started and in the right direction very quickly.

Offline

#4 2010-02-20 08:18:31

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

Re: Enable/Disable Xinha TextArea

I think "squeelsof" is some automatic posting robot, or they have some strange idea of what xinha is, deleting that post, since it's unintelligible.


James Sleeman

Offline

Board footer

Powered by FluxBB