]> git.mjollnir.org Git - moodle.git/commitdiff
Adding a beta version of Rich Text Editor, for embedding into Moodle
authormoodler <moodler>
Thu, 10 Oct 2002 07:21:32 +0000 (07:21 +0000)
committermoodler <moodler>
Thu, 10 Oct 2002 07:21:32 +0000 (07:21 +0000)
forms (forums, readings, journals etc).  Works only on IE 5.5 and later.

Slightly customised for a slimmer toolbar.

145 files changed:
lib/rte/README_MOODLE [new file with mode: 0644]
lib/rte/_header_css.txt [new file with mode: 0644]
lib/rte/_header_html.txt [new file with mode: 0644]
lib/rte/_header_js.txt [new file with mode: 0644]
lib/rte/about_logo.swf [new file with mode: 0644]
lib/rte/about_logo.swi [new file with mode: 0644]
lib/rte/changelog [new file with mode: 0644]
lib/rte/colorchooser.html [new file with mode: 0644]
lib/rte/credits.html [new file with mode: 0644]
lib/rte/custom.css [new file with mode: 0644]
lib/rte/debug_embedded.asp [new file with mode: 0644]
lib/rte/dialog.css [new file with mode: 0644]
lib/rte/dlg_about.html [new file with mode: 0644]
lib/rte/dlg_ins_char.html [new file with mode: 0644]
lib/rte/dlg_ins_image.html [new file with mode: 0644]
lib/rte/dlg_ins_smile.html [new file with mode: 0644]
lib/rte/dlg_ins_table.html [new file with mode: 0644]
lib/rte/example.html [new file with mode: 0644]
lib/rte/images/CloseWindow.gif [new file with mode: 0644]
lib/rte/images/Editor_r11_c2.gif [new file with mode: 0644]
lib/rte/images/Editor_r11_c5.gif [new file with mode: 0644]
lib/rte/images/Editor_r4_c1.gif [new file with mode: 0644]
lib/rte/images/Editor_r4_c4.gif [new file with mode: 0644]
lib/rte/images/Editor_r4_c7.gif [new file with mode: 0644]
lib/rte/images/Editor_r5_c2.gif [new file with mode: 0644]
lib/rte/images/Editor_r5_c5.gif [new file with mode: 0644]
lib/rte/images/Editor_r7_c2.gif [new file with mode: 0644]
lib/rte/images/Editor_r7_c5.gif [new file with mode: 0644]
lib/rte/images/Editor_r9_c2.gif [new file with mode: 0644]
lib/rte/images/Editor_r9_c5.gif [new file with mode: 0644]
lib/rte/images/add_col.gif [new file with mode: 0644]
lib/rte/images/add_col_f2.gif [new file with mode: 0644]
lib/rte/images/add_row.gif [new file with mode: 0644]
lib/rte/images/add_row_f2.gif [new file with mode: 0644]
lib/rte/images/bg.gif [new file with mode: 0644]
lib/rte/images/em.icon.angry.gif [new file with mode: 0644]
lib/rte/images/em.icon.angry.png [new file with mode: 0644]
lib/rte/images/em.icon.approve.gif [new file with mode: 0644]
lib/rte/images/em.icon.approve.png [new file with mode: 0644]
lib/rte/images/em.icon.bigsmile.gif [new file with mode: 0644]
lib/rte/images/em.icon.bigsmile.png [new file with mode: 0644]
lib/rte/images/em.icon.blackeye.gif [new file with mode: 0644]
lib/rte/images/em.icon.blackeye.png [new file with mode: 0644]
lib/rte/images/em.icon.blush.gif [new file with mode: 0644]
lib/rte/images/em.icon.blush.png [new file with mode: 0644]
lib/rte/images/em.icon.clown.gif [new file with mode: 0644]
lib/rte/images/em.icon.clown.png [new file with mode: 0644]
lib/rte/images/em.icon.cool.gif [new file with mode: 0644]
lib/rte/images/em.icon.cool.png [new file with mode: 0644]
lib/rte/images/em.icon.dead.gif [new file with mode: 0644]
lib/rte/images/em.icon.dead.png [new file with mode: 0644]
lib/rte/images/em.icon.dissapprove.gif [new file with mode: 0644]
lib/rte/images/em.icon.dissapprove.png [new file with mode: 0644]
lib/rte/images/em.icon.eightball.gif [new file with mode: 0644]
lib/rte/images/em.icon.eightball.png [new file with mode: 0644]
lib/rte/images/em.icon.evil.gif [new file with mode: 0644]
lib/rte/images/em.icon.evil.png [new file with mode: 0644]
lib/rte/images/em.icon.kiss.gif [new file with mode: 0644]
lib/rte/images/em.icon.kiss.png [new file with mode: 0644]
lib/rte/images/em.icon.question.gif [new file with mode: 0644]
lib/rte/images/em.icon.question.png [new file with mode: 0644]
lib/rte/images/em.icon.sad.gif [new file with mode: 0644]
lib/rte/images/em.icon.sad.png [new file with mode: 0644]
lib/rte/images/em.icon.shocked.gif [new file with mode: 0644]
lib/rte/images/em.icon.shocked.png [new file with mode: 0644]
lib/rte/images/em.icon.shy.gif [new file with mode: 0644]
lib/rte/images/em.icon.shy.png [new file with mode: 0644]
lib/rte/images/em.icon.sleepy.gif [new file with mode: 0644]
lib/rte/images/em.icon.sleepy.png [new file with mode: 0644]
lib/rte/images/em.icon.smile.gif [new file with mode: 0644]
lib/rte/images/em.icon.smile.png [new file with mode: 0644]
lib/rte/images/em.icon.tongue.gif [new file with mode: 0644]
lib/rte/images/em.icon.tongue.png [new file with mode: 0644]
lib/rte/images/em.icon.wink.gif [new file with mode: 0644]
lib/rte/images/em.icon.wink.png [new file with mode: 0644]
lib/rte/images/hdr_tables.gif [new file with mode: 0644]
lib/rte/images/icon_about.gif [new file with mode: 0644]
lib/rte/images/icon_block.gif [new file with mode: 0644]
lib/rte/images/icon_bold.gif [new file with mode: 0644]
lib/rte/images/icon_bullist.gif [new file with mode: 0644]
lib/rte/images/icon_center.gif [new file with mode: 0644]
lib/rte/images/icon_color_fill.gif [new file with mode: 0644]
lib/rte/images/icon_color_text.gif [new file with mode: 0644]
lib/rte/images/icon_copy.gif [new file with mode: 0644]
lib/rte/images/icon_cut.gif [new file with mode: 0644]
lib/rte/images/icon_edt_table.gif [new file with mode: 0644]
lib/rte/images/icon_indent.gif [new file with mode: 0644]
lib/rte/images/icon_ins_char.gif [new file with mode: 0644]
lib/rte/images/icon_ins_image.gif [new file with mode: 0644]
lib/rte/images/icon_ins_link.gif [new file with mode: 0644]
lib/rte/images/icon_ins_sub.gif [new file with mode: 0644]
lib/rte/images/icon_ins_sup.gif [new file with mode: 0644]
lib/rte/images/icon_ins_table.gif [new file with mode: 0644]
lib/rte/images/icon_italic.gif [new file with mode: 0644]
lib/rte/images/icon_left.gif [new file with mode: 0644]
lib/rte/images/icon_numlist.gif [new file with mode: 0644]
lib/rte/images/icon_outdent.gif [new file with mode: 0644]
lib/rte/images/icon_paste.gif [new file with mode: 0644]
lib/rte/images/icon_post.gif [new file with mode: 0644]
lib/rte/images/icon_redo.gif [new file with mode: 0644]
lib/rte/images/icon_rem_formatting.gif [new file with mode: 0644]
lib/rte/images/icon_rem_link.gif [new file with mode: 0644]
lib/rte/images/icon_right.gif [new file with mode: 0644]
lib/rte/images/icon_rule.gif [new file with mode: 0644]
lib/rte/images/icon_select_all.gif [new file with mode: 0644]
lib/rte/images/icon_spell.gif [new file with mode: 0644]
lib/rte/images/icon_strikethrough.gif [new file with mode: 0644]
lib/rte/images/icon_underline.gif [new file with mode: 0644]
lib/rte/images/icon_undo.gif [new file with mode: 0644]
lib/rte/images/incr_colspan.gif [new file with mode: 0644]
lib/rte/images/incr_colspan_f2.gif [new file with mode: 0644]
lib/rte/images/incr_rowspan.gif [new file with mode: 0644]
lib/rte/images/incr_rowspan_f2.gif [new file with mode: 0644]
lib/rte/images/lang/de.icon_post.gif [new file with mode: 0644]
lib/rte/images/lang/no.icon_post.gif [new file with mode: 0644]
lib/rte/images/minimize.gif [new file with mode: 0644]
lib/rte/images/plt_ftr.gif [new file with mode: 0644]
lib/rte/images/plt_hdr.gif [new file with mode: 0644]
lib/rte/images/rmv_col.gif [new file with mode: 0644]
lib/rte/images/rmv_col_f2.gif [new file with mode: 0644]
lib/rte/images/rmv_colspan.gif [new file with mode: 0644]
lib/rte/images/rmv_colspan_f2.gif [new file with mode: 0644]
lib/rte/images/rmv_row.gif [new file with mode: 0644]
lib/rte/images/rmv_row_f2.gif [new file with mode: 0644]
lib/rte/images/rmv_rowspan.gif [new file with mode: 0644]
lib/rte/images/rmv_rowspan_f2.gif [new file with mode: 0644]
lib/rte/images/spacer.gif [new file with mode: 0644]
lib/rte/images/toolbar.gif [new file with mode: 0644]
lib/rte/license.html [new file with mode: 0644]
lib/rte/license.txt [new file with mode: 0644]
lib/rte/popup_editor.html [new file with mode: 0644]
lib/rte/readme.txt [new file with mode: 0644]
lib/rte/richedit.css [new file with mode: 0644]
lib/rte/richedit.html [new file with mode: 0644]
lib/rte/rte.js [new file with mode: 0644]
lib/rte/rte_codesweep.js [new file with mode: 0644]
lib/rte/rte_debug.js [new file with mode: 0644]
lib/rte/rte_dunno.css [new file with mode: 0644]
lib/rte/rte_editmode.js [new file with mode: 0644]
lib/rte/rte_history.js [new file with mode: 0644]
lib/rte/rte_interface.js [new file with mode: 0644]
lib/rte/rte_lang.js [new file with mode: 0644]
lib/rte/rte_xhtml.js [new file with mode: 0644]
lib/rte/syntax.css [new file with mode: 0644]
lib/rte/tableEditor.js [new file with mode: 0644]

diff --git a/lib/rte/README_MOODLE b/lib/rte/README_MOODLE
new file mode 100644 (file)
index 0000000..9087121
--- /dev/null
@@ -0,0 +1,4 @@
+This version of the Richtext editor started out as 0.3 beta 1,
+and I've hacked richedit.html to make the toolbars more compact.
+
+Martin Dougiamas, 10/10/2002
diff --git a/lib/rte/_header_css.txt b/lib/rte/_header_css.txt
new file mode 100644 (file)
index 0000000..02e2263
--- /dev/null
@@ -0,0 +1,46 @@
+/*******************************************************************************\r
+**\r
+** $Header$\r
+**\r
+** HTML Text Editing Component for hosting in Web Pages\r
+** Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+** \r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+**\r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+** Lesser General Public License for more details.\r
+**\r
+** You should have received a copy of the GNU LesserGeneral Public License\r
+** along with this program; if not a copy can be obtained from \r
+**\r
+**    http://www.gnu.org/copyleft/lesser.html\r
+**\r
+** or by writing to:\r
+**\r
+**    Free Software Foundation, Inc.\r
+**    59 Temple Place - Suite 330,\r
+**    Boston,\r
+**    MA  02111-1307,\r
+**    USA.\r
+** \r
+** Original Developer:\r
+**\r
+**     Austin David France\r
+**     Ramesys (Contracting Services) Limited\r
+**     Mentor House\r
+**     Ainsworth Street\r
+**     Blackburn\r
+**     Lancashire\r
+**     BB1 6AY\r
+**     United Kingdom\r
+**  email: Austin.France@Ramesys.com\r
+**\r
+** Home Page:    http://richtext.sourceforge.net/\r
+** Support:      http://richtext.sourceforge.net/\r
+** \r
+*******************************************************************************/\r
diff --git a/lib/rte/_header_html.txt b/lib/rte/_header_html.txt
new file mode 100644 (file)
index 0000000..87dbcc2
--- /dev/null
@@ -0,0 +1,48 @@
+<!--\r
+################################################################################\r
+##\r
+## $Header%\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+## \r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from \r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+## \r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+## \r
+################################################################################\r
+-->\r
diff --git a/lib/rte/_header_js.txt b/lib/rte/_header_js.txt
new file mode 100644 (file)
index 0000000..ff94710
--- /dev/null
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// $Header$\r
+//\r
+// HTML Text Editing Component for hosting in Web Pages\r
+// Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+// \r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License, or (at your option) any later version.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU LesserGeneral Public License\r
+// along with this program; if not a copy can be obtained from \r
+//\r
+//    http://www.gnu.org/copyleft/lesser.html\r
+//\r
+// or by writing to:\r
+//\r
+//    Free Software Foundation, Inc.\r
+//    59 Temple Place - Suite 330,\r
+//    Boston,\r
+//    MA  02111-1307,\r
+//    USA.\r
+// \r
+// Original Developer:\r
+//\r
+//     Austin David France\r
+//     Ramesys (Contracting Services) Limited\r
+//     Mentor House\r
+//     Ainsworth Street\r
+//     Blackburn\r
+//     Lancashire\r
+//     BB1 6AY\r
+//     United Kingdom\r
+//  email: Austin.France@Ramesys.com\r
+//\r
+// Home Page:    http://richtext.sourceforge.net/\r
+// Support:      http://richtext.sourceforge.net/\r
+// \r
+////////////////////////////////////////////////////////////////////////////////\r
diff --git a/lib/rte/about_logo.swf b/lib/rte/about_logo.swf
new file mode 100644 (file)
index 0000000..d849cea
Binary files /dev/null and b/lib/rte/about_logo.swf differ
diff --git a/lib/rte/about_logo.swi b/lib/rte/about_logo.swi
new file mode 100644 (file)
index 0000000..a741b7c
Binary files /dev/null and b/lib/rte/about_logo.swi differ
diff --git a/lib/rte/changelog b/lib/rte/changelog
new file mode 100644 (file)
index 0000000..2fec2ef
--- /dev/null
@@ -0,0 +1,90 @@
+Version DEV\r
+\r
+- Added multi-lingual support.  The editor detects the userLanguage\r
+  of the browser and uses this select the relevent language from the\r
+  new rte_lang.js module which is then applied to the main editor\r
+  window.  This is a work in progress, dialog need translation also.\r
+\r
+- Re-implemented Undo/Redo (history) option this time using the\r
+  document.execCommand('Undo'/'Redo') options which although \r
+  documented as not implemented do work in IE 6.0.\r
+\r
+Version 0.2.3\r
+\r
+- Improved option handling to maintain an array of options that are\r
+  not "features" and added a getOption() private method to obtain\r
+  the current option value.\r
+\r
+- The saveHistory() function is now a no-op if the history option is\r
+  not enabled.  Previously it was still doing all the buffer saving\r
+  behind the scenes.  This should improve the performance of the\r
+  editor.\r
+\r
+- Corrected version and company information in the about dialog.\r
+\r
+- Remove showHistory() status (debug) messages\r
+\r
+- After set editor options, apply them.  In most circumstances the\r
+  options property is set after the editor has initialised and so\r
+  the options need to be processed as the options are set not\r
+  when the editor is initialised.\r
+\r
+- Added numerous options:\r
+    styleBar=yes|no      default yes\r
+    style=yes|no         default yes\r
+    font=yes|no          default yes\r
+    fontSize=yes|no      default yes\r
+    colour=yes|no        default yes\r
+    dragdrop=yes|no      default no\r
+\r
+- Added code to disable drag and drop in the editor.  Previously\r
+  it was possible to drag a toolbar button and drop a copy of it\r
+  into the editor window.  Now, nothing can be dragged from the\r
+  toolbar and nothing can be dropped into the editor window.\r
+  This does not disable any functionality because the editor\r
+  window did not act as a drop target for objects from outside\r
+  of the IE control.  It was however possible to drag elements\r
+  from one page and drop them into the editor, this is now not\r
+  possible unless dragdrop=yes is specified.  However, the \r
+  dragdrop handling is weak (non-existent) and so is disabled\r
+  by default.\r
+\r
+- Some minor cosmetic changes to the toolbar.\r
+\r
+- Added debug window functionality to aid development and support\r
+  of the editor.  Over time, diagnostic debugs will be added to\r
+  the editor code.\r
+\r
+- Default edit area to not editable (effectivly disabled) until\r
+  inisialisation of the editor is complete.\r
+\r
+- Added Full Justify Option\r
+\r
+- Re-worked font color/back color resetting (color none) so that\r
+  a) it worked and b) it only removes the fore/background color\r
+  and preserves the other formatting that bit of text may have.\r
+\r
+- Disable post button when in view source mode.  The post button\r
+  is greyed out whilst disabled.\r
+\r
+Version 0.2.2\r
+=============\r
+- Disabled buggy history and view source options by default in preparation \r
+  for official 0.2 release (to be officially released in a later release).\r
+\r
+- Added editor.options property to allow optional functionality to be \r
+  enabled/disabled. \r
\r
+Version 0.2.1\r
+=============\r
+- Corrected a bug in test_embedded.asp (JavaScript error).\r
\r
+Version 0.2.0\r
+=============\r
+- Added support for Custom Fields\r
+- Beta versions of undo-history and view source options added\r
\r
+Version 0.1\r
+===========\r
+- Original release of The Richtext Editor  \r
+\r
diff --git a/lib/rte/colorchooser.html b/lib/rte/colorchooser.html
new file mode 100644 (file)
index 0000000..be388e8
--- /dev/null
@@ -0,0 +1,178 @@
+<!--\r
+#################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+## \r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from \r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+## \r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+## \r
+## BC  Bill Chalmers   bill_paula@btinternet.com\r
+##\r
+## History:\r
+##\r
+##      BC             15-07-2002      \r
+##                     Changed the font selection to web-safe palette \r
+##                     and removed the style on hover\r
+##\r
+##     BC              24-07-2002\r
+##                     Small Enhancement to the look and feel\r
+#################################################################################\r
+-->\r
+<html>\r
+<head>\r
+<meta name=vs_targetSchema content="HTML 4.0">\r
+<meta name="GENERATOR" content="Microsoft Visual Studio 7.0">\r
+<style type="text/css">\r
+TABLE.colorChooser { background-color: buttonface; border:0}\r
+.colorChooser TD { border: 1px inset buttonface; cursor: hand; }\r
+.colorChooserLabel TD { width: 100%; border: 0;\r
+       font-family: "MS Sans Serif"; font-size: xx-small; vertical-align: middle;\r
+}\r
+TD.colorNone { font-family: "MS Sans Serif"; font-size: xx-small; vertical-align: middle; \r
+                               text-align: center; border: 1px outset buttonface!important; }\r
+</style>\r
+</head>\r
+\r
+<body topmargin="0" leftmargin="0" style="border: 0; margin: 0;" onload="initialise()">\r
+<script language="JavaScript">\r
+var public_description = new ColorMenu();\r
+\r
+function ColorMenu() {\r
+}\r
+\r
+function initialise(){\r
+c=main.insertCell(); //insert cell & set porperties\r
+c.id ="display"; \r
+c.rowSpan="3"; \r
+c.colSpan="6";\r
+}\r
+\r
+function hover(on) {\r
+       var el = window.event.srcElement;\r
+       var disp = document.getElementById("display"); //get display cell\r
+       if (el && el.nodeName == "IMG") {\r
+               if (on) {\r
+                       disp.bgColor=el.parentElement.title; //set display cell bgcolor to hovered\r
+                       // removed the style on hover as too slow\r
+                               } \r
+                                                                       }\r
+}\r
+function choose(on) {\r
+       var el = window.event.srcElement;\r
+       if (el && el.nodeName == "IMG") {\r
+               window.external.raiseEvent("onselect", el.parentElement.title);\r
+                       }\r
+       if (el && el.nodeName == "TD") {\r
+               window.external.raiseEvent("onselect", null);\r
+       }\r
+}\r
+\r
+</script>\r
+<table class="colorChooser" cellpadding="0" cellspacing="0" onmouseover="hover(true)" onmouseout="hover(false)" onclick="choose()">\r
+<tr id="main" class="colorChooserLabel"> \r
+    <td colspan="12">Standard Colors</td>\r
+  </tr>\r
+<tr>\r
+    <td bgcolor="#000000" title="#000000"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#333333" title="#333333"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#666666" title="#666666"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#999999" title="#999999"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#CCCCCC" title="#CCCCCC"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#FFFFFF" title="#FFFFFF"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#FF0000" title="#FF0000"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#00FF00" title="#00FF00"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#0000FF" title="#0000FF"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#FFFF00" title="#FFFF00"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#00FFFF" title="#00FFFF"><img src="spacer.gif" width="12" height="12"></td>\r
+    <td bgcolor="#FF00FF" title="#FF00FF"><img src="spacer.gif" width="12" height="12"></td>\r
+</tr>\r
+<tr class="colorChooserLabel"><td colspan="12">Web Safe</td></tr>\r
+<tr>\r
+<script language=JavaScript>\r
+\r
+                               d = new Array();\r
+                               d[1] = "00";\r
+                               d[2] = "33";\r
+                               d[3] = "66";\r
+                               d[4] = "99";\r
+                               d[5] = "CC";\r
+                               d[6] = "FF";                            \r
+                               \r
+                                                               \r
+                               for (c=1;c<=6;c++){\r
+                                                                               \r
+                                       for (a=1;a<=3;a++){                                     \r
+                                                       \r
+                                               for (b=1;b<=6;b++){                                                     \r
+                                                       \r
+                                                       colour = d[a] + d[b] + d[c];\r
+                                                       \r
+                                                        document.write("<td bgcolor=\"#"+colour+"\" title=\"#"+colour+"\"><img src=\"images\\spacer.gif\" width=12 height=12></td>\n");\r
+                                                   if (a==3 && b==6){\r
+                                                       document.write("</tr>\n<tr>\n");\r
+                                                       }\r
+                                       \r
+                                               }\r
+                                       }\r
+                               }                               \r
+                                       for (c=1;c<=6;c++){\r
+                                                                               \r
+                                       for (a=4;a<=6;a++){                                     \r
+                                                       \r
+                                               for (b=1;b<=6;b++){                                                     \r
+                                                       \r
+                                                       colour = d[a] + d[b] + d[c];\r
+                                                       \r
+                                                        document.write("<td bgcolor=\"#"+colour+"\" title=\"#"+colour+"\"><img src=\"images\\spacer.gif\" width=12 height=12></td>\n");\r
+                                                   if (a==6 && b==6){\r
+                                                       document.write("</tr>\n<tr>\n");\r
+                                                       }\r
+                                       \r
+                                               }\r
+                                       }\r
+                               }\r
+                                       \r
+                               </script>\r
+                       \r
+                               \r
+</tr>\r
+<tr><td colspan="18" class="colorNone" title="None" align="right">None</td></tr>\r
+</table>\r
+</body>\r
+</html>\r
diff --git a/lib/rte/credits.html b/lib/rte/credits.html
new file mode 100644 (file)
index 0000000..0ae4c69
--- /dev/null
@@ -0,0 +1,104 @@
+<!--\r
+#################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+##\r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from\r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+##\r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+##\r
+#################################################################################\r
+-->\r
+<html>\r
+<head>\r
+<title>Acknowledgements</title>\r
+<style type="text/css">\r
+code { font-size: 8pt; font-family: "Andale Mono", "Courier New"}\r
+h1 { font-size: 240%; }\r
+b { font-size: 120%; }\r
+</style>\r
+<base target="_blank">\r
+</head>\r
+<body><center><code>\r
+<b>PROJECT MANAGER</b><br>\r
+<br>\r
+AUSTIN DAVID FRANCE<br>\r
+<a href="http://sourceforge.net/users/third_of_five/">http://sourceforge.net/users/third_of_five/</a><br>\r
+<br>\r
+<br>\r
+<b>LEAD PROGRAMMER</b><br>\r
+<br>\r
+AUSTIN DAVID FRANCE<br>\r
+<a href="http://sourceforge.net/users/third_of_five/">http://sourceforge.net/users/third_of_five/</a><br>\r
+<br>\r
+<br>\r
+<b>DEVELOPERS</b><br>\r
+<br>\r
+William R. Cook<br>\r
+<a href="http://sourceforge.net/users/wcook/">http://sourceforge.net/users/wcook/</a><br>\r
+<br>\r
+Bill Chalmers<br>\r
+<a href="http://sourceforge.net/users/bchalmers/">http://sourceforge.net/users/bchalmers/</a><br>\r
+<br>\r
+Leon Reinders<br>\r
+<a href="http://sourceforge.net/users/leonreinders/">http://sourceforge.net/users/leonreinders/</a><br>\r
+<br>\r
+Torbjørn Engedal<br>\r
+<a href="http://sourceforge.net/users/torbjoen/">http://sourceforge.net/users/torbjoen/</a><br>\r
+<br>\r
+Jan Seda<br>\r
+<a href="http://sourceforge.net/users/aramir/">http://sourceforge.net/users/aramir/</a><br>\r
+<br>\r
+Dave Otto<br>\r
+<a href="http://sourceforge.net/users/daveotto/">http://sourceforge.net/users/daveotto/</a><br>\r
+<br>\r
+<br>\r
+<b>RELEASE TECHNITIONS</b><br>\r
+<br>\r
+William R. Cook<br>\r
+<a href="http://sourceforge.net/users/wcook/">http://sourceforge.net/users/wcook/</a><br>\r
+<br>\r
+AUSTIN DAVID FRANCE<br>\r
+<a href="http://sourceforge.net/users/third_of_five/">http://sourceforge.net/users/third_of_five/</a><br>\r
+<br>\r
+<br>\r
+<b>DREAMWEAVER EXTENSION</b><br>\r
+<br>\r
+Bill Chalmers<br>\r
+<a href="http://sourceforge.net/users/bchalmers/">http://sourceforge.net/users/bchalmers/</a><br>\r
+</code></center></body></html>\r
diff --git a/lib/rte/custom.css b/lib/rte/custom.css
new file mode 100644 (file)
index 0000000..cdcb5d5
--- /dev/null
@@ -0,0 +1,47 @@
+/*******************************************************************************\r
+**\r
+** HTML Text Editing Component for hosting in Web Pages\r
+** Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+** \r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+**\r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+** Lesser General Public License for more details.\r
+**\r
+** You should have received a copy of the GNU LesserGeneral Public License\r
+** along with this program; if not a copy can be obtained from \r
+**\r
+**    http://www.gnu.org/copyleft/lesser.html\r
+**\r
+** or by writing to:\r
+**\r
+**    Free Software Foundation, Inc.\r
+**    59 Temple Place - Suite 330,\r
+**    Boston,\r
+**    MA  02111-1307,\r
+**    USA.\r
+** \r
+** Original Developer:\r
+**\r
+**     Austin David France\r
+**     Ramesys (Contracting Services) Limited\r
+**     Mentor House\r
+**     Ainsworth Street\r
+**     Blackburn\r
+**     Lancashire\r
+**     BB1 6AY\r
+**     United Kingdom\r
+**  email: Austin.France@Ramesys.com\r
+**\r
+** Home Page:    http://richtext.sourceforge.net/\r
+** Support:      http://richtext.sourceforge.net/\r
+** \r
+*******************************************************************************/\r
+\r
+.rebar #featureHistory { display: ; }  /* Change to display: none to disable history feature */\r
+.rebar #featureSource  { display: ; }  /* Change to display: none to disable source feature */
\ No newline at end of file
diff --git a/lib/rte/debug_embedded.asp b/lib/rte/debug_embedded.asp
new file mode 100644 (file)
index 0000000..01f7ba7
--- /dev/null
@@ -0,0 +1,148 @@
+<%@language="JavaScript"%>\r
+<!--\r
+#################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+##\r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from\r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+##\r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+##\r
+#################################################################################\r
+-->\r
+<%\r
+var strHTML = Request.Form("text").Item();\r
+if (strHTML)\r
+{\r
+    // Update your database here\r
+    // ...\r
+\r
+    // Confirmation\r
+    Response.Write("<P>Database Updated</P>");\r
+    Response.Write("<P>HTML:-<hr>" + Server.HTMLEncode(strHTML) + "</P>");\r
+    Response.End();\r
+}\r
+\r
+// Get your HTML from the datbase here\r
+strHTML = '<H1>Heading 1</H1>'\r
+               + '<H2>Heading 2</H2>'\r
+               + '<H3>Heading 3</H3>'\r
+               + '<P>Normal</P>'\r
+               + '<P>Welcome to the richtext text editor, the HTML text editor which works inside a web page.</P>'\r
+               + '<P>This is <a href="http://www.bakedbeanandtomatosoup.co.uk/">Link</a>'\r
+       ;\r
+%>\r
+<HTML>\r
+<HEAD>\r
+<TITLE>Edit Text</TITLE>\r
+<META content="HTML 4.0" name=vs_targetSchema />\r
+<META content="Microsoft FrontPage 4.0" name=GENERATOR />\r
+</HEAD>\r
+<BODY leftMargin=0 topMargin=0 scroll="no" style="border:0">\r
+\r
+<object id="richedit" style="BACKGROUND-COLOR: buttonface" data="richedit.html"\r
+width="100%" height="75%" type="text/x-scriptlet" VIEWASTEXT>\r
+       </object>\r
+<div id="debug">\r
+</div>\r
+\r
+<form id="theForm" method="post">\r
+<textarea name="text" style="display:none" rows="1" cols="20"><%=strHTML%></textarea>\r
+</form>\r
+\r
+<SCRIPT language="JavaScript" event="onload" for="window">\r
+       var win = window.open('about:debugWindow',\r
+                                               '_blank',\r
+                                               'width=1,height=1,top=-100,left=-100,resizable=yes,scrollbars=yes,status=no,menubar=no,toolbar=no,location=no'\r
+                                               );\r
+       win.document.write('<html>'\r
+                                               + '<head>'\r
+                                               + '<title>Editor Debug Window</title>'\r
+                                               + '<style type="text/css">'\r
+                                               + 'div#debug {'\r
+                                                       + 'border: 1px inset activeborder;'\r
+                                                       + 'overflow: auto;'\r
+                                                       + 'font-family: "Lucida Sans Unicode", "Verdana", "Arial";'\r
+                                                       + 'height: 100%;'\r
+                                               + '}'\r
+                                               + 'div#debug td {'\r
+                                                       + 'font-size: 8pt;'\r
+                                                       + 'vertical-align: top;'\r
+                                               + '}'\r
+                                               + 'div#debug th {'\r
+                                                       + 'font-size: 8pt;'\r
+                                                       + 'text-align: left;'\r
+                                                       + 'color: white;'\r
+                                                       + 'background-color: activecaption;'\r
+                                               + '}'\r
+                                               + '</style>'\r
+                                               + '</head>'\r
+                                               + '<body topmargin="0" leftmargin="0">'\r
+                                               + '<table width="100%" height="100%">'\r
+                                               + '<tr><td valign="top" width="100%" height="100%"><div id="debug">'\r
+                                               + '</div></td></tr>'\r
+                                               + '<tr valign="bottom"><td align="right">'\r
+                                                       + '<input type="button" value="close" onclick="window.close()" />'\r
+                                                       + '</td></tr>'\r
+                                               + '</table>'\r
+                                               + '</body>'\r
+                                               + '<s'+'cript>'\r
+                                               + 'var w = window.screen.availWidth/4, h = window.screen.availHeight/2;'\r
+                                               + 'window.resizeTo(w,h);'\r
+                                               + 'window.moveTo((window.screen.availWidth-w)/8,(window.screen.availHeight-h)/4);'\r
+                                               + '</sc'+'ript>'\r
+                                               + '</html>'\r
+                                       );\r
+       richedit.debugWindow = win.document.all("debug");\r
+       richedit.options = "history=no;source=yes";\r
+       richedit.addField("to", "To", 128, "someone@somewhere.com");\r
+       richedit.addField("cc", "Cc", 128, "someone@else.com");\r
+       richedit.addField("subject", "Subject", 128, "Something about Nothing");\r
+       richedit.docHtml = theForm.text.innerText;\r
+</SCRIPT>\r
+\r
+<SCRIPT language="JavaScript" event="onscriptletevent(name, eventData)" for="richedit">\r
+    if (name == "post") {\r
+       richedit.getValue("subject");\r
+        theForm.text.value = eventData;\r
+        theForm.submit();\r
+    }\r
+</SCRIPT>\r
+\r
+</BODY>\r
+</HTML>\r
diff --git a/lib/rte/dialog.css b/lib/rte/dialog.css
new file mode 100644 (file)
index 0000000..3e90ef6
--- /dev/null
@@ -0,0 +1,54 @@
+/*******************************************************************************\r
+**\r
+** HTML Text Editing Component for hosting in Web Pages\r
+** Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+** \r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+**\r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+** Lesser General Public License for more details.\r
+**\r
+** You should have received a copy of the GNU LesserGeneral Public License\r
+** along with this program; if not a copy can be obtained from \r
+**\r
+**    http://www.gnu.org/copyleft/lesser.html\r
+**\r
+** or by writing to:\r
+**\r
+**    Free Software Foundation, Inc.\r
+**    59 Temple Place - Suite 330,\r
+**    Boston,\r
+**    MA  02111-1307,\r
+**    USA.\r
+** \r
+** Original Developer:\r
+**\r
+**     Austin David France\r
+**     Ramesys (Contracting Services) Limited\r
+**     Mentor House\r
+**     Ainsworth Street\r
+**     Blackburn\r
+**     Lancashire\r
+**     BB1 6AY\r
+**     United Kingdom\r
+**  email: Austin.France@Ramesys.com\r
+**\r
+** Home Page:    http://richtext.sourceforge.net/\r
+** Support:      http://richtext.sourceforge.net/\r
+** \r
+*******************************************************************************/\r
+\r
+BODY { background-color: buttonface; }\r
+TD, INPUT, SELECT { font-family: "MS Sans Serif"; font-size: xx-small; vertical-align: middle; }\r
+TABLE.dlg { border:0; }\r
+.dlg TD { align: left; height: 20; }\r
+.dlg INPUT { border-size: 2px; }\r
+INPUT.button { border-top: 1px solid white; border-left: 1px solid white;\r
+border-bottom: 1px solid black; border-right: 1px solid black;\r
+font-size: x-small; width: 60; }\r
+SELECT { height: 75%; }\r
diff --git a/lib/rte/dlg_about.html b/lib/rte/dlg_about.html
new file mode 100644 (file)
index 0000000..ac068eb
--- /dev/null
@@ -0,0 +1,86 @@
+<!--\r
+#################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+##\r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from\r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+##\r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+##\r
+#################################################################################\r
+-->\r
+<html>\r
+<head>\r
+<meta name=vs_targetSchema content="HTML 4.0">\r
+<meta name="GENERATOR" content="Microsoft Visual Studio 7.0">\r
+<LINK rel="stylesheet" type="text/css" href="dialog.css">\r
+<title>About Richtext Editor</title>\r
+</head>\r
+\r
+<body topmargin="0" leftmargin="0" style="border: 0; margin: 0;" scroll="no">\r
+<table class="dlg" cellpadding="1" cellspacing="0" border="0">\r
+<tr><td rowspan="10" width="2">&nbsp;</td>\r
+       <td colspan="2" height="12"><table cellspacing="0"><tr><td valign="middle"><hr width="10"></td><td nowrap>&nbsp;<b>Richtext Editor</b>&nbsp;</td><td valign="middle" width="100%"><hr width="100%"></td><td nowrap>&nbsp;<b>Version rt-0.3.0-beta-1</b>&nbsp;</td><td valign="middle"><hr width="10"></td></tr></table></td></tr>\r
+<tr><td rowspan="4" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\r
+  codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"\r
+  id="about_logo" width="64" height="64">\r
+  <param name="movie" value="about_logo.swf">\r
+  <param name="quality" value="high">\r
+  <param name="wmode" value="transparent">\r
+  <param name="bgcolor" value="#BBBBBB">\r
+  <embed name="about_logo" src="about_logo.swf" quality="high" bgcolor="#FFFFFF"\r
+    width="64" height="64"\r
+    type="application/x-shockwave-flash"\r
+    pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">\r
+  </embed>\r
+</object></td>\r
+       <td height="12">Copyright &copy; 2001-2002, <a href="http://www.cs.ramesys.com/" target="_blank" hidefocus>Ramesys Construction Services</A></td></tr>\r
+<tr><td height="12"><a href="http://richtext.sourceforge.net" target="_blank" hidefocus>http://richtext.sourceforge.net/</a></td></tr>\r
+<tr><td height="12"></td></tr>\r
+<tr><td height="12"></td></tr>\r
+<tr><td colspan="2" height="12">Acknowledgments:</td></tr>\r
+<tr><td colspan="2" height="100"><iframe style="margin: 0; padding: 0" src="credits.html" width="485" height="100"></iframe></td></tr>\r
+<tr><td colspan="2" height="12">License Agreement:</td></tr>\r
+<tr><td colspan="2" height="100"><iframe style="margin: 0; padding: 0" src="license.html" width="485" height="100"></iframe></td></tr>\r
+<tr>\r
+ <td><td colspan="2" height="28" align="right" valign="middle">\r
+       <input class="button" type="button" value="Close" title="Close Dialog" onclick="self.close()"></td>\r
+</tr>\r
+</table>\r
+</body>\r
+</html>\r
diff --git a/lib/rte/dlg_ins_char.html b/lib/rte/dlg_ins_char.html
new file mode 100644 (file)
index 0000000..1c324e2
--- /dev/null
@@ -0,0 +1,150 @@
+<!--\r
+################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+##\r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from\r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+##\r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+##\r
+################################################################################\r
+-->\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\r
+\r
+<html>\r
+<head>\r
+<style type="text/css">\r
+       BODY {\r
+               background-color: buttonface;\r
+       }\r
+       TD, INPUT {\r
+               font-family: "Sans Serif";\r
+               font-size: x-small;\r
+               vertical-align: middle;\r
+               cursor: hand;\r
+       }\r
+       TD.HOVER{\r
+               background-color : Fuchsia;\r
+       }\r
+\r
+\r
+       .dlg TD {\r
+               align: left;\r
+               height: 20;\r
+\r
+       }\r
+\r
+       .dlg INPUT {\r
+               border-top: 1px solid white;\r
+               border-left: 1px solid white;\r
+               border-bottom: 1px solid black;\r
+               border-right: 1px solid black;\r
+               font-size: x-small;\r
+               width: 60; }\r
+</style>\r
+<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">\r
+<!--\r
+var chars = ["!","&quot;","#","$","%","&","'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&lt;","=","&gt;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","&euro;","\83","\84","\85","\86","\87","\88","\\89","\8a","\8b","\8c","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","\95","&ndash;","&mdash;","\98","\99","\9a","\9b","\9c","\9f","&iexcl;","&cent;","&pound;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","­","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;"]\r
+\r
+function tab(w,h) {\r
+       var strtab = ["<TABLE border='1' cellspacing='0' cellpadding='0' align='center' bordercolor='#dcdcdc' bgcolor='#C0C0C0'>"]\r
+       var k = 0;\r
+       for(var i = 0; i < w; i++) {\r
+               strtab[strtab.length] = "<TR>";\r
+               for(var j = 0; j < h; j++) {\r
+                       strtab[strtab.length] = "<TD width='14' align='center' onClick='getchar(this)' onMouseOver='hover(this,true)' onMouseOut='hover(this,false)'>"+(chars[k]||'')+"</TD>";\r
+                       k++;\r
+               }\r
+               strtab[strtab.length]="</TR>";\r
+       }\r
+       strtab[strtab.length] = "</TABLE>";\r
+       return strtab.join("\n");\r
+}\r
+\r
+function hover(obj,val) {\r
+       if (!obj.innerHTML) {\r
+               obj.style.cursor = "default";\r
+               return;\r
+       }\r
+       obj.style.border = val ? "1px solid black" : "1px solid #dcdcdc";\r
+       //obj.style.backgroundColor = val ? "black" : "#C0C0C0"\r
+       //obj.style.color = val ? "white" : "black";\r
+}\r
+function getchar(obj) {\r
+       if(!obj.innerHTML) return;\r
+       window.returnValue = obj.innerHTML || "";\r
+       window.close();\r
+}\r
+function cancel() {\r
+       window.returnValue = null;\r
+       window.close();\r
+}\r
+//-->\r
+</SCRIPT>\r
+<title>Insert Character</title>\r
+</head>\r
+\r
+<body>\r
+<table class="dlg" cellpadding="0" cellspacing="2" width="100%" height="100%">\r
+<tr><td><table width="100%"><tr><td nowrap>Choose Character</td><td valign="middle" width="100%"><hr width="100%"></td></tr></table></td></tr>\r
+<tr>\r
+<td>\r
+    <table border="0" align="center" cellpadding="5">\r
+      <tr valign="top">\r
+        <td>\r
+\r
+       <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">\r
+       <!--\r
+       document.write(tab(7,32))\r
+       //-->\r
+       </SCRIPT>\r
+\r
+        </td>\r
+      </tr>\r
+    </table>\r
+\r
+    </td>\r
+  </tr>\r
+<tr><td><table width="100%"><tr><td valign="middle" width="90%"><hr width="100%"></td></tr></table></td></tr>\r
+<tr><td align="right">\r
+       <input type="button" value="Close" onclick="cancel()"></td></tr>\r
+</table>\r
+\r
+\r
+</body>\r
+</html>\r
diff --git a/lib/rte/dlg_ins_image.html b/lib/rte/dlg_ins_image.html
new file mode 100644 (file)
index 0000000..451decd
--- /dev/null
@@ -0,0 +1,196 @@
+<!--\r
+#################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+##\r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from\r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+##\r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+##\r
+#################################################################################\r
+## Authors & Contributers:\r
+##\r
+##      BC             Bill Chalmers           [bill_paula@btinternet.com]\r
+##                      Font Selection\r
+##\r
+## History:\r
+##\r
+##   BC      24-07-2002\r
+##         Billy fixed the bug relating to picking up the current image\r
+##         I fixed a small bug as a result of the above fix, nothing wrong\r
+##         with billys code, if statment evaluated to true even though it shouldn't\r
+##         also fixed the border attribute not being applied on insert of image\r
+##         and picking up all the properties of an image being edited.\r
+#################################################################################\r
+-->\r
+<html>\r
+<head>\r
+<meta name=vs_targetSchema content="HTML 4.0">\r
+<meta name="GENERATOR" content="Microsoft Visual Studio 7.0">\r
+<LINK rel="stylesheet" type="text/css" href="dialog.css">\r
+<script language="JavaScript">\r
+function attr(name, value) {\r
+       if (!value || value == "") return "";\r
+       return ' ' + name + '="' + value + '"';\r
+}\r
+function insertImage() {\r
+       window.returnValue = '<IMG' + attr("alt", alt.value) + attr("src", url.value)\r
+                                                       + attr("align", align[align.selectedIndex].value)\r
+                                                       + ((width.value)?attr("width", width.value):"")\r
+                                                       + ((height.value)?attr("height", height.value):"")\r
+                                                       + ((vspace.value)?attr("vspace", vspace.value):"")\r
+                                                       + ((hspace.value)?attr("hspace", hspace.value):"")\r
+                                                       + ((border.value)?attr("border", border.value):attr("border",0))\r
+                                                       + '/>';\r
+       window.close();\r
+}\r
+function cancel() {\r
+       window.returnValue = null;\r
+       window.close();\r
+}\r
+\r
+\r
+function setDefaults() {\r
+   if (dialogArguments.RichEditor.selectedImage != null) {\r
+      image = dialogArguments.RichEditor.selectedImage;\r
+      editmode = true;\r
+      fm = document.forms[0];\r
+      if (image.src)\r
+                url.value = image.src\r
+         if  (image.alt)\r
+                alt.value = image.alt\r
+         if (image.width)\r
+         width.value = image.width\r
+      if (image.height)\r
+         height.value = image.height\r
+      if (image.vspace)\r
+         vspace.value = image.vspace\r
+      if (image.hspace)\r
+         hspace.value = image.hspace\r
+      if (image.border)\r
+         border.value = image.border\r
+      if (image.align) {\r
+         for (var i = 0; i < align.options.length; i++) {\r
+            if (align.options[i].value == image.align) {\r
+               align.options[i].selected = true;\r
+               break;\r
+            }\r
+         }        \r
+      }\r
+   }\r
+}\r
+\r
+function updateImage() {\r
+   image.width = width.value;\r
+   image.height = height.value;\r
+   image.vspace = vspace.value;\r
+   image.hspace = hspace.value;\r
+   image.border = border.value;\r
+   image.align = align.options[ align.selectedIndex ].value;\r
+   window.returnValue = null\r
+   window.close();\r
+}\r
+\r
+var image = null     // selected image if there is one\r
+\r
+// we need to set \r
+var editmode = false // are we editing an image?\r
+if (dialogArguments.RichEditor.selectedImage != null) {\r
+   editmode = true;\r
+   document.write("<title>Edit Image</title>");\r
+} else {\r
+   document.write("<title>Insert Image</title>");\r
+\r
+}\r
+\r
+</script>\r
+\r
+</head>\r
+\r
+<body topmargin="0" leftmargin="0" style="border: 0; margin: 0;" scroll="no" onLoad="setDefaults()">\r
+<table class="dlg" cellpadding="0" cellspacing="2" width="100%" height="100%">\r
+<tr><td colspan="5"><table width="100%"><tr><td nowrap>Picture Info&nbsp;</td><td valign="middle" width="100%"><hr width="100%"></td></tr></table></td></tr>\r
+<tr>\r
+ <td width="10">&nbsp;</td>\r
+ <td width="70">Url:</td><td valign="middle" colspan="3"><input type="text" name="url" value="images/em.icon.smile.gif" size="60"></td>\r
+</tr>\r
+<tr>\r
+ <td height="10">&nbsp;</td>\r
+ <td width="70">Alt Text:</td><td valign="middle"><input type="text" name="alt" value="" size="25"></td>\r
+ <td width="70">Align:</td><td valign="middle">\r
+       <select name="align">\r
+               <option value="left">Left</option>\r
+               <option value="absBottom">Abs Bottom</option>\r
+               <option value="absMiddle">Abs Middle</option>\r
+               <option value="baseline">Baseline</option>\r
+               <option value="bottom">Bottom</option>\r
+               <option value="middle">Middle</option>\r
+               <option value="right">Right</option>\r
+               <option value="textTop">Text Top</option>\r
+               <option value="top">Top</option>\r
+       </select></td>\r
+</tr>\r
+ <td>&nbsp;</td>\r
+ <td colspan="4" align="center" valign="top">\r
+ <table width="300" border="0" align="left"><tr>\r
+ <td width="70">Border:</td><td> <input type="text" name="border" value="0" size="2"></td>\r
+ <td width="70">Width:</td><td valign="middle"><input type="text" name="width" value="" size="3"></td>\r
+ <td width="70">Height:</td><td valign="middle"><input type="text" name="height" value="" size="3"></td>\r
+ <td width="70">Vspace:</td><td valign="middle"><input type="text" name="vspace" value="0" size="2"></td>\r
+ <td width="70">Hspace:</td><td valign="middle"><input type="text" name="hspace" value="0" size="2"></td>\r
+ </tr></table>\r
+ </td>\r
+\r
+\r
+</tr>\r
+<tr><td colspan="5"><table width="100%"><tr><td valign="middle" width="100%" colspan="2"><hr width="100%"></td></tr></table></td></tr>\r
+<tr>\r
+ <td>&nbsp;</td>\r
+ <td><td colspan="4" align="right">\r
+<script language="JavaScript">\r
+if (editmode) {\r
+   document.write("<input class=\"button\" type=\"button\" value=\"Update\" title=\"Update Image\" onclick=\"updateImage()\">");\r
+} else {\r
+   document.write("<input class=\"button\" type=\"button\" value=\"Insert\" title=\"Insert Image\" onclick=\"insertImage()\">");\r
+}\r
+</script>\r
+<input class="button" type="button" value="Cancel" title="Cancel Dialog" onclick="cancel()"></td>\r
+</tr>\r
+</table>\r
+</body>\r
+</html>\r
diff --git a/lib/rte/dlg_ins_smile.html b/lib/rte/dlg_ins_smile.html
new file mode 100644 (file)
index 0000000..f9ee78f
--- /dev/null
@@ -0,0 +1,198 @@
+<!--\r
+#################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+##\r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from\r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+##\r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+##\r
+#################################################################################\r
+-->\r
+<html>\r
+<head>\r
+<meta name=vs_targetSchema content="HTML 4.0">\r
+<meta name="GENERATOR" content="Microsoft Visual Studio 7.0">\r
+<LINK rel="stylesheet" type="text/css" href="dialog.css">\r
+<title>Insert Smily</title>\r
+<script language="JavaScript">\r
+function attr(name, value) {\r
+       if (!value || value == "") return "";\r
+       return ' ' + name + '="' + value + '"';\r
+}\r
+function insert() {\r
+       var img = window.event.srcElement;\r
+       if (img) {\r
+                       var src = img.src.replace(/^[a-z]*:[/][/][^/]*/, "");\r
+                       window.returnValue = '<IMG border="0" align="absmiddle" src="' + src + '">';\r
+                       window.close();\r
+       }\r
+}\r
+function cancel() {\r
+       window.returnValue = null;\r
+       window.close();\r
+}\r
+</script>\r
+</head>\r
+\r
+<body topmargin="0" leftmargin="0" style="border: 0; margin: 0;" scroll="no">\r
+<table class="dlg" cellpadding="0" cellspacing="2" width="100%" height="100%">\r
+<tr><td><table width="100%"><tr><td nowrap>Choose Smily</td><td valign="middle" width="100%"><hr width="100%"></td></tr></table></td></tr>\r
+<tr>\r
+<td>\r
+    <table border="0" align="center" cellpadding="5">\r
+      <tr valign="top">\r
+        <td>\r
+        <table border="0" align="center">\r
+          <tr>\r
+            <td><img border="0" hspace="10" src="images/em.icon.smile.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>smile</td>\r
+            <td>[:)]</td>\r
+          </tr>\r
+          <tr>\r
+            <td><img alt border="0" hspace="10" src="images/em.icon.bigsmile.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>big smile</td>\r
+            <td>[:D]</td>\r
+          </tr>\r
+          <tr>\r
+            <td><img alt border="0" hspace="10" src="images/em.icon.cool.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>cool</td>\r
+            <td>[8D]</td>\r
+          </tr>\r
+          <tr>\r
+            <td><img alt border="0" hspace="10" src="images/em.icon.blush.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>blush</td>\r
+            <td>[:I]</td>\r
+          </tr>\r
+          <tr>\r
+            <td><img alt border="0" hspace="10" src="images/em.icon.tongue.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>tongue</td>\r
+            <td>[:P]</td>\r
+         </tr>\r
+          <tr>\r
+            <td><img alt border="0" hspace="10" src="images/em.icon.evil.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>evil</td>\r
+            <td>[}:)]</td>\r
+          </tr>\r
+          <tr>\r
+            <td><img alt border="0" hspace="10" src="images/em.icon.wink.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>wink</td>\r
+            <td>[;)]</td>\r
+          </tr>\r
+          <tr>\r
+            <td><img alt border="0" hspace="10" src="images/em.icon.clown.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>clown</td>\r
+            <td>[:o)]</td>\r
+          </tr>\r
+          <tr>\r
+            <td><img alt border="0" hspace="10" src="images/em.icon.blackeye.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>black eye</td>\r
+            <td>[B)]</td>\r
+          </tr>\r
+          <tr>\r
+            <td><img alt border="0" hspace="10" src="images/em.icon.eightball.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>eightball</td>\r
+            <td>[8]</td>\r
+          </tr>\r
+        </table>\r
+        </td>\r
+        <td>\r
+        <table border="0" align="center">\r
+            <tr>\r
+              <td><img alt border="0" hspace="10" src="images/em.icon.sad.gif" onclick="insert()" width="15" height="15"></td>\r
+              <td>frown</td>\r
+              <td>[:(]</td>\r
+            </tr>\r
+            <tr>\r
+              <td><img alt border="0" hspace="10" src="images/em.icon.shy.gif" onclick="insert()" width="15" height="15"></td>\r
+              <td>shy</td>\r
+              <td>[8)]</td>\r
+            </tr>\r
+            <tr>\r
+              <td><img alt border="0" hspace="10" src="images/em.icon.shocked.gif" onclick="insert()" width="15" height="15"></td>\r
+              <td>shocked</td>\r
+              <td>[:O]</td>\r
+            </tr>\r
+            <tr>\r
+              <td><img alt border="0" hspace="10" src="images/em.icon.angry.gif" onclick="insert()" width="15" height="15"></td>\r
+              <td>angry</td>\r
+              <td>[:(!]</td>\r
+            </tr>\r
+            <tr>\r
+              <td><img alt border="0" hspace="10" src="images/em.icon.dead.gif" onclick="insert()" width="15" height="15"></td>\r
+              <td>dead</td>\r
+              <td>[xx(]</td>\r
+            </tr>\r
+            <tr>\r
+              <td><img alt border="0" hspace="10" src="images/em.icon.sleepy.gif" onclick="insert()" width="15" height="15"></td>\r
+              <td>sleepy</td>\r
+              <td>[|)]</td>\r
+            </tr>\r
+            <tr>\r
+              <td><img alt border="0" hspace="10" src="images/em.icon.kiss.gif" onclick="insert()" width="15" height="15"></td>\r
+              <td>kisses</td>\r
+              <td>[:X]</td>\r
+            </tr>\r
+            <tr>\r
+              <td><img alt border="0" hspace="10" src="images/em.icon.approve.gif" onclick="insert()" width="15" height="15"></td>\r
+              <td>approve</td>\r
+              <td>[^]</td>\r
+           </tr>\r
+            <tr>\r
+              <td><img alt border="0" hspace="10" src="images/em.icon.dissapprove.gif" onclick="insert()" width="15" height="15"></td>\r
+              <td>disapprove</td>\r
+              <td>[V]</td>\r
+           </tr>\r
+          <tr>\r
+            <td><img alt border="0" hspace="10" src="images/em.icon.question.gif" onclick="insert()" width="15" height="15"></td>\r
+            <td>question</td>\r
+            <td>[?]</td>\r
+          </tr>\r
+        </table>\r
+        </td>\r
+      </tr>\r
+    </table>\r
+\r
+    </td>\r
+  </tr>\r
+<tr><td><table width="100%"><tr><td valign="middle" width="90%"><hr width="100%"></td></tr></table></td></tr>\r
+<tr><td align="right">\r
+       <input type="button" value="Close" onclick="cancel()"></td></tr>\r
+</table>\r
+\r
+</html>\r
diff --git a/lib/rte/dlg_ins_table.html b/lib/rte/dlg_ins_table.html
new file mode 100644 (file)
index 0000000..3115100
--- /dev/null
@@ -0,0 +1,149 @@
+<!--\r
+#################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+##\r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from\r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+##\r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+##\r
+#################################################################################\r
+-->\r
+<html>\r
+<head>\r
+<meta name=vs_targetSchema content="HTML 4.0">\r
+<meta name="GENERATOR" content="Microsoft Visual Studio 7.0">\r
+<LINK rel="stylesheet" type="text/css" href="dialog.css">\r
+<title>Insert Table</title>\r
+<script language="JavaScript">\r
+function attr(name, value) {\r
+       if (!value || value == "") return "";\r
+       return ' ' + name + '="' + value + '"';\r
+}\r
+\r
+   function explore(obj, pnt) {\r
+      var i;\r
+      for (i in obj) {\r
+         alert(i +"="+obj[i]);\r
+      }\r
+   }\r
+\r
+function insertTable() {\r
+\r
+\r
+   // use DOM functions to create the table in the dlg_ins_table window\r
+   // and then return the innerHTML of the DIV containing the table\r
+\r
+       var nRows = rows.value ? parseInt(rows.value) : 2;\r
+       var nCols = cols.value ? parseInt(cols.value) : 2;\r
+\r
+   // create the div that will contain the table\r
+   var d = document.body.appendChild( document.createElement("DIV") );\r
+\r
+   // create the table in the div\r
+   var t = d.appendChild( document.createElement("TABLE") );\r
+   var tb = t.appendChild( document.createElement("TBODY") );\r
+   \r
+       for (var i = 0; i < nRows; i++) {\r
+      var tr = tb.appendChild( document.createElement("TR") );\r
+               for (var j = 0; j < nCols; j++) {\r
+            var td = tr.appendChild( document.createElement("TD") );\r
+            td.style.height = rowHeight.value;\r
+            td.style.width = colWidth.value;\r
+               }\r
+       }\r
+\r
+   // set table properties\r
+   t.border = borderWidth.value;\r
+   t.bordercolor = borderColor.value;\r
+   t.cellspacing = cellSpacing.value;\r
+   t.cellpadding = cellPadding.value;\r
+   t.bgcolor = backgroundColor.value;\r
+\r
+   window.returnValue = d.innerHTML;\r
+   window.close();\r
+}\r
+\r
+function cancel() {\r
+       window.returnValue = null;\r
+       window.close();\r
+}\r
+</script>\r
+</head>\r
+\r
+<body topmargin="0" leftmargin="0" style="border: 0; margin: 0;" scroll="no">\r
+<table class="dlg" cellpadding="0" cellspacing="2" width="100%" height="100%">\r
+<tr><td colspan="5"><table width="100%"><tr><td>Layout</td><td valign="middle" width="90%"><hr width="100%"></td></tr></table></td></tr>\r
+<tr>\r
+ <td width="10">&nbsp;</td>\r
+ <td width="70">Rows:</td><td valign="middle"><input type="text" name="rows" value="2" size="5"></td>\r
+ <td width="70">Cell Padding:</td><td valign="middle"><input type="text" name="cellPadding" value="0" size="5"></td>\r
+</tr>\r
+<tr>\r
+ <td>&nbsp;</td>\r
+ <td>Cols:</td><td valign="middle"><input type="text" name="cols" value="2" size="5"></td>\r
+ <td>Cell Spacing:</td><td valign="middle"><input type="text" name="cellSpacing" value="0" size="5"></td>\r
+</tr>\r
+<tr>\r
+ <td>&nbsp;</td>\r
+ <td>Rows Height:</td><td valign="middle"><input type="text" name="rowHeight" value="20" size="5"></td>\r
+</tr>\r
+<tr>\r
+ <td>&nbsp;</td>\r
+ <td>Column Width:</td><td valign="middle"><input type="text" name="colWidth" value="100" size="5"></td>\r
+</tr>\r
+<tr><td colspan="5"><table width="100%"><tr><td>Borders</td><td valign="middle" width="90%"><hr width="100%"></td></tr></table></td></tr>\r
+<tr>\r
+ <td>&nbsp;</td>\r
+ <td>Width:</td><td valign="middle"><input type="text" name="borderWidth" value="1" size="5"></td>\r
+ <td>Color:</td><td valign="middle"><input type="text" name="borderColor" value="black" size="10"></td>\r
+</tr>\r
+<tr><td colspan="5"><table width="100%"><tr><td>Background</td><td valign="middle" width="90%"><hr width="100%"></td></tr></table></td></tr>\r
+<tr>\r
+ <td>&nbsp;</td>\r
+ <td>Color:</td><td valign="middle"><input type="text" name="backgroundColor" value="" size="15"></td>\r
+</tr>\r
+<tr><td colspan="5"><table width="100%"><tr><td valign="middle" width="100%" colspan="2"><hr width="100%"></td></tr></table></td></tr>\r
+<tr>\r
+ <td>&nbsp;</td>\r
+ <td><td colspan="4" align="right"><input class="button" type="button" value="Insert" title="Insert Table" onclick="insertTable()">\r
+<input class="button" type="button" value="Cancel" title="Cancel Dialog" onclick="cancel()"></td>\r
+</tr>\r
+</table>\r
+</body>\r
+</html>\r
diff --git a/lib/rte/example.html b/lib/rte/example.html
new file mode 100644 (file)
index 0000000..3154aae
--- /dev/null
@@ -0,0 +1,92 @@
+<!--\r
+#################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+## \r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from \r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+## \r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+## \r
+#################################################################################\r
+-->\r
+<html>\r
+<head>\r
+<link rel="STYLESHEET" type="text/css" href="rte.css">\r
+\r
+\r
+</head>\r
+\r
+<body>\r
+<input type="button" value="Edit" onClick="edit()">\r
+<hr>\r
+<div id="data" height="200">\r
+\r
+<FORM name=exampleform>\r
+<P><INPUT size=33 value=22 name=text> <INPUT type=button value=22 name=text> </P></FORM>\r
+<TABLE cellSpacing=0 cellPadding=0 align=left border=2>\r
+<TBODY>\r
+<TR>\r
+<TH>\r
+<TD>header </TD></TH>\r
+<TR vAlign=center align=middle>\r
+<TD>td 1 </TD></TR></TBODY></TABLE>\r
+<UL>\r
+<LI>&nbsp; </LI></UL>\r
+<P>&nbsp;</P>\r
+<UL>\r
+<LI>These are some formatting examples</LI>\r
+<LI><A target=_new href="#">These are some formatting examples</A></LI></UL>\r
+\r
+<!--          html  comment       ---------    -->\r
+  \r
+  \r
+  \r
+  \r
+  \r
+</div>\r
+\r
+<script language="JavaScript">\r
+       function edit() {\r
+               var edit={}\r
+               edit.src = data.innerHTML;\r
+               edit.styledata=document.styleSheets\r
+               window.showModalDialog("popup_editor.html", edit,"dialogWidth:800px;dialogHeight:600px;help:no;status:no;scroll:no;resizable:yes;")\r
+       }\r
+</script>\r
+</body>\r
+</html>\r
diff --git a/lib/rte/images/CloseWindow.gif b/lib/rte/images/CloseWindow.gif
new file mode 100644 (file)
index 0000000..93ada9e
Binary files /dev/null and b/lib/rte/images/CloseWindow.gif differ
diff --git a/lib/rte/images/Editor_r11_c2.gif b/lib/rte/images/Editor_r11_c2.gif
new file mode 100644 (file)
index 0000000..e46ec61
Binary files /dev/null and b/lib/rte/images/Editor_r11_c2.gif differ
diff --git a/lib/rte/images/Editor_r11_c5.gif b/lib/rte/images/Editor_r11_c5.gif
new file mode 100644 (file)
index 0000000..66128f3
Binary files /dev/null and b/lib/rte/images/Editor_r11_c5.gif differ
diff --git a/lib/rte/images/Editor_r4_c1.gif b/lib/rte/images/Editor_r4_c1.gif
new file mode 100644 (file)
index 0000000..8a0906b
Binary files /dev/null and b/lib/rte/images/Editor_r4_c1.gif differ
diff --git a/lib/rte/images/Editor_r4_c4.gif b/lib/rte/images/Editor_r4_c4.gif
new file mode 100644 (file)
index 0000000..55dc540
Binary files /dev/null and b/lib/rte/images/Editor_r4_c4.gif differ
diff --git a/lib/rte/images/Editor_r4_c7.gif b/lib/rte/images/Editor_r4_c7.gif
new file mode 100644 (file)
index 0000000..55fff78
Binary files /dev/null and b/lib/rte/images/Editor_r4_c7.gif differ
diff --git a/lib/rte/images/Editor_r5_c2.gif b/lib/rte/images/Editor_r5_c2.gif
new file mode 100644 (file)
index 0000000..d062655
Binary files /dev/null and b/lib/rte/images/Editor_r5_c2.gif differ
diff --git a/lib/rte/images/Editor_r5_c5.gif b/lib/rte/images/Editor_r5_c5.gif
new file mode 100644 (file)
index 0000000..f8dd643
Binary files /dev/null and b/lib/rte/images/Editor_r5_c5.gif differ
diff --git a/lib/rte/images/Editor_r7_c2.gif b/lib/rte/images/Editor_r7_c2.gif
new file mode 100644 (file)
index 0000000..d062655
Binary files /dev/null and b/lib/rte/images/Editor_r7_c2.gif differ
diff --git a/lib/rte/images/Editor_r7_c5.gif b/lib/rte/images/Editor_r7_c5.gif
new file mode 100644 (file)
index 0000000..f8dd643
Binary files /dev/null and b/lib/rte/images/Editor_r7_c5.gif differ
diff --git a/lib/rte/images/Editor_r9_c2.gif b/lib/rte/images/Editor_r9_c2.gif
new file mode 100644 (file)
index 0000000..e46ec61
Binary files /dev/null and b/lib/rte/images/Editor_r9_c2.gif differ
diff --git a/lib/rte/images/Editor_r9_c5.gif b/lib/rte/images/Editor_r9_c5.gif
new file mode 100644 (file)
index 0000000..66128f3
Binary files /dev/null and b/lib/rte/images/Editor_r9_c5.gif differ
diff --git a/lib/rte/images/add_col.gif b/lib/rte/images/add_col.gif
new file mode 100644 (file)
index 0000000..942f10b
Binary files /dev/null and b/lib/rte/images/add_col.gif differ
diff --git a/lib/rte/images/add_col_f2.gif b/lib/rte/images/add_col_f2.gif
new file mode 100644 (file)
index 0000000..aab24cd
Binary files /dev/null and b/lib/rte/images/add_col_f2.gif differ
diff --git a/lib/rte/images/add_row.gif b/lib/rte/images/add_row.gif
new file mode 100644 (file)
index 0000000..72d22c1
Binary files /dev/null and b/lib/rte/images/add_row.gif differ
diff --git a/lib/rte/images/add_row_f2.gif b/lib/rte/images/add_row_f2.gif
new file mode 100644 (file)
index 0000000..dc9dbbf
Binary files /dev/null and b/lib/rte/images/add_row_f2.gif differ
diff --git a/lib/rte/images/bg.gif b/lib/rte/images/bg.gif
new file mode 100644 (file)
index 0000000..843b088
Binary files /dev/null and b/lib/rte/images/bg.gif differ
diff --git a/lib/rte/images/em.icon.angry.gif b/lib/rte/images/em.icon.angry.gif
new file mode 100644 (file)
index 0000000..ed56354
Binary files /dev/null and b/lib/rte/images/em.icon.angry.gif differ
diff --git a/lib/rte/images/em.icon.angry.png b/lib/rte/images/em.icon.angry.png
new file mode 100644 (file)
index 0000000..c55f73b
Binary files /dev/null and b/lib/rte/images/em.icon.angry.png differ
diff --git a/lib/rte/images/em.icon.approve.gif b/lib/rte/images/em.icon.approve.gif
new file mode 100644 (file)
index 0000000..14a9179
Binary files /dev/null and b/lib/rte/images/em.icon.approve.gif differ
diff --git a/lib/rte/images/em.icon.approve.png b/lib/rte/images/em.icon.approve.png
new file mode 100644 (file)
index 0000000..39623ef
Binary files /dev/null and b/lib/rte/images/em.icon.approve.png differ
diff --git a/lib/rte/images/em.icon.bigsmile.gif b/lib/rte/images/em.icon.bigsmile.gif
new file mode 100644 (file)
index 0000000..acc8edb
Binary files /dev/null and b/lib/rte/images/em.icon.bigsmile.gif differ
diff --git a/lib/rte/images/em.icon.bigsmile.png b/lib/rte/images/em.icon.bigsmile.png
new file mode 100644 (file)
index 0000000..891528b
Binary files /dev/null and b/lib/rte/images/em.icon.bigsmile.png differ
diff --git a/lib/rte/images/em.icon.blackeye.gif b/lib/rte/images/em.icon.blackeye.gif
new file mode 100644 (file)
index 0000000..61aeef5
Binary files /dev/null and b/lib/rte/images/em.icon.blackeye.gif differ
diff --git a/lib/rte/images/em.icon.blackeye.png b/lib/rte/images/em.icon.blackeye.png
new file mode 100644 (file)
index 0000000..a3f6566
Binary files /dev/null and b/lib/rte/images/em.icon.blackeye.png differ
diff --git a/lib/rte/images/em.icon.blush.gif b/lib/rte/images/em.icon.blush.gif
new file mode 100644 (file)
index 0000000..d461925
Binary files /dev/null and b/lib/rte/images/em.icon.blush.gif differ
diff --git a/lib/rte/images/em.icon.blush.png b/lib/rte/images/em.icon.blush.png
new file mode 100644 (file)
index 0000000..f734af4
Binary files /dev/null and b/lib/rte/images/em.icon.blush.png differ
diff --git a/lib/rte/images/em.icon.clown.gif b/lib/rte/images/em.icon.clown.gif
new file mode 100644 (file)
index 0000000..b4809f0
Binary files /dev/null and b/lib/rte/images/em.icon.clown.gif differ
diff --git a/lib/rte/images/em.icon.clown.png b/lib/rte/images/em.icon.clown.png
new file mode 100644 (file)
index 0000000..bdc5879
Binary files /dev/null and b/lib/rte/images/em.icon.clown.png differ
diff --git a/lib/rte/images/em.icon.cool.gif b/lib/rte/images/em.icon.cool.gif
new file mode 100644 (file)
index 0000000..ce6b23d
Binary files /dev/null and b/lib/rte/images/em.icon.cool.gif differ
diff --git a/lib/rte/images/em.icon.cool.png b/lib/rte/images/em.icon.cool.png
new file mode 100644 (file)
index 0000000..38a0033
Binary files /dev/null and b/lib/rte/images/em.icon.cool.png differ
diff --git a/lib/rte/images/em.icon.dead.gif b/lib/rte/images/em.icon.dead.gif
new file mode 100644 (file)
index 0000000..466c267
Binary files /dev/null and b/lib/rte/images/em.icon.dead.gif differ
diff --git a/lib/rte/images/em.icon.dead.png b/lib/rte/images/em.icon.dead.png
new file mode 100644 (file)
index 0000000..f59071a
Binary files /dev/null and b/lib/rte/images/em.icon.dead.png differ
diff --git a/lib/rte/images/em.icon.dissapprove.gif b/lib/rte/images/em.icon.dissapprove.gif
new file mode 100644 (file)
index 0000000..ab47d4c
Binary files /dev/null and b/lib/rte/images/em.icon.dissapprove.gif differ
diff --git a/lib/rte/images/em.icon.dissapprove.png b/lib/rte/images/em.icon.dissapprove.png
new file mode 100644 (file)
index 0000000..a62400e
Binary files /dev/null and b/lib/rte/images/em.icon.dissapprove.png differ
diff --git a/lib/rte/images/em.icon.eightball.gif b/lib/rte/images/em.icon.eightball.gif
new file mode 100644 (file)
index 0000000..c9e44c5
Binary files /dev/null and b/lib/rte/images/em.icon.eightball.gif differ
diff --git a/lib/rte/images/em.icon.eightball.png b/lib/rte/images/em.icon.eightball.png
new file mode 100644 (file)
index 0000000..ca9f45c
Binary files /dev/null and b/lib/rte/images/em.icon.eightball.png differ
diff --git a/lib/rte/images/em.icon.evil.gif b/lib/rte/images/em.icon.evil.gif
new file mode 100644 (file)
index 0000000..cac3dba
Binary files /dev/null and b/lib/rte/images/em.icon.evil.gif differ
diff --git a/lib/rte/images/em.icon.evil.png b/lib/rte/images/em.icon.evil.png
new file mode 100644 (file)
index 0000000..38f2577
Binary files /dev/null and b/lib/rte/images/em.icon.evil.png differ
diff --git a/lib/rte/images/em.icon.kiss.gif b/lib/rte/images/em.icon.kiss.gif
new file mode 100644 (file)
index 0000000..be729a2
Binary files /dev/null and b/lib/rte/images/em.icon.kiss.gif differ
diff --git a/lib/rte/images/em.icon.kiss.png b/lib/rte/images/em.icon.kiss.png
new file mode 100644 (file)
index 0000000..dcb2105
Binary files /dev/null and b/lib/rte/images/em.icon.kiss.png differ
diff --git a/lib/rte/images/em.icon.question.gif b/lib/rte/images/em.icon.question.gif
new file mode 100644 (file)
index 0000000..1f4bb7f
Binary files /dev/null and b/lib/rte/images/em.icon.question.gif differ
diff --git a/lib/rte/images/em.icon.question.png b/lib/rte/images/em.icon.question.png
new file mode 100644 (file)
index 0000000..0881075
Binary files /dev/null and b/lib/rte/images/em.icon.question.png differ
diff --git a/lib/rte/images/em.icon.sad.gif b/lib/rte/images/em.icon.sad.gif
new file mode 100644 (file)
index 0000000..8615b4c
Binary files /dev/null and b/lib/rte/images/em.icon.sad.gif differ
diff --git a/lib/rte/images/em.icon.sad.png b/lib/rte/images/em.icon.sad.png
new file mode 100644 (file)
index 0000000..fb0db91
Binary files /dev/null and b/lib/rte/images/em.icon.sad.png differ
diff --git a/lib/rte/images/em.icon.shocked.gif b/lib/rte/images/em.icon.shocked.gif
new file mode 100644 (file)
index 0000000..55ea56d
Binary files /dev/null and b/lib/rte/images/em.icon.shocked.gif differ
diff --git a/lib/rte/images/em.icon.shocked.png b/lib/rte/images/em.icon.shocked.png
new file mode 100644 (file)
index 0000000..e4dac61
Binary files /dev/null and b/lib/rte/images/em.icon.shocked.png differ
diff --git a/lib/rte/images/em.icon.shy.gif b/lib/rte/images/em.icon.shy.gif
new file mode 100644 (file)
index 0000000..3f11e3d
Binary files /dev/null and b/lib/rte/images/em.icon.shy.gif differ
diff --git a/lib/rte/images/em.icon.shy.png b/lib/rte/images/em.icon.shy.png
new file mode 100644 (file)
index 0000000..37f9242
Binary files /dev/null and b/lib/rte/images/em.icon.shy.png differ
diff --git a/lib/rte/images/em.icon.sleepy.gif b/lib/rte/images/em.icon.sleepy.gif
new file mode 100644 (file)
index 0000000..0f80ef7
Binary files /dev/null and b/lib/rte/images/em.icon.sleepy.gif differ
diff --git a/lib/rte/images/em.icon.sleepy.png b/lib/rte/images/em.icon.sleepy.png
new file mode 100644 (file)
index 0000000..a0757a4
Binary files /dev/null and b/lib/rte/images/em.icon.sleepy.png differ
diff --git a/lib/rte/images/em.icon.smile.gif b/lib/rte/images/em.icon.smile.gif
new file mode 100644 (file)
index 0000000..5156c81
Binary files /dev/null and b/lib/rte/images/em.icon.smile.gif differ
diff --git a/lib/rte/images/em.icon.smile.png b/lib/rte/images/em.icon.smile.png
new file mode 100644 (file)
index 0000000..826b285
Binary files /dev/null and b/lib/rte/images/em.icon.smile.png differ
diff --git a/lib/rte/images/em.icon.tongue.gif b/lib/rte/images/em.icon.tongue.gif
new file mode 100644 (file)
index 0000000..7411be7
Binary files /dev/null and b/lib/rte/images/em.icon.tongue.gif differ
diff --git a/lib/rte/images/em.icon.tongue.png b/lib/rte/images/em.icon.tongue.png
new file mode 100644 (file)
index 0000000..51aa5a6
Binary files /dev/null and b/lib/rte/images/em.icon.tongue.png differ
diff --git a/lib/rte/images/em.icon.wink.gif b/lib/rte/images/em.icon.wink.gif
new file mode 100644 (file)
index 0000000..8951a58
Binary files /dev/null and b/lib/rte/images/em.icon.wink.gif differ
diff --git a/lib/rte/images/em.icon.wink.png b/lib/rte/images/em.icon.wink.png
new file mode 100644 (file)
index 0000000..b3968af
Binary files /dev/null and b/lib/rte/images/em.icon.wink.png differ
diff --git a/lib/rte/images/hdr_tables.gif b/lib/rte/images/hdr_tables.gif
new file mode 100644 (file)
index 0000000..14d8daa
Binary files /dev/null and b/lib/rte/images/hdr_tables.gif differ
diff --git a/lib/rte/images/icon_about.gif b/lib/rte/images/icon_about.gif
new file mode 100644 (file)
index 0000000..42f90ff
Binary files /dev/null and b/lib/rte/images/icon_about.gif differ
diff --git a/lib/rte/images/icon_block.gif b/lib/rte/images/icon_block.gif
new file mode 100644 (file)
index 0000000..a9ce564
Binary files /dev/null and b/lib/rte/images/icon_block.gif differ
diff --git a/lib/rte/images/icon_bold.gif b/lib/rte/images/icon_bold.gif
new file mode 100644 (file)
index 0000000..925229a
Binary files /dev/null and b/lib/rte/images/icon_bold.gif differ
diff --git a/lib/rte/images/icon_bullist.gif b/lib/rte/images/icon_bullist.gif
new file mode 100644 (file)
index 0000000..55d8689
Binary files /dev/null and b/lib/rte/images/icon_bullist.gif differ
diff --git a/lib/rte/images/icon_center.gif b/lib/rte/images/icon_center.gif
new file mode 100644 (file)
index 0000000..d4ba94d
Binary files /dev/null and b/lib/rte/images/icon_center.gif differ
diff --git a/lib/rte/images/icon_color_fill.gif b/lib/rte/images/icon_color_fill.gif
new file mode 100644 (file)
index 0000000..85ba81d
Binary files /dev/null and b/lib/rte/images/icon_color_fill.gif differ
diff --git a/lib/rte/images/icon_color_text.gif b/lib/rte/images/icon_color_text.gif
new file mode 100644 (file)
index 0000000..0b04509
Binary files /dev/null and b/lib/rte/images/icon_color_text.gif differ
diff --git a/lib/rte/images/icon_copy.gif b/lib/rte/images/icon_copy.gif
new file mode 100644 (file)
index 0000000..5322f46
Binary files /dev/null and b/lib/rte/images/icon_copy.gif differ
diff --git a/lib/rte/images/icon_cut.gif b/lib/rte/images/icon_cut.gif
new file mode 100644 (file)
index 0000000..1eec71f
Binary files /dev/null and b/lib/rte/images/icon_cut.gif differ
diff --git a/lib/rte/images/icon_edt_table.gif b/lib/rte/images/icon_edt_table.gif
new file mode 100644 (file)
index 0000000..1aa7af1
Binary files /dev/null and b/lib/rte/images/icon_edt_table.gif differ
diff --git a/lib/rte/images/icon_indent.gif b/lib/rte/images/icon_indent.gif
new file mode 100644 (file)
index 0000000..2289066
Binary files /dev/null and b/lib/rte/images/icon_indent.gif differ
diff --git a/lib/rte/images/icon_ins_char.gif b/lib/rte/images/icon_ins_char.gif
new file mode 100644 (file)
index 0000000..b24452a
Binary files /dev/null and b/lib/rte/images/icon_ins_char.gif differ
diff --git a/lib/rte/images/icon_ins_image.gif b/lib/rte/images/icon_ins_image.gif
new file mode 100644 (file)
index 0000000..1b9413e
Binary files /dev/null and b/lib/rte/images/icon_ins_image.gif differ
diff --git a/lib/rte/images/icon_ins_link.gif b/lib/rte/images/icon_ins_link.gif
new file mode 100644 (file)
index 0000000..c1f2ca7
Binary files /dev/null and b/lib/rte/images/icon_ins_link.gif differ
diff --git a/lib/rte/images/icon_ins_sub.gif b/lib/rte/images/icon_ins_sub.gif
new file mode 100644 (file)
index 0000000..bc77635
Binary files /dev/null and b/lib/rte/images/icon_ins_sub.gif differ
diff --git a/lib/rte/images/icon_ins_sup.gif b/lib/rte/images/icon_ins_sup.gif
new file mode 100644 (file)
index 0000000..8d64b22
Binary files /dev/null and b/lib/rte/images/icon_ins_sup.gif differ
diff --git a/lib/rte/images/icon_ins_table.gif b/lib/rte/images/icon_ins_table.gif
new file mode 100644 (file)
index 0000000..b47fec9
Binary files /dev/null and b/lib/rte/images/icon_ins_table.gif differ
diff --git a/lib/rte/images/icon_italic.gif b/lib/rte/images/icon_italic.gif
new file mode 100644 (file)
index 0000000..0bea697
Binary files /dev/null and b/lib/rte/images/icon_italic.gif differ
diff --git a/lib/rte/images/icon_left.gif b/lib/rte/images/icon_left.gif
new file mode 100644 (file)
index 0000000..d2d19c1
Binary files /dev/null and b/lib/rte/images/icon_left.gif differ
diff --git a/lib/rte/images/icon_numlist.gif b/lib/rte/images/icon_numlist.gif
new file mode 100644 (file)
index 0000000..0608c97
Binary files /dev/null and b/lib/rte/images/icon_numlist.gif differ
diff --git a/lib/rte/images/icon_outdent.gif b/lib/rte/images/icon_outdent.gif
new file mode 100644 (file)
index 0000000..0eb1077
Binary files /dev/null and b/lib/rte/images/icon_outdent.gif differ
diff --git a/lib/rte/images/icon_paste.gif b/lib/rte/images/icon_paste.gif
new file mode 100644 (file)
index 0000000..b09eaea
Binary files /dev/null and b/lib/rte/images/icon_paste.gif differ
diff --git a/lib/rte/images/icon_post.gif b/lib/rte/images/icon_post.gif
new file mode 100644 (file)
index 0000000..62d7f8c
Binary files /dev/null and b/lib/rte/images/icon_post.gif differ
diff --git a/lib/rte/images/icon_redo.gif b/lib/rte/images/icon_redo.gif
new file mode 100644 (file)
index 0000000..7582556
Binary files /dev/null and b/lib/rte/images/icon_redo.gif differ
diff --git a/lib/rte/images/icon_rem_formatting.gif b/lib/rte/images/icon_rem_formatting.gif
new file mode 100644 (file)
index 0000000..ad8d047
Binary files /dev/null and b/lib/rte/images/icon_rem_formatting.gif differ
diff --git a/lib/rte/images/icon_rem_link.gif b/lib/rte/images/icon_rem_link.gif
new file mode 100644 (file)
index 0000000..f653109
Binary files /dev/null and b/lib/rte/images/icon_rem_link.gif differ
diff --git a/lib/rte/images/icon_right.gif b/lib/rte/images/icon_right.gif
new file mode 100644 (file)
index 0000000..c7cf3f0
Binary files /dev/null and b/lib/rte/images/icon_right.gif differ
diff --git a/lib/rte/images/icon_rule.gif b/lib/rte/images/icon_rule.gif
new file mode 100644 (file)
index 0000000..648e7f0
Binary files /dev/null and b/lib/rte/images/icon_rule.gif differ
diff --git a/lib/rte/images/icon_select_all.gif b/lib/rte/images/icon_select_all.gif
new file mode 100644 (file)
index 0000000..430fdb2
Binary files /dev/null and b/lib/rte/images/icon_select_all.gif differ
diff --git a/lib/rte/images/icon_spell.gif b/lib/rte/images/icon_spell.gif
new file mode 100644 (file)
index 0000000..7849726
Binary files /dev/null and b/lib/rte/images/icon_spell.gif differ
diff --git a/lib/rte/images/icon_strikethrough.gif b/lib/rte/images/icon_strikethrough.gif
new file mode 100644 (file)
index 0000000..dae104d
Binary files /dev/null and b/lib/rte/images/icon_strikethrough.gif differ
diff --git a/lib/rte/images/icon_underline.gif b/lib/rte/images/icon_underline.gif
new file mode 100644 (file)
index 0000000..0809c02
Binary files /dev/null and b/lib/rte/images/icon_underline.gif differ
diff --git a/lib/rte/images/icon_undo.gif b/lib/rte/images/icon_undo.gif
new file mode 100644 (file)
index 0000000..bb9e1db
Binary files /dev/null and b/lib/rte/images/icon_undo.gif differ
diff --git a/lib/rte/images/incr_colspan.gif b/lib/rte/images/incr_colspan.gif
new file mode 100644 (file)
index 0000000..84b8fa1
Binary files /dev/null and b/lib/rte/images/incr_colspan.gif differ
diff --git a/lib/rte/images/incr_colspan_f2.gif b/lib/rte/images/incr_colspan_f2.gif
new file mode 100644 (file)
index 0000000..65bf50e
Binary files /dev/null and b/lib/rte/images/incr_colspan_f2.gif differ
diff --git a/lib/rte/images/incr_rowspan.gif b/lib/rte/images/incr_rowspan.gif
new file mode 100644 (file)
index 0000000..a27b719
Binary files /dev/null and b/lib/rte/images/incr_rowspan.gif differ
diff --git a/lib/rte/images/incr_rowspan_f2.gif b/lib/rte/images/incr_rowspan_f2.gif
new file mode 100644 (file)
index 0000000..997e42f
Binary files /dev/null and b/lib/rte/images/incr_rowspan_f2.gif differ
diff --git a/lib/rte/images/lang/de.icon_post.gif b/lib/rte/images/lang/de.icon_post.gif
new file mode 100644 (file)
index 0000000..af0ca63
Binary files /dev/null and b/lib/rte/images/lang/de.icon_post.gif differ
diff --git a/lib/rte/images/lang/no.icon_post.gif b/lib/rte/images/lang/no.icon_post.gif
new file mode 100644 (file)
index 0000000..9891aa2
Binary files /dev/null and b/lib/rte/images/lang/no.icon_post.gif differ
diff --git a/lib/rte/images/minimize.gif b/lib/rte/images/minimize.gif
new file mode 100644 (file)
index 0000000..876965b
Binary files /dev/null and b/lib/rte/images/minimize.gif differ
diff --git a/lib/rte/images/plt_ftr.gif b/lib/rte/images/plt_ftr.gif
new file mode 100644 (file)
index 0000000..e2f086f
Binary files /dev/null and b/lib/rte/images/plt_ftr.gif differ
diff --git a/lib/rte/images/plt_hdr.gif b/lib/rte/images/plt_hdr.gif
new file mode 100644 (file)
index 0000000..8a7c609
Binary files /dev/null and b/lib/rte/images/plt_hdr.gif differ
diff --git a/lib/rte/images/rmv_col.gif b/lib/rte/images/rmv_col.gif
new file mode 100644 (file)
index 0000000..fce7c3f
Binary files /dev/null and b/lib/rte/images/rmv_col.gif differ
diff --git a/lib/rte/images/rmv_col_f2.gif b/lib/rte/images/rmv_col_f2.gif
new file mode 100644 (file)
index 0000000..b9e92a1
Binary files /dev/null and b/lib/rte/images/rmv_col_f2.gif differ
diff --git a/lib/rte/images/rmv_colspan.gif b/lib/rte/images/rmv_colspan.gif
new file mode 100644 (file)
index 0000000..43d33b1
Binary files /dev/null and b/lib/rte/images/rmv_colspan.gif differ
diff --git a/lib/rte/images/rmv_colspan_f2.gif b/lib/rte/images/rmv_colspan_f2.gif
new file mode 100644 (file)
index 0000000..79b2c0e
Binary files /dev/null and b/lib/rte/images/rmv_colspan_f2.gif differ
diff --git a/lib/rte/images/rmv_row.gif b/lib/rte/images/rmv_row.gif
new file mode 100644 (file)
index 0000000..a1a4c3a
Binary files /dev/null and b/lib/rte/images/rmv_row.gif differ
diff --git a/lib/rte/images/rmv_row_f2.gif b/lib/rte/images/rmv_row_f2.gif
new file mode 100644 (file)
index 0000000..674d796
Binary files /dev/null and b/lib/rte/images/rmv_row_f2.gif differ
diff --git a/lib/rte/images/rmv_rowspan.gif b/lib/rte/images/rmv_rowspan.gif
new file mode 100644 (file)
index 0000000..e62f51e
Binary files /dev/null and b/lib/rte/images/rmv_rowspan.gif differ
diff --git a/lib/rte/images/rmv_rowspan_f2.gif b/lib/rte/images/rmv_rowspan_f2.gif
new file mode 100644 (file)
index 0000000..3015075
Binary files /dev/null and b/lib/rte/images/rmv_rowspan_f2.gif differ
diff --git a/lib/rte/images/spacer.gif b/lib/rte/images/spacer.gif
new file mode 100644 (file)
index 0000000..fc25609
Binary files /dev/null and b/lib/rte/images/spacer.gif differ
diff --git a/lib/rte/images/toolbar.gif b/lib/rte/images/toolbar.gif
new file mode 100644 (file)
index 0000000..2de1043
Binary files /dev/null and b/lib/rte/images/toolbar.gif differ
diff --git a/lib/rte/license.html b/lib/rte/license.html
new file mode 100644 (file)
index 0000000..4ee5829
--- /dev/null
@@ -0,0 +1,514 @@
+<!--\r
+#################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+##\r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from\r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+##\r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+##\r
+#################################################################################\r
+-->\r
+<html>\r
+<head>\r
+<title>GNU LESSER GENERAL PUBLIC LICENSE</title>\r
+<style type="text/css">\r
+pre { font-size: 9.5px; font-family: "Andale Mono", "Courier New"}\r
+</style>\r
+</head>\r
+<body><pre>\r
+                   GNU LESSER GENERAL PUBLIC LICENSE\r
+                       Version 2.1, February 1999\r
+\r
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+[This is the first released version of the Lesser GPL.  It also counts\r
+ as the successor of the GNU Library Public License, version 2, hence\r
+ the version number 2.1.]\r
+\r
+                            Preamble\r
+\r
+  The licenses for most software are designed to take away your\r
+freedom to share and change it.  By contrast, the GNU General Public\r
+Licenses are intended to guarantee your freedom to share and change\r
+free software--to make sure the software is free for all its users.\r
+\r
+  This license, the Lesser General Public License, applies to some\r
+specially designated software packages--typically libraries--of the\r
+Free Software Foundation and other authors who decide to use it.  You\r
+can use it too, but we suggest you first think carefully about whether\r
+this license or the ordinary General Public License is the better\r
+strategy to use in any particular case, based on the explanations below.\r
+\r
+  When we speak of free software, we are referring to freedom of use,\r
+not price.  Our General Public Licenses are designed to make sure that\r
+you have the freedom to distribute copies of free software (and charge\r
+for this service if you wish); that you receive source code or can get\r
+it if you want it; that you can change the software and use pieces of\r
+it in new free programs; and that you are informed that you can do\r
+these things.\r
+\r
+  To protect your rights, we need to make restrictions that forbid\r
+distributors to deny you these rights or to ask you to surrender these\r
+rights.  These restrictions translate to certain responsibilities for\r
+you if you distribute copies of the library or if you modify it.\r
+\r
+  For example, if you distribute copies of the library, whether gratis\r
+or for a fee, you must give the recipients all the rights that we gave\r
+you.  You must make sure that they, too, receive or can get the source\r
+code.  If you link other code with the library, you must provide\r
+complete object files to the recipients, so that they can relink them\r
+with the library after making changes to the library and recompiling\r
+it.  And you must show them these terms so they know their rights.\r
+\r
+  We protect your rights with a two-step method: (1) we copyright the\r
+library, and (2) we offer you this license, which gives you legal\r
+permission to copy, distribute and/or modify the library.\r
+\r
+  To protect each distributor, we want to make it very clear that\r
+there is no warranty for the free library.  Also, if the library is\r
+modified by someone else and passed on, the recipients should know\r
+that what they have is not the original version, so that the original\r
+author's reputation will not be affected by problems that might be\r
+introduced by others.\r
+\r
+  Finally, software patents pose a constant threat to the existence of\r
+any free program.  We wish to make sure that a company cannot\r
+effectively restrict the users of a free program by obtaining a\r
+restrictive license from a patent holder.  Therefore, we insist that\r
+any patent license obtained for a version of the library must be\r
+consistent with the full freedom of use specified in this license.\r
+\r
+  Most GNU software, including some libraries, is covered by the\r
+ordinary GNU General Public License.  This license, the GNU Lesser\r
+General Public License, applies to certain designated libraries, and\r
+is quite different from the ordinary General Public License.  We use\r
+this license for certain libraries in order to permit linking those\r
+libraries into non-free programs.\r
+\r
+  When a program is linked with a library, whether statically or using\r
+a shared library, the combination of the two is legally speaking a\r
+combined work, a derivative of the original library.  The ordinary\r
+General Public License therefore permits such linking only if the\r
+entire combination fits its criteria of freedom.  The Lesser General\r
+Public License permits more lax criteria for linking other code with\r
+the library.\r
+\r
+  We call this license the "Lesser" General Public License because it\r
+does Less to protect the user's freedom than the ordinary General\r
+Public License.  It also provides other free software developers Less\r
+of an advantage over competing non-free programs.  These disadvantages\r
+are the reason we use the ordinary General Public License for many\r
+libraries.  However, the Lesser license provides advantages in certain\r
+special circumstances.\r
+\r
+  For example, on rare occasions, there may be a special need to\r
+encourage the widest possible use of a certain library, so that it becomes\r
+a de-facto standard.  To achieve this, non-free programs must be\r
+allowed to use the library.  A more frequent case is that a free\r
+library does the same job as widely used non-free libraries.  In this\r
+case, there is little to gain by limiting the free library to free\r
+software only, so we use the Lesser General Public License.\r
+\r
+  In other cases, permission to use a particular library in non-free\r
+programs enables a greater number of people to use a large body of\r
+free software.  For example, permission to use the GNU C Library in\r
+non-free programs enables many more people to use the whole GNU\r
+operating system, as well as its variant, the GNU/Linux operating\r
+system.\r
+\r
+  Although the Lesser General Public License is Less protective of the\r
+users' freedom, it does ensure that the user of a program that is\r
+linked with the Library has the freedom and the wherewithal to run\r
+that program using a modified version of the Library.\r
+\r
+  The precise terms and conditions for copying, distribution and\r
+modification follow.  Pay close attention to the difference between a\r
+"work based on the library" and a "work that uses the library".  The\r
+former contains code derived from the library, whereas the latter must\r
+be combined with the library in order to run.\r
+\r
+                  GNU LESSER GENERAL PUBLIC LICENSE\r
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+  0. This License Agreement applies to any software library or other\r
+program which contains a notice placed by the copyright holder or\r
+other authorized party saying it may be distributed under the terms of\r
+this Lesser General Public License (also called "this License").\r
+Each licensee is addressed as "you".\r
+\r
+  A "library" means a collection of software functions and/or data\r
+prepared so as to be conveniently linked with application programs\r
+(which use some of those functions and data) to form executables.\r
+\r
+  The "Library", below, refers to any such software library or work\r
+which has been distributed under these terms.  A "work based on the\r
+Library" means either the Library or any derivative work under\r
+copyright law: that is to say, a work containing the Library or a\r
+portion of it, either verbatim or with modifications and/or translated\r
+straightforwardly into another language.  (Hereinafter, translation is\r
+included without limitation in the term "modification".)\r
+\r
+  "Source code" for a work means the preferred form of the work for\r
+making modifications to it.  For a library, complete source code means\r
+all the source code for all modules it contains, plus any associated\r
+interface definition files, plus the scripts used to control compilation\r
+and installation of the library.\r
+\r
+  Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope.  The act of\r
+running a program using the Library is not restricted, and output from\r
+such a program is covered only if its contents constitute a work based\r
+on the Library (independent of the use of the Library in a tool for\r
+writing it).  Whether that is true depends on what the Library does\r
+and what the program that uses the Library does.\r
+\r
+  1. You may copy and distribute verbatim copies of the Library's\r
+complete source code as you receive it, in any medium, provided that\r
+you conspicuously and appropriately publish on each copy an\r
+appropriate copyright notice and disclaimer of warranty; keep intact\r
+all the notices that refer to this License and to the absence of any\r
+warranty; and distribute a copy of this License along with the\r
+Library.\r
+\r
+  You may charge a fee for the physical act of transferring a copy,\r
+and you may at your option offer warranty protection in exchange for a\r
+fee.\r
+\r
+  2. You may modify your copy or copies of the Library or any portion\r
+of it, thus forming a work based on the Library, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+    a) The modified work must itself be a software library.\r
+\r
+    b) You must cause the files modified to carry prominent notices\r
+    stating that you changed the files and the date of any change.\r
+\r
+    c) You must cause the whole of the work to be licensed at no\r
+    charge to all third parties under the terms of this License.\r
+\r
+    d) If a facility in the modified Library refers to a function or a\r
+    table of data to be supplied by an application program that uses\r
+    the facility, other than as an argument passed when the facility\r
+    is invoked, then you must make a good faith effort to ensure that,\r
+    in the event an application does not supply such function or\r
+    table, the facility still operates, and performs whatever part of\r
+    its purpose remains meaningful.\r
+\r
+    (For example, a function in a library to compute square roots has\r
+    a purpose that is entirely well-defined independent of the\r
+    application.  Therefore, Subsection 2d requires that any\r
+    application-supplied function or table used by this function must\r
+    be optional: if the application does not supply it, the square\r
+    root function must still compute square roots.)\r
+\r
+These requirements apply to the modified work as a whole.  If\r
+identifiable sections of that work are not derived from the Library,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works.  But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Library, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote\r
+it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Library.\r
+\r
+In addition, mere aggregation of another work not based on the Library\r
+with the Library (or with a work based on the Library) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+  3. You may opt to apply the terms of the ordinary GNU General Public\r
+License instead of this License to a given copy of the Library.  To do\r
+this, you must alter all the notices that refer to this License, so\r
+that they refer to the ordinary GNU General Public License, version 2,\r
+instead of to this License.  (If a newer version than version 2 of the\r
+ordinary GNU General Public License has appeared, then you can specify\r
+that version instead if you wish.)  Do not make any other change in\r
+these notices.\r
+\r
+  Once this change is made in a given copy, it is irreversible for\r
+that copy, so the ordinary GNU General Public License applies to all\r
+subsequent copies and derivative works made from that copy.\r
+\r
+  This option is useful when you wish to copy part of the code of\r
+the Library into a program that is not a library.\r
+\r
+  4. You may copy and distribute the Library (or a portion or\r
+derivative of it, under Section 2) in object code or executable form\r
+under the terms of Sections 1 and 2 above provided that you accompany\r
+it with the complete corresponding machine-readable source code, which\r
+must be distributed under the terms of Sections 1 and 2 above on a\r
+medium customarily used for software interchange.\r
+\r
+  If distribution of object code is made by offering access to copy\r
+from a designated place, then offering equivalent access to copy the\r
+source code from the same place satisfies the requirement to\r
+distribute the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\r
+  5. A program that contains no derivative of any portion of the\r
+Library, but is designed to work with the Library by being compiled or\r
+linked with it, is called a "work that uses the Library".  Such a\r
+work, in isolation, is not a derivative work of the Library, and\r
+therefore falls outside the scope of this License.\r
+\r
+  However, linking a "work that uses the Library" with the Library\r
+creates an executable that is a derivative of the Library (because it\r
+contains portions of the Library), rather than a "work that uses the\r
+library".  The executable is therefore covered by this License.\r
+Section 6 states terms for distribution of such executables.\r
+\r
+  When a "work that uses the Library" uses material from a header file\r
+that is part of the Library, the object code for the work may be a\r
+derivative work of the Library even though the source code is not.\r
+Whether this is true is especially significant if the work can be\r
+linked without the Library, or if the work is itself a library.  The\r
+threshold for this to be true is not precisely defined by law.\r
+\r
+  If such an object file uses only numerical parameters, data\r
+structure layouts and accessors, and small macros and small inline\r
+functions (ten lines or less in length), then the use of the object\r
+file is unrestricted, regardless of whether it is legally a derivative\r
+work.  (Executables containing this object code plus portions of the\r
+Library will still fall under Section 6.)\r
+\r
+  Otherwise, if the work is a derivative of the Library, you may\r
+distribute the object code for the work under the terms of Section 6.\r
+Any executables containing that work also fall under Section 6,\r
+whether or not they are linked directly with the Library itself.\r
+\r
+  6. As an exception to the Sections above, you may also combine or\r
+link a "work that uses the Library" with the Library to produce a\r
+work containing portions of the Library, and distribute that work\r
+under terms of your choice, provided that the terms permit\r
+modification of the work for the customer's own use and reverse\r
+engineering for debugging such modifications.\r
+\r
+  You must give prominent notice with each copy of the work that the\r
+Library is used in it and that the Library and its use are covered by\r
+this License.  You must supply a copy of this License.  If the work\r
+during execution displays copyright notices, you must include the\r
+copyright notice for the Library among them, as well as a reference\r
+directing the user to the copy of this License.  Also, you must do one\r
+of these things:\r
+\r
+    a) Accompany the work with the complete corresponding\r
+    machine-readable source code for the Library including whatever\r
+    changes were used in the work (which must be distributed under\r
+    Sections 1 and 2 above); and, if the work is an executable linked\r
+    with the Library, with the complete machine-readable "work that\r
+    uses the Library", as object code and/or source code, so that the\r
+    user can modify the Library and then relink to produce a modified\r
+    executable containing the modified Library.  (It is understood\r
+    that the user who changes the contents of definitions files in the\r
+    Library will not necessarily be able to recompile the application\r
+    to use the modified definitions.)\r
+\r
+    b) Use a suitable shared library mechanism for linking with the\r
+    Library.  A suitable mechanism is one that (1) uses at run time a\r
+    copy of the library already present on the user's computer system,\r
+    rather than copying library functions into the executable, and (2)\r
+    will operate properly with a modified version of the library, if\r
+    the user installs one, as long as the modified version is\r
+    interface-compatible with the version that the work was made with.\r
+\r
+    c) Accompany the work with a written offer, valid for at\r
+    least three years, to give the same user the materials\r
+    specified in Subsection 6a, above, for a charge no more\r
+    than the cost of performing this distribution.\r
+\r
+    d) If distribution of the work is made by offering access to copy\r
+    from a designated place, offer equivalent access to copy the above\r
+    specified materials from the same place.\r
+\r
+    e) Verify that the user has already received a copy of these\r
+    materials or that you have already sent this user a copy.\r
+\r
+  For an executable, the required form of the "work that uses the\r
+Library" must include any data and utility programs needed for\r
+reproducing the executable from it.  However, as a special exception,\r
+the materials to be distributed need not include anything that is\r
+normally distributed (in either source or binary form) with the major\r
+components (compiler, kernel, and so on) of the operating system on\r
+which the executable runs, unless that component itself accompanies\r
+the executable.\r
+\r
+  It may happen that this requirement contradicts the license\r
+restrictions of other proprietary libraries that do not normally\r
+accompany the operating system.  Such a contradiction means you cannot\r
+use both them and the Library together in an executable that you\r
+distribute.\r
+\r
+  7. You may place library facilities that are a work based on the\r
+Library side-by-side in a single library together with other library\r
+facilities not covered by this License, and distribute such a combined\r
+library, provided that the separate distribution of the work based on\r
+the Library and of the other library facilities is otherwise\r
+permitted, and provided that you do these two things:\r
+\r
+    a) Accompany the combined library with a copy of the same work\r
+    based on the Library, uncombined with any other library\r
+    facilities.  This must be distributed under the terms of the\r
+    Sections above.\r
+\r
+    b) Give prominent notice with the combined library of the fact\r
+    that part of it is a work based on the Library, and explaining\r
+    where to find the accompanying uncombined form of the same work.\r
+\r
+  8. You may not copy, modify, sublicense, link with, or distribute\r
+the Library except as expressly provided under this License.  Any\r
+attempt otherwise to copy, modify, sublicense, link with, or\r
+distribute the Library is void, and will automatically terminate your\r
+rights under this License.  However, parties who have received copies,\r
+or rights, from you under this License will not have their licenses\r
+terminated so long as such parties remain in full compliance.\r
+\r
+  9. You are not required to accept this License, since you have not\r
+signed it.  However, nothing else grants you permission to modify or\r
+distribute the Library or its derivative works.  These actions are\r
+prohibited by law if you do not accept this License.  Therefore, by\r
+modifying or distributing the Library (or any work based on the\r
+Library), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Library or works based on it.\r
+\r
+  10. Each time you redistribute the Library (or any work based on the\r
+Library), the recipient automatically receives a license from the\r
+original licensor to copy, distribute, link with or modify the Library\r
+subject to these terms and conditions.  You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties with\r
+this License.\r
+\r
+  11. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License.  If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Library at all.  For example, if a patent\r
+license would not permit royalty-free redistribution of the Library by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Library.\r
+\r
+If any portion of this section is held invalid or unenforceable under any\r
+particular circumstance, the balance of the section is intended to apply,\r
+and the section as a whole is intended to apply in other circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system which is\r
+implemented by public license practices.  Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\r
+  12. If the distribution and/or use of the Library is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Library under this License may add\r
+an explicit geographical distribution limitation excluding those countries,\r
+so that distribution is permitted only in or among countries not thus\r
+excluded.  In such case, this License incorporates the limitation as if\r
+written in the body of this License.\r
+\r
+  13. The Free Software Foundation may publish revised and/or new\r
+versions of the Lesser General Public License from time to time.\r
+Such new versions will be similar in spirit to the present version,\r
+but may differ in detail to address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number.  If the Library\r
+specifies a version number of this License which applies to it and\r
+"any later version", you have the option of following the terms and\r
+conditions either of that version or of any later version published by\r
+the Free Software Foundation.  If the Library does not specify a\r
+license version number, you may choose any version ever published by\r
+the Free Software Foundation.\r
+\r
+  14. If you wish to incorporate parts of the Library into other free\r
+programs whose distribution conditions are incompatible with these,\r
+write to the author to ask for permission.  For software which is\r
+copyrighted by the Free Software Foundation, write to the Free\r
+Software Foundation; we sometimes make exceptions for this.  Our\r
+decision will be guided by the two goals of preserving the free status\r
+of all derivatives of our free software and of promoting the sharing\r
+and reuse of software generally.\r
+\r
+                            NO WARRANTY\r
+\r
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
+\r
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
+DAMAGES.\r
+\r
+                     END OF TERMS AND CONDITIONS\r
+\r
+</pre></body></html>
\ No newline at end of file
diff --git a/lib/rte/license.txt b/lib/rte/license.txt
new file mode 100644 (file)
index 0000000..59c5f03
--- /dev/null
@@ -0,0 +1,459 @@
+                   GNU LESSER GENERAL PUBLIC LICENSE\r
+                       Version 2.1, February 1999\r
+\r
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+[This is the first released version of the Lesser GPL.  It also counts\r
+ as the successor of the GNU Library Public License, version 2, hence\r
+ the version number 2.1.]\r
+\r
+                            Preamble\r
+\r
+  The licenses for most software are designed to take away your\r
+freedom to share and change it.  By contrast, the GNU General Public\r
+Licenses are intended to guarantee your freedom to share and change\r
+free software--to make sure the software is free for all its users.\r
+\r
+  This license, the Lesser General Public License, applies to some\r
+specially designated software packages--typically libraries--of the\r
+Free Software Foundation and other authors who decide to use it.  You\r
+can use it too, but we suggest you first think carefully about whether\r
+this license or the ordinary General Public License is the better\r
+strategy to use in any particular case, based on the explanations below.\r
+\r
+  When we speak of free software, we are referring to freedom of use,\r
+not price.  Our General Public Licenses are designed to make sure that\r
+you have the freedom to distribute copies of free software (and charge\r
+for this service if you wish); that you receive source code or can get\r
+it if you want it; that you can change the software and use pieces of\r
+it in new free programs; and that you are informed that you can do\r
+these things.\r
+\r
+  To protect your rights, we need to make restrictions that forbid\r
+distributors to deny you these rights or to ask you to surrender these\r
+rights.  These restrictions translate to certain responsibilities for\r
+you if you distribute copies of the library or if you modify it.\r
+\r
+  For example, if you distribute copies of the library, whether gratis\r
+or for a fee, you must give the recipients all the rights that we gave\r
+you.  You must make sure that they, too, receive or can get the source\r
+code.  If you link other code with the library, you must provide\r
+complete object files to the recipients, so that they can relink them\r
+with the library after making changes to the library and recompiling\r
+it.  And you must show them these terms so they know their rights.\r
+\r
+  We protect your rights with a two-step method: (1) we copyright the\r
+library, and (2) we offer you this license, which gives you legal\r
+permission to copy, distribute and/or modify the library.\r
+\r
+  To protect each distributor, we want to make it very clear that\r
+there is no warranty for the free library.  Also, if the library is\r
+modified by someone else and passed on, the recipients should know\r
+that what they have is not the original version, so that the original\r
+author's reputation will not be affected by problems that might be\r
+introduced by others.\r
+\r
+  Finally, software patents pose a constant threat to the existence of\r
+any free program.  We wish to make sure that a company cannot\r
+effectively restrict the users of a free program by obtaining a\r
+restrictive license from a patent holder.  Therefore, we insist that\r
+any patent license obtained for a version of the library must be\r
+consistent with the full freedom of use specified in this license.\r
+\r
+  Most GNU software, including some libraries, is covered by the\r
+ordinary GNU General Public License.  This license, the GNU Lesser\r
+General Public License, applies to certain designated libraries, and\r
+is quite different from the ordinary General Public License.  We use\r
+this license for certain libraries in order to permit linking those\r
+libraries into non-free programs.\r
+\r
+  When a program is linked with a library, whether statically or using\r
+a shared library, the combination of the two is legally speaking a\r
+combined work, a derivative of the original library.  The ordinary\r
+General Public License therefore permits such linking only if the\r
+entire combination fits its criteria of freedom.  The Lesser General\r
+Public License permits more lax criteria for linking other code with\r
+the library.\r
+\r
+  We call this license the "Lesser" General Public License because it\r
+does Less to protect the user's freedom than the ordinary General\r
+Public License.  It also provides other free software developers Less\r
+of an advantage over competing non-free programs.  These disadvantages\r
+are the reason we use the ordinary General Public License for many\r
+libraries.  However, the Lesser license provides advantages in certain\r
+special circumstances.\r
+\r
+  For example, on rare occasions, there may be a special need to\r
+encourage the widest possible use of a certain library, so that it becomes\r
+a de-facto standard.  To achieve this, non-free programs must be\r
+allowed to use the library.  A more frequent case is that a free\r
+library does the same job as widely used non-free libraries.  In this\r
+case, there is little to gain by limiting the free library to free\r
+software only, so we use the Lesser General Public License.\r
+\r
+  In other cases, permission to use a particular library in non-free\r
+programs enables a greater number of people to use a large body of\r
+free software.  For example, permission to use the GNU C Library in\r
+non-free programs enables many more people to use the whole GNU\r
+operating system, as well as its variant, the GNU/Linux operating\r
+system.\r
+\r
+  Although the Lesser General Public License is Less protective of the\r
+users' freedom, it does ensure that the user of a program that is\r
+linked with the Library has the freedom and the wherewithal to run\r
+that program using a modified version of the Library.\r
+\r
+  The precise terms and conditions for copying, distribution and\r
+modification follow.  Pay close attention to the difference between a\r
+"work based on the library" and a "work that uses the library".  The\r
+former contains code derived from the library, whereas the latter must\r
+be combined with the library in order to run.\r
+\r
+                  GNU LESSER GENERAL PUBLIC LICENSE\r
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+  0. This License Agreement applies to any software library or other\r
+program which contains a notice placed by the copyright holder or\r
+other authorized party saying it may be distributed under the terms of\r
+this Lesser General Public License (also called "this License").\r
+Each licensee is addressed as "you".\r
+\r
+  A "library" means a collection of software functions and/or data\r
+prepared so as to be conveniently linked with application programs\r
+(which use some of those functions and data) to form executables.\r
+\r
+  The "Library", below, refers to any such software library or work\r
+which has been distributed under these terms.  A "work based on the\r
+Library" means either the Library or any derivative work under\r
+copyright law: that is to say, a work containing the Library or a\r
+portion of it, either verbatim or with modifications and/or translated\r
+straightforwardly into another language.  (Hereinafter, translation is\r
+included without limitation in the term "modification".)\r
+\r
+  "Source code" for a work means the preferred form of the work for\r
+making modifications to it.  For a library, complete source code means\r
+all the source code for all modules it contains, plus any associated\r
+interface definition files, plus the scripts used to control compilation\r
+and installation of the library.\r
+\r
+  Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope.  The act of\r
+running a program using the Library is not restricted, and output from\r
+such a program is covered only if its contents constitute a work based\r
+on the Library (independent of the use of the Library in a tool for\r
+writing it).  Whether that is true depends on what the Library does\r
+and what the program that uses the Library does.\r
+  \r
+  1. You may copy and distribute verbatim copies of the Library's\r
+complete source code as you receive it, in any medium, provided that\r
+you conspicuously and appropriately publish on each copy an\r
+appropriate copyright notice and disclaimer of warranty; keep intact\r
+all the notices that refer to this License and to the absence of any\r
+warranty; and distribute a copy of this License along with the\r
+Library.\r
+\r
+  You may charge a fee for the physical act of transferring a copy,\r
+and you may at your option offer warranty protection in exchange for a\r
+fee.\r
+\r
+  2. You may modify your copy or copies of the Library or any portion\r
+of it, thus forming a work based on the Library, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+    a) The modified work must itself be a software library.\r
+\r
+    b) You must cause the files modified to carry prominent notices\r
+    stating that you changed the files and the date of any change.\r
+\r
+    c) You must cause the whole of the work to be licensed at no\r
+    charge to all third parties under the terms of this License.\r
+\r
+    d) If a facility in the modified Library refers to a function or a\r
+    table of data to be supplied by an application program that uses\r
+    the facility, other than as an argument passed when the facility\r
+    is invoked, then you must make a good faith effort to ensure that,\r
+    in the event an application does not supply such function or\r
+    table, the facility still operates, and performs whatever part of\r
+    its purpose remains meaningful.\r
+\r
+    (For example, a function in a library to compute square roots has\r
+    a purpose that is entirely well-defined independent of the\r
+    application.  Therefore, Subsection 2d requires that any\r
+    application-supplied function or table used by this function must\r
+    be optional: if the application does not supply it, the square\r
+    root function must still compute square roots.)\r
+\r
+These requirements apply to the modified work as a whole.  If\r
+identifiable sections of that work are not derived from the Library,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works.  But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Library, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote\r
+it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Library.\r
+\r
+In addition, mere aggregation of another work not based on the Library\r
+with the Library (or with a work based on the Library) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+  3. You may opt to apply the terms of the ordinary GNU General Public\r
+License instead of this License to a given copy of the Library.  To do\r
+this, you must alter all the notices that refer to this License, so\r
+that they refer to the ordinary GNU General Public License, version 2,\r
+instead of to this License.  (If a newer version than version 2 of the\r
+ordinary GNU General Public License has appeared, then you can specify\r
+that version instead if you wish.)  Do not make any other change in\r
+these notices.\r
+\r
+  Once this change is made in a given copy, it is irreversible for\r
+that copy, so the ordinary GNU General Public License applies to all\r
+subsequent copies and derivative works made from that copy.\r
+\r
+  This option is useful when you wish to copy part of the code of\r
+the Library into a program that is not a library.\r
+\r
+  4. You may copy and distribute the Library (or a portion or\r
+derivative of it, under Section 2) in object code or executable form\r
+under the terms of Sections 1 and 2 above provided that you accompany\r
+it with the complete corresponding machine-readable source code, which\r
+must be distributed under the terms of Sections 1 and 2 above on a\r
+medium customarily used for software interchange.\r
+\r
+  If distribution of object code is made by offering access to copy\r
+from a designated place, then offering equivalent access to copy the\r
+source code from the same place satisfies the requirement to\r
+distribute the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\r
+  5. A program that contains no derivative of any portion of the\r
+Library, but is designed to work with the Library by being compiled or\r
+linked with it, is called a "work that uses the Library".  Such a\r
+work, in isolation, is not a derivative work of the Library, and\r
+therefore falls outside the scope of this License.\r
+\r
+  However, linking a "work that uses the Library" with the Library\r
+creates an executable that is a derivative of the Library (because it\r
+contains portions of the Library), rather than a "work that uses the\r
+library".  The executable is therefore covered by this License.\r
+Section 6 states terms for distribution of such executables.\r
+\r
+  When a "work that uses the Library" uses material from a header file\r
+that is part of the Library, the object code for the work may be a\r
+derivative work of the Library even though the source code is not.\r
+Whether this is true is especially significant if the work can be\r
+linked without the Library, or if the work is itself a library.  The\r
+threshold for this to be true is not precisely defined by law.\r
+\r
+  If such an object file uses only numerical parameters, data\r
+structure layouts and accessors, and small macros and small inline\r
+functions (ten lines or less in length), then the use of the object\r
+file is unrestricted, regardless of whether it is legally a derivative\r
+work.  (Executables containing this object code plus portions of the\r
+Library will still fall under Section 6.)\r
+\r
+  Otherwise, if the work is a derivative of the Library, you may\r
+distribute the object code for the work under the terms of Section 6.\r
+Any executables containing that work also fall under Section 6,\r
+whether or not they are linked directly with the Library itself.\r
+\r
+  6. As an exception to the Sections above, you may also combine or\r
+link a "work that uses the Library" with the Library to produce a\r
+work containing portions of the Library, and distribute that work\r
+under terms of your choice, provided that the terms permit\r
+modification of the work for the customer's own use and reverse\r
+engineering for debugging such modifications.\r
+\r
+  You must give prominent notice with each copy of the work that the\r
+Library is used in it and that the Library and its use are covered by\r
+this License.  You must supply a copy of this License.  If the work\r
+during execution displays copyright notices, you must include the\r
+copyright notice for the Library among them, as well as a reference\r
+directing the user to the copy of this License.  Also, you must do one\r
+of these things:\r
+\r
+    a) Accompany the work with the complete corresponding\r
+    machine-readable source code for the Library including whatever\r
+    changes were used in the work (which must be distributed under\r
+    Sections 1 and 2 above); and, if the work is an executable linked\r
+    with the Library, with the complete machine-readable "work that\r
+    uses the Library", as object code and/or source code, so that the\r
+    user can modify the Library and then relink to produce a modified\r
+    executable containing the modified Library.  (It is understood\r
+    that the user who changes the contents of definitions files in the\r
+    Library will not necessarily be able to recompile the application\r
+    to use the modified definitions.)\r
+\r
+    b) Use a suitable shared library mechanism for linking with the\r
+    Library.  A suitable mechanism is one that (1) uses at run time a\r
+    copy of the library already present on the user's computer system,\r
+    rather than copying library functions into the executable, and (2)\r
+    will operate properly with a modified version of the library, if\r
+    the user installs one, as long as the modified version is\r
+    interface-compatible with the version that the work was made with.\r
+\r
+    c) Accompany the work with a written offer, valid for at\r
+    least three years, to give the same user the materials\r
+    specified in Subsection 6a, above, for a charge no more\r
+    than the cost of performing this distribution.\r
+\r
+    d) If distribution of the work is made by offering access to copy\r
+    from a designated place, offer equivalent access to copy the above\r
+    specified materials from the same place.\r
+\r
+    e) Verify that the user has already received a copy of these\r
+    materials or that you have already sent this user a copy.\r
+\r
+  For an executable, the required form of the "work that uses the\r
+Library" must include any data and utility programs needed for\r
+reproducing the executable from it.  However, as a special exception,\r
+the materials to be distributed need not include anything that is\r
+normally distributed (in either source or binary form) with the major\r
+components (compiler, kernel, and so on) of the operating system on\r
+which the executable runs, unless that component itself accompanies\r
+the executable.\r
+\r
+  It may happen that this requirement contradicts the license\r
+restrictions of other proprietary libraries that do not normally\r
+accompany the operating system.  Such a contradiction means you cannot\r
+use both them and the Library together in an executable that you\r
+distribute.\r
+\r
+  7. You may place library facilities that are a work based on the\r
+Library side-by-side in a single library together with other library\r
+facilities not covered by this License, and distribute such a combined\r
+library, provided that the separate distribution of the work based on\r
+the Library and of the other library facilities is otherwise\r
+permitted, and provided that you do these two things:\r
+\r
+    a) Accompany the combined library with a copy of the same work\r
+    based on the Library, uncombined with any other library\r
+    facilities.  This must be distributed under the terms of the\r
+    Sections above.\r
+\r
+    b) Give prominent notice with the combined library of the fact\r
+    that part of it is a work based on the Library, and explaining\r
+    where to find the accompanying uncombined form of the same work.\r
+\r
+  8. You may not copy, modify, sublicense, link with, or distribute\r
+the Library except as expressly provided under this License.  Any\r
+attempt otherwise to copy, modify, sublicense, link with, or\r
+distribute the Library is void, and will automatically terminate your\r
+rights under this License.  However, parties who have received copies,\r
+or rights, from you under this License will not have their licenses\r
+terminated so long as such parties remain in full compliance.\r
+\r
+  9. You are not required to accept this License, since you have not\r
+signed it.  However, nothing else grants you permission to modify or\r
+distribute the Library or its derivative works.  These actions are\r
+prohibited by law if you do not accept this License.  Therefore, by\r
+modifying or distributing the Library (or any work based on the\r
+Library), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Library or works based on it.\r
+\r
+  10. Each time you redistribute the Library (or any work based on the\r
+Library), the recipient automatically receives a license from the\r
+original licensor to copy, distribute, link with or modify the Library\r
+subject to these terms and conditions.  You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties with\r
+this License.\r
+\r
+  11. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License.  If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Library at all.  For example, if a patent\r
+license would not permit royalty-free redistribution of the Library by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Library.\r
+\r
+If any portion of this section is held invalid or unenforceable under any\r
+particular circumstance, the balance of the section is intended to apply,\r
+and the section as a whole is intended to apply in other circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system which is\r
+implemented by public license practices.  Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\r
+  12. If the distribution and/or use of the Library is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Library under this License may add\r
+an explicit geographical distribution limitation excluding those countries,\r
+so that distribution is permitted only in or among countries not thus\r
+excluded.  In such case, this License incorporates the limitation as if\r
+written in the body of this License.\r
+\r
+  13. The Free Software Foundation may publish revised and/or new\r
+versions of the Lesser General Public License from time to time.\r
+Such new versions will be similar in spirit to the present version,\r
+but may differ in detail to address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number.  If the Library\r
+specifies a version number of this License which applies to it and\r
+"any later version", you have the option of following the terms and\r
+conditions either of that version or of any later version published by\r
+the Free Software Foundation.  If the Library does not specify a\r
+license version number, you may choose any version ever published by\r
+the Free Software Foundation.\r
+\r
+  14. If you wish to incorporate parts of the Library into other free\r
+programs whose distribution conditions are incompatible with these,\r
+write to the author to ask for permission.  For software which is\r
+copyrighted by the Free Software Foundation, write to the Free\r
+Software Foundation; we sometimes make exceptions for this.  Our\r
+decision will be guided by the two goals of preserving the free status\r
+of all derivatives of our free software and of promoting the sharing\r
+and reuse of software generally.\r
+\r
+                            NO WARRANTY\r
+\r
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
+\r
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
+DAMAGES.\r
+\r
+                     END OF TERMS AND CONDITIONS\r
+\r
diff --git a/lib/rte/popup_editor.html b/lib/rte/popup_editor.html
new file mode 100644 (file)
index 0000000..f41ac41
--- /dev/null
@@ -0,0 +1,73 @@
+<!--\r
+#################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+## \r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from \r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+## \r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+## \r
+#################################################################################\r
+-->\r
+<HTML>\r
+<HEAD>\r
+<META content="HTML 4.0" name="vs_targetSchema">\r
+<META content="Microsoft Visual Studio 7.0" name="GENERATOR">\r
+<title>Edit Text</title>\r
+</HEAD>\r
+<BODY leftMargin=0 topMargin=0>\r
+<object id=richedit style="BACKGROUND-COLOR: buttonface" data="richedit.html" width="100%" height="100%" type="text/x-scriptlet" VIEWASTEXT>\r
+       </object>\r
+       \r
+<SCRIPT language="JavaScript">\r
+var edit = window.dialogArguments;\r
+</SCRIPT>\r
+\r
+<SCRIPT language="JavaScript" event="onload" for="window">\r
+       window.returnValue = null;\r
+       if (edit.defaultFont) richedit.defaultFont = edit.defaultFont;\r
+       if (edit.defaultFontSize) richedit.defaultFontSize = edit.defaultFontSize;\r
+       if (edit.styledata) richedit.styledata = edit.styledata\r
+       richedit.docHtml = edit.src;\r
+</script>\r
+\r
+<SCRIPT language="JavaScript" event="onscriptletevent(name, eventData)" for="richedit">\r
+       window.returnValue = eventData;\r
+       window.close();\r
+</script>\r
+</BODY></HTML>\r
diff --git a/lib/rte/readme.txt b/lib/rte/readme.txt
new file mode 100644 (file)
index 0000000..ec7e25d
--- /dev/null
@@ -0,0 +1,44 @@
+RichText is an HTML Text Editor written using DHTML, JavaScript and\r
+Scriptlet technologies allows WYSIWYG editing of HTML from\r
+within a web page. Ideal for use as a forum message editor\r
+or anywhere else description text is required.\r
+\r
+\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+##\r
+\r
+Author:\r
+\r
+       Austin David France\r
+       Ramesys (Contracting Services) Limited\r
+       Mentor House\r
+       Ainsworth Street\r
+       Blackburn\r
+       Lancashire\r
+       BB1 6AY\r
+       United Kingdom\r
+\r
+    email: Austin.France@Ramesys.com\r
+\r
+\r
+HTML Text Editing Component for hosting in Web Pages\r
+Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
\r
+This library is free software; you can redistribute it and/or\r
+modify it under the terms of the GNU Lesser General Public\r
+License as published by the Free Software Foundation; either\r
+version 2.1 of the License, or (at your option) any later version.\r
+\r
+This library is distributed in the hope that it will be useful,\r
+but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+Lesser General Public License for more details.\r
+\r
+You should have received a copy of the GNU LesserGeneral Public License\r
+along with this program; if not a copy can be obtained from \r
+\r
+   http://www.gnu.org/copyleft/lesser.html\r
+\r
+\r
diff --git a/lib/rte/richedit.css b/lib/rte/richedit.css
new file mode 100644 (file)
index 0000000..f913c36
--- /dev/null
@@ -0,0 +1,219 @@
+/*******************************************************************************\r
+**\r
+** HTML Text Editing Component for hosting in Web Pages\r
+** Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+** \r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+**\r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+** Lesser General Public License for more details.\r
+**\r
+** You should have received a copy of the GNU LesserGeneral Public License\r
+** along with this program; if not a copy can be obtained from \r
+**\r
+**    http://www.gnu.org/copyleft/lesser.html\r
+**\r
+** or by writing to:\r
+**\r
+**    Free Software Foundation, Inc.\r
+**    59 Temple Place - Suite 330,\r
+**    Boston,\r
+**    MA  02111-1307,\r
+**    USA.\r
+** \r
+** Original Developer:\r
+**\r
+**     Austin David France\r
+**     Ramesys (Contracting Services) Limited\r
+**     Mentor House\r
+**     Ainsworth Street\r
+**     Blackburn\r
+**     Lancashire\r
+**     BB1 6AY\r
+**     United Kingdom\r
+**  email: Austin.France@Ramesys.com\r
+**\r
+** Home Page:    http://richtext.sourceforge.net/\r
+** Support:      http://richtext.sourceforge.net/\r
+** \r
+*******************************************************************************/\r
+\r
+body { width: 100%; border: 1px inset buttonface; border-left: 0px; background-color: buttonface }\r
+\r
+table#editor { width: 100%; height: 100%; border: 0px; visibility: hidden; }\r
+\r
+td.textedit { }\r
+\r
+.textedit div.document {\r
+       height: 150;\r
+       font-family: "Times New Roman";\r
+       background-color: window;\r
+       border: 2px inset buttonface; padding:5;\r
+}\r
+\r
+/* rebar styles ***************************************************************/\r
+td.rebar { padding:0; padding-bottom:2; padding-top:2;\r
+       font-family: "MS Sans Serif"; font-size: xx-small; vertical-align: middle;\r
+}\r
+\r
+td.spacer {\r
+       border-top: 1px solid buttonhighlight;\r
+       padding: 0; margin: 0; height: 4;\r
+}\r
+\r
+.rebar span.toolbar {\r
+       border-top: 1px solid buttonhighlight;\r
+       border-left: 1px solid buttonhighlight;\r
+       border-bottom: 1px solid buttonshadow;\r
+       border-right: 1px solid buttonshadow;\r
+       padding: 0; margin: 0; padding-bottom:1; padding-top:1;\r
+}\r
+\r
+.rebar span.spacer { width: 2px; }\r
+\r
+.rebar span.start {\r
+       margin:0;\r
+       background-color: buttonface;\r
+       border-top: 1px solid buttonhighlight;\r
+       border-left: 1px solid buttonhighlight;\r
+       border-bottom: 1px solid buttonshadow;\r
+       border-right: 1px solid buttonshadow;\r
+       width: 3px;\r
+       height: 18px;\r
+}\r
+\r
+.rebar span.label { border:0; position:relative; top: -2; margin-left: 3; }\r
+\r
+.rebar span.sep {\r
+       margin:0;\r
+       background-color: buttonface;\r
+       border-top: 1px solid buttonshadow;\r
+       border-left: 1px solid buttonshadow;\r
+       border-bottom: 1px solid buttonhighlight;\r
+       border-right: 1px solid buttonhighlight;\r
+       width: 2px;\r
+       height: 18px;\r
+}\r
+\r
+.rebar select {\r
+       font-size: 11px;\r
+       margin-top: 1; margin-bottom: 1;\r
+       width : 100px;\r
+}\r
+\r
+.rebar .fontselect  {\r
+       font-size: 11px;\r
+       margin-top: 1; margin-bottom: 1;\r
+       width : 200px;\r
+}\r
+\r
+.rebar option { border: 5px solid red; }\r
+\r
+.rebar span.field {\r
+       border-top: 1px solid buttonhighlight;\r
+       border-left: 1px solid buttonhighlight;\r
+       border-bottom: 1px solid buttonshadow;\r
+       border-right: 1px solid buttonshadow;\r
+       padding: 0; margin: 0; padding-bottom:1; padding-top:1;\r
+}\r
+\r
+.rebar .field span.label {\r
+       margin-left: 0;\r
+       padding-left: 8; width: 60;\r
+}\r
+\r
+.rebar .field span.start {\r
+       position: relative; top: 1;\r
+\r
+}\r
+\r
+.rebar .field input.field {\r
+       border-top: 1px solid buttonshadow;\r
+       border-left: 1px solid buttonshadow;\r
+       border-bottom: 1px solid buttonhighlight;\r
+       border-right: 1px solid buttonhighlight;\r
+       height: 20px; margin: 0px; \r
+       margin-bottom: -1px;\r
+}\r
+\r
+.rebar img {\r
+       border: 1px solid buttonface; margin:0; padding:1;\r
+       cursor: hand;\r
+}\r
+\r
+.rebar img.hover {\r
+       border-top: 1px solid buttonhighlight;\r
+       border-left: 1px solid buttonhighlight;\r
+       border-bottom: 1px solid buttonshadow;\r
+       border-right: 1px solid buttonshadow;\r
+}\r
+\r
+.rebar img.down {\r
+       border-bottom: 1px solid buttonhighlight;\r
+       border-right: 1px solid buttonhighlight;\r
+       border-top: 1px solid buttonshadow;\r
+       border-left: 1px solid buttonshadow;\r
+}\r
+\r
+.rebar img.disabled {\r
+       border: 1px solid buttonface; margin:0; padding:0;\r
+       filter: progid:DXImageTransform.Microsoft.Alpha(opacity=30);\r
+       cursor: normal;\r
+}\r
+\r
+.rebar img.spacer {\r
+       cursor: normal;\r
+}\r
+\r
+/* table control styles ***************************************************************/\r
+td.tbl { padding:0; padding-bottom:0; padding-top:0;\r
+       font-family: "MS Sans Serif"; font-size: xx-small; vertical-align: middle;\r
+}\r
+\r
+td.spacer {\r
+       border-top: 1px solid buttonhighlight;\r
+       padding: 0; margin: 0; height: 4;\r
+}\r
+\r
+.tbl img {\r
+       border: 1px solid buttonface; margin:0; padding:1;\r
+       cursor: hand;\r
+}\r
+\r
+.tbl img.hover {\r
+       border-top: 1px solid buttonhighlight;\r
+       border-left: 1px solid buttonhighlight;\r
+       border-bottom: 1px solid buttonshadow;\r
+       border-right: 1px solid buttonshadow;\r
+}\r
+\r
+.tbl img.down {\r
+       border-bottom: 1px solid buttonhighlight;\r
+       border-right: 1px solid buttonhighlight;\r
+       border-top: 1px solid buttonshadow;\r
+       border-left: 1px solid buttonshadow;\r
+}\r
+\r
+.tbl img.disabled {\r
+       border: 1px solid buttonface; margin:0; padding:0;\r
+       filter: progid:DXImageTransform.Microsoft.Alpha(opacity=30);\r
+       cursor: normal;\r
+}\r
+\r
+.tbl img.spacer {\r
+       cursor: normal;\r
+}\r
+\r
+\r
+/* control styles ***************************************************************/\r
+object#color {\r
+       position: absolute;\r
+       width:252; height: 225;\r
+       display: none;\r
+       background-color: white; border: 1px outset buttonface\r
+}\r
diff --git a/lib/rte/richedit.html b/lib/rte/richedit.html
new file mode 100644 (file)
index 0000000..7d71422
--- /dev/null
@@ -0,0 +1,337 @@
+<!--\r
+################################################################################\r
+##\r
+## HTML Text Editing Component for hosting in Web Pages\r
+## Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+##\r
+## This library is free software; you can redistribute it and/or\r
+## modify it under the terms of the GNU Lesser General Public\r
+## License as published by the Free Software Foundation; either\r
+## version 2.1 of the License, or (at your option) any later version.\r
+##\r
+## This library is distributed in the hope that it will be useful,\r
+## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+## Lesser General Public License for more details.\r
+##\r
+## You should have received a copy of the GNU LesserGeneral Public License\r
+## along with this program; if not a copy can be obtained from\r
+##\r
+##    http://www.gnu.org/copyleft/lesser.html\r
+##\r
+## or by writing to:\r
+##\r
+##    Free Software Foundation, Inc.\r
+##    59 Temple Place - Suite 330,\r
+##    Boston,\r
+##    MA  02111-1307,\r
+##    USA.\r
+##\r
+## Original Developer:\r
+##\r
+##     Austin David France\r
+##     Ramesys (Contracting Services) Limited\r
+##     Mentor House\r
+##     Ainsworth Street\r
+##     Blackburn\r
+##     Lancashire\r
+##     BB1 6AY\r
+##     United Kingdom\r
+##  email: Austin.France@Ramesys.com\r
+##\r
+## Home Page:    http://richtext.sourceforge.net/\r
+## Support:      http://richtext.sourceforge.net/\r
+##\r
+################################################################################\r
+##\r
+## Authors & Contributers:\r
+##\r
+##     OZ              Austin David France             [austin.france@ramesys.com]\r
+##                             Primary Developer\r
+##\r
+##     LEON    Leon Reinders                   [leonreinders@hetnet.nl]\r
+##                             Author of View Source & History Functions\r
+##\r
+##     DIRK    Dirk Datzert                    [Dirk.Datzert@rasselstein-hoesch.de]\r
+##                             Justify Full Option\r
+##\r
+##     GE              Herfurth, Gerrit                [gerrit.herfurth@gs-druckfarben.de]\r
+##                             Translator\r
+##\r
+##     BC              Bill chalmers                   [bill_paula@btinternet.com]\r
+##                             General Geek\r
+##\r
+## History:\r
+##\r
+##     OZ              08-01-2002\r
+##                     Extended the richeditor interface to include an options property.\r
+##                     This property can be set to enable/disable functionality in the\r
+##                     editor.\r
+##\r
+##     OZ              22-01-2002\r
+##                     Disable drag-drop into the editor window and from toolbar buttons.\r
+##\r
+##     OZ              10-02-2002\r
+##                     Added new Full Justify toolbar button.  Implementation of\r
+##                     a mod to the editor made by Dirk Datzert who supplied the code and\r
+##                     the Image.\r
+##\r
+##     OZ              11-02-2002\r
+##                     Startup with text area set to contenteditable="false".  The content\r
+##                     is made editable when the editor has been initialised.\r
+##\r
+##     OZ              11-02-2002\r
+##                     Include debug routines script (rte_debug.js)\r
+##\r
+##     OZ              14-02-2002\r
+##                     Fix removing of color from text.  This actually removes all formatting\r
+##                     and is equivelent to selecting the remove formatting option.\r
+##\r
+##     OZ              14-02-2002\r
+##                     Reset Fill/Text color buttons once event has fired so they no longer\r
+##                     appear pressed.\r
+##\r
+##     GE              05-06-2002\r
+##                     Add language translation support for table edit option.\r
+##\r
+##     OZ              01-07-2002\r
+##                     Update table editing html (toolbar) with translation support.\r
+##\r
+##     OZ              01-07-2002\r
+##                     Move language translation (rte_lang.js) below attaching of the\r
+##                     initEditor() window onload event to ensure translation is done\r
+##                     before the editor becomes visible.\r
+##\r
+##     BC              10-07-2002\r
+##                     Made the font selection more "web style" with multiple font face attributes.\r
+##                                             \r
+## WC    06-08-2002\r
+##       Testing to ensure code was branched properly for 0.3.0 release\r
+-->\r
+<html><head>\r
+<meta content="HTML 4.0" name="vs_targetSchema">\r
+<meta content="Microsoft FrontPage 5.0" name="GENERATOR">\r
+<link rel="StyleSheet" type="text/css" href="richedit.css">\r
+<link rel="StyleSheet" type="text/css" href="syntax.css">\r
+<link rel="StyleSheet" type="text/css" href="custom.css">\r
+<script language="JavaScript" src="rte_xhtml.js"></script>\r
+<script language="JavaScript" src="rte_interface.js"></script>\r
+<script language="JavaScript" src="rte_debug.js"></script>\r
+<script language="JavaScript" src="rte.js"></script>\r
+<script language="JavaScript" src="rte_codesweep.js"></script>\r
+<script language="JavaScript" src="rte_editmode.js"></script>\r
+<script language="JavaScript" src="rte_history.js"></script>\r
+<SCRIPT language="JavaScript" src="tableEditor.js"></SCRIPT>\r
+<script language="JavaScript">\r
+// This defines the scriptlets public interface.  See rte_interface.js for\r
+// the actual interface definition.\r
+var public_description =  new RichEditor();\r
+// Initialise the editor as soon as the window is loaded.\r
+window.attachEvent("onload", initEditor);\r
+// Initialise the tEdit var\r
+var tEdit = null;\r
+</script>\r
+<script language="JavaScript" src="rte_lang.js"></script>\r
+</head>\r
+<body leftMargin="0" topMargin="0" scroll="no" unselectable="on"\r
+       onload="tEdit = new tableEditor('doc', 'textedit');"\r
+       onMouseMove="if (tEdit) { tEdit.changePos(); tEdit.resizeCell() }" >\r
+\r
+<!-- Loading Layer ----------------------------------->\r
+<div id="loading" style="position: absolute; top: 0px; left: 0px; height: 100%; z-index: -1">\r
+       <table width="100%" height="100%"><tr><td align="center" valign="middle">\r
+       <font size="+2">Loading ...</font>\r
+       </td></tr></table>\r
+</div>\r
+\r
+<!-- Editor Layer -------------------------------------->\r
+<table id="editor" unselectable="on" height="100%" cellspacing="0" cellpadding="0" width="100%" bgcolor="buttonface" border="0">\r
+  <tr ondragstart="handleDrag(0)" onmouseup="press(false)" onmousedown="press(true)" onmouseover="hover(true)" onmouseout="hover(false)">\r
+    <td class="rebar"><nobr><span class="toolbar">\r
+               <img class="spacer" src="images/spacer.gif" width="2"><span class="start"></span>\r
+               <img id="btnBold"     onclick="doStyle('bold')" alt="@{Bold}" src="images/icon_bold.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnItalic"   onclick="doStyle('italic')" alt="@{Italic}" src="images/icon_italic.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnUnderline"  onclick="doStyle('underline')" alt="@{Underline}" src="images/icon_underline.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnStrikethrough"  onclick="doStyle('strikethrough')" alt="@{Strikethrough}" src="images/icon_strikethrough.gif" align="absMiddle" width="20" height="20">\r
+               <img class="spacer" src="images/spacer.gif" width="2"><span class="sep"></span>\r
+               <img id="btnLeftJustify"  onclick="doStyle('JustifyLeft')" alt="@{AlignLeft}" src="images/icon_left.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnCenter"   onclick="doStyle('JustifyCenter')" alt="@{Center}" src="images/icon_center.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnRightJustify"  onclick="doStyle('JustifyRight')" alt="@{AlignRight}" src="images/icon_right.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnFullJustify" onclick="doStyle('JustifyFull')" alt="@{AlignBlock}" src="images/icon_block.gif" align="absMiddle" width="20" height="20">\r
+               <img class="spacer" src="images/spacer.gif" width="2"><span class="sep"></span>\r
+               <img id="btnNumList"  onclick="doStyle('InsertOrderedList')" alt="@{NumberedList}" src="images/icon_numlist.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnBulList"  onclick="doStyle('InsertUnorderedList')" alt="@{BulettedList}" src="images/icon_bullist.gif" align="absMiddle" width="20" height="20">\r
+               <img class="spacer" src="images/spacer.gif" width="2"><span class="sep"></span>\r
+               <img id="btnOutdent"  onmousedown="doStyle('Outdent')" alt="@{DecreaseIndent}" src="images/icon_outdent.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnIndent"   onmousedown="doStyle('Indent')" alt="@{IncreaseIndent}" src="images/icon_indent.gif" align="absMiddle" width="20" height="20">\r
+               <span id="featureHistory">\r
+               <img class="spacer" src="images/spacer.gif" width="2"><span class="sep"></span>\r
+               <img id="btnPrev" onmousedown="document.execCommand('Undo')" alt="@{HistoryBack}"    src="images/icon_undo.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnNext" onmousedown="document.execCommand('Redo')"  alt="@{HistoryForward}" src="images/icon_redo.gif" align="absMiddle" width="20" height="20">\r
+       </span></nobr></td>\r
+\r
+    <td class="rebar"><nobr><span class="toolbar">\r
+               <img class="spacer" src="images/spacer.gif" width="2"><span class="start"></span>\r
+               <img id="btnLink"   onclick="link(true)" alt="@{InsertLink}" src="images/icon_ins_link.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnRemLink" onclick="link(false)" alt="@{RemoveLink}" src="images/icon_rem_link.gif" align="absMiddle" width="20" height="20">\r
+               <img class="spacer" src="images/spacer.gif" width="2"><span class="sep"></span>\r
+               <img id="btnImage"  onclick="insert('image')" alt="@{InsertImage}" src="images/icon_ins_image.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnTable"  onclick="insert('table')" alt="@{InsertTable}" src="images/icon_ins_table.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnTable"  onclick="document.getElementById('tblCtrl').style.visibility = 'visible';" alt="@{EditTable}" src="images/icon_edt_table.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnRule"   onclick="doStyle('InsertHorizontalRule')" alt="@{InsertLine}" src="images/icon_rule.gif" align="absMiddle" width="20" height="20">\r
+               <img id="btnSmile"  onclick="insert('smile')" alt="@{InsertSmily}" src="images/em.icon.smile.gif" align="absMiddle" width="15" height="15">\r
+               <img id="btnChar"       onclick="insert('char')" alt="@{InsertCharacter}" src="images/icon_ins_char.gif" align="absMiddle" width="20" height="20" border="0">\r
+               <img class="spacer" src="images/spacer.gif" width="2"><span class="sep"></span>\r
+               <img id="btnAbout"  onclick="insert('about')" alt="@{About}" src="images/icon_about.gif" align="absMiddle" width="16" height="16">\r
+    </span></nobr></td></tr>\r
+       <tr id="featureStyleBar" ondragstart="handleDrag(0)" onmouseup="press(false)" onmousedown="press(true)" onmouseover="hover(true)" onmouseout="hover(false)">\r
+    <td colspan=2 class="rebar"><nobr><span class="toolbar">\r
+               <img class="spacer" src="images/spacer.gif" width="2"><span class="start"></span>&nbsp;\r
+               <span id="featureStyle">\r
+                       <span class="label">@{Style}</span>\r
+                       <select name="" id="ctlStyle" class="button" onchange="addTag(this)">\r
+                       </select>\r
+                       <span class="sep"></span>\r
+               </span>\r
+               <span id="featureFont">\r
+                       <span class="label">@{Font}</span>\r
+                       <select hidefocus class="fontselect" id="ctlFont"  onchange="sel(this)">\r
+                               <option selected></option>\r
+                               <option id="Arial" value="Arial, Helvetica, sans-serif">Arial, Helvetica, sans-serif</option>\r
+                               <option id="Times New Roman" value="Times New Roman, Times, serif">Times New Roman, Times, serif</option>\r
+                               <option id="Courier New" value="Courier New, Courier, mono">Courier New, Courier, mono</option>\r
+                               <option id="Georgia" value="Georgia, Times New Roman, Times, serif">Georgia, Times New Roman, Times, serif</option>\r
+                               <option id="Verdana" value="Verdana, Arial, Helvetica, sans-serif">Verdana, Arial, Helvetica, sans-serif</option>\r
+                               <option id="Geneva" value="Geneva, Arial, Helvetica, sans-serif">Geneva, Arial, Helvetica, sans-serif</option>\r
+                       </select>\r
+               </span>\r
+               <span id="featureFontSize">\r
+                       <span class="sep"></span>\r
+                       <span class="label">@{Size}</span>\r
+                       <select hidefocus class="button" id="ctlSize"  onchange="sel(this)">\r
+                               <option selected></option>\r
+                               <option value="1">xx-small</option>\r
+                               <option value="2">x-small</option>\r
+                               <option value="3">small</option>\r
+                               <option value="4">medium</option>\r
+                               <option value="5">large</option>\r
+                               <option value="6">x-large</option>\r
+                               <option value="7">xx-large</option>\r
+                       </select>\r
+               </span>\r
+               <span id="featureColour">\r
+                       <span class="sep"></span>\r
+                       <img id="btnText"  onclick="pickColor('ForeColor')" alt="@{TextColor}" src="images/icon_color_text.gif" align="absMiddle" width="36" height="20">\r
+                       <img id="btnFill"  onclick="pickColor('BackColor')" alt="@{BackgroundColor}" src="images/icon_color_fill.gif" align="absMiddle" width="36" height="20">\r
+               </span>\r
+               <span id="featureSource">\r
+                       <img class="spacer" src="images/spacer.gif" width="2"><span class="start"></span>&nbsp;\r
+                       <span class="label">@{Source}</span>\r
+                       <input title="@{SourceTitle}" class="checkbox" hidefocus type="checkbox" name="switchMode"\r
+                                       onclick="tEdit.stopCellResize(true); tEdit.unSetTableElements(); setEditMode(switchMode)">\r
+               </span>\r
+       </span></nobr></td>\r
+</tr>\r
+<!-- Fields are inserted here -->\r
+<tr id="rebarBottom">\r
+    <td colspan=2 class="spacer" height="2"><img height="1" src="images/spacer.gif" align="left"></td></tr>\r
+  <tr>\r
+    <td colspan=2 class="textedit" id="textedit" valign="top" height="100%">\r
+               <div class="document" id="doc" onkeyup="reset(); markSelectedElement(); tEdit.setTableElements(); tEdit.repositionArrows();" contenteditable="false" style="OVERFLOW: auto; WIDTH: 100%; HEIGHT: 100%" onclick="reset(); markSelectedElement()"  onmouseup="markSelectedElement(); tEdit.setTableElements(); tEdit.stopCellResize(false);" onscroll="tEdit.repositionArrows()" height="100%" width="100%">\r
+         </div>\r
+       </td></tr>\r
+</table>\r
+<object id="color" data="colorchooser.html" type="text/x-scriptlet" VIEWASTEXT>\r
+</object>\r
+<script for="color" event="onscriptletevent(name, data)">\r
+       setColor(name, data);\r
+</script>\r
+\r
+<!-- Table Editing Layer ----------------------------------->\r
+<div id="tblCtrl" style="position:absolute; visibility:hidden; left:200; top:200; z-index: 5">\r
+<table border="0" cellpadding="0" cellspacing="0" width="68" bgcolor="buttonface">\r
+  <tr ondragstart="handleDrag(0)">\r
+   <td><img src="images/spacer.gif" width="8" height="1" border="0"></td>\r
+   <td><img src="images/spacer.gif" width="5" height="1" border="0"></td>\r
+   <td><img src="images/spacer.gif" width="18" height="1" border="0"></td>\r
+   <td><img src="images/spacer.gif" width="2" height="1" border="0"></td>\r
+   <td><img src="images/spacer.gif" width="22" height="1" border="0"></td>\r
+   <td><img src="images/spacer.gif" width="4" height="1" border="0"></td>\r
+   <td><img src="images/spacer.gif" width="9" height="1" border="0"></td>\r
+   <td><img src="images/spacer.gif" width="1" height="1" border="0"></td>\r
+  </tr>\r
+\r
+  <tr ondragstart="handleDrag(0)">\r
+   <td colspan="2" onClick="document.getElementById('tblCtrl').style.visibility = 'hidden';"><img name="CloseWindow" src="images/CloseWindow.gif" width="13" height="16" border="0"></td>\r
+   <td colspan="3" onmousedown="tEdit.setDrag( document.getElementById('tblCtrl') )" onmouseup="tEdit.setDrag( document.getElementById('tblCtrl') )"><img name="toolbar" src="images/toolbar.gif" width="42" height="16" border="0"></td>\r
+   <td colspan="2"><img name="minimize" src="images/minimize.gif" width="13" height="16" border="0"></td>\r
+   <td><img src="images/spacer.gif" width="1" height="16" border="0"></td>\r
+  </tr>\r
+  <tr ondragstart="handleDrag(0)">\r
+         <td colspan="7"><img name="hdr_tables" src="@{hdr_tables}" width="68" height="15" border="0"></td>\r
+   <td><img src="images/spacer.gif" width="1" height="15" border="0"></td>\r
+  </tr>\r
+  <tr ondragstart="handleDrag(0)">\r
+   <td colspan="7"><img name="plt_hdr" src="images/plt_hdr.gif" width="68" height="9" border="0"></td>\r
+   <td><img src="images/spacer.gif" width="1" height="9" border="0"></td>\r
+  </tr>\r
+\r
+  <tr ondragstart="handleDrag(0)" onmouseup="press(false)" onmousedown="press(true)" onmouseover="hover(true)" onmouseout="hover(false)">\r
+   <td rowspan="8"><img class="spacer" name="Editor_r4_c1" src="images/Editor_r4_c1.gif" width="8" height="112" border="0"></td>\r
+   <td colspan="2" class="tbl"><img name="rmv_colspan"  onclick="tEdit.splitCell();" src="images/rmv_colspan.gif" width="21" height="24" alt="@{RemoveColspan}"></td>\r
+   <td rowspan="8"><img class="spacer" name="Editor_r4_c4" src="images/Editor_r4_c4.gif" width="2" height="112" border="0"></td>\r
+   <td colspan="2" class="tbl"><img name="rmv_rowspan"  onclick="tEdit.unMergeDown();" src="images/rmv_rowspan.gif" width="24" height="24" alt="@{RemoveRowspan}"></td>\r
+   <td rowspan="8"><img class="spacer" name="Editor_r4_c7" src="images/Editor_r4_c7.gif" width="9" height="112" border="0"></td>\r
+   <td><img class="spacer" src="images/spacer.gif" width="1" height="26" border="0"></td>\r
+  </tr>\r
+\r
+  <tr ondragstart="handleDrag(0)">\r
+   <td colspan="2"><img class="spacer" name="Editor_r5_c2" src="images/Editor_r5_c2.gif" width="23" height="2" border="0"></td>\r
+   <td colspan="2"><img class="spacer" name="Editor_r5_c5" src="images/Editor_r5_c5.gif" width="26" height="2" border="0"></td>\r
+   <td><img class="spacer" src="images/spacer.gif" width="1" height="2" border="0"></td>\r
+  </tr>\r
+\r
+  <tr ondragstart="handleDrag(0)" onmouseup="press(false)" onmousedown="press(true)" onmouseover="hover(true)" onmouseout="hover(false)">\r
+         <td colspan="2" class="tbl"><img name="incr_colspan"  onclick="tEdit.mergeRight();" src="images/incr_colspan.gif" width="21" height="24" alt="@{IncreaseColspan}"  border="0"></td> \r
+         <td colspan="2" class="tbl"><img name="incr_rowspan" onclick="tEdit.mergeDown();" src="images/incr_rowspan.gif" width="24" height="24" alt="@{IncreaseRowspan}"  border="0"></td>\r
+   <td><img class="spacer" src="images/spacer.gif" width="1" height="26" border="0"></td>\r
+  </tr>\r
+\r
+  <tr ondragstart="handleDrag(0)">\r
+   <td colspan="2"><img class="spacer"  name="Editor_r7_c2" src="images/Editor_r7_c2.gif" width="23" height="2" border="0"></td>\r
+   <td colspan="2"><img class="spacer" name="Editor_r7_c5" src="images/Editor_r7_c5.gif" width="26" height="2" border="0"></td>\r
+   <td><img class="spacer" src="images/spacer.gif" width="1" height="2" border="0"></td>\r
+  </tr>\r
+\r
+  <tr ondragstart="handleDrag(0)" onmouseup="press(false)" onmousedown="press(true)" onmouseover="hover(true)" onmouseout="hover(false)">\r
+         <td colspan="2" class="tbl"><img name="add_col" onclick="tEdit.processColumn('add');"  src="images/add_col.gif" width="21" height="22" alt="@{AddColumn}" border="0" ></td> \r
+         <td colspan="2" class="tbl"><img name="add_row"  onclick="tEdit.processRow('add');" src="images/add_row.gif" width="24" height="22" alt="@{AddRow}" border="0" ></td>\r
+   <td><img src="images/spacer.gif" width="1" height="24" border="0"></td>\r
+  </tr>\r
+\r
+  <tr ondragstart="handleDrag(0)">\r
+   <td colspan="2"><img class="spacer" name="Editor_r9_c2" src="images/Editor_r9_c2.gif" width="23" height="4" border="0"></td>\r
+   <td colspan="2"><img class="spacer" name="Editor_r9_c5" src="images/Editor_r9_c5.gif" width="26" height="4" border="0"></td>\r
+   <td><img class="spacer" src="images/spacer.gif" width="1" height="4" border="0"></td>\r
+  </tr>\r
+\r
+  <tr ondragstart="handleDrag(0)" onmouseup="press(false)" onmousedown="press(true)" onmouseover="hover(true)" onmouseout="hover(false)">\r
+         <td colspan="2" class="tbl"><img name="rmv_col" onclick="tEdit.processColumn('remove');" src="images/rmv_col.gif" width="21" height="22" alt="@{RemoveColumn}" border="0" ></td> \r
+         <td colspan="2" class="tbl"><img name="rmv_row" onclick="tEdit.processRow('remove');" src="images/rmv_row.gif" width="24" height="22" alt="@{RemoveRow}" border="0" ></td>\r
+   <td><img src="images/spacer.gif" width="1" height="24" border="0"></td>\r
+  </tr>\r
+\r
+  <tr ondragstart="handleDrag(0)">\r
+   <td colspan="2"><img name="Editor_r11_c2" src="images/Editor_r11_c2.gif" width="23" height="4" border="0"></td>\r
+   <td colspan="2"><img name="Editor_r11_c5" src="images/Editor_r11_c5.gif" width="26" height="4" border="0"></td>\r
+   <td><img class="spacer" src="images/spacer.gif" width="1" height="4" border="0"></td>\r
+  </tr>\r
+\r
+  <tr ondragstart="handleDrag(0)">\r
+   <td colspan="7"><img name="plt_ftr" src="images/plt_ftr.gif" width="68" height="8" border="0"></td>\r
+   <td><img class="spacer" src="images/spacer.gif" width="1" height="8" border="0"></td>\r
+  </tr>\r
+</table>\r
+</div>\r
+\r
+</body></html>\r
diff --git a/lib/rte/rte.js b/lib/rte/rte.js
new file mode 100644 (file)
index 0000000..6734d2e
--- /dev/null
@@ -0,0 +1,633 @@
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// HTML Text Editing Component for hosting in Web Pages\r
+// Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License, or (at your option) any later version.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU LesserGeneral Public License\r
+// along with this program; if not a copy can be obtained from\r
+//\r
+//    http://www.gnu.org/copyleft/lesser.html\r
+//\r
+// or by writing to:\r
+//\r
+//    Free Software Foundation, Inc.\r
+//    59 Temple Place - Suite 330,\r
+//    Boston,\r
+//    MA  02111-1307,\r
+//    USA.\r
+//\r
+// Original Developer:\r
+//\r
+//   Austin David France\r
+//   Ramesys (Contracting Services) Limited\r
+//   Mentor House\r
+//   Ainsworth Street\r
+//   Blackburn\r
+//   Lancashire\r
+//   BB1 6AY\r
+//   United Kingdom\r
+//  email: Austin.France@Ramesys.com\r
+//\r
+// Home Page:    http://richtext.sourceforge.net/\r
+// Support:      http://richtext.sourceforge.net/\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Authors & Contributers:\r
+//\r
+//   OZ      Austin David France      [austin.france@ramesys.com]\r
+//            Primary Developer\r
+//\r
+//   LEON   Leon Reinders         [leonreinders@hetnet.nl]\r
+//            Author of View Source, History and Extended Style Functions\r
+//\r
+//   DIRK   Dirk Datzert         [Dirk.Datzert@rasselstein-hoesch.de]\r
+//            Justify Full Option\r
+//\r
+//      BC             Bill Chalmers           [bill_paula@btinternet.com]\r
+//                      Font Selection\r
+//\r
+// History:\r
+//\r
+//   OZ      21-01-2002\r
+//         Fix a bug in applyOptions() that was not detecting a truth setting\r
+//         properly.  Changed substr(eq) to substr(eq+1).  Also, set the\r
+//         runtime style property, not the style property.\r
+//\r
+//   OZ      22-01-2002\r
+//         Moved initEditor() function into here from richedit.html\r
+//\r
+//   OZ      22-01-2002\r
+//         Added handleDrag() method to handle drag and drop events within the\r
+//         html of the editor.  Drag and drop is currently disabled until we\r
+//         can find a practicle use for it.\r
+//\r
+//   OZ      10-02-2002\r
+//         Added code to handle the new Full Justify Option.  Implementation of\r
+//         a mod to the editor made by Dirk Datzert who supplied the code and\r
+//         the Image.\r
+//\r
+//   OZ      11-02-2002\r
+//         Startup with text area set to contenteditable="false".  The content\r
+//         is made editable when the editor has been initialised.\r
+//\r
+//   OZ      12-02-2002\r
+//         Fix handling of mouse hover when hover over a button that is in the\r
+//         down state.  The down state of the button was being lost.  This is\r
+//         a re-introduction of an earlier bug which I thought was fixed.\r
+//         The bug also occured when the button was pressed in some \r
+//         circumstances.  The fix implemented is to have a button state \r
+//         property which is set when the state of a button is set in the\r
+//         setState() routine and this is used to restore the button state when\r
+//         the button is released or mouse moves out.\r
+//\r
+//     OZ              12-06-2002 [richtext-Bugs-567960] Text area of editor window not get focus\r
+//                     Ensure the doc element (the DIV) has focus once initialisation is\r
+//                     complete.  This ensures that when no HTML is supplied via the docHtml\r
+//                     property, that focus is where the user expects.\r
+//\r
+//     BC           10-07-2002\r
+//                      added getfontface() function to retrieve the new "web style" font selection\r
+//                      this function is called from reset() in the same way as getStyle()\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+// Internal (private) properties.  \r
+// RichEditor is the global RichEditor object (function) of which there is only\r
+// 1 instance.\r
+RichEditor.txtView = true;         // WYSIWYG mode.  false == View Source\r
+\r
+// initEditor(): Initialise the editor (called on window load, see below)\r
+function initEditor()\r
+{\r
+       // Apply style data if supplied\r
+       if (!public_description.styleData) {\r
+         public_description.put_styleData(null);\r
+       }\r
+\r
+       // Apply default editor options\r
+       var strDefaults = 'dragdrop=no;source=yes';\r
+       strDefaults += ';history=' + (document.queryCommandSupported('Undo') ? 'yes' : 'no');\r
+       applyOptions(strDefaults);\r
+\r
+       // Prepare the editable region\r
+       loading.style.display = 'none';\r
+    doc.contentEditable = "true";\r
+    editor.style.visibility = 'visible';\r
+\r
+       // OZ - 12-06-2002\r
+       // Put focus into the document (required when no HTML is supplied via docHtml property)\r
+       doc.focus();\r
+}\r
+\r
+// checkRange(): make sure our pretend document (the content editable\r
+// DIV with id of "doc") has focus and that a text range exists (which\r
+// is what execCommand() operates on).\r
+function checkRange()\r
+{\r
+   RichEditor.selectedImage = null;\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+   doc.focus();\r
+   if (document.selection.type == "None") {\r
+      document.selection.createRange();\r
+   }\r
+var r = document.selection.createRange();\r
+   DBG(1, 'RANGE Bounding('\r
+            + 'top='+r.boundingHeight\r
+            + ', left='+r.boundingHeight\r
+            + ', width='+r.boundingWidth\r
+            + ', height='+r.boundingHeight + ')'\r
+         + ', Offset('\r
+            + 'top='+r.offsetTop\r
+            + ', left='+r.offsetLeft + ')'\r
+         + ', Text=(' + r.text + ')'\r
+         + ', HTML=(' + r.htmlText + ')'\r
+      );\r
+}\r
+\r
+// post(): Called in response to clicking the post button in the\r
+// toolbar. It fires an event in the container named post, passing the\r
+// HTML of our newly edited document as the data argument.\r
+function post()\r
+{\r
+   DBG(1, 'Raise "post" event');\r
+   window.external.raiseEvent("post", doc.innerHTML);\r
+}\r
+\r
+// insert(): called in response to clicking the insert table, image,\r
+// smily icons in the toolbar.  Loads up an appropriate dialog to\r
+// prompt for information, the dialog then returns the HTML code or\r
+// NULL.  We paste the HTML code into the document.\r
+function insert(what)\r
+{\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+\r
+   DBG(1, 'insert(' + what + ')');\r
+\r
+   // Chose action based on what is being inserted.\r
+   switch(what)\r
+   {\r
+   case "table":\r
+      strPage = "dlg_ins_table.html";\r
+      strAttr = "status:no;dialogWidth:340px;dialogHeight:360px;help:no";\r
+      break;\r
+   case "smile":\r
+      strPage = "dlg_ins_smile.html";\r
+      strAttr = "status:no;dialogWidth:300px;dialogHeight:350px;help:no";\r
+      break;\r
+   case "char":\r
+      strPage = "dlg_ins_char.html";\r
+      strAttr = "status:no;dialogWidth:450px;dialogHeight:290px;help:no";\r
+      break;\r
+   case "image":\r
+      strPage = "dlg_ins_image.html";\r
+      strAttr = "status:no;dialogWidth:400px;dialogHeight:200px;help:no";' '\r
+      break;\r
+   case "about":\r
+      strPage = "dlg_about.html";\r
+      strAttr = "status:no;dialogWidth:500px;dialogHeight:405px;help:no";' '\r
+      break;\r
+   }\r
+\r
+   // run the dialog that implements this type of element\r
+   html = showModalDialog(strPage, window, strAttr);\r
+\r
+   // and insert any result into the document.\r
+   if (html) {\r
+      insertHtml(html);\r
+   }\r
+}\r
+\r
+// insertHtml(): Insert the supplied HTML into the current position\r
+// within the document.\r
+function insertHtml(html)\r
+{\r
+   doc.focus();\r
+   var sel = document.selection.createRange();\r
+   // don't try to insert HTML into a control selection (ie. image or table)\r
+   if (document.selection.type == 'Control') {\r
+      return;\r
+   }\r
+   sel.pasteHTML(html);\r
+}\r
+\r
+// doStyle(): called to handle the simple style commands such a bold,\r
+// italic etc.  These require no special handling, just a call to\r
+// execCommand().  We also call reset so that the toolbar represents\r
+// the state of the current text.\r
+//\r
+// 2002-07-30 Updated based on patch submitted by Michael Keck (mkkeck) \r
+//\r
+function doStyle(s){ \r
+   if(!RichEditor.txtView) return; \r
+   /* Disabled in View Source mode */ \r
+   DBG(1, 'doStyle(' + s + ')'); \r
+   checkRange(); \r
+   if(s!='InsertHorizontalRule'){ \r
+      /* what command string? */ \r
+      document.execCommand(s); \r
+   } else if( s=='InsertHorizontalRule') { \r
+      /* if s=='InsertHorizontalRule then use this command */ \r
+      document.execCommand(s,false, null); \r
+\r
+      /* Note: \r
+      In your source view the <HR> has an ID like this \r
+      <HR id=null> \r
+      */ \r
+   } \r
+   reset(); \r
+} \r
+\r
+\r
+// link(): called to insert a hyperlink.  It will use the selected text\r
+// if there is some, or the URL entered if not.  If clicked when over a\r
+// link, that link is allowed to be edited.\r
+function link(on)\r
+{\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+\r
+   var strURL = "http://";\r
+   var strText;\r
+\r
+   // First, pick up the current selection.\r
+   doc.focus();\r
+   var r = document.selection.createRange();\r
+   var el = r.parentElement();\r
+\r
+   // Is this aready a link?\r
+   if (el && el.nodeName == "A") {\r
+      r.moveToElementText(el);\r
+      if (!on) {      // If removing the link, then replace all with\r
+         r.pasteHTML(el.innerHTML);\r
+         return;\r
+      }\r
+      strURL = el.href;\r
+   }\r
+\r
+   // Get the text associated with this link\r
+   strText = r.text;\r
+\r
+   // Prompt for the URL\r
+   strURL = window.prompt("Enter URL", strURL);\r
+   if (strURL) {\r
+      // Default the TEXT to the url if non selected\r
+      if (!strText || !strText.length) {\r
+         strText = strURL;\r
+      }\r
+\r
+      // Replace with new URL\r
+      r.pasteHTML('<A href=' + strURL + ' target=_new>' + strText + '</a>');\r
+   }\r
+\r
+   reset();\r
+}\r
+\r
+// sel(); similar to doStyle() but called from the dropdown list boxes\r
+// for font and style commands.\r
+function sel(el)\r
+{\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+   checkRange();\r
+   switch(el.id)\r
+   {\r
+   case "ctlFont":\r
+      document.execCommand('FontName', false, el[el.selectedIndex].value);\r
+      break;\r
+   case "ctlSize":\r
+      document.execCommand('FontSize', false, el[el.selectedIndex].value);\r
+      break;\r
+   case "ctlStyle":\r
+      document.execCommand('FormatBlock', false, el[el.selectedIndex].text);\r
+      break;\r
+   }\r
+   doc.focus();\r
+   reset();\r
+}\r
+\r
+// pickColor(): called when the text or fill color icons are clicked.  Displays\r
+// the color chooser control.  The color setting is completed by the event\r
+// handler of this control (see richedit.html)\r
+function pickColor(fg)\r
+{\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+   checkRange();\r
+   var el = window.event.srcElement;\r
+   if (el && el.nodeName == "IMG") {\r
+      setState(el, true);\r
+   }\r
+   color.style.top = window.event.clientY + 10;\r
+   color.style.left = window.event.clientX - 100;\r
+   color.style.display = 'block';\r
+   color._fg = fg;\r
+}\r
+\r
+// setColor(): called from the fore/back color selection dialog event handler\r
+// to set/reset the fore/background color.\r
+function setColor(name, data)\r
+{\r
+   color.style.display = 'none';\r
+   checkRange();\r
+   if (!data) {\r
+      removeFormat(document.selection.createRange(), color._fg);\r
+   } else {\r
+      document.execCommand(color._fg, false, data);\r
+   }\r
+   setState(btnText, false);\r
+   setState(btnFill, false);\r
+   doc.focus();\r
+}\r
+\r
+// removeFormat(): Called to remove specific formats from the selected text.\r
+// The 'removeFormat' command removes all formatting.  The principle behind\r
+// this routine is to have a list of the possible formats the selection may\r
+// have, check the selection for the current formats, ignoreing the one we\r
+// want to use, then remove all formatting and then re-apply all but the\r
+// one we wanted to remove.\r
+function removeFormat(r, name)\r
+{\r
+   var cmd = [ "Bold", "Italic", "Underline", "Strikethrough", "FontName", "FontSize", "ForeColor", "BackColor" ];\r
+   var on = new Array(cmd.length);\r
+   for (var i = 0; i < cmd.length; i++) {\r
+      on[i] = name == cmd[i] ? null : r.queryCommandValue(cmd[i]);\r
+   }\r
+   r.execCommand('RemoveFormat');\r
+   for (var i = 0; i < cmd.length; i++) {\r
+      if (on[i]) r.execCommand(cmd[i], false, on[i]);\r
+   }\r
+}\r
+\r
+// setValue(): called from reset() to make a select list show the current font\r
+// or style attributes\r
+function selValue(el, str)\r
+{\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+   for (var i = 0; i < el.length; i++) {\r
+      if ((!el[i].value && el[i].text == str) || el[i].value == str) {\r
+         el.selectedIndex = i;\r
+         return;\r
+      }\r
+   }\r
+   el.selectedIndex = 0;\r
+}\r
+\r
+// setState(): called from reset() to make a button represent the state\r
+// of the current text.  Pressed is on, unpressed is off.\r
+function setState(el, on)\r
+{\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+   if (!el.disabled) {\r
+      if (on) {\r
+         el.defaultState = el.className = "down";\r
+      } else {\r
+         el.defaultState = el.className = null;\r
+      }\r
+   }\r
+}\r
+\r
+// getStyle(): called to obtain the class or type of formatting applied to an element,\r
+// This is used by reset() to set the state of the toolbar to indicate the class of\r
+// the current element.\r
+function getStyle() {\r
+   var style = document.queryCommandValue('FormatBlock');\r
+   if (style == "Normal") {\r
+      doc.focus();\r
+      var rng = document.selection.createRange();\r
+      if (typeof(rng.parentElement) != "undefined") {\r
+         var el = rng.parentElement();\r
+         var tag = el.nodeName.toUpperCase();\r
+         var str = el.className.toLowerCase();\r
+         if (!(tag == "DIV" && el.id == "doc" && str == "textedit")) {\r
+            if (tag == "SPAN") {\r
+               style = "." + str;\r
+            } else if (str == "") {\r
+               style = tag;\r
+            } else {\r
+               style = tag + "." + str;\r
+            }\r
+         }\r
+         return style;\r
+      }\r
+   }\r
+   return style;\r
+}\r
+\r
+// getfontface(): called to obtain the face attribute applied to a font tag,\r
+// This is used by reset() to set the state of the toolbar to indicate the class of\r
+// the current element.\r
+function getfontface()\r
+{\r
+var family = document.selection.createRange(); //create text range\r
+\r
+// don't get font face for image or table\r
+if (document.selection.type == 'Control') {\r
+   return;\r
+}\r
+\r
+var el = family.parentElement(); //get parent element\r
+var tag = el.nodeName.toUpperCase(); //convert tag element to upper case\r
+\r
+       if (typeof(el.parentElement) != "undefined" && tag == "FONT") { //only do function if tag is font - this is for greater execution speed\r
+               var elface = el.getAttribute('FACE'); //get the font tags FACE attribute\r
+               return elface; //return the value of the face attribute to the reset() function\r
+       }\r
+}\r
+\r
+// markSelectedElement(): called by onClick and onKeyup events\r
+// on the contectEditable area\r
+function markSelectedElement() {\r
+\r
+   RichEditor.selectedImage = null;\r
+\r
+   var r = document.selection.createRange();\r
+\r
+   if (document.selection.type != 'Text') {\r
+      if (r.length == 1) {\r
+         if (r.item(0).tagName == "IMG") {\r
+            RichEditor.selectedImage = r.item(0);\r
+         }\r
+      }\r
+   }\r
+}\r
+\r
+// reset(): called from all over the place to make the toolbar\r
+// represent the current text. If el specified, it was called from\r
+// hover(off)\r
+function reset(el)\r
+{\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+   if (!el) color.style.display = 'none';\r
+   if (!el || el == ctlStyle)         selValue(ctlStyle, getStyle());\r
+   if (!el || el == ctlFont)         selValue(ctlFont, getfontface());\r
+   if (!el || el == ctlSize)         selValue(ctlSize, document.queryCommandValue('FontSize'));\r
+   if (!el || el == btnBold)         setState(btnBold, document.queryCommandValue('Bold'));\r
+   if (!el || el == btnItalic)         setState(btnItalic,   document.queryCommandValue('Italic'));\r
+   if (!el || el == btnUnderline)      setState(btnUnderline, document.queryCommandValue('Underline'));\r
+   if (!el || el == btnStrikethrough)   setState(btnStrikethrough, document.queryCommandValue('Strikethrough'));\r
+   if (!el || el == btnLeftJustify)   setState(btnLeftJustify, document.queryCommandValue('JustifyLeft'));\r
+   if (!el || el == btnCenter)         setState(btnCenter,   document.queryCommandValue('JustifyCenter'));\r
+   if (!el || el == btnRightJustify)   setState(btnRightJustify, document.queryCommandValue('JustifyRight'));\r
+   if (!el || el == btnFullJustify)   setState(btnFullJustify, document.queryCommandValue('JustifyFull'));\r
+   if (!el || el == btnNumList)      setState(btnNumList, document.queryCommandValue('InsertOrderedList'));\r
+   if (!el || el == btnBulList)      setState(btnBulList, document.queryCommandValue('InsertUnorderedList'));\r
+}\r
+\r
+// hover(): Handles mouse hovering over toolbar buttons\r
+function hover(on)\r
+{\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+   var el = window.event.srcElement;\r
+   if (el && !el.disabled && el.nodeName == "IMG" && el.className != "spacer") {\r
+      if (on) {\r
+         el.className = "hover";\r
+      } else {\r
+         el.className = el.defaultState ? el.defaultState : null;\r
+      }\r
+   }\r
+}\r
+// hover(): Handles mouse clicks on toolbar buttons\r
+function press(on)\r
+{\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+   var el = window.event.srcElement;\r
+   if (el && !el.disabled && el.nodeName == "IMG" && el.className != "spacer") {\r
+      if (on) {\r
+         el.className = "down";\r
+      } else {\r
+         el.className = el.className == "down" ? "hover" : el.defaultState ? el.defaultState : null;\r
+      }\r
+   }\r
+}\r
+\r
+// addTag(): This is the handler for the style dropdown.  This takes value\r
+// selected and interprates it and makes the necessary changes to the HTML to\r
+// apply this style.\r
+function addTag(obj) {\r
+\r
+   if (!RichEditor.txtView) return;      // Disabled in View Source mode\r
+\r
+   // Determine the type of element we are dealing with.\r
+   // TYPE 0 IS NORMAL-TAG, 1 IS CLASS, 2 IS SUBCLASS, 3 = Format Block command\r
+   var value = obj[obj.selectedIndex].value;\r
+   if (!value) {                        // Format Block\r
+      sel(obj);\r
+      return;\r
+   }\r
+\r
+   var type = 0;                        // TAG\r
+\r
+   if (value.indexOf(".") == 0) {            // .className\r
+      type = 1;\r
+   } else if (value.indexOf(".") != -1) {      // TAG.className\r
+      type = 2;\r
+   }\r
+\r
+   doc.focus();\r
+\r
+   // Pick up the highlighted text\r
+   var r = document.selection.createRange();\r
+   r.select();\r
+   var s = r.htmlText;\r
+\r
+   // If we have some selected text, then ignore silly selections\r
+   if (s == " " || s == "&nbsp;") {\r
+      return;\r
+   }\r
+\r
+   // How we apply formatting is based upon the type of formitting being\r
+   // done.\r
+   switch(type)\r
+   {\r
+   case 1:\r
+      // class: Wrap the selected text with a span of the specified\r
+      // class name\r
+      value = value.substring(1,value.length);\r
+      r.pasteHTML("<span class="+value+">" + r.htmlText + "</span>")\r
+      break;\r
+\r
+   case 2:\r
+      // subclass: split the value into tag + class\r
+      value = value.split(".");\r
+      r.pasteHTML('<' + value[0] + ' class="' + value[1] +'">'\r
+               + r.htmlText\r
+               + '</' + value[0] + '>'\r
+            );\r
+      break;\r
+\r
+   default:\r
+      // TAG: wrap up the highlighted text with the specified tag\r
+      r.pasteHTML("<"+value+">"+r.htmlText+"</"+value+">")\r
+      break;\r
+   }\r
+}\r
+\r
+// initStyleDropdown(): This takes the passed styleList and generates the style\r
+// dropdown list box from it.\r
+function initStyleDropdown(styleList) {\r
+\r
+   // Build the option list for the styles dropdown from the passed styles\r
+   for (var i = 0; i < styleList.length; i++) {\r
+      var oOption = document.createElement("OPTION");\r
+      if (styleList[i][0]) oOption.value = styleList[i][0];\r
+      oOption.text = styleList[i][1];\r
+      oOption.style.backgroundColor = 'white';\r
+      document.all.ctlStyle.add(oOption);\r
+   }\r
+}\r
+\r
+// applyOptions(): This takes the passed options string and actions them.\r
+// Called during the init process.\r
+function applyOptions(str)\r
+{\r
+   var options = str.split(";");\r
+   for (var i = 0; i < options.length; i++) {\r
+      var eq = options[i].indexOf('=');\r
+      var on = eq == -1 ? true : "yes;true;1".indexOf(options[i].substr(eq+1).toLowerCase()) != -1;\r
+      var name = eq == -1 ? options[i] : options[i].substr(0,eq);\r
+      var el = document.all("feature" + name);\r
+      if (el) {\r
+         el.runtimeStyle.display = (on ? 'inline' : 'none'); \r
+      } else {\r
+         if (!RichEditor.aOptions) RichEditor.aOptions = new Array;\r
+         RichEditor.aOptions[name] = on;\r
+      }\r
+   }\r
+}\r
+\r
+// getOption(): Get the value for a previously set option or return undefined if\r
+// the option is not set.\r
+function getOption(name)\r
+{\r
+   if (RichEditor.aOptions) return RichEditor.aOptions[name];\r
+   return;   // Undefined\r
+} \r
+\r
+// Handle drag and drop events into the editor window.  Until we\r
+// work out how to handle these better (which requires co-operation\r
+// from the code being dragged from as far as I can tell) we simply\r
+// disable the functionality.\r
+function handleDrag(n)\r
+{\r
+   // if drag and drop is disabled, then cancel the dragdrop\r
+   // events\r
+   if (!getOption("dragdrop"))\r
+   {\r
+      switch(n) {\r
+      case 0:   // ondragenter\r
+         window.event.dataTransfer.dropEffect = "none";\r
+         break;\r
+      }\r
+      // Cancel the event\r
+      window.event.returnValue = false;\r
+   }\r
+}\r
+\r
diff --git a/lib/rte/rte_codesweep.js b/lib/rte/rte_codesweep.js
new file mode 100644 (file)
index 0000000..4033805
--- /dev/null
@@ -0,0 +1,115 @@
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// HTML Text Editing Component for hosting in Web Pages\r
+// Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License, or (at your option) any later version.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU LesserGeneral Public License\r
+// along with this program; if not a copy can be obtained from\r
+//\r
+//    http://www.gnu.org/copyleft/lesser.html\r
+//\r
+// or by writing to:\r
+//\r
+//    Free Software Foundation, Inc.\r
+//    59 Temple Place - Suite 330,\r
+//    Boston,\r
+//    MA  02111-1307,\r
+//    USA.\r
+//\r
+// Original Developer:\r
+//\r
+//     Austin David France\r
+//     Ramesys (Contracting Services) Limited\r
+//     Mentor House\r
+//     Ainsworth Street\r
+//     Blackburn\r
+//     Lancashire\r
+//     BB1 6AY\r
+//     United Kingdom\r
+//  email: Austin.France@Ramesys.com\r
+//\r
+// Home Page:    http://richtext.sourceforge.net/\r
+// Support:      http://richtext.sourceforge.net/\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Author(s):  leonreinders@hetnet.nl                          LEON\r
+//\r
+// History:\r
+//\r
+//     LEON    04-08-2001\r
+//                     Initial Implementation\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+function replaceCharacters(html) {\r
+\r
+       // Special characters and their HTML equivelent\r
+       var set = [\r
+               ["\80","\91","\92","\92","\93","\94","\96","\97","¡","¢","£","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ü","ý","þ","ÿ"],\r
+               ["&euro;","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","&ndash;","&mdash;","&iexcl;","&cent;","&pound;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","­","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;"]\r
+       ];\r
+\r
+       // Replace each instance of one of the above special characters with it's HTML equivelent\r
+       if (html) {\r
+               for(var j = 0; j < set[0].length; j++){\r
+                       html = html.replace(eval("/"+set[0][j]+"/g"),set[1][j]);\r
+               }\r
+       }\r
+\r
+       // Return the HTML or an empty string if no HTML was supplied\r
+       return html || "";\r
+}\r
+\r
+// removes empty tags and tags with only non-breaking-spaces unlimited levels\r
+function removeEmptyTags(html) {\r
+       var re = /<[^(>|\/)]+>[ |       ]*<\/[^>]+>/gi;\r
+       while(re.test(html)) {\r
+               html = html.replace(re,"");\r
+               while(re.test(html)) {\r
+                       html = html.replace(re,"");\r
+               }\r
+       }\r
+       return html;\r
+}\r
+\r
+// replaceAbsoluteUrls(): replaces absolute URL's with relative urls\r
+// assuming the editor is in a level equal-to or above the image.\r
+function replaceAbsoluteUrls(html) {\r
+       var docLoc = document.location.toString();\r
+       docLoc = docLoc.substring(0,docLoc.lastIndexOf("/")+1);\r
+       docLoc = docLoc.replace(/\//gi,"\\\/");\r
+       var re = eval("/"+docLoc+"/gi");\r
+       return html.replace(re, "");\r
+}\r
+\r
+// replaceTags(): replace tags for better formatting\r
+// set: [[tag,replacement],[tag,replacm....\r
+function replaceTags(set, html) {\r
+       var re;\r
+       for(var i = 0; i < set.length; i++) {\r
+               re = eval("/(<[\/]{0,1})"+set[i][0]+">/gi");\r
+               html=html.replace(re,"$1"+set[i][1]+">");\r
+       }\r
+       return html\r
+}\r
+\r
+// codeSweeper(): apply several code-modifications\r
+function codeSweeper() {\r
+       var html = doc.innerHTML;\r
+       if (html) html = replaceCharacters(html);\r
+       if (html) html = replaceAbsoluteUrls(html);\r
+       // if (html) html = removeEmptyTags(html)\r
+       if (html) html = replaceTags([["strong","B"],["em","I"]],html);\r
+       return html;\r
+}\r
diff --git a/lib/rte/rte_debug.js b/lib/rte/rte_debug.js
new file mode 100644 (file)
index 0000000..88964b9
--- /dev/null
@@ -0,0 +1,106 @@
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// HTML Text Editing Component for hosting in Web Pages\r
+// Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License, or (at your option) any later version.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU LesserGeneral Public License\r
+// along with this program; if not a copy can be obtained from\r
+//\r
+//    http://www.gnu.org/copyleft/lesser.html\r
+//\r
+// or by writing to:\r
+//\r
+//    Free Software Foundation, Inc.\r
+//    59 Temple Place - Suite 330,\r
+//    Boston,\r
+//    MA  02111-1307,\r
+//    USA.\r
+//\r
+// Original Developer:\r
+//\r
+//     Austin David France\r
+//     Ramesys (Contracting Services) Limited\r
+//     Mentor House\r
+//     Ainsworth Street\r
+//     Blackburn\r
+//     Lancashire\r
+//     BB1 6AY\r
+//     United Kingdom\r
+//  email: Austin.France@Ramesys.com\r
+//\r
+// Home Page:    http://richtext.sourceforge.net/\r
+// Support:      http://richtext.sourceforge.net/\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Authors & Contributers:\r
+//\r
+//     OZ              Austin David France             [austin.france@ramesys.com]\r
+//                             Primary Developer\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+// DBG(): Get the debug window handle in a safe manaer.\r
+function DBGGetWindow(el) {\r
+       if (el) {\r
+               // Debug window closed?\r
+               try { el.className; } catch(e) {\r
+                       if (e.number == -2147418094) {\r
+                               return null;\r
+                       }\r
+               }\r
+       }\r
+       return el;\r
+}\r
+\r
+// DBG(): Debug routine activated by the debugWindow property\r
+function DBG(n, str)\r
+{\r
+       // Initialise debug functionality, first time in or if DBG() is called\r
+       // with no arguments (as called from put_debugWindow).\r
+       if (typeof(n) == "undefined" || !DBG.fInitialised) {\r
+               var el = DBGGetWindow(public_description.debugWindow);\r
+               if (el) {\r
+                       el.className = "debugWindow";\r
+                       el.innerHTML = '<table width="100%" id="debug">'\r
+                                                       + '<tr><th>Seq</th><th>Caller</th><th>Debug</th></tr>'\r
+                                                       + '</table>';\r
+                       DBG.idTable = el.all("debug");\r
+               }\r
+               DBG.fInitialised = true;\r
+               DBG.seq = 0;\r
+       }\r
+\r
+       // If debug window supplied, then output debug message, assuming one was\r
+       // supplied.\r
+       if (typeof(str) != "undefined") {\r
+               var el = DBGGetWindow(DBG.idTable);\r
+               if (el) {\r
+                       var row = el.insertRow(1);\r
+                       var caller = DBG.caller.toString().substr(9);\r
+                       var cell = row.insertCell();\r
+                       cell.innerText = DBG.seq++;\r
+                       cell.nowrap = '';\r
+                       cell = row.insertCell();\r
+                       cell.innerText = caller.substr(0, caller.indexOf('\n'));\r
+                       cell.nowrap = '';\r
+                       row.insertCell().innerText = str;\r
+               } else {\r
+                       // If no debug window, but RichEdit.debug is true, then output\r
+                       // debugs to status bar.\r
+                       if (RichEditor.debug) {\r
+                               window.status = str;\r
+                       }\r
+               }\r
+       }\r
+}\r
diff --git a/lib/rte/rte_dunno.css b/lib/rte/rte_dunno.css
new file mode 100644 (file)
index 0000000..dc3a5de
--- /dev/null
@@ -0,0 +1,54 @@
+       .text{\r
+               font-family : Arial, Helvetica, sans-serif;\r
+               font-size : x-small;\r
+               color : black;\r
+       }\r
+       .red{\r
+       font-family : Arial, Helvetica, sans-serif;\r
+       color : red;\r
+}\r
+       .acomment{\r
+       background-color : #E7E7E7;\r
+       color : Gray;\r
+       font-family : Arial, Helvetica, sans-serif;\r
+       font-size : x-small;\r
+}\r
+       DIV.red{\r
+       font-family : Arial, Helvetica, sans-serif;\r
+       color : red;\r
+       font-size : x-small;\r
+}\r
+       LI.red{\r
+       font-family : Arial, Helvetica, sans-serif;\r
+       color : red;\r
+       font-size : x-small;\r
+}\r
+       H1{\r
+               font-family : "Lucida Console";\r
+               font-variant : small-caps;\r
+               font-size : larger;\r
+               color : ButtonHighlight;\r
+               font-style : italic;\r
+               font-weight : 300;\r
+               letter-spacing : 3px;\r
+       }\r
+       address{\r
+               font-family : "Lucida Console";\r
+               font-variant : small-caps;\r
+               font-size : smaller;\r
+               color : Gray;\r
+               font-style : normal;\r
+               font-weight : bolder;\r
+               letter-spacing : normal;\r
+               text-align : center;\r
+       }\r
+       H1.purple{\r
+               font-family : "Lucida Console";\r
+               font-variant : small-caps;\r
+               font-size : larger;\r
+               color : Violet;\r
+               font-style : italic;\r
+               font-weight : 300;\r
+               letter-spacing : 3px;\r
+               border : #9966FF;\r
+       }
\ No newline at end of file
diff --git a/lib/rte/rte_editmode.js b/lib/rte/rte_editmode.js
new file mode 100644 (file)
index 0000000..1d07499
--- /dev/null
@@ -0,0 +1,125 @@
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// HTML Text Editing Component for hosting in Web Pages\r
+// Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License, or (at your option) any later version.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU LesserGeneral Public License\r
+// along with this program; if not a copy can be obtained from\r
+//\r
+//    http://www.gnu.org/copyleft/lesser.html\r
+//\r
+// or by writing to:\r
+//\r
+//    Free Software Foundation, Inc.\r
+//    59 Temple Place - Suite 330,\r
+//    Boston,\r
+//    MA  02111-1307,\r
+//    USA.\r
+//\r
+// Original Developer:\r
+//\r
+//     Austin David France\r
+//     Ramesys (Contracting Services) Limited\r
+//     Mentor House\r
+//     Ainsworth Street\r
+//     Blackburn\r
+//     Lancashire\r
+//     BB1 6AY\r
+//     United Kingdom\r
+//  email: Austin.France@Ramesys.com\r
+//\r
+// Home Page:    http://richtext.sourceforge.net/\r
+// Support:      http://richtext.sourceforge.net/\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Author(s):  leonreinders@hetnet.nl                          LEON\r
+//\r
+//                             Austin.France@Ramesys.com                       OZ\r
+//\r
+// History:\r
+//\r
+//     LEON    04-08-2001\r
+//                     Initial Implementation\r
+//\r
+//     OZ              Disable/enable post button during view source mode.\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+// setEditMode(): switch between html and textview\r
+function setEditMode() {\r
+       switchMode.blur(); // htmlview\r
+       if (switchMode.checked == true) {\r
+               ctlStyle.disabled = ctlFont.disabled = ctlSize.disabled = btnPost.disabled = true;\r
+               btnPost.className = 'disabled';\r
+               doc.style.fontFamily = "Courier";\r
+               doc.style.fontSize = "10px";\r
+               RichEditor.txtView = false;\r
+               doc.innerText = codeSweeper();\r
+               doc.innerHTML = ccParser(doc.innerHTML);\r
+       } else {\r
+               ctlStyle.disabled = ctlFont.disabled = ctlSize.disabled = btnPost.disabled = false;\r
+               doc.style.fontFamily = doc.style.fontSize = "";\r
+               btnPost.className = '';\r
+               RichEditor.txtView = true;\r
+               doc.focus();\r
+               doc.innerHTML = doc.innerText;\r
+       }\r
+}\r
+\r
+// resetMode();\r
+function resetMode(){\r
+       if (switchMode.checked == true) {\r
+               switchMode.click();\r
+       }\r
+}\r
+\r
+// ccParser(): colorcode-parser for html-editing view\r
+function ccParser(html) {\r
+\r
+       html = html.replace(/@/gi,"_AT_");\r
+       html = html.replace(/#/gi,"_HASH_");\r
+\r
+       var htmltag = /(&lt;[\w\/]+[ ]*[\w\=\"\'\.\/\;\: \)\(-]*&gt;)/gi;\r
+       html = html.replace(htmltag,"<span class=ccp_tag>$1</span>");\r
+\r
+       var imgtag = /<span class=ccp_tag>(&lt;IMG[ ]*[\w\=\"\'\.\/\;\: \)\(-]*&gt;)<\/span>/gi;\r
+       html = html.replace(imgtag,"<span class=ccp_img>$1</span>");\r
+\r
+       var formtag = /<span class=ccp_tag>(&lt;[\/]*(form|input){1}[ ]*[\w\=\"\'\.\/\;\: \)\(-]*&gt;)<\/span>/gi;\r
+       html = html.replace(formtag,"<br><span class=ccp_form>$1</span>");\r
+\r
+       var tabletag = /<span class=ccp_tag>(&lt;[\/]*(table|tbody|th|tr|td){1}([ ]*[\w\=\"\'\.\/\;\:\)\(-]*){0,}&gt;)<\/span>/gi;\r
+       html = html.replace(tabletag,"<span class=ccp_table>$1</span>");\r
+\r
+       //var Atag = /<span class=ccp_tag>(&lt;(\/a&gt;|[\W _\w\=\"\'\.\/\;\:\)\(-]&gt;){1})<\/span>/gi;\r
+       var Atag = /<span class=ccp_tag>(&lt;\/a&gt;){1}<\/span>/gi;\r
+       html = html.replace(Atag,"<span class=ccp_A>$1</span>");\r
+\r
+       var Atag = /<span class=ccp_tag>(&lt;a [\W _\w\=\"\'\.\/\;\:\)\(-]+&gt;){1,}<\/span>/gi;\r
+       html = html.replace(Atag,"<span class=ccp_A>$1</span>");\r
+\r
+       var parameter = /=("[ \w\'\.\/\;\:\)\(-]+"|'[ \w\"\.\/\;\:\)\(-]+')/gi;\r
+       html = html.replace(parameter,"=<span class=ccp_paramvalue>$1</span>");\r
+\r
+       var entity = /&amp;([\w]+);/gi;\r
+       html = html.replace(entity,"<span class=ccp_entity>&amp;$1;</span>");\r
+\r
+       var comment = /(&lt;\!--[\W _\w\=\"\'\.\/\;\:\)\(-]*--&gt;)/gi;\r
+       html = html.replace(comment,"<br><span class=ccp_htmlcomment>$1</span>");\r
+\r
+       html = html.replace(/_AT_/gi,"@");\r
+       html = html.replace(/_HASH_/gi,"#");\r
+\r
+       return html;\r
+}\r
diff --git a/lib/rte/rte_history.js b/lib/rte/rte_history.js
new file mode 100644 (file)
index 0000000..6a6dda0
--- /dev/null
@@ -0,0 +1,125 @@
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// HTML Text Editing Component for hosting in Web Pages\r
+// Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License, or (at your option) any later version.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU LesserGeneral Public License\r
+// along with this program; if not a copy can be obtained from\r
+//\r
+//    http://www.gnu.org/copyleft/lesser.html\r
+//\r
+// or by writing to:\r
+//\r
+//    Free Software Foundation, Inc.\r
+//    59 Temple Place - Suite 330,\r
+//    Boston,\r
+//    MA  02111-1307,\r
+//    USA.\r
+//\r
+// Original Developer:\r
+//\r
+//     Austin David France\r
+//     Ramesys (Contracting Services) Limited\r
+//     Mentor House\r
+//     Ainsworth Street\r
+//     Blackburn\r
+//     Lancashire\r
+//     BB1 6AY\r
+//     United Kingdom\r
+//  email: Austin.France@Ramesys.com\r
+//\r
+// Home Page:    http://richtext.sourceforge.net/\r
+// Support:      http://richtext.sourceforge.net/\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Author(s):  leonreinders@hetnet.nl                          LEON\r
+//\r
+// History:\r
+//\r
+//     LEON    04-08-2001\r
+//                     Initial Implementation\r
+//\r
+//     OZ              30-08-2001\r
+//                     * Correct a problem where the last amendment could not be re-done.\r
+//                     * Alter the way the buttons are disabled so that the background of\r
+//                     the button is transparent and matches the user rebar background\r
+//                     color - specifically - buttonface.\r
+//\r
+//     OZ              22-01-2002\r
+//                     Only do any saving if the history option is enabled.  This should\r
+//                     speed up the editor in the default case.  This is because the\r
+//                     history option takes entire copies of the buffer being edited which\r
+//                     can consume large amounts of memory.\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+var history = new Object;\r
+history.items = [];\r
+history.cursor = -1;\r
+\r
+// saveHistory(): Saves a copy of the document in the history.items.items buffer\r
+function saveHistory() {\r
+       if (!getOption("history")) return;\r
+       codeSweeper();\r
+       history.items[history.items.length] = doc.innerHTML;\r
+       history.cursor = history.items.length;\r
+       // window.status = 'saveHistory() cursor=' + history.cursor + ', items = ' + history.items.length;\r
+       showHistory();\r
+}\r
+\r
+// goHistory(): Advance or retreat the history.items.items cursor and show the\r
+// document as it was at that point in time.\r
+function goHistory(value) {\r
+\r
+       if (!RichEditor.txtView) return;\r
+       switch(value) {\r
+       case -1:\r
+               i = history.cursor - 1;\r
+               // when first start undoing, save final state at end of history buffer\r
+               // so it can be re-done.\r
+               if (history.cursor == history.items.length) {\r
+                       saveHistory();\r
+               }\r
+               history.cursor = i;\r
+               break;\r
+       case 1:\r
+               history.cursor ++;\r
+               break;\r
+       }\r
+       if (history.items[history.cursor]) {\r
+               doc.innerHTML = history.items[history.cursor];\r
+       }\r
+       // window.status = 'goHistory(' + value + ') cursor=' + history.cursor + ', items = ' + history.items.length;\r
+       showHistory()\r
+}\r
+\r
+// showHistory(): enable and disable the history.items buttons as appropriate\r
+function showHistory() {\r
+\r
+       if (history.cursor > 0) {\r
+               btnPrev.className = "";\r
+               btnPrev.disabled = false;\r
+       } else {\r
+               btnPrev.className = "disabled";\r
+               btnPrev.disabled = true;\r
+       }\r
+\r
+       if (history.cursor < history.items.length - 1) {\r
+               btnNext.className = "";\r
+               btnNext.disabled = false;\r
+       } else {\r
+               btnNext.className = "disabled";\r
+               btnNext.disabled = true;\r
+       }\r
+}\r
diff --git a/lib/rte/rte_interface.js b/lib/rte/rte_interface.js
new file mode 100644 (file)
index 0000000..086db51
--- /dev/null
@@ -0,0 +1,300 @@
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// HTML Text Editing Component for hosting in Web Pages\r
+// Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License, or (at your option) any later version.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU LesserGeneral Public License\r
+// along with this program; if not a copy can be obtained from\r
+//\r
+//    http://www.gnu.org/copyleft/lesser.html\r
+//\r
+// or by writing to:\r
+//\r
+//    Free Software Foundation, Inc.\r
+//    59 Temple Place - Suite 330,\r
+//    Boston,\r
+//    MA  02111-1307,\r
+//    USA.\r
+//\r
+// Original Developer:\r
+//\r
+//     Austin David France\r
+//     Ramesys (Contracting Services) Limited\r
+//     Mentor House\r
+//     Ainsworth Street\r
+//     Blackburn\r
+//     Lancashire\r
+//     BB1 6AY\r
+//     United Kingdom\r
+//  email: Austin.France@Ramesys.com\r
+//\r
+// Home Page:    http://richtext.sourceforge.net/\r
+// Support:      http://richtext.sourceforge.net/\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Author(s):  austin.france@ramesys.com                       OZ\r
+//                             leonreinders@hetnet.nl                          LEON\r
+//\r
+// History:\r
+//\r
+//     LEON    04-08-2001\r
+//                     Added styleData functionality for extending the style dropdown\r
+//\r
+//     OZ              30-08-2001\r
+//                     Re-worked styleData to restore FormatBlock logic which works better\r
+//                     for some styles, for example, heading styles - as these can be\r
+//                     applied without having to select text.\r
+//\r
+//     OZ              02-09-2001\r
+//                     Extended the richeditor interface to make the docHtml property read\r
+//                     write.\r
+//\r
+//     OZ              08-01-2002\r
+//                     Extended the richeditor interface to include an options property.\r
+//                     This property can be set to enable/disable functionality in the\r
+//                     editor.\r
+//\r
+//     OZ              21-01-2002\r
+//                     After set editor options, apply them.  In some circumstances the\r
+//                     options property is set after the editor has initialised and so the\r
+//                     options need to be re-applied.\r
+//\r
+//     OZ              12-02-2002\r
+//                     Add new property debugWindow which should be a reference to an HTML\r
+//                     element that can contain innerHTML.  A table is inserted into this\r
+//                     element and debug statements are output.\r
+//\r
+//     OZ              12-06-2002 [ richtext-Bugs-567677 ] Cursor at bottom of document on load\r
+//                     When initialising HTML throught the docHtml property, get a text range\r
+//                     object before inserting HTML (this will reflect the cursor position for\r
+//                     the empty document), insert the HTML (this moves the cursor position)\r
+//                     and then collapse the resulting range which now covers the entire document\r
+//                     to the beginning (i.e. move the insertion point to the start of the\r
+//                     selection).  All changes isolated to the put_docHtml() routine.\r
+//\r
+//     OZ              18-06-2002\r
+//                     Add support for a docXHtml property to allow an XHMTL representation\r
+//                     of the document to be extracted.  See rte_xhtml.js for the\r
+//                     implementation.\r
+//\r
+//     OZ              01-07-2002\r
+//                     If the editor is slow at initialisation (for example if an alert box\r
+//                     is placed inside initEditor() in rte.js) then it is possible for\r
+//                     the docHtml property to be called before the editor is properly\r
+//                     initialised.  This is ok except that we can't put focus on the editor\r
+//                     until it is visible.\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+// object:             RichEditor()\r
+// description: This object provides the interface to the calling page.\r
+function RichEditor()\r
+{\r
+   var selectedImage = null; // currently selected image\r
+\r
+       this.put_docHtml                        = put_docHtml;\r
+       this.get_docHtml                        = get_docHtml;                  // OZ\r
+       this.get_docXHtml                       = get_docXHtml;                 // OZ\r
+       this.put_defaultFont            = put_defaultFont;\r
+       this.put_defaultFontSize        = put_defaultFontSize;\r
+       this.put_styleData                      = put_styleData;                // LEON\r
+       this.put_options                        = put_options;\r
+       this.addField                           = addField;\r
+       this.getValue                           = getValue;\r
+       this.put_debugWindow            = put_debugWindow;              // OZ\r
+}\r
+\r
+// property:   docHtml\r
+// access:             read/write\r
+// description: Set this property to define the initial HTML to be\r
+//                             edited.\r
+// author:             austin.france@ramesys.com\r
+function put_docHtml(passedValue) {\r
+       var r = document.selection.createRange();\r
+       doc.innerHTML = passedValue;\r
+       r.collapse(true);\r
+       r.select();\r
+\r
+       // Only if editor initialisation has completed (and therfore visible)\r
+       if (editor.style.visibility == "visible") {\r
+               doc.focus();\r
+               reset();\r
+       }\r
+}\r
+\r
+function get_docHtml() {\r
+       return doc.innerHTML;\r
+}\r
+\r
+// property:   docXHtml\r
+// access:             read only\r
+// description: Return an XHTML representation of the document.  \r
+// author:             austin.france@ramesys.com\r
+function get_docXHtml() {                                                              // OZ\r
+       // Ignore any contenteditable attributes seen as these are \r
+       // inherited from the editor and not relevent to the document\r
+       // HTML.\r
+       return innerXHTML(doc, new RegExp("contenteditable"));\r
+}\r
+\r
+// property:   defaultFont\r
+// access:             write only\r
+// description:        Sets the default font for the editor.  The default\r
+//                             if this is not specified is whatever the microsoft\r
+//                             html editing component decides (Times New Roman\r
+//                             typically)\r
+// author:             austin.france@ramesys.com\r
+function put_defaultFont(passedValue) {\r
+       doc.style.fontFamily = passedValue;\r
+}\r
+\r
+// property:   defaultFontSize\r
+// access:             write only\r
+// description:        Sets the default font size for the editor.\r
+// author:             austin.france@ramesys.com\r
+function put_defaultFontSize(passedValue) {\r
+       switch(passedValue) {\r
+       case "1": passedValue = "xx-small"; break;\r
+       case "2": passedValue = "x-small";      break;\r
+       case "3": passedValue = "small";        break;\r
+       case "4": passedValue = "medium";       break;\r
+       case "5": passedValue = "large";        break;\r
+       case "6": passedValue = "x-large";      break;\r
+       case "7": passedValue = "xx-large";     break;\r
+       }\r
+       doc.style.fontSize = passedValue;\r
+}\r
+\r
+// property:   styleData\r
+// access:             writeOnly\r
+// description:        Defines extended style data for the style dropdown\r
+// author:             leonreinders@hetnet.nl\r
+function put_styleData(passedValue) {\r
+\r
+       var a,b;\r
+\r
+       // Define the default style list\r
+       this.styleList = [\r
+               // element              description                     Active\r
+               [null,                  "Normal",                       0],\r
+               [null,                  "Heading 1",            0],\r
+               [null,                  "Heading 2",            0],\r
+               [null,                  "Heading 3",            0],\r
+               [null,                  "Heading 4",            0],\r
+               [null,                  "Heading 5",            0],\r
+               [null,                  "Heading 6",            0],\r
+               [null,                  "Address",                      0],\r
+               [null,                  "Formatted",            0],\r
+               ["BLOCKQUOTE",  "Blockquote",           0],\r
+               ["CITE",                "Citation",                     0],\r
+               ["BDO",                 "Reversed",                     0],\r
+               ["BIG",                 "Big",                          0],\r
+               ["SMALL",               "Small",                        0],\r
+               ["DIV",                 "Div",                          0],\r
+               ["SUP",                 "Superscript",          0],\r
+               ["SUB",                 "Subscript",            0]\r
+       ];\r
+\r
+       // Add the passed styles to the documents stylesheet\r
+       for (var i = 0; passedValue && i < passedValue.length; i++)\r
+       {\r
+               for (var j = 0; j < passedValue[i].rules.length; j++)\r
+               {\r
+                       // Extract the rule and the rule definition from the passed style\r
+                       // data.\r
+                       a = passedValue[i].rules[j].selectorText.toString().toLowerCase();\r
+                       b = passedValue[i].rules[j].style.cssText.toLowerCase();\r
+\r
+                       // Ignore non-style entries\r
+                       if (!a || !b) continue;\r
+\r
+                       // Add this rule to our style sheet\r
+                       document.styleSheets[0].addRule(a,b);\r
+\r
+                       // Id: These are added to the document style sheet but are not\r
+                       // available in the style dropdown\r
+                       if (a.indexOf("#") != -1) {\r
+                               continue;\r
+                       }\r
+\r
+                       // Class: Append a cless element to the style list\r
+                       if (a.indexOf(".") == 0) {\r
+                               this.styleList[this.styleList.length] = [a, "Class " + a, 1];\r
+                       }\r
+\r
+                       // SubClass: Append the sub-class to the style list\r
+                       else if(a.indexOf(".") > 0) {\r
+                               this.styleList[this.styleList.length] = [a, a, 1];\r
+                       }\r
+\r
+                       // Otherwise, assume it's a tag and select the existing tag entry\r
+                       // in the style list.\r
+                       else {\r
+                               for (var k = 0; k < this.styleList.length; k++) {\r
+                                       if (this.styleList[k][0] == a) {\r
+                                               this.styleList[k][2] = 1;\r
+                                               break;\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+       // Initialise the style dropdown with the new style list\r
+       initStyleDropdown(this.styleList);\r
+}\r
+\r
+function addField(name, label, maxlen, value, size) {\r
+       var row = rebarBottom.parentElement.insertRow(rebarBottom.rowIndex);\r
+       var cell = row.insertCell();\r
+       cell.className = 'rebar';\r
+       cell.width = '100%';\r
+       cell.innerHTML = '<nobr width="100%"><span class="field" width="100%">'\r
+                                               + '<img class="spacer" src="spacer.gif" width="2">'\r
+                                               + '<span class="start"></span>'\r
+                                               + '<span class="label">' + label + ':</span>'\r
+                                               + '&nbsp;<input class="field" type="text"'\r
+                                                       + ' name="' + name + '" maxlength="' + maxlen + '"'\r
+                                                               + (value ? ' value="' + value + '"' : '')\r
+                                                               + 'size="' + (size ? size : 58) + '"'\r
+                                                               + '>&nbsp;'\r
+                                               + '</span>'\r
+                                               + '</nobr>';\r
+}\r
+\r
+function getValue(name) {\r
+       return document.all(name).value;\r
+}\r
+\r
+// property:   options\r
+// access:             writeOnly\r
+// description:        Sets options for the editor.  Used by the editor to control\r
+//                             certain features\r
+//\r
+//                             viewsource=<true|false>;...\r
+//\r
+// author:             austin.france@ramesys.com\r
+function put_options(passedValue) {\r
+       this.options = passedValue;\r
+       applyOptions(this.options);\r
+}\r
+\r
+// property:   debugWindow\r
+// access:             writeOnly\r
+// description:        Tells the editor to emit debugs to the debug window.\r
+// author:             austin.france@ramesys.com\r
+function put_debugWindow(passedValue) {\r
+       this.debugWindow = passedValue;\r
+       DBG();\r
+}\r
diff --git a/lib/rte/rte_lang.js b/lib/rte/rte_lang.js
new file mode 100644 (file)
index 0000000..6ad64ae
--- /dev/null
@@ -0,0 +1,392 @@
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// HTML Text Editing Component for hosting in Web Pages\r
+// Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License, or (at your option) any later version.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU LesserGeneral Public License\r
+// along with this program; if not a copy can be obtained from\r
+//\r
+//    http://www.gnu.org/copyleft/lesser.html\r
+//\r
+// or by writing to:\r
+//\r
+//    Free Software Foundation, Inc.\r
+//    59 Temple Place - Suite 330,\r
+//    Boston,\r
+//    MA  02111-1307,\r
+//    USA.\r
+//\r
+// Original Developer:\r
+//\r
+//     Austin David France\r
+//     Ramesys (Contracting Services) Limited\r
+//     Mentor House\r
+//     Ainsworth Street\r
+//     Blackburn\r
+//     Lancashire\r
+//     BB1 6AY\r
+//     United Kingdom\r
+//  email: Austin.France@Ramesys.com\r
+//\r
+// Home Page:    http://richtext.sourceforge.net/\r
+// Support:      http://richtext.sourceforge.net/\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Authors & Contributers:\r
+//\r
+//     OZ                      Austin David France             [austin.france@ramesys.com]\r
+//                                     Primary Developer\r
+//\r
+//     TE                      Torbjørn Engedal                [torbjoen@stud.ntnu.no]\r
+//                                     Doc. Translator\r
+//\r
+//     GE                      Herfurth, Gerrit                [gerrit.herfurth@gs-druckfarben.de]\r
+//\r
+//     BC                      Bill Chalmers                   [bill_paula@btinternet.com]\r
+//\r
+// History:\r
+//\r
+//     OZ              16-02-2002\r
+//                     Initial Implementation\r
+//\r
+//     TE              17-02-2002\r
+//                     Norwegian Translation\r
+//\r
+//     GE              05-06-2002\r
+//                     German Translation\r
+//\r
+//     OZ              01-07-2002\r
+//                     Extended EN translation to include table editing.  Other languages\r
+//                     to follow.\r
+//\r
+//     BC              21-07-2002\r
+//                     Fixed bug no: 584424, trying to set lang equal to local[lang] caused error\r
+//                     if the users local lang was not in the predefined locale array.\r
+//\r
+//     BC              31-07-2002\r
+//                     Added french translation courtesy of Arnaud Vatel.\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+var locale = new Object;\r
+\r
+// locale.getLanguage(): Called to work out what language to use.\r
+locale.getLanguage = function()\r
+{\r
+       return locale.language ? locale.language : navigator.userLanguage;\r
+}\r
+\r
+// locale.getString(): Called to return the language variant of a @code string.\r
+// this routin will fall back to en-us is no language variant is found.  If no\r
+// english version exists, the code is returned.\r
+locale.getString = function(str, lang)\r
+{\r
+       // If not supplied, pick up the language to use\r
+       if (!lang) lang = locale.getLanguage();\r
+\r
+       // Get references to required languages \r
+       if (!locale[lang])\r
+       {\r
+               lang = locale["en-us"];\r
+       }\r
+       else\r
+       {\r
+               lang = locale[lang];\r
+       }\r
+\r
+       // Find the end of the text code\r
+       var i = str.indexOf('@{');\r
+       while (i != -1)\r
+       {\r
+               // Find the closing } \r
+               var j = str.indexOf('}', i+1);\r
+\r
+               // Extrace the language code\r
+               var code = str.substr(i+2,j-i-2);\r
+\r
+               // Return the language version of the text\r
+               if (lang[code]) {\r
+                       str = str.substr(0,i) + lang[code] + str.substr(i+j+1);\r
+               }\r
+               // Find the next code if any\r
+               i = str.indexOf('@{', i+1);\r
+       }\r
+\r
+       // Untranslated\r
+       return str;\r
+}\r
+\r
+// locale.setLocale(): Called once the editor has loaded to replace all language\r
+// codes in alt, title and innerText with thier language counterparts.\r
+locale.setLocale = function()\r
+{\r
+       // Work out which language to apply\r
+       var lang = locale.getLanguage();\r
+\r
+       for (var i = 0; i < document.all.length; i++)\r
+       {\r
+               var el = document.all(i);\r
+               if (el.alt && el.alt.indexOf('@{') != -1) {\r
+                       el.alt = locale.getString(el.alt, lang);\r
+               }\r
+               if (el.title && el.title.indexOf('@{') != -1) {\r
+                       el.title = locale.getString(el.title, lang);\r
+               }\r
+               if (el.src && el.src.indexOf('@{') != -1) {\r
+                       el.src = locale.getString(el.src, lang);\r
+               }\r
+               if (!el.children.length && el.innerText && el.innerText.indexOf('@{') != -1) {\r
+                       el.innerText = locale.getString(el.innerText, lang);\r
+               }\r
+       }\r
+}\r
+\r
+window.attachEvent("onload", locale.setLocale);\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// English (American & British)\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+var o = locale["en-us"] = locale["en-gb"] = new Object;\r
+\r
+       // Icon Titles (alt="")\r
+       o["PostTopic"]                  = "Post Topic";\r
+       o["Cut"]                                = "Cut";\r
+       o["Copy"]                               = "Copy";\r
+       o["Paste"]                              = "Paste";\r
+       o["SpellCheck"]                 = "Spell Check";\r
+       o["SelectAll"]                  = "Select All";\r
+       o["RemoveFormatting"]   = "Remove Formatting";\r
+       o["InsertLink"]                 = "Insert Link";\r
+       o["RemoveLink"]                 = "Remove Link";\r
+       o["InsertImage"]                = "Insert Image";\r
+       o["InsertTable"]                = "Insert Table";\r
+       o["EditTable"]                  = "Edit Table";\r
+       o["InsertLine"]                 = "Insert Horizontal Line";\r
+       o["InsertSmily"]                = "Insert Smily 8-)";\r
+       o["InsertCharacter"]    = "Insert special character";\r
+       o["About"]                              = "About Richtext Editor";\r
+       o["Bold"]                               = "Bold";\r
+       o["Italic"]                             = "Italic";\r
+       o["Underline"]                  = "Underline";\r
+       o["Strikethrough"]              = "Strikethrough";\r
+       o["AlignLeft"]                  = "Align Left";\r
+       o["Center"]                             = "Center";\r
+       o["AlignRight"]                 = "Align Right";\r
+       o["AlignBlock"]                 = "Align Block";\r
+       o["NumberedList"]               = "Numbered List";\r
+       o["BulettedList"]               = "Buletted List";\r
+       o["DecreaseIndent"]             = "Decrease Indent";\r
+       o["IncreaseIndent"]             = "Increase Indent";\r
+       o["HistoryBack"]                = "History back";\r
+       o["HistoryForward"]             = "History forward";\r
+       o["TextColor"]                  = "Text Color";\r
+       o["BackgroundColor"]    = "Background Color";\r
+\r
+       o["RemoveColspan"]              = "Remove Colspan";\r
+       o["RemoveRowspan"]              = "Remove Rowspan";\r
+       o["IncreaseColspan"]    = "Increase Colspan";\r
+       o["IncreaseRowspan"]    = "Increase Rowspan";\r
+       o["AddColumn"]                  = "Add Column";\r
+       o["AddRow"]                             = "Add Row";\r
+       o["RemoveColumn"]               = "Remove Column";\r
+       o["RemoveRow"]                  = "Remove Row";\r
+\r
+       // Label Text\r
+       o["Style"]                              = "Style";\r
+       o["Font"]                               = "Font";\r
+       o["Size"]                               = "Size";\r
+       o["Source"]                             = "Source";\r
+\r
+       // Titles\r
+       o["SourceTitle"]                = "Click here to toggle between WYSIWYG and Source mode.";\r
+\r
+       // Image Sources\r
+       o["icon_post"]                  = "images/icon_post.gif";\r
+       o["hdr_tables"]                 = "images/hdr_tables.gif";\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Norwegian Bokmål\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+o = locale["no"] = new Object;\r
+\r
+       // Icon Titles (alt="")\r
+       o["PostTopic"]                  = "Send";\r
+       o["Cut"]                                = "Klipp";\r
+       o["Copy"]                               = "Kopier";\r
+       o["Paste"]                              = "Lim";\r
+       o["SpellCheck"]                 = "Stavekontroll";\r
+       o["SelectAll"]                  = "Marker alt";\r
+       o["RemoveFormatting"]   = "Fjern formatering";\r
+       o["InsertLink"]                 = "Sett inn link";\r
+       o["RemoveLink"]                 = "Fjern link";\r
+       o["InsertImage"]                = "Sett inn bilde";\r
+       o["InsertTable"]                = "Sett inn tabell";\r
+       o["EditTable"]                  = "Endre tabell";\r
+       o["InsertLine"]                 = "Sett inn horisontal linje";\r
+       o["InsertSmily"]                = "Sett inn smily 8-)";\r
+       o["InsertCharacter"]    = "Sett inn spesialtegn";\r
+       o["About"]                              = "Om Richtext Editor";\r
+       o["Bold"]                               = "Fet";\r
+       o["Italic"]                             = "Kursiv";\r
+       o["Underline"]                  = "Understrekning";\r
+       o["Strikethrough"]              = "Gjennomstrekning";\r
+       o["AlignLeft"]                  = "Venstrejustering";\r
+       o["Center"]                             = "Sentrering";\r
+       o["AlignRight"]                 = "Høyrejustering";\r
+       o["AlignBlock"]                 = "Blokkjustering";\r
+       o["NumberedList"]               = "Nummerert liste";\r
+       o["BulettedList"]               = "Punktliste";\r
+       o["DecreaseIndent"]             = "Mink innrykksverdi";\r
+       o["IncreaseIndent"]             = "Øk innrykksverdi";\r
+       o["HistoryBack"]                = "Historie bakover";\r
+       o["HistoryForward"]             = "Historie forover";\r
+       o["TextColor"]                  = "Tekstfarge";\r
+       o["BackgroundColor"]    = "Bakgrunnsfarge";\r
+\r
+       // Label Text\r
+       o["Style"]                              = "Stil";\r
+       o["Font"]                               = "Type";\r
+       o["Size"]                               = "Størrelse";\r
+       o["Source"]                             = "Kilde";\r
+\r
+       // Titles\r
+       o["SourceTitle"]                = "Klikk her for å bytte mellom WYSIWYG og kilde modus.";\r
+\r
+       // Image Sources\r
+       o["icon_post"]                  = "images/lang/no.icon_post.gif";\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// German\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+var o = locale["de"] = new Object;\r
+\r
+       // Icon Titles (alt="")\r
+       o["PostTopic"]                  = "Speichern";\r
+       o["Cut"]                        = "Ausschneiden";\r
+       o["Copy"]                       = "Kopieren";\r
+       o["Paste"]                      = "Einfügen";\r
+       o["SpellCheck"]                 = "Rechschreibprüfung";\r
+       o["SelectAll"]                  = "Alles markieren";\r
+       o["RemoveFormatting"]           = "Formatierung entfernen";\r
+       o["InsertLink"]                 = "Link einfügen";\r
+       o["RemoveLink"]                 = "Link entfernen";\r
+       o["InsertImage"]                = "Bild einfügen";\r
+       o["InsertTable"]                = "Tabelle einfügen";\r
+       o["EditTable"]                  = "Tabelle bearbeiten";\r
+       o["InsertLine"]                 = "Horizontale Linie einfügen";\r
+       o["InsertSmily"]                = "Smily 8-) einfügen";\r
+       o["InsertCharacter"]            = "Sonderzeichen einfügen";\r
+       o["About"]                      = "Über Richtext Editor";\r
+       o["Bold"]                       = "Fett";\r
+       o["Italic"]                     = "Kursiv";\r
+       o["Underline"]                  = "Unterstrichen";\r
+       o["Strikethrough"]              = "Durchgestrichen";\r
+       o["AlignLeft"]                  = "Linksbündig";\r
+       o["Center"]                     = "Zentriert";\r
+       o["AlignRight"]                 = "Rechtsbündig";\r
+       o["AlignBlock"]                 = "Blocksatz";\r
+       o["NumberedList"]               = "Nummerierung";\r
+       o["BulettedList"]               = "Aufzählungszeichen";\r
+       o["DecreaseIndent"]             = "Einzug verkleinern";\r
+       o["IncreaseIndent"]             = "Einzug vergrößern";\r
+       o["HistoryBack"]                = "Rückgängig";\r
+       o["HistoryForward"]             = "Wiederherstellen";\r
+       o["TextColor"]                  = "Zeichenfarbe";\r
+       o["BackgroundColor"]            = "Hintergrundfarbe";\r
+\r
+       // Label Text\r
+       o["Style"]                      = "Absatzformat";\r
+       o["Font"]                       = "Schriftart";\r
+       o["Size"]                       = "Größe";\r
+       o["Source"]                     = "Quelltext";\r
+\r
+       // Titles\r
+       o["SourceTitle"]                = "Hier klicken, um zwischen WYSIWYG- und Quelltext-Modus umzuschalten.";\r
+\r
+       // Image Sources\r
+       o["icon_post"]                  = "images/lang/de.icon_post.gif";\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Français\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+var o = locale["fr"] = new Object;\r
+\r
+       // Icon Titles (alt="")\r
+       o["PostTopic"]                  = "Poster le sujet";\r
+       o["Cut"]                                = "Couper";\r
+       o["Copy"]                               = "Copier";\r
+       o["Paste"]                              = "Coller";\r
+       o["Find Text"]                  = "Rechercher";\r
+       o["SpellCheck"]                 = "Vérifier l'orthographe";\r
+       o["SelectAll"]                  = "Sélectionner tout";\r
+       o["RemoveFormatting"]   = "Supprimer le formattage";\r
+       o["InsertLink"]                 = "Insérer un lien";\r
+       o["RemoveLink"]                 = "Supprimer un lien";\r
+       o["InsertImage"]                = "Insérer une image";\r
+       o["InsertTable"]                = "Insérer un tableau";\r
+       o["EditTable"]                  = "Editer le tableau";\r
+       o["InsertLine"]                 = "Insérer une ligne horizontale";\r
+       o["InsertSmily"]                = "Insérer un Smiley 8-)";\r
+       o["InsertCharacter"]    = "Insérer des caractères spéciaux";\r
+       o["About"]                              = "A propos de Richtext Editor";\r
+       o["Bold"]                               = "Gras";\r
+       o["Italic"]                             = "Italique";\r
+       o["Underline"]                  = "Souligné";\r
+       o["Strikethrough"]              = "Barré";\r
+       o["AlignLeft"]                  = "Aligné à gauche";\r
+       o["Center"]                             = "Centré";\r
+       o["AlignRight"]                 = "Aligné à droite";\r
+       o["AlignBlock"]                 = "Justifié";\r
+       o["NumberedList"]               = "Liste numérotée";\r
+       o["BulettedList"]               = "Liste à puces";\r
+       o["DecreaseIndent"]             = "Diminuer le retrait";\r
+       o["IncreaseIndent"]             = "Augmenter le retrait";\r
+       o["HistoryBack"]                = "Annuler";\r
+       o["HistoryForward"]             = "Rétablir";\r
+       o["TextColor"]                  = "Couleur du texte";\r
+       o["BackgroundColor"]    = "Couleur de l'arrière plan";\r
+\r
+       o["RemoveColspan"]              = "Fractionner la cellule";\r
+       o["RemoveRowspan"]              = "Fusionner la cellule";\r
+       o["IncreaseColspan"]    = "Augmenter l'étendue de la colonne";\r
+       o["IncreaseRowspan"]    = "Augmenter l'étendue de la ligne";\r
+       o["AddColumn"]                  = "Ajouter une colonne";\r
+       o["AddRow"]                             = "Ajouter une ligne";\r
+       o["RemoveColumn"]               = "Supprimer une colonne";\r
+       o["RemoveRow"]                  = "Supprimer une ligne";\r
+\r
+       // Label Text\r
+       o["Style"]                              = "Style";\r
+       o["Font"]                               = "Police";\r
+       o["Size"]                               = "Taille";\r
+       o["Source"]                             = "Code source";\r
+\r
+       // Titles\r
+       o["SourceTitle"]                = "Cliquez ici pour basculer entre Aperçu et mode Source.";\r
+\r
+       // Image Sources\r
+       o["icon_post"]                  = "images/icon_post.gif";\r
+       \r
+////////////////////////////////////////////////////////////////////////////////
\ No newline at end of file
diff --git a/lib/rte/rte_xhtml.js b/lib/rte/rte_xhtml.js
new file mode 100644 (file)
index 0000000..dbde145
--- /dev/null
@@ -0,0 +1,185 @@
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// HTML Text Editing Component for hosting in Web Pages\r
+// Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License, or (at your option) any later version.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU LesserGeneral Public License\r
+// along with this program; if not a copy can be obtained from\r
+//\r
+//    http://www.gnu.org/copyleft/lesser.html\r
+//\r
+// or by writing to:\r
+//\r
+//    Free Software Foundation, Inc.\r
+//    59 Temple Place - Suite 330,\r
+//    Boston,\r
+//    MA  02111-1307,\r
+//    USA.\r
+//\r
+// Original Developer:\r
+//\r
+//     Austin David France\r
+//     Ramesys (Contracting Services) Limited\r
+//     Mentor House\r
+//     Ainsworth Street\r
+//     Blackburn\r
+//     Lancashire\r
+//     BB1 6AY\r
+//     United Kingdom\r
+//  email: Austin.France@Ramesys.com\r
+//\r
+// Home Page:    http://richtext.sourceforge.net/\r
+// Support:      http://richtext.sourceforge.net/\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Author(s):  austin.france@ramesys.com                       OZ\r
+//\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+///////////////////////////////////////////////////////////////////////////\r
+//\r
+// Description:\r
+//     Escape XHTML text\r
+//\r
+\r
+function escapeXHTML(str)\r
+{\r
+       return str.replace(/[&]/g, "&amp;")\r
+                         .replace(/[<]/g, "&lt;")\r
+                         .replace(/[>]/g, "&gt;")\r
+                         ;\r
+}\r
+\r
+function escapeXHTMLAttribute(str)\r
+{\r
+       return str.replace(/[\"]/g, "&quot;");\r
+}\r
+\r
+///////////////////////////////////////////////////////////////////////////\r
+//\r
+// Description:\r
+//     Return the XHTML attribute list (space separated) for the given element\r
+//\r
+// Notes:\r
+//     The ignore list is a JavaScript Regular expression that matches those\r
+//     attribute that should not be output.\r
+//\r
+\r
+function innerXHTMLAttributes(el, ignore)\r
+{\r
+       // Start with an empty attribute list\r
+       var str = '';\r
+\r
+       // Output attributes for the element\r
+       for (var i = 0; i < el.attributes.length; i++)\r
+       {\r
+               // Get this attribute\r
+               var attr = el.attributes[i];\r
+\r
+               // Only output if it has a value of type string\r
+               if (attr.nodeValue && typeof(attr.nodeValue) == "string")\r
+               {\r
+                       // and it's not one we want to ignore\r
+                       if (!ignore || attr.nodeName.toLowerCase().search(ignore) == -1)\r
+                       {\r
+                               // Output the attribute (space separated if necessary)\r
+                               if (str.length) str += ' ';\r
+                               str += attr.nodeName.toLowerCase();\r
+                               str += '="' + escapeXHTMLAttribute(attr.nodeValue) + '"';\r
+                       }\r
+               }\r
+       }\r
+\r
+       // Return the resulting attribute string\r
+       return str;\r
+}\r
+\r
+///////////////////////////////////////////////////////////////////////////\r
+//\r
+// Description:\r
+//     Get the inner XHTML from the supplied element.\r
+//\r
+// Return Value:\r
+//     XHTML string\r
+//\r
+// Notes:\r
+//     The ignore list is a JavaScript Regular expression that matches those\r
+//     attribute that should not be output.\r
+//\r
+\r
+function innerXHTML(el, ignore)\r
+{\r
+       // Default innerXTHML is empty\r
+       var str = '';\r
+\r
+       // Create a text range for the element we are converting to source\r
+       var r2; var r = document.body.createTextRange();\r
+       r.moveToElementText(el);\r
+\r
+       // Scan the child nodes of this element.\r
+       for (var i = 0; i < el.children.length; i++)\r
+       {\r
+               // Create a text range for this child node\r
+               r2 = document.body.createTextRange();\r
+               r2.moveToElementText(el.children[i]);\r
+\r
+               // Set the end of our range to the start of this child node.\r
+               // so that r.text contains all the text up to this element.\r
+               r.setEndPoint("EndToStart", r2);\r
+               str += escapeXHTML(r.text);\r
+\r
+               // Emit the child node\r
+               str += outerXHTML(el.children[i], ignore);\r
+\r
+               // Now, reset the text range for the main element and then move\r
+               // the start point of our range to the end of the element just\r
+               // output in preperation for the next chunk of text (or last chunk\r
+               // if this was the last child node)\r
+               r.moveToElementText(el);\r
+               r.setEndPoint("StartToEnd", r2);\r
+       }\r
+\r
+       // Output the HTML (if any) plus the last chunk of text (again, if any).\r
+       // Note: if no child nodes existed, the r.text contains the entire text\r
+       // however, if child nodes did exist, then r.text contains just the \r
+       return str + escapeXHTML(r.text);\r
+}\r
+\r
+///////////////////////////////////////////////////////////////////////////\r
+//\r
+// Description:\r
+//     Get the outer XHTML from the supplied element.\r
+//\r
+// Return Value:\r
+//     XHTML string\r
+//\r
+// Notes:\r
+//     The ignore list is a JavaScript Regular expression that matches those\r
+//     attribute that should not be output.\r
+//\r
+\r
+function outerXHTML(el, ignore)\r
+{\r
+       // First, get the attribute values\r
+       var attrs = innerXHTMLAttributes(el, ignore);\r
+\r
+       // And any inner XHTML\r
+       var inner = innerXHTML(el, ignore);\r
+\r
+       // Then build the tag.  Note: We use the XML abbreviation if the element is empty\r
+       return '<' + el.nodeName.toLowerCase()\r
+                       + (attrs.length ? ' ' + attrs : '')\r
+                       + (inner.length ? '>' + inner + '</' + el.nodeName.toLowerCase() + '>'\r
+                                                       : ' />');\r
+}\r
diff --git a/lib/rte/syntax.css b/lib/rte/syntax.css
new file mode 100644 (file)
index 0000000..94356c4
--- /dev/null
@@ -0,0 +1,97 @@
+/*******************************************************************************\r
+**\r
+** HTML Text Editing Component for hosting in Web Pages\r
+** Copyright (C) 2001  Ramesys (Contracting Services) Limited\r
+** \r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+**\r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+** Lesser General Public License for more details.\r
+**\r
+** You should have received a copy of the GNU LesserGeneral Public License\r
+** along with this program; if not a copy can be obtained from \r
+**\r
+**    http://www.gnu.org/copyleft/lesser.html\r
+**\r
+** or by writing to:\r
+**\r
+**    Free Software Foundation, Inc.\r
+**    59 Temple Place - Suite 330,\r
+**    Boston,\r
+**    MA  02111-1307,\r
+**    USA.\r
+** \r
+** Original Developer:\r
+**\r
+**     Austin David France\r
+**     Ramesys (Contracting Services) Limited\r
+**     Mentor House\r
+**     Ainsworth Street\r
+**     Blackburn\r
+**     Lancashire\r
+**     BB1 6AY\r
+**     United Kingdom\r
+**  email: Austin.France@Ramesys.com\r
+**\r
+** Home Page:    http://richtext.sourceforge.net/\r
+** Support:      http://richtext.sourceforge.net/\r
+** \r
+*******************************************************************************/\r
+\r
+.ccp_paramvalue {\r
+       color : #0000FF ;\r
+       font-family : "Courier New";\r
+       font-size : 13px;\r
+}\r
+.ccp_htmlcomment {\r
+       color : #808080 ;\r
+       font-family : "Courier New";\r
+       font-size : 12px;\r
+       font-style : italic;\r
+}\r
+.ccp_tag {\r
+       color : #000080;\r
+       font-family : "Courier New";\r
+       font-size : 12px;\r
+}\r
+.ccp_img {\r
+       color : #800080;\r
+       font-family : "Courier New";\r
+       font-size : 12px;\r
+}\r
+.ccp_A {\r
+       color : #008000;\r
+       font-family : "Courier New";\r
+       font-size : 12px;\r
+}\r
+.ccp_form {\r
+       color : #FF8000;\r
+       font-family : "Courier New";\r
+       font-size : 12px;\r
+}\r
+.ccp_table {\r
+       color : #008080;\r
+       font-family : "Courier New";\r
+       font-size : 12px;\r
+}\r
+.ccp_entity {\r
+       color : #000000;\r
+       font-family : "Courier New";\r
+       font-size : 12px;\r
+       font-weight : bold;\r
+}\r
+.ccp_styletag {\r
+       color : #800080;\r
+       font-family : "Courier New";\r
+       font-size : 12px;\r
+}\r
+.ccp_styleitem {\r
+       color : #800080;\r
+       font-family : "Courier New";\r
+       font-size : 12px;\r
+}\r
diff --git a/lib/rte/tableEditor.js b/lib/rte/tableEditor.js
new file mode 100644 (file)
index 0000000..e40c668
--- /dev/null
@@ -0,0 +1,743 @@
+///////////////////////////////////////////////////////////////\r
+// Table Editing Class\r
+// Author:  Billy Cook (wcook@nuvox.net)\r
+// Date:    2002-05-07\r
+// Purpose: Provide methods to edit a table.  Only\r
+//          works in Internet Explorer version 5.5\r
+//          and above for now.\r
+//\r
+\r
+function tableEditor(docID, pntCell) {\r
+\r
+   this.docID = docID;        // ID of editable portion of document\r
+   this.pntCell = pntCell;    // TD contentarea is contained in if any\r
+   this.tableCell = null;     // cell currently selected\r
+   this.tableElem = null;     // table currently selected\r
+   this.cellResizeObj = null; // object that user clicks on to resize cell\r
+   this.cellWidth = null;     // selected cell's current width\r
+   this.cellHeight = null;    // selected cell's current height\r
+   this.cellX = null;         // x coord of selected cell's bottom right \r
+   this.cellY = null;         // y coord of selected cell's bottom right\r
+   this.moveable = null;      // moveable div\r
+\r
+   // define methods only once\r
+   if (typeof(_tableEditor_prototype_called) == 'undefined') {\r
+      _tableEditor_prototype_called = true;\r
+\r
+      // public methods\r
+      tableEditor.prototype.mergeDown = mergeDown;\r
+      tableEditor.prototype.unMergeDown = unMergeDown;\r
+      tableEditor.prototype.mergeRight = mergeRight;\r
+      tableEditor.prototype.splitCell = splitCell;\r
+      tableEditor.prototype.addCell = addCell;\r
+      tableEditor.prototype.removeCell = removeCell;\r
+      tableEditor.prototype.processRow = processRow;\r
+      tableEditor.prototype.processColumn = processColumn;\r
+      tableEditor.prototype.buildTable = buildTable;\r
+      tableEditor.prototype.setTableElements = setTableElements;\r
+      tableEditor.prototype.unSetTableElements = unSetTableElements;\r
+      tableEditor.prototype.setDrag = setDrag;\r
+      tableEditor.prototype.stopCellResize = stopCellResize;\r
+      tableEditor.prototype.markCellResize = markCellResize;\r
+      tableEditor.prototype.resizeCell = resizeCell;\r
+      tableEditor.prototype.changePos = changePos;\r
+      tableEditor.prototype.resizeColumn = resizeColumn;\r
+      tableEditor.prototype.resizeRow = resizeRow;\r
+      tableEditor.prototype.repositionArrows = repositionArrows;\r
+      tableEditor.prototype.explore = explore;\r
+\r
+      // private methods\r
+      tableEditor.prototype.__addOrRemoveCols = __addOrRemoveCols;\r
+      tableEditor.prototype.__findParentTable = __findParentTable;\r
+      tableEditor.prototype.__hideArrows = __hideArrows;\r
+      tableEditor.prototype.__showArrows = __showArrows;\r
+      tableEditor.prototype.__resizeColumn = __resizeColumn;\r
+   }\r
+\r
+   // create divs for editing cell width and height\r
+   document.body.innerHTML += ' <div id="rArrow" title="Drag to modify cell width." style="position:absolute; visibility:hidden; cursor: E-resize; z-index: 1" onmousedown="tEdit.markCellResize(this)" onmouseup="tEdit.stopCellResize(false)" ondragstart="handleDrag(0)"> <table border="0" cellpadding="0" cellspacing="0" width="7" height="7"> <tr><td bgcolor="#000000"></td></tr> </table> </div> <div id="dArrow" title="Drag to modify cell height." style="position:absolute; visibility:hidden; cursor: S-resize; z-index: 1" onmousedown="tEdit.markCellResize(this)" onmouseup="tEdit.stopCellResize(false)" ondragstart="handleDrag(0)"> <table border="0" cellpadding="0" cellspacing="0" width="7" height="7"> <tr><td bgcolor="#000000"></td></tr> </table> </div>';\r
+\r
+\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: setTableElements\r
+   //    args: none\r
+   // purpose: look to see if the cursor is inside a TD or TABLE and\r
+   //          if so assign the TD to this.tableCell or the TABLE to\r
+   //          this.tableElem\r
+   //\r
+   function setTableElements(){\r
+\r
+      // stop resizing cell if already resizing one\r
+      this.stopCellResize(true);\r
+      this.tableCell = null;\r
+      \r
+      cursorPos=document.selection.createRange();\r
+\r
+      if (document.selection.type == 'Text') {\r
+         var elt = cursorPos.parentElement(); \r
+         while (elt) {\r
+            if (elt.tagName == "TD") {\r
+               break;\r
+            }\r
+            elt = elt.parentElement;\r
+         }\r
+\r
+\r
+         if (elt) {\r
+            // don't select document area\r
+            if (elt.id == this.docID)\r
+               return;\r
+\r
+            // don't select parent TD\r
+            if (this.pntCell)\r
+               if (this.pntCell == elt.id)\r
+                  return;\r
+\r
+            this.tableCell = elt;\r
+\r
+            // set width and height as globals for \r
+            // resizing\r
+            this.cellWidth = this.tableCell.offsetWidth;\r
+            this.cellHeight = this.tableCell.offsetHeight;\r
+            this.__showArrows();\r
+         }\r
+      } else {\r
+         if (cursorPos.length == 1) {\r
+            if (cursorPos.item(0).tagName == "TABLE") {\r
+               this.tableElem = cursorPos.item(0);\r
+               this.__hideArrows();\r
+               this.tableCell = null;\r
+            }\r
+         }\r
+      }\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: unSetTableElements\r
+   //    args: none\r
+   // purpose: unset references to currently selected cell or table \r
+   //          \r
+   function unSetTableElements(){\r
+\r
+      this.tableCell = null;\r
+      this.tableElem = null;\r
+      return;\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: mergeDown\r
+   //    args: none\r
+   // purpose: merge the currently selected cell with the one below it\r
+   //\r
+   function mergeDown() {\r
+      if (!this.tableCell)\r
+         return;\r
+      \r
+      if (!this.tableCell.parentNode.nextSibling) {\r
+         alert("There is not a cell below this one to merge with.");\r
+         return;\r
+      }\r
+\r
+      var topRowIndex = this.tableCell.parentNode.rowIndex;\r
+\r
+      //               [  TD   ] [  TR    ] [  TBODY ] [                   TR                      ] [            TD                 ]\r
+      var bottomCell = this.tableCell.parentNode.parentNode.childNodes[ topRowIndex + this.tableCell.rowSpan ].childNodes[ this.tableCell.cellIndex ];\r
+\r
+      if (!bottomCell) {\r
+         alert("There is not a cell below this one to merge with.");\r
+         return;\r
+      }\r
+\r
+      // don't allow merging rows with different colspans\r
+      if (this.tableCell.colSpan != bottomCell.colSpan) {\r
+         alert("Can't merge cells with different colSpans."); \r
+         return;\r
+      }\r
+\r
+      // do the merge\r
+      this.tableCell.innerHTML += bottomCell.innerHTML;\r
+      this.tableCell.rowSpan += bottomCell.rowSpan;\r
+      bottomCell.removeNode(true); \r
+      this.repositionArrows();\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: unMergeDown\r
+   //    args: none\r
+   // purpose: merge the currently selected cell with the one below it\r
+   //\r
+   function unMergeDown() {\r
+      if (!this.tableCell)\r
+         return;\r
+      \r
+      if (this.tableCell.rowSpan <= 1) {\r
+         alert("RowSpan is already set to 1.");\r
+         return;\r
+      }\r
+\r
+      var topRowIndex = this.tableCell.parentNode.rowIndex;\r
+\r
+      // add a cell to the beginning of the next row\r
+      this.tableCell.parentNode.parentNode.childNodes[ topRowIndex + this.tableCell.rowSpan - 1 ].appendChild( document.createElement("TD") );\r
+\r
+      this.tableCell.rowSpan -= 1;\r
+\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: mergeRight\r
+   //    args: none\r
+   // purpose: merge the currently selected cell with the one to \r
+   //          the immediate right.  Won't allow user to merge cells\r
+   //          with different rowspans.\r
+   //\r
+   function mergeRight() {\r
+      if (!this.tableCell)\r
+         return;\r
+      if (!this.tableCell.nextSibling)\r
+         return;\r
+\r
+      // don't allow user to merge rows with different rowspans\r
+      if (this.tableCell.rowSpan != this.tableCell.nextSibling.rowSpan) {\r
+         alert("Can't merge cells with different rowSpans.");\r
+         return;\r
+      }\r
+\r
+      this.tableCell.innerHTML += this.tableCell.nextSibling.innerHTML;\r
+      this.tableCell.colSpan += this.tableCell.nextSibling.colSpan;\r
+      this.tableCell.nextSibling.removeNode(true);\r
+       \r
+\r
+      this.repositionArrows();\r
+      this.__hideArrows();\r
+      this.tableCell = null;\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: splitCell \r
+   //    args: none\r
+   // purpose: split the currently selected cell back into two cells \r
+   //          it the cell has a colspan > 1.\r
+   //\r
+   function splitCell() {\r
+      if (!this.tableCell)\r
+         return;\r
+      if (this.tableCell.colSpan < 2) {\r
+         alert("Cell can't be divided.  Add another cell instead");\r
+         return;\r
+      }\r
+\r
+      this.tableCell.colSpan = this.tableCell.colSpan - 1;\r
+      var newCell = this.tableCell.parentNode.insertBefore( document.createElement("TD"), this.tableCell);\r
+      newCell.rowSpan = this.tableCell.rowSpan;\r
+      this.repositionArrows();\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: removeCell \r
+   //    args: none\r
+   // purpose: remove the currently selected cell\r
+   //\r
+   function removeCell() {\r
+      if (!this.tableCell)\r
+         return;\r
+\r
+      // can't remove all cells for a row\r
+      if (!this.tableCell.previousSibling && !this.tableCell.nextSibling) {\r
+         alert("You can't remove the only remaining cell in a row.");\r
+         return;\r
+      }\r
+\r
+      this.tableCell.removeNode(false);\r
+\r
+      this.repositionArrows();\r
+      this.tableCell = null;\r
+   } \r
\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: addCell \r
+   //    args: none\r
+   // purpose: add a cell to the right of the selected cell\r
+   //\r
+   function addCell() {\r
+      if (!this.tableCell)\r
+         return;\r
+\r
+      this.tableCell.parentElement.insertBefore(document.createElement("TD"), this.tableCell.nextSibling);\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: processRow \r
+   //    args: (string)action = "add" or "remove"\r
+   // purpose: add a row above the row that \r
+   //          contains the currently selected cell or\r
+   //          remove the row containing the selected cell\r
+   //\r
+   function processRow(action) {\r
+      if (!this.tableCell)\r
+        return;\r
+\r
+      // go back to TABLE def and keep track of cell index\r
+      var idx = 0;\r
+      var rowidx = -1;\r
+      var tr = this.tableCell.parentNode;\r
+      var numcells = tr.childNodes.length;\r
+     \r
+\r
+      while (tr) {\r
+         if (tr.tagName == "TR")\r
+            rowidx++;\r
+         tr = tr.previousSibling;\r
+      }\r
+      // now we should have a row index indicating where the\r
+      // row should be added / removed\r
+\r
+      var tbl = this.__findParentTable(this.tableCell);\r
+  \r
+      if (!tbl) {\r
+         alert("Could not " + action + " row.");\r
+         return;\r
+      }\r
+     \r
+      if (action == "add") {\r
+         var r = tbl.insertRow(rowidx);\r
+         for (var i = 0; i < numcells; i++) {\r
+            var c = r.appendChild( document.createElement("TD") );\r
+            if (this.tableCell.parentNode.childNodes[i].colSpan)\r
+               c.colSpan = this.tableCell.parentNode.childNodes[i].colSpan;\r
+         }\r
+      } else {\r
+         tbl.deleteRow(rowidx);\r
+         this.stopCellResize(true);\r
+         this.tableCell = null;\r
+      }\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: processColumn\r
+   //    args: (string)action = "add" or "remove"\r
+   // purpose: add a column to the right column containing\r
+   //          the selected cell\r
+   //\r
+   function processColumn(action) {\r
+      if (!this.tableCell)\r
+        return;\r
+\r
+      // store cell index in a var because the cell will be\r
+      // deleted when processing the first row\r
+      var cellidx = this.tableCell.cellIndex;\r
+      \r
+      var tbl = this.__findParentTable(this.tableCell);\r
+  \r
+      if (!tbl) {\r
+         alert("Could not " + action + " column.");\r
+         return;\r
+      }\r
+         \r
+      // now we have the table containing the cell\r
+      this.__addOrRemoveCols(tbl, cellidx, action);\r
+\r
+      // clear out global this.tableCell value for remove\r
+      if (action == 'remove') {\r
+         this.stopCellResize(true);\r
+         this.tableCell = null;\r
+      } else {\r
+         this.repositionArrows();\r
+      }\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: __addOrRemoveCols\r
+   //    args: (table object)tbl, (int)cellidx, (string)action\r
+   //          tbl = the table containing the selected cell\r
+   //          cellidx = the index of the selected cell in its row\r
+   //          action = "add" or "remove" the column\r
+   //\r
+   // purpose: add or remove the column at the cell index\r
+   //\r
+   function __addOrRemoveCols(tbl, cellidx, action) {\r
+      if (!tbl.childNodes.length)\r
+         return;\r
+      var i;\r
+      for (i = 0; i < tbl.childNodes.length; i++) {\r
+         if (tbl.childNodes[i].tagName == "TR") {\r
+            var cell = tbl.childNodes[i].childNodes[ cellidx ];\r
+            if (!cell)\r
+               break; // can't add cell after cell that doesn't exist\r
+            if (action == "add") {\r
+               cell.insertAdjacentElement("AfterEnd",  document.createElement("TD") );\r
+            } else {\r
+               // don't delete too many cells because or a rowspan setting\r
+                 \r
+               if (cell.rowSpan > 1) {\r
+                  i += (cell.rowSpan - 1);\r
+               }\r
+               cell.removeNode(true);\r
+            }\r
+         } else {\r
+            // keep looking for a "TR"\r
+            this.__addOrRemoveCols(tbl.childNodes[i], cellidx, action); \r
+         }\r
+      }\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: __findParentTable \r
+   //    args: (TD object)cell\r
+   //          cell = the selected cell object\r
+   //\r
+   // purpose: locate the table object that contains the\r
+   //          cell object passed in\r
+   //\r
+   function __findParentTable(cell) {\r
+      var tbl = cell.parentElement\r
+      while (tbl) {\r
+         if (tbl.tagName == "TABLE") {\r
+            return tbl;\r
+         }\r
+         tbl = tbl.parentElement;\r
+      }\r
+      return false;\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: exploreTree \r
+   //    args: (obj)obj, (obj)pnt\r
+   //          obj = object to explore\r
+   //          pnt = object to append output to\r
+   //\r
+   // purpose: traverse the dom tree printing out all properties\r
+   //          of the object, its children.....recursive.  helpful\r
+   //          when looking for object properties.\r
+   //\r
+   function exploreTree(obj, pnt) {\r
+      if (!obj.childNodes.length)\r
+         return;\r
+      var i;\r
+      var ul = pnt.appendChild( document.createElement("UL") );\r
+      for (i = 0; i < obj.childNodes.length; i++) {\r
+         var li = document.createElement("LI");\r
+         explore(obj.childNodes[i], li);\r
+         ul.appendChild(li);\r
+         exploreTree(obj.childNodes[i], li); \r
+         /*\r
+         var n = document.createTextNode(obj.childNodes[i].tagName);\r
+         li.appendChild(n);\r
+         */\r
+      }\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: explore\r
+   //    args: (obj)obj, (obj)pnt\r
+   //          obj = object to explore\r
+   //          pnt = object to append output to\r
+   //\r
+   // purpose: show all properties for the object "obj"\r
+   //\r
+   function explore(obj, pnt) {\r
+      var i;\r
+      for (i in obj) {\r
+         var n = document.createTextNode(i +"="+obj[i]);\r
+         pnt.appendChild(n);\r
+         pnt.appendChild( document.createElement("BR") );\r
+      }\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: buildTable \r
+   //    args: pnt = parent to append table to\r
+   //\r
+   // purpose: build a test table for debugging\r
+   //\r
+   function buildTable(pnt) {\r
+      var t = pnt.appendChild( document.createElement("TABLE") );\r
+      t.border=1;\r
+      t.cellPadding=2;\r
+      t.cellSpacing=0;\r
+      var tb = t.appendChild( document.createElement("TBODY") );\r
+      for(var r = 0; r < 10; r++) {\r
+         var tr = tb.appendChild( document.createElement("TR") );\r
+         for(var c = 0; c < 10; c++) {\r
+            var cell = tr.appendChild( document.createElement("TD") );\r
+            cell.appendChild( document.createTextNode(r+"-"+c) );\r
+         }\r
+      }\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: setDrag\r
+   //    args: obj = object (DIV) that is currently draggable\r
+   //\r
+   // purpose: set the object to be moved with the mouse\r
+   //\r
+   function setDrag(obj) {\r
+     if (this.moveable) \r
+       this.moveable = null;\r
+     else \r
+       this.moveable = obj; \r
+   }\r
+\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: changePos\r
+   //    args: none\r
+   //          mouse pointer appear inside the object set by "setDrag"\r
+   //          function above.\r
+   //\r
+   // purpose: move the object selected in the "setDrag" function defined\r
+   //          above.\r
+   //\r
+   function changePos() {\r
+      if (!this.moveable) \r
+         return;\r
+\r
+      this.moveable.style.posTop = event.clientY - 10;\r
+      this.moveable.style.posLeft = event.clientX - 25;\r
+   }\r
+\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: markCellResize\r
+   //    args: (object)obj = the square table div object that\r
+   //          was clicked on by the user to resize a cell\r
+   //\r
+   // purpose: store the object in "this.cellResizeObj" to be referenced\r
+   //          in the "resizeCell" function.\r
+   //          \r
+   //\r
+   function markCellResize(obj) {\r
+      if (this.cellResizeObj) {\r
+         this.cellResizeObj = null;\r
+      } else {\r
+         this.cellResizeObj = obj;\r
+      }\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: stopCellResize\r
+   //    args: (bool)hideArrows\r
+   //\r
+   // purpose: stop changing cell width and height\r
+   //\r
+   function stopCellResize(hidearrows) {\r
+      this.cellResizeObj = null;\r
+      if (hidearrows)\r
+         this.__hideArrows();\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: __hideArrows()\r
+   //    args: none\r
+   //\r
+   // purpose: hide editing tabs that are positioned in the selected\r
+   //          cell\r
+   //\r
+   function __hideArrows() {\r
+      document.getElementById("rArrow").style.visibility = 'hidden';\r
+      document.getElementById("dArrow").style.visibility = 'hidden';\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: __showArrows()\r
+   //    args: none\r
+   //\r
+   // purpose: position editing tabs in the middle or the right cell\r
+   //          wall and middle of the bottom wall to be used to drag\r
+   //          the cell's width and height dimensions\r
+   //\r
+   function __showArrows() {\r
+      if (!this.tableCell)\r
+         return;\r
+\r
+      var cell_hgt = this.tableCell.offsetTop;\r
+      var cell_wdt = this.tableCell.offsetLeft;\r
+      var par = this.tableCell.offsetParent;\r
+      while (par) {\r
+         cell_hgt = cell_hgt + par.offsetTop;\r
+         cell_wdt = cell_wdt + par.offsetLeft;\r
+         current_obj = par;\r
+         par = current_obj.offsetParent;\r
+      }\r
+      this.cellX = cell_wdt + this.tableCell.offsetWidth; //bottom right X\r
+      this.cellY = cell_hgt + this.tableCell.offsetHeight; // bottom right Y\r
+\r
+      var scrollTop = document.getElementById(this.docID).scrollTop;\r
+      var scrollLeft = document.getElementById(this.docID).scrollLeft;\r
+\r
+      document.getElementById("rArrow").style.posLeft = cell_wdt + this.tableCell.offsetWidth - 6 - scrollLeft;\r
+      document.getElementById("rArrow").style.posTop = cell_hgt + (this.tableCell.offsetHeight / 2) - 2 - scrollTop;\r
+\r
+      document.getElementById("dArrow").style.posLeft = cell_wdt + (this.tableCell.offsetWidth / 2) - 2 - scrollLeft;\r
+      document.getElementById("dArrow").style.posTop = cell_hgt + this.tableCell.offsetHeight - 6 - scrollTop;\r
+\r
+      document.getElementById("rArrow").style.visibility = 'visible';\r
+      document.getElementById("dArrow").style.visibility = 'visible';\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: repositionArrows()\r
+   //    args: none\r
+   //\r
+   // purpose: reposition editing tabs in the middle or the right cell\r
+   //          wall and middle of the bottom wall to be used to drag\r
+   //          the cell's width and height dimensions.  this must be\r
+   //          run while changing the cell's dimensions.\r
+   //\r
+   function repositionArrows() {\r
+\r
+      if (!this.tableCell)\r
+         return;\r
+\r
+      var cell_hgt = this.tableCell.offsetTop;\r
+      var cell_wdt = this.tableCell.offsetLeft;\r
+      var par = this.tableCell.offsetParent;\r
+      while (par) {\r
+         cell_hgt = cell_hgt + par.offsetTop;\r
+         cell_wdt = cell_wdt + par.offsetLeft;\r
+         current_obj = par;\r
+         par = current_obj.offsetParent;\r
+      }\r
+\r
+      var scrollTop = document.getElementById(this.docID).scrollTop;\r
+      var scrollLeft = document.getElementById(this.docID).scrollLeft;\r
+\r
+      document.getElementById("rArrow").style.posLeft = cell_wdt + this.tableCell.offsetWidth - 6 - scrollLeft;\r
+      document.getElementById("rArrow").style.posTop = cell_hgt + (this.tableCell.offsetHeight / 2) - 2 - scrollTop;\r
+\r
+      document.getElementById("dArrow").style.posLeft = cell_wdt + (this.tableCell.offsetWidth / 2) - 2 - scrollLeft; \r
+      document.getElementById("dArrow").style.posTop = cell_hgt + this.tableCell.offsetHeight - 6 - scrollTop;\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: resizeCell()\r
+   //    args: none\r
+   //\r
+   // purpose: resize the selected cell based on the direction of the mouse\r
+   //\r
+   function resizeCell() {\r
+      if (!this.cellResizeObj)\r
+         return;\r
+\r
+      if (this.cellResizeObj.id == 'dArrow') {\r
+         var scrollTop = document.getElementById(this.docID).scrollTop;\r
+         var newHeight = (event.clientY - (this.cellY - scrollTop) ) + this.cellHeight;\r
+\r
+         if (newHeight > 0)\r
+            // don't resize entire row if rowspan > 1\r
+            if (this.tableCell.rowSpan > 1) \r
+               this.tableCell.style.height = newHeight;\r
+            else \r
+               this.resizeRow(newHeight);\r
+\r
+         this.repositionArrows();\r
+\r
+      } else if (this.cellResizeObj.id == 'rArrow') {\r
+         var scrollLeft = document.getElementById(this.docID).scrollLeft;\r
+         var newWidth = (event.clientX - (this.cellX - scrollLeft) ) + this.cellWidth;\r
+\r
+         if (newWidth > 0) \r
+            // don't resize entire column if colspan > 1\r
+            if (this.tableCell.colSpan > 1)\r
+               this.tableCell.style.width = newWidth;\r
+            else\r
+               this.resizeColumn(newWidth);\r
+\r
+         this.repositionArrows();\r
+\r
+      } else {\r
+         // do nothing\r
+      }\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: resizeRow \r
+   //    args: (int)size\r
+   // purpose: set cell.style.height on all cells in a row that\r
+   //          have rowspan = 1 \r
+   //\r
+   function resizeRow(size) {\r
+      if (!this.tableCell)\r
+        return;\r
+\r
+      // go back to TABLE def and keep track of cell index\r
+      var idx = 0;\r
+      var rowidx = -1;\r
+      var tr = this.tableCell.parentNode;\r
+      var numcells = tr.childNodes.length;\r
+\r
+      while (tr) {\r
+         if (tr.tagName == "TR")\r
+            rowidx++;\r
+         tr = tr.previousSibling;\r
+      }\r
+      // now we should have a row index indicating where the\r
+      // row should be added / removed\r
+\r
+      var tbl = this.__findParentTable(this.tableCell);\r
+  \r
+      if (!tbl) {\r
+         return;\r
+      }\r
+     \r
+      // resize cells in the row\r
+      for (var j = 0; j < tbl.rows(rowidx).cells.length; j++) {\r
+         if (tbl.rows(rowidx).cells(j).rowSpan == 1)\r
+            tbl.rows(rowidx).cells(j).style.height = size;\r
+      }\r
+   }\r
+\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: resizeColumn \r
+   //    args: (int)size = size in pixels\r
+   // purpose: set column width\r
+   //\r
+   function resizeColumn(size) {\r
+      if (!this.tableCell)\r
+        return;\r
+\r
+      // store cell index in a var because the cell will be\r
+      // deleted when processing the first row\r
+      var cellidx = this.tableCell.cellIndex;\r
+      \r
+      var tbl = this.__findParentTable(this.tableCell);\r
+  \r
+      if (!tbl) {\r
+         alert("Could not resize  column.");\r
+         return;\r
+      }\r
+         \r
+      // now we have the table containing the cell\r
+      this.__resizeColumn(tbl, cellidx, size);\r
+   }\r
+\r
+   ////////////////////////////////////////////////////////////////\r
+   //  method: __resizeColumn\r
+   //    args: (table object)tbl, (int)cellidx, (int)size\r
+   //          tbl = the table containing the selected cell\r
+   //          cellidx = the index of the selected cell in its row\r
+   //          size = size in pixels\r
+   //\r
+   // purpose: resize all cells in the a column\r
+   //\r
+   function __resizeColumn(tbl, cellidx, size) {\r
+      if (!tbl.childNodes.length)\r
+         return;\r
+      var i;\r
+      for (i = 0; i < tbl.childNodes.length; i++) {\r
+         if (tbl.childNodes[i].tagName == "TR") {\r
+            var cell = tbl.childNodes[i].childNodes[ cellidx ];\r
+            if (!cell)\r
+               break; // can't add cell after cell that doesn't exist\r
+\r
+            if (cell.colSpan == 1)\r
+               cell.style.width = size;\r
+         } else {\r
+            // keep looking for a "TR"\r
+            this.__resizeColumn(tbl.childNodes[i], cellidx, size); \r
+         }\r
+      }\r
+   }\r
+} \r