Announcement

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

#1 2009-04-22 09:41:42

mantis2009
New member
Registered: 2009-04-22
Posts: 4

Xinha interferring with other scripts!?

Hi,

I'm new to Xinha but was able to install Xinha for my submission form.
Overall, it works well, however, I have another script running for star rating (the user clicks on a star for his vote).
Xinha loads into these scripts as well, although their IDs are not definied in Xinha's config file (only two text areas are)!
Therefore, I don't know how to resolve this, since I never told Xinha to have such a behavior.

Can someone please give me a hint what's wrong here?

Thanks!


my_config.js

xinha_editors = null;
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, specify the textareas that shall be turned into Xinhas. 
   * For each one add the respective id to the xinha_editors array.
   * I you want add more than on textarea, keep in mind that these 
   * values are comma seperated BUT there is no comma after the last value.
   * If you are going to use this configuration on several pages with different
   * textarea ids, you can add them all. The ones that are not found on the
   * current page will just be skipped.
   ************************************************************************/
  
  xinha_editors = xinha_editors ? xinha_editors :
  [
    'textfield1', 'textfield2'
  ];
  
  /** STEP 2 ***************************************************************
   * Now, 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.
   *
   * The list of plugins below is a good starting point, but if you prefer
   * a simpler editor to start with then you can use the following 
   * 
   * xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
   *
   * which will load no extra plugins at all.
   ************************************************************************/

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
   'CharacterMap',
   'ContextMenu',
   'ListType',
   'Stylist',
   'Linker',
   'SuperClean'
  ];
  
         // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
         if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;



   xinha_config = xinha_config ? xinha_config() : new Xinha.Config();
 
xinha_config.toolbar =
 [
   ["separator","bold","italic","underline","strikethrough"],
   ["separator","subscript","superscript"],
   ["linebreak","separator","insertorderedlist","insertunorderedlist","outdent","indent"],
   ["separator","createlink"],
   ["separator","undo","redo","selectall"], (Xinha.is_gecko ? [] : ["cut","copy","paste"]),
   ["separator","killword","clearfonts","removeformat"],
   ["separator","htmlmode","showhelp","about"]
 ];
 
   xinha_config.getHtmlMethod = "TransformInnerHTML";
   xinha_config.killWordOnPaste = true;
   
        
   // To adjust the styling inside the editor, we can load an external stylesheet like this
   // NOTE : YOU MUST GIVE AN ABSOLUTE URL
  
   xinha_config.pageStyleSheets = [ _editor_url + "examples/full_example.css" ];

  /** STEP 4 ***************************************************************
   * We first create editors for the textareas.
   *
   * You can do this in two ways, either
   *
   *   xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
   *
   * if you want all the editor objects to use the same set of plugins, OR;
   *
   *   xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config);
   *   xinha_editors.myTextArea.registerPlugins(['Stylist']);
   *   xinha_editors.anotherOne.registerPlugins(['CSS','SuperClean']);
   *
   * if you want to use a different set of plugins for one or more of the
   * editors.
   ************************************************************************/

  xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);

  /** STEP 5 ***************************************************************
   * If you want to change the configuration variables of any of the
   * editors,  this is the place to do that, for example you might want to
   * change the width and height of one of the editors, like this...
   *
   *   xinha_editors.myTextArea.config.width  = '640px';
   *   xinha_editors.myTextArea.config.height = '480px';
   *
   ************************************************************************/


  /** STEP 6 ***************************************************************
   * Finally we "start" the editors, this turns the textareas into
   * Xinha editors.
   ************************************************************************/

  Xinha.startEditors(xinha_editors);
}

Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load 
                                            // and does not interfere with window.onload properties set by other scripts

Last edited by mantis2009 (2009-04-22 09:43:25)

Offline

#2 2009-04-23 05:18:39

mantis2009
New member
Registered: 2009-04-22
Posts: 4

Re: Xinha interferring with other scripts!?

Removed

Last edited by mantis2009 (2009-04-30 04:37:32)

Offline

#3 2009-04-29 10:57:07

douglas
New member
Registered: 2009-04-29
Posts: 5

Re: Xinha interferring with other scripts!?

Maybe you've fixed it since then, but as far as I can tell, it's loading in the two textareas you've asked it to...

Offline

#4 2009-04-30 04:36:53

mantis2009
New member
Registered: 2009-04-22
Posts: 4

Re: Xinha interferring with other scripts!?

Yes. Since I got no reply and couldn't find anything in the documentation, I removed the other script and will stick to this solution for now.

Offline

Board footer

Powered by FluxBB