Announcement

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

#1 2007-07-27 10:50:30

mjpg
Xinha Community Member
Registered: 2006-09-28
Posts: 13

How do I make Pastetext plugin work?

Version 0.931: config at bottom of this post

I looked over the forum and site, but cannot see an answer.

I'm trying to get PasteText to work, but I don't see a button. Everything else works, as do SuperClean buttons. Do Pastetext and SuperClean work together?

Can I make the Word clean functions work on paste? These used to work OK back in the HTMLArea2 days.

CONFIG

    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()
{


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

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



       xinha_config = xinha_config ? xinha_config() : new Xinha.Config();    
      
      xinha_config.pageStyleSheets = [ '/css/maineditor.css' ];
      
      // stylist sheet to use
      //xinha_config.stylistLoadStylesheet('/css/cmsstyles.css');
      



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


      
      
      xinha_editors.bodytext.config.width = '700px';
      xinha_editors.bodytext.config.height = '400px';
      xinha_editors.bodytext.config.statusBar = false;
      

    // We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL
    //  otherwise it won't work!
    //xinha_editors.bodytext.stylistLoadStylesheet('/css/main.css');


  xinha_editors.bodytext.config.toolbar =
  [
    //["popupeditor"],
    ["separator","formatblock","bold","italic"],
    ["linebreak","separator","justifyleft","justifycenter","justifyright"],
    ["separator","insertorderedlist","insertunorderedlist"],
    ["separator","inserthorizontalrule","createlink","insertimage","inserttable","toggleborders"],
    ["separator","killword","clearfonts","removeformat"],
    ["linebreak","separator","undo","redo"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste"]),
    ["separator","htmlmode"]
  ];
 
 

  xinha_editors.bodytext.config.formatblock =
  {
    "— format —": "",
    "Heading 2": "h2",
    "Heading 3": "h3",
    "Heading 4": "h4",
    "Normal"   : "p"
  };
  


      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

Many thanks in advance.

Offline

#2 2007-07-31 16:26:37

mjpg
Xinha Community Member
Registered: 2006-09-28
Posts: 13

Re: How do I make Pastetext plugin work?

Partly answering my own post - I see that 'SuperClean' and 'PasteText' are not required for 'killWordOnPaste' to be working.

I tried setting: xinha_config.killWordOnPaste = true; but it did not work - not surprising as that is the default.

Any ideas - I see there are a few posts on here that seem to stem from 'killWordOnPaste' not to be functioning - a bug?

Thanks

Offline

Board footer

Powered by FluxBB