Announcement

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

#1 2006-04-17 10:29:18

pejacobs
New member
Registered: 2006-04-14
Posts: 7

Configuring Stylist Plug-in from config.js file

Hello,
I am currently in the process of updating an older version of Xinha to the newest build.  All of the additions and new improvements are great!  The one problem I am having is using the Stylist plug-in.  I have tried all of the different ways listed at http://xinha.python-hosting.com/wiki/Stylist to configure the plug-in and just keep getting errors.  It says that you must  start with editor.registerPlugin(Stylist);, but isn't the plugin registered from step 1 of the config file?

I have moved the editor to a public server so you can see the error.
http://www.aacc.edu/sp/test/editor

Thank you very much for all your help,
-Phil

Here is the configuration file I am using.

    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 ***************************************************************

      xinha_plugins = xinha_plugins ? xinha_plugins :
      [
       'CharCounter',
       'ContextMenu',
       'FullScreen',
       'Stylist',
       'TableOperations'
      ];
             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
             if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;

      //* STEP 2 ***************************************************************

      xinha_editors = xinha_editors ? xinha_editors : ['textBox'];

      //* STEP 3 ***************************************************************

        xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
       
    //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  Where I tried diffrent calls to get stylelist to work vvvvvvvvvvvvvvvvvvvvv
       
                //xinha_config.stylistLoadStyles('p.txtSbHd { font-weight: bold; font-size: 1.3em; }');
        //xinha_config.stylistLoadStyles('p.txtSbHd { font-weight: bold; font-size: 1.3em; }', {'p.txtSbHd' : 'Subhead'});
        xinha_config.stylistLoadStylesheet('/sp/test/editor/css/subhead.css', {'p.txtSbHd' : 'Subhead'});

     //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   
        xinha_config.width  = '100%';
        xinha_config.height = '20em';
        xinha_config.toolbar =
            [
                ["popupeditor","undo","redo","htmlmode"],
                ["separator","bold","italic","underline","subscript","superscript"],
                ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
                ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
                ["separator","createlink","inserttable"]
            ];
   
       

      //* STEP 4 ***************************************************************

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

      //** STEP 5 ***************************************************************

      HTMLArea.startEditors(xinha_editors);
    }

    window.onload = xinha_init;

Offline

#2 2006-04-17 12:48:45

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

Re: Configuring Stylist Plug-in from config.js file

I've thoroughly recreated your setup, and it works. I'm sorry but I really can't find the error

Offline

#3 2006-04-17 14:08:46

pejacobs
New member
Registered: 2006-04-14
Posts: 7

Re: Configuring Stylist Plug-in from config.js file

Thank you very much Ray, I was working with a build that was a week or so old.  I downloaded the most recent and the problem seems to be corrected.  Thank you once again for looking into the issue.
-Phil

Offline

Board footer

Powered by FluxBB