Announcement

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

#1 2006-12-07 16:06:02

Napsty
New member
From: Switzerland
Registered: 2006-12-07
Posts: 4

Multiple Editors don't work

Heya

I installed xinha today:
'$LastChangedDate: 2006-12-07 02:03:34 +1300 (Thu, 07 Dec 2006)

and I recognized that multiple Editors set in my_config.js don't work.

You know, this here:

xinha_editors = xinha_editors ? xinha_editors :
      [
        'iSubInhalt',
        'newbiearea1'
      ];

None of those can be loaded - only if I set ONLY one Textarea-Name in it.

Someone has experienced that too?

Offline

#2 2006-12-08 15:33:32

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Multiple Editors don't work

Sorry, I couldn't reproduce what you describe. (Sorry for copy/paste)

Which browser?
Any JS errors?

Offline

#3 2006-12-11 12:48:17

Napsty
New member
From: Switzerland
Registered: 2006-12-07
Posts: 4

Re: Multiple Editors don't work

Hey ray

sorry for the delay, the webserver was down :-/

If i set multiple editors in the my_config.js (like shown above) I get a JS error in IE:

Row 114
Char 5
Error 'this._textArea' is Null or not an Object
Code 0

I also tried it in writing it in the same row, space between comma and so on.


edit: tested it with IE 6 and Firefox 2. IE 6 shows the error, Firefox just doesnt do anything except showing the (normal) textarea field.

Last edited by Napsty (2006-12-11 12:49:40)

Offline

#4 2006-12-12 05:44:34

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Multiple Editors don't work

One simple question: Do you have each textarea in your HTML?

Offline

#5 2006-12-12 14:31:21

Napsty
New member
From: Switzerland
Registered: 2006-12-07
Posts: 4

Re: Multiple Editors don't work

Uh oh... do you mean the textareas have to be IN THE SAME html-page that it would work?
I have two different pages, each with one textarea and the same script codes...

Offline

#6 2006-12-12 17:04:34

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Multiple Editors don't work

yeah, thats right
simply pull xinha_editors out of your config
Page:

 
<script type="text/javascript">
xinha_editors =
      [
        'myTextArea'
      ];
</script>
  <script type="text/javascript" src="../htmlarea.js"></script>
  <script type="text/javascript" src="config.js"></script>

config.js:

 
    //xinha_editors = null;  <-------------------------------- Don't forget this!
    xinha_init    = null;
    xinha_config  = null;
    xinha_plugins = null;

    // This contains the names of textareas we will make into Xinha editors
    xinha_init = xinha_init ? xinha_init : function()
    {
      /** STEP 1 ***************************************************************
       * First, what are the plugins you will be using in the editors on this
       * page.  List all the plugins you will need, even if not all the editors
       * will use all the plugins.
       ************************************************************************/

Offline

#7 2006-12-13 08:54:09

Napsty
New member
From: Switzerland
Registered: 2006-12-07
Posts: 4

Re: Multiple Editors don't work

GREAT! Thank you, ray!

I did it like that now:

  <script type="text/javascript">
    _editor_url  = "/inc/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
    _editor_lang = "de";      // And the language we need to use in the editor.
    xinha_editors = ['iSubInhalt']; // defines the textarea
  </script>
  <script type="text/javascript" src="/inc/xinha/htmlarea.js"></script>
  
<script type="text/javascript" src="/inc/xinha/ag_config.js"></script>

And it works well with several Textareas. Thx again!

Offline

#8 2007-10-06 04:25:54

mcrosmar
New member
Registered: 2007-10-05
Posts: 2

Re: Multiple Editors don't work

Hi. I have the same problem. I followed the above instructions but nothing happened. I have two pages. Each one includes one <textarea>.

Page1 - working page

<script type="text/javascript">
    _editor_url  = "../../xinha/";
    _editor_lang = "en";
    _editor_skin = "../../xinha/skins/green-look";
    xinha_editors = ['description'];    
</script>
<script type="text/javascript" src="../../xinha/XinhaCore.js"></script>
<script type="text/javascript" src="../../xinha/htmlarea.js"></script>
<script type="text/javascript" src="../../xinha/my_config.js"></script>
.
.
.
<textarea id="description" name="description" rows="20" cols="50" style="width: 100%"></textarea>

Page2 - not working page

<script type="text/javascript">
    _editor_url  = "../../xinha/";
    _editor_lang = "en";
    _editor_skin = "../../xinha/skins/green-look";
    xinha_editors = ['description'];    
</script>
<script type="text/javascript" src="../../xinha/XinhaCore.js"></script>
<script type="text/javascript" src="../../xinha/htmlarea.js"></script>
<script type="text/javascript" src="../../xinha/my_config.js"></script>
.
.
.
<textarea id="description" name="description" rows="20" cols="50" style="width: 100%"></textarea>

my_config.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:['description'];
xinha_plugins=xinha_plugins?xinha_plugins:["CharacterMap","ContextMenu","ListType","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);
};
Xinha._addEvent(window,"load",xinha_init);

Any ideas?

Last edited by mcrosmar (2007-10-06 11:26:15)

Offline

#9 2007-10-06 11:32:00

mcrosmar
New member
Registered: 2007-10-05
Posts: 2

Re: Multiple Editors don't work

I found it!!! I was set wrong paths wink

Offline

Board footer

Powered by FluxBB