cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephane Delort" <>
Subject [htmlarea] config file
Date Wed, 07 Jul 2004 07:33:23 GMT

I saw the sample with htmlarea and found it pretty and am currently working
on adding this function into my webapp.

Though, I don't know how to specify an home-made file which could override
default settings.
(the way it is told in the htmlarea doc)

I pasted the code (1) from the doc into the file : "mycustomsettings.js"
and then, modify
"forms-htmlarea-styling.xsl"  with this <script type="text/javascript" src
but, unfortunatly, this, does NOT work.


1 :
<script language="JavaScript1.2" defer>

// All our custom buttons will call this function when clicked.
// We use the buttonId parameter to determine what button
// triggered the call.
function clickHandler(editor, buttonId) {
  switch (buttonId) {
    case "my-toc":
      editor.insertHTML("<h1>Table Of Contents</h1>");
    case "my-date":
      editor.insertHTML((new Date()).toString());
    case "my-bold":
    case "my-hilite":
      editor.surroundHTML("<span class=\"hilite\">", "</span>");

// Create a new configuration object
var config = new HTMLArea.Config();

// Register our custom buttons
config.registerButton("my-toc",  "Insert TOC", "my-toc.gif", false, clickHandler);
config.registerButton("my-date", "Insert date/time", "my-date.gif", false, clickHandler);
config.registerButton("my-bold", "Toggle bold/italic", "my-bold.gif", false, clickHandler);
config.registerButton("my-hilite", "Hilite selection", "my-hilite.gif", false, clickHandler);

// Append the buttons to the default toolbar
config.toolbar.push(["linebreak", "my-toc", "my-date", "my-bold", "my-hilite"]);

// Replace an existing textarea with an HTMLArea object having the above config.
HTMLArea.replace("textAreaID", config);


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message