You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jh...@apache.org on 2005/11/03 15:00:48 UTC
svn commit: r330548 [114/132] - in
/cocoon/whiteboard/maven2/cocoon-flat-layout: ./ cocoon-ajax-block/
cocoon-ajax-block/api/ cocoon-ajax-block/api/src/
cocoon-ajax-block/api/src/main/ cocoon-ajax-block/api/src/main/java/
cocoon-ajax-block/api/src/main...
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/htmlarea/reference.html
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/htmlarea/reference.html?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/htmlarea/reference.html (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/htmlarea/reference.html Thu Nov 3 05:41:06 2005
@@ -0,0 +1,523 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html> <head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>HTMLArea-3.0 Reference</title>
+
+<style type="text/css">
+ @import url(htmlarea.css);
+ body { font: 14px verdana,sans-serif; background: #fff; color: #000; }
+ h1, h2 { font-family:tahoma,sans-serif; }
+ h1 { border-bottom: 2px solid #000; }
+ h2 { border-bottom: 1px solid #aaa; }
+ h3, h4 { margin-bottom: 0px; font-family: Georgia,serif; font-style: italic; }
+ h4 { font-size: 90%; margin-left: 1em; }
+ acronym { border-bottom: 1px dotted #063; color: #063; }
+ p { margin-left: 2em; margin-top: 0.3em; }
+ li p { margin-left: 0px; }
+ .abstract { padding: 5px; margin: 0px 10em; font-size: 90%; border: 1px dashed #aaa; background: #eee;}
+ li { margin-left: 2em; }
+ em { color: #042; }
+ a { color: #00f; }
+ a:hover { color: #f00; }
+ a:active { color: #f80; }
+ span.browser { font-weight: bold; color: #864; }
+ .fixme { font-size: 20px; font-weight: bold; color: red; background: #fab;
+padding: 5px; text-align: center; }
+ .code {
+ background: #e4efff; padding: 5px; border: 1px dashed #abc; margin-left: 2em; margin-right: 2em;
+ font-family: fixed,"lucidux mono","andale mono","courier new",monospace;
+ }
+ .note, .warning { font-weight: bold; color: #0a0; font-variant: small-caps; }
+ .warning { color: #a00; }
+
+.string {
+ color: #06c;
+} /* font-lock-string-face */
+.comment {
+ color: #840;
+} /* font-lock-comment-face */
+.variable-name {
+ color: #000;
+} /* font-lock-variable-name-face */
+.type {
+ color: #008;
+ font-weight: bold;
+} /* font-lock-type-face */
+.reference {
+ color: #048;
+} /* font-lock-reference-face */
+.preprocessor {
+ color: #808;
+} /* font-lock-preprocessor-face */
+.keyword {
+ color: #00f;
+ font-weight: bold;
+} /* font-lock-keyword-face */
+.function-name {
+ color: #044;
+} /* font-lock-function-name-face */
+.html-tag {
+ font-weight: bold;
+} /* html-tag-face */
+.html-helper-italic {
+ font-style: italic;
+} /* html-helper-italic-face */
+.html-helper-bold {
+ font-weight: bold;
+} /* html-helper-bold-face */
+
+</style>
+
+<script type="text/javascript">
+ _editor_url = './';
+ _editor_lang = 'en';
+</script>
+<script type="text/javascript" src="htmlarea.js"></script>
+<script type="text/javascript" src="dialog.js"></script>
+<script tyle="text/javascript" src="lang/en.js"></script>
+
+</head>
+
+<body onload="HTMLArea.replace('TA')">
+
+
+<h1>HTMLArea-3.0 Documentation</h1>
+
+<div class="abstract" style="color: red; font-weight: bold">
+
+ This documentation contains valid information, but is outdated in the
+ terms that it does not covers all the features of HTMLArea. A new
+ documentation project will be started, based on LaTeX.
+
+</div>
+
+
+<h2>Introduction</h2>
+
+<h3>What is HTMLArea?</h3>
+
+<p>HTMLArea is a free <acronym title="What You See Is What You Get"
+>WYSIWYG</acronym> editor replacement for <code><textarea></code>
+fields. By adding a few simple lines of JavaScript code to your web page
+you can replace a regular textarea with a rich text editor that lets your
+users do the following:</p>
+
+<ul>
+ <li>Format text to be bold, italicized, or underlined.</li>
+ <li>Change the face, size, style and color.</li>
+ <li>Left, center, or right-justify paragraphs.</li>
+ <li>Make bulleted or numbered lists.</li>
+ <li>Indent or un-indent paragraphs.</li>
+ <li>Insert a horizontal line.</li>
+ <li>Insert hyperlinks and images.</li>
+ <li>View the raw HTML source of what they're editing.</li>
+ <li>and much more...</li>
+</ul>
+
+<p>Some of the interesting features of HTMLArea that set's it apart from
+other web based WYSIWYG editors are as follows:</p>
+
+<ul>
+ <li>It's lightweight, fast loading and can transform a regular textarea
+ into a rich-text editor with a single line of JavaScript.</li>
+ <li>Generates clean, valid HTML.</li>
+ <li>It degrades gracefully to older or non-supported browsers
+ (they get the original textarea field).</li>
+ <li>It's free and can be incorporated into any free or commercial
+ program.</li>
+ <li>It works with any server-side languages (ASP, PHP, Perl, Java,
+ etc).</li>
+ <li>It's written in JavaScript and can be easily viewed, modified or
+ extended.</li>
+ <li>It remembers entered content when a user navigates away and then hits
+ "back" in their browser.</li>
+ <li>Since it replaces existing textareas it doesn't require a lot of code
+ to add it to your pages (just one line).</li>
+ <li>Did we mention it was free? ;-)</li>
+</ul>
+
+<h3>Is it really free? What's the catch?</h3>
+
+<p>Yes! It's really free. You can use it, modify it, distribute it with your
+software, or do just about anything you like with it.</p>
+
+<h3>What are the browser requirements?</h3>
+
+<p>HTMLArea requires <span class="browser"><a
+href="http://www.microsoft.com/ie">Internet Explorer</a> >= 5.5</span>
+(Windows only), or <span class="browser"><a
+href="http://mozilla.org">Mozilla</a> >= 1.3-Beta</span> on any platform.
+Any browser based on <a href="http://mozilla.org/newlayout">Gecko</a> will
+also work, provided that Gecko version is at least the one included in
+Mozilla-1.3-Beta (for example, <a
+href="http://galeon.sf.net">Galeon-1.2.8</a>). However, it degrades
+gracefully to other browsers. They will get a regular textarea field
+instead of a WYSIWYG editor.</p>
+
+<h3>Can I see an example of what it looks like?</h3>
+
+<p>Just make sure you're using one of the browsers mentioned above and see
+below.</p>
+
+<form onsubmit="return false;">
+<textarea id="TA" style="width: 100%; height: 15em;">
+<p>Here is some sample text in textarea that's been transformed with <font
+color="#0000CC"><b>HTMLArea</b></font>.<br />
+You can make things <b>bold</b>, <i>italic</i>, <u>underline</u>. You can change the
+<font size="3">size</font> and <b><font color="#0000CC">c</font><font color="#00CC00">o</font><font color="#00CCCC">l</font><font color="#CC0000">o</font><font color="#CC00CC">r</font><font color="#CCCC00">s</font><font color="#CCCCCC">!</font></b>
+And lots more...</p>
+
+<p align="center"><font size="4" color="#ff0000"><b><u>Try HTMLArea
+today!</u></b></font><br /></p>
+</textarea>
+</form>
+
+<h3>Where can I find out more info, download the latest version and talk to
+other HTMLArea users?</h3>
+
+<p>You can find out more about HTMLArea and download the latest version on
+the <a href="http://dynarch.com/htmlarea/">HTMLArea
+homepage</a> and you can talk to other HTMLArea users and post any comments
+or suggestions you have in the <a
+href="http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Alpha_Release_F14/"
+>HTMLArea forum</a>.</p>
+
+<h2>Keyboard shortcuts</h2>
+
+<p>The editor provides the following key combinations:</p>
+
+<ul>
+ <li>CTRL-A -- select all</li>
+ <li>CTRL-B -- bold</li>
+ <li>CTRL-I -- italic</li>
+ <li>CTRL-U -- underline</li>
+ <li>CTRL-S -- strikethrough</li>
+ <li>CTRL-L -- justify left</li>
+ <li>CTRL-E -- justify center</li>
+ <li>CTRL-R -- justify right</li>
+ <li>CTRL-J -- justify full</li>
+ <li>CTRL-1 .. CTRL-6 -- headings (<h1> .. <h6>)</li>
+ <li>CTRL-0 (zero) -- clean content pasted from Word</li>
+</ul>
+
+<h2>Installation</h2>
+
+<h3>How do I add HTMLArea to my web page?</h3>
+
+<p>It's easy. First you need to upload HTMLArea files to your website.
+Just follow these steps.</p>
+
+<ol>
+ <li>Download the latest version from the <a
+ href="http://www.interactivetools.com/products/htmlarea/">htmlArea
+ homepage</a>.</li>
+ <li>Unzip the files onto your local computer (making sure to maintain the
+ directory structure contained in the zip).</li>
+ <li>Create a new folder on your website called /htmlarea/ (make sure it's
+ NOT inside the cgi-bin).</li>
+ <li>Transfer all the HTMLArea files from your local computer into the
+ /htmlarea/ folder on your website.</li>
+ <li>Open the example page /htmlarea/examples/core.html with your browser to make
+ sure everything works.</li>
+</ol>
+
+<p>Once htmlArea is on your website all you need to do is add some
+JavaScript to any pages that you want to add WYSIWYG editors to. Here's how
+to do that.</p>
+
+<ol>
+
+ <li>Define some global variables. "_editor_url" has to be the absolute
+ URL where HTMLArea resides within your
+ website; as we discussed, this would be â/htmlarea/â. "_editor_lang" must
+ be the language code in which you want HTMLArea to appear. This defaults
+ to "en" (English); for a list of supported languages, please look into
+ the "lang" subdirectory in the distribution.
+ <pre class="code"
+ ><span class="function-name"><</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">"text/javascript"</span><span class="function-name">></span>
+ _editor_url = <span class="string">"/htmlarea/"</span>;
+ _editor_lang = <span class="string">"en"</span>;
+<span class="function-name"><</span><span class="html-tag">/script</span><span class="function-name">></span></pre>
+
+ <li>Include the "htmlarea.js" script:
+ <pre class="code"
+ ><span class="function-name"><</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">"text/javascript"</span> <span class="variable-name">src=</span><span class="string">"/htmlarea/htmlarea.js"</span><span class="function-name">></span><span class="paren-face-match"><</span><span class="html-tag">/script</span><span class="paren-face-match">></span></pre>
+ </li>
+
+ <li><p>If you want to change all your <textarea>-s into
+ HTMLArea-s then you can use the simplest way to create HTMLArea:</p>
+ <pre class="code"
+ ><span class="function-name"><</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">"text/javascript"</span> <span class="variable-name">defer=</span><span class="string">"1"</span><span class="function-name">></span>
+ HTMLArea.replaceAll<span class="function-name">()</span>;
+<span class="paren-face-match"><</span><span class="html-tag">/script</span><span class="paren-face-match">></span></pre>
+ <p><span class="note">Note:</span> you can also add the
+ <code>HTMLArea.replaceAll()</code> code to the <code>onload</code>
+ event handler for the <code>body</code> element, if you find it more appropriate.</p>
+
+ <p>A different approach, if you have more than one textarea and only want
+ to change one of them, is to use <code>HTMLArea.replace("id")</code> --
+ pass the <code>id</code> of your textarea. Do not use the
+ <code>name</code> attribute anymore, it's not a standard solution!</p>
+
+</ol>
+
+<p>This section applies to HTMLArea-3.0 release candidate 1 or later; prior
+to this version, one needed to include more files; however, now HTMLArea is
+able to include other files too (such as stylesheet, language definition
+file, etc.) so you only need to define the editor path and load
+"htmlarea.js". Nice, eh? ;-)</p>
+
+<h3>I want to change the editor settings, how do I do that?</h3>
+
+<p>While it's true that all you need is one line of JavaScript to create an
+htmlArea WYSIWYG editor, you can also specify more config settings in the
+code to control how the editor works and looks. Here's an example of some of
+the available settings:</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config(); <span class="comment">// create a new configuration object
+</span> <span class="comment">// having all the default values
+</span>config.width = '<span class="string">90%</span>';
+config.height = '<span class="string">200px</span>';
+
+<span class="comment">// the following sets a style for the page body (black text on yellow page)
+// and makes all paragraphs be bold by default
+</span>config.pageStyle =
+ '<span class="string">body { background-color: yellow; color: black; font-family: verdana,sans-serif } </span>' +
+ '<span class="string">p { font-width: bold; } </span>';
+
+<span class="comment">// the following replaces the textarea with the given id with a new
+// HTMLArea object having the specified configuration
+</span>HTMLArea.replace('<span class="string">id</span>', config);</pre>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file. This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h3>How do I customize the toolbar?</h3>
+
+<p>Using the configuration object introduced above allows you to completely
+control what the toolbar contains. Following is an example of a one-line,
+customized toolbar, much simpler than the default one:</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+config.toolbar = [
+ ['<span class="string">fontname</span>', '<span class="string">space</span>',
+ '<span class="string">fontsize</span>', '<span class="string">space</span>',
+ '<span class="string">formatblock</span>', '<span class="string">space</span>',
+ '<span class="string">bold</span>', '<span class="string">italic</span>', '<span class="string">underline</span>']
+];
+HTMLArea.replace('<span class="string">id</span>', config);</pre>
+
+<p>The toolbar is an Array of Array objects. Each array in the toolbar
+defines a new line. The default toolbar looks like this:</p>
+
+<pre class="code"
+>config.toolbar = [
+[ "<span class="string">fontname</span>", "<span class="string">space</span>",
+ "<span class="string">fontsize</span>", "<span class="string">space</span>",
+ "<span class="string">formatblock</span>", "<span class="string">space</span>",
+ "<span class="string">bold</span>", "<span class="string">italic</span>", "<span class="string">underline</span>", "<span class="string">separator</span>",
+ "<span class="string">strikethrough</span>", "<span class="string">subscript</span>", "<span class="string">superscript</span>", "<span class="string">separator</span>",
+ "<span class="string">copy</span>", "<span class="string">cut</span>", "<span class="string">paste</span>", "<span class="string">space</span>", "<span class="string">undo</span>", "<span class="string">redo</span>" ],
+
+[ "<span class="string">justifyleft</span>", "<span class="string">justifycenter</span>", "<span class="string">justifyright</span>", "<span class="string">justifyfull</span>", "<span class="string">separator</span>",
+ "<span class="string">insertorderedlist</span>", "<span class="string">insertunorderedlist</span>", "<span class="string">outdent</span>", "<span class="string">indent</span>", "<span class="string">separator</span>",
+ "<span class="string">forecolor</span>", "<span class="string">hilitecolor</span>", "<span class="string">textindicator</span>", "<span class="string">separator</span>",
+ "<span class="string">inserthorizontalrule</span>", "<span class="string">createlink</span>", "<span class="string">insertimage</span>", "<span class="string">inserttable</span>", "<span class="string">htmlmode</span>", "<span class="string">separator</span>",
+ "<span class="string">popupeditor</span>", "<span class="string">separator</span>", "<span class="string">showhelp</span>", "<span class="string">about</span>" ]
+];</pre>
+
+<p>Except three strings, all others in the examples above need to be defined
+in the <code>config.btnList</code> object (detailed a bit later in this
+document). The three exceptions are: 'space', 'separator' and 'linebreak'.
+These three have the following meaning, and need not be present in
+<code>btnList</code>:</p>
+
+<ul>
+ <li>'space' -- Inserts a space of 5 pixels (the width is configurable by external
+ <acronym title="Cascading Style Sheets">CSS</acronym>) at the current
+ position in the toolbar.</li>
+ <li>'separator' -- Inserts a small vertical separator, for visually grouping related
+ buttons.</li>
+ <li>'linebreak' -- Starts a new line in the toolbar. Subsequent controls will be
+ inserted on the new line.</li>
+</ul>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file. This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h3>How do I create custom buttons?</h3>
+
+<p>By design, the toolbar is easily extensible. For adding a custom button
+one needs to follow two steps.</p>
+
+<h4 id="regbtn">1. Register the button in <code>config.btnList</code>.</h4>
+
+<p>For each button in the toolbar, HTMLArea needs to know the following
+information:</p>
+<ul>
+ <li>a name for it (we call it the ID of the button);</li>
+ <li>the path to an image to be displayed in the toolbar;</li>
+ <li>a tooltip for it;</li>
+ <li>whether the button is enabled or not in text mode;</li>
+ <li>what to do when the button is clicked;</li>
+</ul>
+<p>You need to provide all this information for registering a new button
+too. The button ID can be any string identifier and it's used when
+defining the toolbar, as you saw above. We recommend starting
+it with "my-" so that it won't clash with the standard ID-s (those from
+the default toolbar).</p>
+
+<p class="note">Register button example #1</p>
+
+<pre class="code"
+><span class="comment">// get a default configuration
+</span><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+<span class="comment">// register the new button using Config.registerButton.
+// parameters: button ID, tooltip, image, textMode,
+</span>config.registerButton("<span class="string">my-hilite</span>", "<span class="string">Highlight text</span>", "<span class="string">my-hilite.gif</span>", <span class="keyword">false</span>,
+<span class="comment">// function that gets called when the button is clicked
+</span> <span class="keyword">function</span>(editor, id) {
+ editor.surroundHTML('<span class="string"><span class="hilite"></span>', '<span class="string"></span></span>');
+ }
+);</pre>
+
+<p>An alternate way of calling registerButton is exemplified above. Though
+the code might be a little bit larger, using this form makes your code more
+maintainable. It doesn't even needs comments as it's pretty clear.</p>
+
+<p class="note">Register button example #2</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+config.registerButton({
+ id : "<span class="string">my-hilite</span>",
+ tooltip : "<span class="string">Highlight text</span>",
+ image : "<span class="string">my-hilite.gif</span>",
+ textMode : <span class="keyword">false</span>,
+ action : <span class="keyword">function</span>(editor, id) {
+ editor.surroundHTML('<span class="string"><span class="hilite"></span>', '<span class="string"></span></span>');
+ }
+});</pre>
+
+<p>You might notice that the "action" function receives two parameters:
+<b>editor</b> and <b>id</b>. In the examples above we only used the
+<b>editor</b> parameter. But it could be helpful for you to understand
+both:</p>
+
+<ul>
+ <li><b>editor</b> is a reference to the HTMLArea object. Since our entire
+ code now has an <acronym title="Object Oriented Programming">OOP</acronym>-like
+ design, you need to have a reference to
+ the editor object in order to do things with it. In previous versions of
+ HTMLArea, in order to identify the object an ID was used -- the ID of the
+ HTML element. In this version ID-s are no longer necessary.</li>
+
+ <li><b>id</b> is the button ID. Wondering why is this useful? Well, you
+ could use the same handler function (presuming that it's not an anonymous
+ function like in the examples above) for more buttons. You can <a
+ href="#btnex">see an example</a> a bit later in this document.</li>
+</ul>
+
+<h4>2. Inserting it into the toolbar</h4>
+
+<p>At this step you need to specify where in the toolbar to insert the
+button, or just create the whole toolbar again as you saw in the previous
+section. You use the button ID, as shown in the examples of customizing the
+toolbar in the previous section.</p>
+
+<p>For the sake of completion, following there are another examples.</p>
+
+<p class="note">Append your button to the default toolbar</p>
+
+<pre class="code"
+>config.toolbar.push([ "<span class="string">my-hilite</span>" ]);</pre>
+
+<p class="note">Customized toolbar</p>
+
+<pre class="code"
+>config.toolbar = [
+ ['<span class="string">fontname</span>', '<span class="string">space</span>',
+ '<span class="string">fontsize</span>', '<span class="string">space</span>',
+ '<span class="string">formatblock</span>', '<span class="string">space</span>',
+ '<span class="string">separator</span>', '<span class="string">my-hilite</span>', '<span class="string">separator</span>', '<span class="string">space</span>', <span class="comment">// here's your button
+</span> '<span class="string">bold</span>', '<span class="string">italic</span>', '<span class="string">underline</span>', '<span class="string">space</span>']
+];</pre>
+
+<p><span class="note">Note:</span> in the example above our new button is
+between two vertical separators. But this is by no means required. You can
+put it wherever you like. Once registered in the btnList (<a
+href="#regbtn">step 1</a>) your custom button behaves just like a default
+button.</p>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file. This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h4 id="btnex">A complete example</h4>
+
+<p>Please note that it is by no means necessary to include the following
+code into the htmlarea.js file. On the contrary, it might not work there.
+The configuration system is designed such that you can always customize the
+editor <em>from outside files</em>, thus keeping the htmlarea.js file
+intact. This will make it easy for you to upgrade your HTMLArea when we
+release a new official version. OK, I promise it's the last time I said
+this. ;)</p>
+
+<pre class="code"
+><span class="comment">// All our custom buttons will call this function when clicked.
+// We use the <b>buttonId</b> parameter to determine what button
+// triggered the call.
+</span><span class="keyword">function</span> <span class="function-name">clickHandler</span>(editor, buttonId) {
+ <span class="keyword">switch</span> (buttonId) {
+ <span class="keyword">case</span> "<span class="string">my-toc</span>":
+ editor.insertHTML("<span class="string"><h1>Table Of Contents</h1></span>");
+ <span class="keyword">break</span>;
+ <span class="keyword">case</span> "<span class="string">my-date</span>":
+ editor.insertHTML((<span class="keyword">new</span> Date()).toString());
+ <span class="keyword">break</span>;
+ <span class="keyword">case</span> "<span class="string">my-bold</span>":
+ editor.execCommand("<span class="string">bold</span>");
+ editor.execCommand("<span class="string">italic</span>");
+ <span class="keyword">break</span>;
+ <span class="keyword">case</span> "<span class="string">my-hilite</span>":
+ editor.surroundHTML("<span class="string"><span class=\"hilite\"></span>", "<span class="string"></span></span>");
+ <span class="keyword">break</span>;
+ }
+};
+
+<span class="comment">// Create a new configuration object
+</span><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+
+<span class="comment">// Register our custom buttons
+</span>config.registerButton("<span class="string">my-toc</span>", "<span class="string">Insert TOC</span>", "<span class="string">my-toc.gif</span>", <span class="keyword">false</span>, clickHandler);
+config.registerButton("<span class="string">my-date</span>", "<span class="string">Insert date/time</span>", "<span class="string">my-date.gif</span>", <span class="keyword">false</span>, clickHandler);
+config.registerButton("<span class="string">my-bold</span>", "<span class="string">Toggle bold/italic</span>", "<span class="string">my-bold.gif</span>", <span class="keyword">false</span>, clickHandler);
+config.registerButton("<span class="string">my-hilite</span>", "<span class="string">Hilite selection</span>", "<span class="string">my-hilite.gif</span>", <span class="keyword">false</span>, clickHandler);
+
+<span class="comment">// Append the buttons to the default toolbar
+</span>config.toolbar.push(["<span class="string">linebreak</span>", "<span class="string">my-toc</span>", "<span class="string">my-date</span>", "<span class="string">my-bold</span>", "<span class="string">my-hilite</span>"]);
+
+<span class="comment">// Replace an existing textarea with an HTMLArea object having the above config.
+</span>HTMLArea.replace("<span class="string">textAreaID</span>", config);</pre>
+
+
+<hr />
+<address>© <a href="http://interactivetools.com" title="Visit our website"
+>InteractiveTools.com</a> 2002-2004.
+<br />
+© <a href="http://dynarch.com">dynarch.com</a> 2003-2004<br />
+HTMLArea v3.0 developed by <a
+href="http://dynarch.com/mishoo/">Mihai Bazon</a>.
+<br />
+Documentation written by Mihai Bazon.
+</address>
+<!-- hhmts start --> Last modified: Wed Jan 28 12:18:23 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+</body> </html>
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/htmlarea/reference.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/htmlarea/release-notes.html
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/htmlarea/release-notes.html?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/htmlarea/release-notes.html (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/htmlarea/release-notes.html Thu Nov 3 05:41:06 2005
@@ -0,0 +1,165 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>HTMLArea-3.0-rc1 release notes</title>
+ <style>
+ .fixme { color: red; }
+ </style>
+ </head>
+
+ <body>
+
+ <h1>HTMLArea-3.0-rc1 release notes</h1>
+
+ <p>This release was compiled on Mar 1, 2004 [19:37] GMT.</p>
+
+ <h2>3.0-rc1</h2>
+
+ <p>Changes since 3.0-Beta:</p>
+
+ <ul>
+ <li>
+ <b>New plugins</b>
+ <ul>
+ <li>
+ ContextMenu plugin (provides a nice context menu with common
+ operations, including table ops, link ops, etc.)
+ </li>
+ <li>
+ CSS plugin (provides an easy way to insert/change CSS classes)
+ </li>
+ <li>
+ FullPage plugin (allows HTMLArea to edit a whole HTML file,
+ not only the content within <body>.)
+ </li>
+ </ul>
+ </li>
+ <li>
+ <b>Changes in the SpellChecker plugin</b>
+ <ul>
+ <li>
+ Many bugfixes: now it works ;-) Fully Unicode-safe.
+ </li>
+ <li>
+ Speed and bandwidth optimization: reports the list of
+ suggestions only once for each mispelled word; this helps
+ in cases where you have, for instance, the word âHTMLAreaâ
+ in 10 places all over the document; the list of
+ suggestions for it--which is kind of huge--will only be
+ included <em>once</em>.
+ </li>
+ <li>
+ User interface improvements: the highlighted word will
+ remain in view; in cases where it's normally outside, the
+ window will be scrolled to it.
+ </li>
+ <li>
+ Added a "Revert" button for those that change their minds ;-)
+ </li>
+ <li>
+ Added a "Info" button which reports information about the
+ document, retrieved by the server-side spell checker:
+ total number of words, total number of mispelled words,
+ number of suggestions made, spell check time, etc. More
+ can be easily added. <span class="fixme">FIXME: this part
+ is not yet internationalized.</span>
+ </li>
+ <li>
+ The server-side spell checker now uses XML::DOM instead of
+ HTML::Parser, which means that it will be unable to parse
+ âtag-soupâ HTML. It needs valid code. Usually HTMLArea
+ generates valid code, but on rare occasions it might fail
+ and the spell checker will report a gross error message.
+ This gonna have to be fixed, but instead of making the
+ spell checker accept invalid HTML I prefer to make
+ HTMLArea generate valid code, so changes are to be done in
+ other places ;-)
+ </li>
+ </ul>
+ </li>
+ <li>
+ <b>Changes in the core editor</b>
+ <ul>
+ <li>
+ Easier to setup: you only need to load
+ <tt>htmlarea.js</tt>; other scripts will be loaded
+ automatically. <a href="reference.html">Documentation</a>
+ and <a href="examples/">examples</a> updated.
+ </li>
+ <li>
+ Better plugin support (they register information about
+ themselves with the editor; can register event handlers for
+ the editor, etc.)
+ </li>
+ <li>
+ New about box; check it out, it's cool ;-)
+ </li>
+ <li>
+ Word cleaner (can be enabled to automatically kill Word crap
+ on paste (see Config.killWordOnPaste); otherwise accessible by
+ pressing CTRL-0 in the editor; a toolbar button will come up
+ soon)
+ </li>
+ <li>
+ Image preview in "insert image" dialog. Also allows
+ modification of current image, if selected.
+ </li>
+ <li>
+ New "insert link" dialog, allows target and title
+ specification, allows editing links.
+ </li>
+ <li>
+ Implemented support for text direction (left-to-right or
+ right-to-left).
+ </li>
+ <li>
+ Lots of bug fixes! ... and more, I guess ;-) an
+ automatically generated <a href="ChangeLog">change log</a>
+ is now available.
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>I don't have the power to go through the <a
+href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse">bug
+system</a> at SourceForge
+ now. Some of the bugs reported there may be fixed; I'll update
+ their status, some other time. If you reported bugs there and now
+ find them to be fixed, please let me know.</p>
+
+ <h2>3.0-Beta</h2>
+
+ <p>Changes since 3.0-Alpha:</p>
+
+ <ul>
+
+ <li>Performance improvements.</li>
+
+ <li>Many bugs fixed.</li>
+
+ <li>Plugin infrastructure.</li>
+
+ <li>TableOperations plugin.</li>
+
+ <li>SpellChecker plugin.</li>
+
+ <li>Status bar.</li>
+
+ <li>API for registering custom buttons and drop-down boxes in the
+ toolbar.</li>
+
+ <li>Toolbar can contain text labels.</li>
+
+ <li>Cut, copy, paste, undo, redo buttons.</li>
+
+ </ul>
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Sun Aug 3 16:55:08 EEST 2003 -->
+<!-- hhmts start --> Last modified: Sun Feb 1 13:16:10 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
+
+
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/htmlarea/release-notes.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/blank_btn.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/blank_btn.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/blank_btn.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/cal.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/cal.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/cal.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/close.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/close.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/close.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/delete.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/delete.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/delete.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/edit.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/edit.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/edit.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/fold.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/fold.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/fold.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/help.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/help.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/help.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/move_down.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/move_down.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/move_down.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/move_up.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/move_up.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/move_up.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/new.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/new.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/new.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/new_child.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/new_child.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/new_child.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/tree/win/collapsed.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/tree/win/collapsed.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/tree/win/collapsed.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/tree/win/expanded.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/tree/win/expanded.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/tree/win/expanded.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/tree/win/leaf.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/tree/win/leaf.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/tree/win/leaf.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/view.gif
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/view.gif?rev=330548&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/img/view.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/js/cforms.js
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/js/cforms.js?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/js/cforms.js (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/js/cforms.js Thu Nov 3 05:41:06 2005
@@ -0,0 +1,193 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Runtime JavaScript library for Cocoon forms.
+ *
+ * @version $Id: cforms.js 326906 2005-10-20 14:05:39Z sylvain $
+ */
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * The cocoon.forms object holds all forms-related properties and methods.
+ */
+if (typeof cocoon == "undefined") cocoon = {};
+
+cocoon.forms = {
+ ajax : false // default mode is full page update
+};
+
+/**
+ * Get the form of an element
+ */
+cocoon.forms.getForm = function(element) {
+ while(element != null && element.tagName != "FORM") {
+ element = element.parentNode;
+ }
+ return element;
+}
+
+/**
+ * Submits a form. If ajax mode is on and the browser is ajax-aware, the page isn't reloaded
+ */
+cocoon.forms.submitForm = function(element, name) {
+ if (typeof(name) == "undefined") {
+ name = element.name;
+ }
+
+ var form = this.getForm(element);
+ if (form == null) {
+ alert("Cannot find form for " + element);
+ } else {
+ form["forms_submit_id"].value = name;
+ // FIXME: programmatically submitting the form doesn't trigger onsubmit ? (both in IE and Moz)
+ forms_onsubmit();
+
+ var req = this.ajax && cocoon.ajax.newXMLHttpRequest();
+ if (req) {
+ var query = this._buildQueryString(form, name);
+ if (!query) {
+ // Some inputs are not ajax-compatible. Fall back to full page reload
+ form.submit();
+ }
+
+ // Provide feedback that something is happening.
+ document.body.style.cursor = "wait";
+
+ // The "ajax-action" attribute specifies an alternate submit location used in Ajax mode.
+ // This allows to use Ajax in the portal where forms are normally posted to the portal URL.
+ var uri = form.getAttribute("ajax-action");
+ if (! uri) uri = form.action;
+ if (uri == "") uri = document.location;
+
+ req.open("POST", uri, true);
+ req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
+ req.onreadystatechange = function() {
+ if (req.readyState == 4) {
+ cocoon.forms._handleBrowserUpdate(form, req);
+ }
+ }
+ req.send(query);
+ // Reset submit-id
+ form["forms_submit_id"].value = '';
+ forms_onsubmitHandlers = new Array();
+ } else {
+ // Non ajax-aware browser : regular submit
+ form.submit();
+ }
+ }
+}
+
+// Override the default forms_submitForm
+forms_submitForm = function() { cocoon.forms.submitForm.apply(cocoon.forms, arguments) };
+
+/**
+ * Build a query string with all form inputs
+ */
+cocoon.forms._buildQueryString = function(form, submitId) {
+ // Indicate to the server that we're in ajax mode
+ var result = "cocoon-ajax=true";
+ // Iterate on all form controls
+ for (var i = 0; i < form.elements.length; i++) {
+ input = form.elements[i];
+ if (input.type == "submit" || input.type == "image") {
+ // Skip buttons
+ continue;
+ }
+ if ((input.type == "checkbox" || input.type == "radio") && !input.checked) {
+ // Skip unchecked checkboxes and radio buttons
+ continue;
+ }
+ if (input.type == "file") {
+ // Can't send files in Ajax mode. Fall back to full page
+ return null;
+ }
+ if (input.tagName.toLowerCase() == "select" && input.multiple) {
+ var name = encodeURIComponent(input.name);
+ var options = input.options;
+ for (i in options) {
+ if (options[i].selected) {
+ result += "&" + name + "=" + encodeURIComponent(options[i].value)
+ }
+ }
+ // don't use the default fallback
+ continue;
+ }
+
+ // text, passwod, textarea, hidden, single select
+ result += "&" + encodeURIComponent(input.name) + "=" + encodeURIComponent(input.value);
+ }
+ return result;
+}
+
+/**
+ * Redirect when interaction is finished with the current form
+ */
+cocoon.forms._continue = function(form) {
+ if (form.method.toLowerCase() == "post") {
+ // Create a fake form and post it
+ var div = document.createElement("div");
+ content = "<form action='" + form.action + "' method='POST'>" +
+ "<input type='hidden' name='cocoon-ajax-continue' value='true'/>";
+ if (form.elements["continuation-id"]) {
+ content += "<input type='hidden' name='continuation-id' value='" +
+ form.elements["continuation-id"].value + "'/>";
+ }
+ content += "</form>";
+ div.innerHTML = content;
+ document.body.appendChild(div);
+ div.firstChild.submit();
+ } else {
+ // Redirect to the form's action URL
+ var contParam = '?cocoon-ajax-continue=true';
+ if (form.elements["continuation-id"]) {
+ contParam += "&continuation-id=" + form.elements["continuation-id"].value;
+ }
+ window.location.href = form.action + contParam;
+ }
+}
+
+/**
+ * Handle the server response
+ */
+cocoon.forms._handleBrowserUpdate = function(form, request) {
+ // Restore normal cursor
+ document.body.style.cursor = "auto";
+ if (request.status == 200) {
+ var xca;
+ try { // An exception is thrown if header doesn't exist
+ xca = request.getResponseHeader("X-Cocoon-Ajax");
+ } catch (e) {
+ // header doesn't exist
+ }
+ if (xca == "continue") {
+ this._continue(form);
+ } else {
+ // Handle browser update directives
+ var doc = request.responseXML;
+ if (!doc) {
+ cocoon.ajax.BrowserUpdater.handleError("No xml answer", request);
+ return;
+ }
+
+ var updater = new cocoon.ajax.BrowserUpdater();
+ updater.handlers['continue'] = function() { cocoon.forms._continue(form); }
+ updater.processResponse(doc, request);
+ }
+ } else {
+ cocoon.ajax.BrowserUpdater.handleError("Request failed - status=" + request.status, request);
+ }
+}
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/js/cforms.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/js/forms-lib.js
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/js/forms-lib.js?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/js/forms-lib.js (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/js/forms-lib.js Thu Nov 3 05:41:06 2005
@@ -0,0 +1,359 @@
+/*
+* Copyright 1999-2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+/**
+ * Runtime JavaScript library for Cocoon forms.
+ *
+ * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
+ * @version $Id: forms-lib.js 326897 2005-10-20 13:03:52Z bruno $
+ */
+
+// Handlers that are to be called in the document's "onload" event
+var forms_onloadHandlers = new Array();
+
+function forms_onload() {
+ for (var i = 0; i < forms_onloadHandlers.length; i++) {
+ forms_onloadHandlers[i].forms_onload();
+ }
+ // Clear it (we no more need them)
+ forms_onloadHandlers = null;
+}
+
+// Handlers that are to be called in form's "onsubmit" event
+// FIXME: this single var implies only one form per page, and needs to be
+// visited if we decide to support several forms per page.
+var forms_onsubmitHandlers = new Array();
+
+function forms_onsubmit() {
+ if (forms_onsubmitHandlers == null) {
+ // Form already submited, but the new page is not yet loaded. This can happen when
+ // the focus is in an input with an "onchange" and the user clicks on a submit button.
+ return false;
+ }
+
+ for (var i = 0; i < forms_onsubmitHandlers.length; i++) {
+ if (forms_onsubmitHandlers[i].forms_onsubmit() == false) {
+ // handler cancels the submit
+ return false;
+ }
+ }
+ // clear it
+ forms_onsubmitHandlers = null;
+ return true;
+}
+
+/**
+ * Submit the form containing an element, also storing in the hidden
+ * 'forms_submit_id' field the name of the element which triggered the submit.
+ */
+function oldforms_submitForm(element, name) {
+ // Mac IE 5 doesn't recognize key word 'undefined', so use typeof and compare strings
+ if (typeof(name) == "undefined") {
+ name = element.name;
+ }
+
+ var form = forms_getForm(element);
+ if (form == null) {
+ alert("Cannot find form for " + element);
+ } else {
+ form["forms_submit_id"].value = name;
+ // FIXME: programmatically submitting the form doesn't trigger onsubmit ? (both in IE and Moz)
+ if (forms_onsubmit()) {
+ form.submit();
+ }
+ }
+}
+
+/**
+ * Crawl the parents of an element up to finding a form.
+ */
+function forms_getForm(element) {
+ while(element != null && element.tagName != "FORM") {
+ element = element.parentNode;
+ }
+ return element;
+}
+
+/**
+ * Move a named element as an immediate child of the <body> element.
+ * This is required for help popups inside <wi:group> tabs. The reason is that CSS positioning
+ * properties ("left" and "top") on a block with a "position: absolute" are actually relative to
+ * the nearest ancestor that has a position of "absolute", "relative" or "fixed".
+ * See http://www.w3.org/TR/CSS21/visudet.html#containing-block-details $4
+ */
+
+function forms_moveInBody(element) {
+ element.parentNode.removeChild(element);
+ document.body.appendChild(element);
+}
+
+/**
+ * Create a popup window for a named element.
+ *
+ * @param id the ID of the element to make a popup with.
+ */
+function forms_createPopupWindow(id) {
+ var result = new PopupWindow(id);
+ result.autoHide();
+ // add to onload handlers
+ result.forms_id = id;
+ result.forms_onload = function() {
+ forms_moveInBody(document.getElementById(this.forms_id));
+ }
+ forms_onloadHandlers.push(result);
+ return result;
+}
+
+
+function forms_createOptionTransfer(id, submitOnChange) {
+ var result = new OptionTransfer(id + ".unselected", id);
+ result.setAutoSort(true);
+ // add to onload handlers
+ result.forms_id = id;
+ result.forms_onload = function() {
+ var form = forms_getForm(document.getElementById(this.forms_id));
+ this.init(form);
+ sortSelect(this.left);
+ sortSelect(this.right);
+ }
+ result.submitOnChange = submitOnChange;
+ result.forms_transferLeft = function() {
+ this.transferLeft();
+ if (this.submitOnChange) {
+ forms_submitForm(document.getElementById(this.forms_id));
+ }
+ }
+ result.forms_transferRight = function() {
+ this.transferRight();
+ if (this.submitOnChange) {
+ forms_submitForm(document.getElementById(this.forms_id));
+ }
+ }
+ result.forms_transferAllLeft = function() {
+ this.transferAllLeft();
+ if (this.submitOnChange) {
+ forms_submitForm(document.getElementById(this.forms_id));
+ }
+ };
+ result.forms_transferAllRight = function() {
+ this.transferAllRight();
+ if (this.submitOnChange) {
+ forms_submitForm(document.getElementById(this.forms_id));
+ }
+ };
+ forms_onloadHandlers.push(result);
+
+ // add to onsubmit handlers
+ result.forms_onsubmit = function() {
+ // Select all options in the "selected" list to that
+ // its values are sent.
+ selectAllOptions(this.right);
+ }
+ forms_onsubmitHandlers.push(result);
+ return result;
+}
+
+
+/**
+ * Show a tab in a <wi:group>
+ *
+ * @param tabgroup (string) name of the <wi:group>
+ * @param idx (integer) index of the selected tab
+ * @param length (integer) total number of tabs
+ * @param state (string, optional) name of the input storing the tabgroup state
+ */
+function forms_showTab(tabgroup, idx, length, state) {
+ // Change state value
+ if (state.length > 0) {
+ document.forms[0][state].value = idx;
+ }
+ for (var i = 0; i < length; i++) {
+ // Change tab status (selected/unselected)
+ var tab = document.getElementById(tabgroup + "_tab_" + i);
+ if (tab != null) {
+ tab.className = (i == idx) ? 'forms-tab forms-activeTab': 'forms-tab';
+ }
+ // Change tab content visibilty
+ var tabitems = document.getElementById(tabgroup + "_items_" + i);
+ if (tabitems != null) {
+ tabitems.style.display = (i == idx) ? '' : 'none';
+ // execute event handler if any
+ if (i == idx &&
+ window.onTabShownHandlers != null &&
+ window.onTabShownHandlers[tabgroup] != null) {
+ var onShowHandler = window.onTabShownHandlers[tabgroup][tabgroup + "_items_" + i];
+ if (onShowHandler != null) {
+ eval(onShowHandler);
+ }
+ }
+ }
+ }
+}
+
+/**
+ * FormsMultiValueEditor is the implementation of the free-form multivalue field editor.
+ */
+function FormsMultiValueEditor(id) {
+ this.select = document.getElementById(id + "-input");
+ this.entry = document.getElementById(id + ".entry");
+ var self = this;
+ this.entry.onkeypress = function(event) { return self.processInputKey(event); };
+ this.select.onkeydown = function(event) { return self.processSelectKey(event); };
+ this.select.onchange = function(event) { return self.processSelectChange(event); };
+
+ var deleteEl = document.getElementById(id + ".delete");
+ deleteEl.onclick = function() { self.deleteValues(); return false; };
+
+ var upEl = document.getElementById(id + ".up");
+ upEl.onclick = function() { self.moveUp(); return false; };
+
+ var downEl = document.getElementById(id + ".down");
+ downEl.onclick = function() { self.moveDown(); return false; };
+
+ var onsubmitHandler = new Object();
+ onsubmitHandler.forms_onsubmit = function () {
+ self.selectAll();
+ }
+ forms_onsubmitHandlers.push(onsubmitHandler);
+}
+
+/**
+ * Key event handler for keypresses in the input box.
+ */
+FormsMultiValueEditor.prototype.processInputKey = function(event) {
+ if (event == null) event = window.event; // Internet Explorer
+ if (event.keyCode == 13 || event.keyCode == 10) {
+ var entry = this.entry;
+ var select = this.select;
+ var newItem = entry.value;
+ if (newItem == null || newItem == "")
+ return false;
+ // if ctrl+enter is pressed, the first selected item is replaced with the new value
+ // (otherwise, the new value is appended at the end of the list)
+ var replace = event.ctrlKey;
+ var newItemPos = -1;
+ for (var i = 0; i < select.options.length; i++) {
+ if (select.options[i].selected && replace && newItemPos == -1)
+ newItemPos = i;
+ select.options[i].selected = false;
+ }
+ if (newItemPos == -1)
+ newItemPos = select.options.length;
+ select.options[newItemPos] = new Option(newItem, newItem, false, true);
+ entry.value = "";
+ return false;
+ } else {
+ return true;
+ }
+}
+
+/**
+ * Key event handler for keypresses in the select list.
+ */
+FormsMultiValueEditor.prototype.processSelectKey = function(event) {
+ if (event == null) event = window.event; // Internet Explorer
+ // 46 = delete key
+ if (event.keyCode == 46) {
+ this.deleteValues();
+ return false;
+ } else if (event.ctrlKey && event.keyCode == 38) {
+ // key up = 38
+ this.moveUp();
+ return false;
+ } else if (event.ctrlKey && event.keyCode == 40) {
+ // key down = 40
+ this.moveDown();
+ return false;
+ }
+}
+
+
+FormsMultiValueEditor.prototype.deleteValues = function() {
+ var options = this.select.options;
+ var i = 0;
+ var lastRemovedItem = -1;
+ while (i < options.length) {
+ if (options[i].selected) {
+ options[i] = null;
+ lastRemovedItem = i;
+ } else {
+ i++;
+ }
+ }
+
+ if (lastRemovedItem != -1) {
+ if (options.length > lastRemovedItem) {
+ options[lastRemovedItem].selected = true;
+ } else if (lastRemovedItem - 1 >= 0) {
+ options[lastRemovedItem - 1].selected = true;
+ }
+ }
+}
+
+FormsMultiValueEditor.prototype.processSelectChange = function() {
+ var options = this.select.options;
+ for (var i = 0; i < options.length; i++) {
+ if (options[i].selected) {
+ this.entry.value = options[i].value;
+ break;
+ }
+ }
+}
+
+FormsMultiValueEditor.prototype.moveUp = function() {
+ var options = this.select.options;
+ if (options.length == 0)
+ return;
+ if (options[0].selected)
+ return;
+
+ for (var i = 0; i < options.length; i++) {
+ if (options[i].selected) {
+ var prev = this.cloneOption(options[i - 1]);
+ var current = this.cloneOption(options[i]);
+ options[i - 1] = current;
+ options[i] = prev;
+ }
+ }
+}
+
+FormsMultiValueEditor.prototype.cloneOption = function(option) {
+ return new Option(option.text, option.value, false, option.selected);
+}
+
+FormsMultiValueEditor.prototype.moveDown = function() {
+ var options = this.select.options;
+ if (options.length == 0)
+ return;
+ if (options[options.length - 1].selected)
+ return;
+
+ for (var i = options.length - 1; i >= 0; i--) {
+ if (options[i].selected) {
+ var next = this.cloneOption(options[i + 1]);
+ var current = this.cloneOption(options[i]);
+ options[i + 1] = current;
+ options[i] = next;
+ }
+ }
+}
+
+FormsMultiValueEditor.prototype.selectAll = function() {
+ var options = this.select.options;
+ for (var i = 0; i < options.length; i++) {
+ options[i].selected = true;
+ }
+}
+
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/js/forms-lib.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/mattkruse-lib/AnchorPosition.js
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/mattkruse-lib/AnchorPosition.js?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/mattkruse-lib/AnchorPosition.js (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/mattkruse-lib/AnchorPosition.js Thu Nov 3 05:41:06 2005
@@ -0,0 +1,147 @@
+// ===================================================================
+// Author: Matt Kruse <ma...@mattkruse.com>
+// WWW: http://www.mattkruse.com/
+//
+// NOTICE: You may use this code for any purpose, commercial or
+// private, without any further permission from the author. You may
+// remove this notice from your final code if you wish, however it is
+// appreciated by the author if at least my web site address is kept.
+//
+// You may *NOT* re-distribute this code in any way except through its
+// use. That means, you can include it in your product, or your web
+// site, or any other form where the code is actually being used. You
+// may not put the plain javascript up on your site for download or
+// include it in your javascript libraries for download.
+// If you wish to share this code with others, please just point them
+// to the URL instead.
+// Please DO NOT link directly to my .js files from your site. Copy
+// the files to your server and use them there. Thank you.
+// ===================================================================
+
+/*
+AnchorPosition.js
+Author: Matt Kruse
+Last modified: 10/11/02
+
+DESCRIPTION: These functions find the position of an <A> tag in a document,
+so other elements can be positioned relative to it.
+
+COMPATIBILITY: Netscape 4.x,6.x,Mozilla, IE 5.x,6.x on Windows. Some small
+positioning errors - usually with Window positioning - occur on the
+Macintosh platform.
+
+FUNCTIONS:
+getAnchorPosition(anchorname)
+ Returns an Object() having .x and .y properties of the pixel coordinates
+ of the upper-left corner of the anchor. Position is relative to the PAGE.
+
+getAnchorWindowPosition(anchorname)
+ Returns an Object() having .x and .y properties of the pixel coordinates
+ of the upper-left corner of the anchor, relative to the WHOLE SCREEN.
+
+NOTES:
+
+1) For popping up separate browser windows, use getAnchorWindowPosition.
+ Otherwise, use getAnchorPosition
+
+2) Your anchor tag MUST contain both NAME and ID attributes which are the
+ same. For example:
+ <A NAME="test" ID="test"> </A>
+
+3) There must be at least a space between <A> </A> for IE5.5 to see the
+ anchor tag correctly. Do not do <A></A> with no space.
+*/
+
+// getAnchorPosition(anchorname)
+// This function returns an object having .x and .y properties which are the coordinates
+// of the named anchor, relative to the page.
+function getAnchorPosition(anchorname) {
+ // This function will return an Object with x and y properties
+ var useWindow=false;
+ var coordinates=new Object();
+ var x=0,y=0;
+ // Browser capability sniffing
+ var use_gebi=false, use_css=false, use_layers=false;
+ if (document.getElementById) { use_gebi=true; }
+ else if (document.all) { use_css=true; }
+ else if (document.layers) { use_layers=true; }
+ // Logic to find position
+ if (use_gebi && document.all) {
+ x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
+ y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
+ }
+ else if (use_gebi) {
+ var o=document.getElementById(anchorname);
+ x=AnchorPosition_getPageOffsetLeft(o);
+ y=AnchorPosition_getPageOffsetTop(o);
+ }
+ else if (use_css) {
+ x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
+ y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
+ }
+ else if (use_layers) {
+ var found=0;
+ for (var i=0; i<document.anchors.length; i++) {
+ if (document.anchors[i].name==anchorname) { found=1; break; }
+ }
+ if (found==0) {
+ coordinates.x=0; coordinates.y=0; return coordinates;
+ }
+ x=document.anchors[i].x;
+ y=document.anchors[i].y;
+ }
+ else {
+ coordinates.x=0; coordinates.y=0; return coordinates;
+ }
+ coordinates.x=x;
+ coordinates.y=y;
+ return coordinates;
+ }
+
+// getAnchorWindowPosition(anchorname)
+// This function returns an object having .x and .y properties which are the coordinates
+// of the named anchor, relative to the window
+function getAnchorWindowPosition(anchorname) {
+ var coordinates=getAnchorPosition(anchorname);
+ var x=0;
+ var y=0;
+ if (document.getElementById) {
+ if (isNaN(window.screenX)) {
+ x=coordinates.x-document.body.scrollLeft+window.screenLeft;
+ y=coordinates.y-document.body.scrollTop+window.screenTop;
+ }
+ else {
+ x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
+ y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
+ }
+ }
+ else if (document.all) {
+ x=coordinates.x-document.body.scrollLeft+window.screenLeft;
+ y=coordinates.y-document.body.scrollTop+window.screenTop;
+ }
+ else if (document.layers) {
+ x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
+ y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
+ }
+ coordinates.x=x;
+ coordinates.y=y;
+ return coordinates;
+ }
+
+// Functions for IE to get position of an object
+function AnchorPosition_getPageOffsetLeft (el) {
+ var ol=el.offsetLeft;
+ while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
+ return ol;
+ }
+function AnchorPosition_getWindowOffsetLeft (el) {
+ return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
+ }
+function AnchorPosition_getPageOffsetTop (el) {
+ var ot=el.offsetTop;
+ while((el=el.offsetParent) != null) { ot += el.offsetTop; }
+ return ot;
+ }
+function AnchorPosition_getWindowOffsetTop (el) {
+ return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
+ }
Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/mattkruse-lib/AnchorPosition.js
------------------------------------------------------------------------------
svn:eol-style = native