From: moodler Date: Thu, 10 Oct 2002 07:21:32 +0000 (+0000) Subject: Adding a beta version of Rich Text Editor, for embedding into Moodle X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=de909d238d33d434b102cdbe7e64366c13366b37;p=moodle.git Adding a beta version of Rich Text Editor, for embedding into Moodle forms (forums, readings, journals etc). Works only on IE 5.5 and later. Slightly customised for a slimmer toolbar. --- diff --git a/lib/rte/README_MOODLE b/lib/rte/README_MOODLE new file mode 100644 index 0000000000..9087121815 --- /dev/null +++ b/lib/rte/README_MOODLE @@ -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 index 0000000000..02e22639d8 --- /dev/null +++ b/lib/rte/_header_css.txt @@ -0,0 +1,46 @@ +/******************************************************************************* +** +** $Header$ +** +** HTML Text Editing Component for hosting in Web Pages +** Copyright (C) 2001 Ramesys (Contracting Services) Limited +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU LesserGeneral Public License +** along with this program; if not a copy can be obtained from +** +** http://www.gnu.org/copyleft/lesser.html +** +** or by writing to: +** +** Free Software Foundation, Inc. +** 59 Temple Place - Suite 330, +** Boston, +** MA 02111-1307, +** USA. +** +** Original Developer: +** +** Austin David France +** Ramesys (Contracting Services) Limited +** Mentor House +** Ainsworth Street +** Blackburn +** Lancashire +** BB1 6AY +** United Kingdom +** email: Austin.France@Ramesys.com +** +** Home Page: http://richtext.sourceforge.net/ +** Support: http://richtext.sourceforge.net/ +** +*******************************************************************************/ diff --git a/lib/rte/_header_html.txt b/lib/rte/_header_html.txt new file mode 100644 index 0000000000..87dbcc2abf --- /dev/null +++ b/lib/rte/_header_html.txt @@ -0,0 +1,48 @@ + diff --git a/lib/rte/_header_js.txt b/lib/rte/_header_js.txt new file mode 100644 index 0000000000..ff94710e67 --- /dev/null +++ b/lib/rte/_header_js.txt @@ -0,0 +1,46 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// $Header$ +// +// HTML Text Editing Component for hosting in Web Pages +// Copyright (C) 2001 Ramesys (Contracting Services) Limited +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU LesserGeneral Public License +// along with this program; if not a copy can be obtained from +// +// http://www.gnu.org/copyleft/lesser.html +// +// or by writing to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330, +// Boston, +// MA 02111-1307, +// USA. +// +// Original Developer: +// +// Austin David France +// Ramesys (Contracting Services) Limited +// Mentor House +// Ainsworth Street +// Blackburn +// Lancashire +// BB1 6AY +// United Kingdom +// email: Austin.France@Ramesys.com +// +// Home Page: http://richtext.sourceforge.net/ +// Support: http://richtext.sourceforge.net/ +// +//////////////////////////////////////////////////////////////////////////////// diff --git a/lib/rte/about_logo.swf b/lib/rte/about_logo.swf new file mode 100644 index 0000000000..d849cea8ae 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 index 0000000000..a741b7c65e 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 index 0000000000..2fec2ef238 --- /dev/null +++ b/lib/rte/changelog @@ -0,0 +1,90 @@ +Version DEV + +- Added multi-lingual support. The editor detects the userLanguage + of the browser and uses this select the relevent language from the + new rte_lang.js module which is then applied to the main editor + window. This is a work in progress, dialog need translation also. + +- Re-implemented Undo/Redo (history) option this time using the + document.execCommand('Undo'/'Redo') options which although + documented as not implemented do work in IE 6.0. + +Version 0.2.3 + +- Improved option handling to maintain an array of options that are + not "features" and added a getOption() private method to obtain + the current option value. + +- The saveHistory() function is now a no-op if the history option is + not enabled. Previously it was still doing all the buffer saving + behind the scenes. This should improve the performance of the + editor. + +- Corrected version and company information in the about dialog. + +- Remove showHistory() status (debug) messages + +- After set editor options, apply them. In most circumstances the + options property is set after the editor has initialised and so + the options need to be processed as the options are set not + when the editor is initialised. + +- Added numerous options: + styleBar=yes|no default yes + style=yes|no default yes + font=yes|no default yes + fontSize=yes|no default yes + colour=yes|no default yes + dragdrop=yes|no default no + +- Added code to disable drag and drop in the editor. Previously + it was possible to drag a toolbar button and drop a copy of it + into the editor window. Now, nothing can be dragged from the + toolbar and nothing can be dropped into the editor window. + This does not disable any functionality because the editor + window did not act as a drop target for objects from outside + of the IE control. It was however possible to drag elements + from one page and drop them into the editor, this is now not + possible unless dragdrop=yes is specified. However, the + dragdrop handling is weak (non-existent) and so is disabled + by default. + +- Some minor cosmetic changes to the toolbar. + +- Added debug window functionality to aid development and support + of the editor. Over time, diagnostic debugs will be added to + the editor code. + +- Default edit area to not editable (effectivly disabled) until + inisialisation of the editor is complete. + +- Added Full Justify Option + +- Re-worked font color/back color resetting (color none) so that + a) it worked and b) it only removes the fore/background color + and preserves the other formatting that bit of text may have. + +- Disable post button when in view source mode. The post button + is greyed out whilst disabled. + +Version 0.2.2 +============= +- Disabled buggy history and view source options by default in preparation + for official 0.2 release (to be officially released in a later release). + +- Added editor.options property to allow optional functionality to be + enabled/disabled. + +Version 0.2.1 +============= +- Corrected a bug in test_embedded.asp (JavaScript error). + +Version 0.2.0 +============= +- Added support for Custom Fields +- Beta versions of undo-history and view source options added + +Version 0.1 +=========== +- Original release of The Richtext Editor + diff --git a/lib/rte/colorchooser.html b/lib/rte/colorchooser.html new file mode 100644 index 0000000000..be388e8be2 --- /dev/null +++ b/lib/rte/colorchooser.html @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Standard Colors
Web Safe
None
+ + diff --git a/lib/rte/credits.html b/lib/rte/credits.html new file mode 100644 index 0000000000..0ae4c696e6 --- /dev/null +++ b/lib/rte/credits.html @@ -0,0 +1,104 @@ + + + +Acknowledgements + + + +
+PROJECT MANAGER
+
+AUSTIN DAVID FRANCE
+http://sourceforge.net/users/third_of_five/
+
+
+LEAD PROGRAMMER
+
+AUSTIN DAVID FRANCE
+http://sourceforge.net/users/third_of_five/
+
+
+DEVELOPERS
+
+William R. Cook
+http://sourceforge.net/users/wcook/
+
+Bill Chalmers
+http://sourceforge.net/users/bchalmers/
+
+Leon Reinders
+http://sourceforge.net/users/leonreinders/
+
+Torbjørn Engedal
+http://sourceforge.net/users/torbjoen/
+
+Jan Seda
+http://sourceforge.net/users/aramir/
+
+Dave Otto
+http://sourceforge.net/users/daveotto/
+
+
+RELEASE TECHNITIONS
+
+William R. Cook
+http://sourceforge.net/users/wcook/
+
+AUSTIN DAVID FRANCE
+http://sourceforge.net/users/third_of_five/
+
+
+DREAMWEAVER EXTENSION
+
+Bill Chalmers
+http://sourceforge.net/users/bchalmers/
+
diff --git a/lib/rte/custom.css b/lib/rte/custom.css new file mode 100644 index 0000000000..cdcb5d5f98 --- /dev/null +++ b/lib/rte/custom.css @@ -0,0 +1,47 @@ +/******************************************************************************* +** +** HTML Text Editing Component for hosting in Web Pages +** Copyright (C) 2001 Ramesys (Contracting Services) Limited +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU LesserGeneral Public License +** along with this program; if not a copy can be obtained from +** +** http://www.gnu.org/copyleft/lesser.html +** +** or by writing to: +** +** Free Software Foundation, Inc. +** 59 Temple Place - Suite 330, +** Boston, +** MA 02111-1307, +** USA. +** +** Original Developer: +** +** Austin David France +** Ramesys (Contracting Services) Limited +** Mentor House +** Ainsworth Street +** Blackburn +** Lancashire +** BB1 6AY +** United Kingdom +** email: Austin.France@Ramesys.com +** +** Home Page: http://richtext.sourceforge.net/ +** Support: http://richtext.sourceforge.net/ +** +*******************************************************************************/ + +.rebar #featureHistory { display: ; } /* Change to display: none to disable history feature */ +.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 index 0000000000..01f7ba7d84 --- /dev/null +++ b/lib/rte/debug_embedded.asp @@ -0,0 +1,148 @@ +<%@language="JavaScript"%> + +<% +var strHTML = Request.Form("text").Item(); +if (strHTML) +{ + // Update your database here + // ... + + // Confirmation + Response.Write("

Database Updated

"); + Response.Write("

HTML:-


" + Server.HTMLEncode(strHTML) + "

"); + Response.End(); +} + +// Get your HTML from the datbase here +strHTML = '

Heading 1

' + + '

Heading 2

' + + '

Heading 3

' + + '

Normal

' + + '

Welcome to the richtext text editor, the HTML text editor which works inside a web page.

' + + '

This is Link' + ; +%> + + +Edit Text + + + + + + + +

+
+ +
+ +
+ + + + + + + diff --git a/lib/rte/dialog.css b/lib/rte/dialog.css new file mode 100644 index 0000000000..3e90ef6db7 --- /dev/null +++ b/lib/rte/dialog.css @@ -0,0 +1,54 @@ +/******************************************************************************* +** +** HTML Text Editing Component for hosting in Web Pages +** Copyright (C) 2001 Ramesys (Contracting Services) Limited +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU LesserGeneral Public License +** along with this program; if not a copy can be obtained from +** +** http://www.gnu.org/copyleft/lesser.html +** +** or by writing to: +** +** Free Software Foundation, Inc. +** 59 Temple Place - Suite 330, +** Boston, +** MA 02111-1307, +** USA. +** +** Original Developer: +** +** Austin David France +** Ramesys (Contracting Services) Limited +** Mentor House +** Ainsworth Street +** Blackburn +** Lancashire +** BB1 6AY +** United Kingdom +** email: Austin.France@Ramesys.com +** +** Home Page: http://richtext.sourceforge.net/ +** Support: http://richtext.sourceforge.net/ +** +*******************************************************************************/ + +BODY { background-color: buttonface; } +TD, INPUT, SELECT { font-family: "MS Sans Serif"; font-size: xx-small; vertical-align: middle; } +TABLE.dlg { border:0; } +.dlg TD { align: left; height: 20; } +.dlg INPUT { border-size: 2px; } +INPUT.button { border-top: 1px solid white; border-left: 1px solid white; +border-bottom: 1px solid black; border-right: 1px solid black; +font-size: x-small; width: 60; } +SELECT { height: 75%; } diff --git a/lib/rte/dlg_about.html b/lib/rte/dlg_about.html new file mode 100644 index 0000000000..ac068eb97a --- /dev/null +++ b/lib/rte/dlg_about.html @@ -0,0 +1,86 @@ + + + + + + +About Richtext Editor + + + + + + + + + + + + + + + + + + +
 

 Richtext Editor 
 Version rt-0.3.0-beta-1 
Copyright © 2001-2002, Ramesys Construction Services
http://richtext.sourceforge.net/
Acknowledgments:
License Agreement:
+
+ + diff --git a/lib/rte/dlg_ins_char.html b/lib/rte/dlg_ins_char.html new file mode 100644 index 0000000000..1c324e2757 --- /dev/null +++ b/lib/rte/dlg_ins_char.html @@ -0,0 +1,150 @@ + + + + + + + +Insert Character + + + + + + + + + + +
Choose Character
+ + + + +
+ + + +
+ +

+
+ + + + diff --git a/lib/rte/dlg_ins_image.html b/lib/rte/dlg_ins_image.html new file mode 100644 index 0000000000..451decd2b8 --- /dev/null +++ b/lib/rte/dlg_ins_image.html @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Picture Info 
 Url:
 Alt Text:Align: +
  + + + + + + +
Border: Width:Height:Vspace:Hspace:
+

  + +
+ + diff --git a/lib/rte/dlg_ins_smile.html b/lib/rte/dlg_ins_smile.html new file mode 100644 index 0000000000..f9ee78f848 --- /dev/null +++ b/lib/rte/dlg_ins_smile.html @@ -0,0 +1,198 @@ + + + + + + +Insert Smily + + + + + + + + + + + +
Choose Smily
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
smile[:)]
big smile[:D]
cool[8D]
blush[:I]
tongue[:P]
evil[}:)]
wink[;)]
clown[:o)]
black eye[B)]
eightball[8]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
frown[:(]
shy[8)]
shocked[:O]
angry[:(!]
dead[xx(]
sleepy[|)]
kisses[:X]
approve[^]
disapprove[V]
question[?]
+
+ +

+
+ + diff --git a/lib/rte/dlg_ins_table.html b/lib/rte/dlg_ins_table.html new file mode 100644 index 0000000000..3115100ca5 --- /dev/null +++ b/lib/rte/dlg_ins_table.html @@ -0,0 +1,149 @@ + + + + + + +Insert Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Layout
 Rows:Cell Padding:
 Cols:Cell Spacing:
 Rows Height:
 Column Width:
Borders
 Width:Color:
Background
 Color:

  +
+ + diff --git a/lib/rte/example.html b/lib/rte/example.html new file mode 100644 index 0000000000..3154aae5bc --- /dev/null +++ b/lib/rte/example.html @@ -0,0 +1,92 @@ + + + + + + + + + + +
+
+ +
+

+ + + + + +
+header
td 1
+ +

 

+ + + + + + + + +
+ + + + diff --git a/lib/rte/images/CloseWindow.gif b/lib/rte/images/CloseWindow.gif new file mode 100644 index 0000000000..93ada9e5a2 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 index 0000000000..e46ec615d9 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 index 0000000000..66128f39d1 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 index 0000000000..8a0906b06e 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 index 0000000000..55dc540f27 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 index 0000000000..55fff78d2b 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 index 0000000000..d062655e39 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 index 0000000000..f8dd6430a8 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 index 0000000000..d062655e39 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 index 0000000000..f8dd6430a8 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 index 0000000000..e46ec615d9 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 index 0000000000..66128f39d1 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 index 0000000000..942f10b0f1 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 index 0000000000..aab24cd52d 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 index 0000000000..72d22c1d26 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 index 0000000000..dc9dbbf08a 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 index 0000000000..843b088459 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 index 0000000000..ed563544d1 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 index 0000000000..c55f73b0b6 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 index 0000000000..14a917962b 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 index 0000000000..39623ef42a 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 index 0000000000..acc8edbc9a 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 index 0000000000..891528bcae 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 index 0000000000..61aeef57eb 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 index 0000000000..a3f65662f4 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 index 0000000000..d461925fe0 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 index 0000000000..f734af4ab3 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 index 0000000000..b4809f0cbf 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 index 0000000000..bdc5879bf9 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 index 0000000000..ce6b23d68c 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 index 0000000000..38a0033c8f 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 index 0000000000..466c2673b8 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 index 0000000000..f59071a61e 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 index 0000000000..ab47d4c0ab 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 index 0000000000..a62400edf8 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 index 0000000000..c9e44c5f51 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 index 0000000000..ca9f45c319 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 index 0000000000..cac3dba863 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 index 0000000000..38f2577570 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 index 0000000000..be729a2d39 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 index 0000000000..dcb2105684 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 index 0000000000..1f4bb7f4aa 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 index 0000000000..08810758eb 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 index 0000000000..8615b4c341 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 index 0000000000..fb0db91699 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 index 0000000000..55ea56dba0 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 index 0000000000..e4dac6132a 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 index 0000000000..3f11e3d410 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 index 0000000000..37f9242034 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 index 0000000000..0f80ef7770 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 index 0000000000..a0757a4b77 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 index 0000000000..5156c81ad4 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 index 0000000000..826b2859be 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 index 0000000000..7411be7236 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 index 0000000000..51aa5a631c 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 index 0000000000..8951a58967 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 index 0000000000..b3968af548 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 index 0000000000..14d8daa76b 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 index 0000000000..42f90ff9f8 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 index 0000000000..a9ce564d1c 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 index 0000000000..925229af72 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 index 0000000000..55d86897ba 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 index 0000000000..d4ba94d6aa 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 index 0000000000..85ba81db4f 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 index 0000000000..0b045090e2 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 index 0000000000..5322f462e7 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 index 0000000000..1eec71f9b0 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 index 0000000000..1aa7af1c5c 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 index 0000000000..2289066c5e 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 index 0000000000..b24452ae34 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 index 0000000000..1b9413e988 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 index 0000000000..c1f2ca7e94 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 index 0000000000..bc7763599b 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 index 0000000000..8d64b22008 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 index 0000000000..b47fec9305 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 index 0000000000..0bea697348 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 index 0000000000..d2d19c1f2b 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 index 0000000000..0608c97f83 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 index 0000000000..0eb1077ffb 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 index 0000000000..b09eaea1b8 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 index 0000000000..62d7f8cf69 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 index 0000000000..75825568fa 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 index 0000000000..ad8d0475e5 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 index 0000000000..f653109b80 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 index 0000000000..c7cf3f067c 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 index 0000000000..648e7f078c 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 index 0000000000..430fdb288b 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 index 0000000000..7849726f33 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 index 0000000000..dae104d40d 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 index 0000000000..0809c025e4 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 index 0000000000..bb9e1dbdd8 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 index 0000000000..84b8fa13e8 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 index 0000000000..65bf50e4e9 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 index 0000000000..a27b719379 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 index 0000000000..997e42fefe 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 index 0000000000..af0ca6331a 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 index 0000000000..9891aa2930 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 index 0000000000..876965baa8 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 index 0000000000..e2f086f92a 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 index 0000000000..8a7c6091cc 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 index 0000000000..fce7c3f355 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 index 0000000000..b9e92a1adf 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 index 0000000000..43d33b1f02 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 index 0000000000..79b2c0e65b 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 index 0000000000..a1a4c3acae 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 index 0000000000..674d79667d 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 index 0000000000..e62f51ebd7 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 index 0000000000..30150751a0 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 index 0000000000..fc2560981e 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 index 0000000000..2de10434dc 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 index 0000000000..4ee5829cfc --- /dev/null +++ b/lib/rte/license.html @@ -0,0 +1,514 @@ + + + +GNU LESSER GENERAL PUBLIC LICENSE + + +
+                   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+
\ No newline at end of file diff --git a/lib/rte/license.txt b/lib/rte/license.txt new file mode 100644 index 0000000000..59c5f03e4f --- /dev/null +++ b/lib/rte/license.txt @@ -0,0 +1,459 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + diff --git a/lib/rte/popup_editor.html b/lib/rte/popup_editor.html new file mode 100644 index 0000000000..f41ac413d9 --- /dev/null +++ b/lib/rte/popup_editor.html @@ -0,0 +1,73 @@ + + + + + +Edit Text + + + + + + + + + + + diff --git a/lib/rte/readme.txt b/lib/rte/readme.txt new file mode 100644 index 0000000000..ec7e25df6b --- /dev/null +++ b/lib/rte/readme.txt @@ -0,0 +1,44 @@ +RichText is an HTML Text Editor written using DHTML, JavaScript and +Scriptlet technologies allows WYSIWYG editing of HTML from +within a web page. Ideal for use as a forum message editor +or anywhere else description text is required. + + +## +## Home Page: http://richtext.sourceforge.net/ +## Support: http://richtext.sourceforge.net/ +## + +Author: + + Austin David France + Ramesys (Contracting Services) Limited + Mentor House + Ainsworth Street + Blackburn + Lancashire + BB1 6AY + United Kingdom + + email: Austin.France@Ramesys.com + + +HTML Text Editing Component for hosting in Web Pages +Copyright (C) 2001 Ramesys (Contracting Services) Limited + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU LesserGeneral Public License +along with this program; if not a copy can be obtained from + + http://www.gnu.org/copyleft/lesser.html + + diff --git a/lib/rte/richedit.css b/lib/rte/richedit.css new file mode 100644 index 0000000000..f913c362d8 --- /dev/null +++ b/lib/rte/richedit.css @@ -0,0 +1,219 @@ +/******************************************************************************* +** +** HTML Text Editing Component for hosting in Web Pages +** Copyright (C) 2001 Ramesys (Contracting Services) Limited +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU LesserGeneral Public License +** along with this program; if not a copy can be obtained from +** +** http://www.gnu.org/copyleft/lesser.html +** +** or by writing to: +** +** Free Software Foundation, Inc. +** 59 Temple Place - Suite 330, +** Boston, +** MA 02111-1307, +** USA. +** +** Original Developer: +** +** Austin David France +** Ramesys (Contracting Services) Limited +** Mentor House +** Ainsworth Street +** Blackburn +** Lancashire +** BB1 6AY +** United Kingdom +** email: Austin.France@Ramesys.com +** +** Home Page: http://richtext.sourceforge.net/ +** Support: http://richtext.sourceforge.net/ +** +*******************************************************************************/ + +body { width: 100%; border: 1px inset buttonface; border-left: 0px; background-color: buttonface } + +table#editor { width: 100%; height: 100%; border: 0px; visibility: hidden; } + +td.textedit { } + +.textedit div.document { + height: 150; + font-family: "Times New Roman"; + background-color: window; + border: 2px inset buttonface; padding:5; +} + +/* rebar styles ***************************************************************/ +td.rebar { padding:0; padding-bottom:2; padding-top:2; + font-family: "MS Sans Serif"; font-size: xx-small; vertical-align: middle; +} + +td.spacer { + border-top: 1px solid buttonhighlight; + padding: 0; margin: 0; height: 4; +} + +.rebar span.toolbar { + border-top: 1px solid buttonhighlight; + border-left: 1px solid buttonhighlight; + border-bottom: 1px solid buttonshadow; + border-right: 1px solid buttonshadow; + padding: 0; margin: 0; padding-bottom:1; padding-top:1; +} + +.rebar span.spacer { width: 2px; } + +.rebar span.start { + margin:0; + background-color: buttonface; + border-top: 1px solid buttonhighlight; + border-left: 1px solid buttonhighlight; + border-bottom: 1px solid buttonshadow; + border-right: 1px solid buttonshadow; + width: 3px; + height: 18px; +} + +.rebar span.label { border:0; position:relative; top: -2; margin-left: 3; } + +.rebar span.sep { + margin:0; + background-color: buttonface; + border-top: 1px solid buttonshadow; + border-left: 1px solid buttonshadow; + border-bottom: 1px solid buttonhighlight; + border-right: 1px solid buttonhighlight; + width: 2px; + height: 18px; +} + +.rebar select { + font-size: 11px; + margin-top: 1; margin-bottom: 1; + width : 100px; +} + +.rebar .fontselect { + font-size: 11px; + margin-top: 1; margin-bottom: 1; + width : 200px; +} + +.rebar option { border: 5px solid red; } + +.rebar span.field { + border-top: 1px solid buttonhighlight; + border-left: 1px solid buttonhighlight; + border-bottom: 1px solid buttonshadow; + border-right: 1px solid buttonshadow; + padding: 0; margin: 0; padding-bottom:1; padding-top:1; +} + +.rebar .field span.label { + margin-left: 0; + padding-left: 8; width: 60; +} + +.rebar .field span.start { + position: relative; top: 1; + +} + +.rebar .field input.field { + border-top: 1px solid buttonshadow; + border-left: 1px solid buttonshadow; + border-bottom: 1px solid buttonhighlight; + border-right: 1px solid buttonhighlight; + height: 20px; margin: 0px; + margin-bottom: -1px; +} + +.rebar img { + border: 1px solid buttonface; margin:0; padding:1; + cursor: hand; +} + +.rebar img.hover { + border-top: 1px solid buttonhighlight; + border-left: 1px solid buttonhighlight; + border-bottom: 1px solid buttonshadow; + border-right: 1px solid buttonshadow; +} + +.rebar img.down { + border-bottom: 1px solid buttonhighlight; + border-right: 1px solid buttonhighlight; + border-top: 1px solid buttonshadow; + border-left: 1px solid buttonshadow; +} + +.rebar img.disabled { + border: 1px solid buttonface; margin:0; padding:0; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=30); + cursor: normal; +} + +.rebar img.spacer { + cursor: normal; +} + +/* table control styles ***************************************************************/ +td.tbl { padding:0; padding-bottom:0; padding-top:0; + font-family: "MS Sans Serif"; font-size: xx-small; vertical-align: middle; +} + +td.spacer { + border-top: 1px solid buttonhighlight; + padding: 0; margin: 0; height: 4; +} + +.tbl img { + border: 1px solid buttonface; margin:0; padding:1; + cursor: hand; +} + +.tbl img.hover { + border-top: 1px solid buttonhighlight; + border-left: 1px solid buttonhighlight; + border-bottom: 1px solid buttonshadow; + border-right: 1px solid buttonshadow; +} + +.tbl img.down { + border-bottom: 1px solid buttonhighlight; + border-right: 1px solid buttonhighlight; + border-top: 1px solid buttonshadow; + border-left: 1px solid buttonshadow; +} + +.tbl img.disabled { + border: 1px solid buttonface; margin:0; padding:0; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=30); + cursor: normal; +} + +.tbl img.spacer { + cursor: normal; +} + + +/* control styles ***************************************************************/ +object#color { + position: absolute; + width:252; height: 225; + display: none; + background-color: white; border: 1px outset buttonface +} diff --git a/lib/rte/richedit.html b/lib/rte/richedit.html new file mode 100644 index 0000000000..7d71422dd6 --- /dev/null +++ b/lib/rte/richedit.html @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+ Loading ... +
+
+ + + + + + + + + + + + + + + +
+ + @{Bold} + @{Italic} + @{Underline} + @{Strikethrough} + + @{AlignLeft} + @{Center} + @{AlignRight} + @{AlignBlock} + + @{NumberedList} + @{BulettedList} + + @{DecreaseIndent} + @{IncreaseIndent} + + + @{HistoryBack} + @{HistoryForward} + + + @{InsertLink} + @{RemoveLink} + + @{InsertImage} + @{InsertTable} + @{EditTable} + @{InsertLine} + @{InsertSmily} + @{InsertCharacter} + + @{About} +
+   + + @{Style} + + + + + @{Font} + + + + + @{Size} + + + + + @{TextColor} + @{BackgroundColor} + + +   + @{Source} + + +
+
+
+
+ + + + + + + + diff --git a/lib/rte/rte.js b/lib/rte/rte.js new file mode 100644 index 0000000000..6734d2ea83 --- /dev/null +++ b/lib/rte/rte.js @@ -0,0 +1,633 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// HTML Text Editing Component for hosting in Web Pages +// Copyright (C) 2001 Ramesys (Contracting Services) Limited +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU LesserGeneral Public License +// along with this program; if not a copy can be obtained from +// +// http://www.gnu.org/copyleft/lesser.html +// +// or by writing to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330, +// Boston, +// MA 02111-1307, +// USA. +// +// Original Developer: +// +// Austin David France +// Ramesys (Contracting Services) Limited +// Mentor House +// Ainsworth Street +// Blackburn +// Lancashire +// BB1 6AY +// United Kingdom +// email: Austin.France@Ramesys.com +// +// Home Page: http://richtext.sourceforge.net/ +// Support: http://richtext.sourceforge.net/ +// +//////////////////////////////////////////////////////////////////////////////// +// +// Authors & Contributers: +// +// OZ Austin David France [austin.france@ramesys.com] +// Primary Developer +// +// LEON Leon Reinders [leonreinders@hetnet.nl] +// Author of View Source, History and Extended Style Functions +// +// DIRK Dirk Datzert [Dirk.Datzert@rasselstein-hoesch.de] +// Justify Full Option +// +// BC Bill Chalmers [bill_paula@btinternet.com] +// Font Selection +// +// History: +// +// OZ 21-01-2002 +// Fix a bug in applyOptions() that was not detecting a truth setting +// properly. Changed substr(eq) to substr(eq+1). Also, set the +// runtime style property, not the style property. +// +// OZ 22-01-2002 +// Moved initEditor() function into here from richedit.html +// +// OZ 22-01-2002 +// Added handleDrag() method to handle drag and drop events within the +// html of the editor. Drag and drop is currently disabled until we +// can find a practicle use for it. +// +// OZ 10-02-2002 +// Added code to handle the new Full Justify Option. Implementation of +// a mod to the editor made by Dirk Datzert who supplied the code and +// the Image. +// +// OZ 11-02-2002 +// Startup with text area set to contenteditable="false". The content +// is made editable when the editor has been initialised. +// +// OZ 12-02-2002 +// Fix handling of mouse hover when hover over a button that is in the +// down state. The down state of the button was being lost. This is +// a re-introduction of an earlier bug which I thought was fixed. +// The bug also occured when the button was pressed in some +// circumstances. The fix implemented is to have a button state +// property which is set when the state of a button is set in the +// setState() routine and this is used to restore the button state when +// the button is released or mouse moves out. +// +// OZ 12-06-2002 [richtext-Bugs-567960] Text area of editor window not get focus +// Ensure the doc element (the DIV) has focus once initialisation is +// complete. This ensures that when no HTML is supplied via the docHtml +// property, that focus is where the user expects. +// +// BC 10-07-2002 +// added getfontface() function to retrieve the new "web style" font selection +// this function is called from reset() in the same way as getStyle() +// +//////////////////////////////////////////////////////////////////////////////// + +// Internal (private) properties. +// RichEditor is the global RichEditor object (function) of which there is only +// 1 instance. +RichEditor.txtView = true; // WYSIWYG mode. false == View Source + +// initEditor(): Initialise the editor (called on window load, see below) +function initEditor() +{ + // Apply style data if supplied + if (!public_description.styleData) { + public_description.put_styleData(null); + } + + // Apply default editor options + var strDefaults = 'dragdrop=no;source=yes'; + strDefaults += ';history=' + (document.queryCommandSupported('Undo') ? 'yes' : 'no'); + applyOptions(strDefaults); + + // Prepare the editable region + loading.style.display = 'none'; + doc.contentEditable = "true"; + editor.style.visibility = 'visible'; + + // OZ - 12-06-2002 + // Put focus into the document (required when no HTML is supplied via docHtml property) + doc.focus(); +} + +// checkRange(): make sure our pretend document (the content editable +// DIV with id of "doc") has focus and that a text range exists (which +// is what execCommand() operates on). +function checkRange() +{ + RichEditor.selectedImage = null; + if (!RichEditor.txtView) return; // Disabled in View Source mode + doc.focus(); + if (document.selection.type == "None") { + document.selection.createRange(); + } +var r = document.selection.createRange(); + DBG(1, 'RANGE Bounding(' + + 'top='+r.boundingHeight + + ', left='+r.boundingHeight + + ', width='+r.boundingWidth + + ', height='+r.boundingHeight + ')' + + ', Offset(' + + 'top='+r.offsetTop + + ', left='+r.offsetLeft + ')' + + ', Text=(' + r.text + ')' + + ', HTML=(' + r.htmlText + ')' + ); +} + +// post(): Called in response to clicking the post button in the +// toolbar. It fires an event in the container named post, passing the +// HTML of our newly edited document as the data argument. +function post() +{ + DBG(1, 'Raise "post" event'); + window.external.raiseEvent("post", doc.innerHTML); +} + +// insert(): called in response to clicking the insert table, image, +// smily icons in the toolbar. Loads up an appropriate dialog to +// prompt for information, the dialog then returns the HTML code or +// NULL. We paste the HTML code into the document. +function insert(what) +{ + if (!RichEditor.txtView) return; // Disabled in View Source mode + + DBG(1, 'insert(' + what + ')'); + + // Chose action based on what is being inserted. + switch(what) + { + case "table": + strPage = "dlg_ins_table.html"; + strAttr = "status:no;dialogWidth:340px;dialogHeight:360px;help:no"; + break; + case "smile": + strPage = "dlg_ins_smile.html"; + strAttr = "status:no;dialogWidth:300px;dialogHeight:350px;help:no"; + break; + case "char": + strPage = "dlg_ins_char.html"; + strAttr = "status:no;dialogWidth:450px;dialogHeight:290px;help:no"; + break; + case "image": + strPage = "dlg_ins_image.html"; + strAttr = "status:no;dialogWidth:400px;dialogHeight:200px;help:no";' ' + break; + case "about": + strPage = "dlg_about.html"; + strAttr = "status:no;dialogWidth:500px;dialogHeight:405px;help:no";' ' + break; + } + + // run the dialog that implements this type of element + html = showModalDialog(strPage, window, strAttr); + + // and insert any result into the document. + if (html) { + insertHtml(html); + } +} + +// insertHtml(): Insert the supplied HTML into the current position +// within the document. +function insertHtml(html) +{ + doc.focus(); + var sel = document.selection.createRange(); + // don't try to insert HTML into a control selection (ie. image or table) + if (document.selection.type == 'Control') { + return; + } + sel.pasteHTML(html); +} + +// doStyle(): called to handle the simple style commands such a bold, +// italic etc. These require no special handling, just a call to +// execCommand(). We also call reset so that the toolbar represents +// the state of the current text. +// +// 2002-07-30 Updated based on patch submitted by Michael Keck (mkkeck) +// +function doStyle(s){ + if(!RichEditor.txtView) return; + /* Disabled in View Source mode */ + DBG(1, 'doStyle(' + s + ')'); + checkRange(); + if(s!='InsertHorizontalRule'){ + /* what command string? */ + document.execCommand(s); + } else if( s=='InsertHorizontalRule') { + /* if s=='InsertHorizontalRule then use this command */ + document.execCommand(s,false, null); + + /* Note: + In your source view the
has an ID like this +
+ */ + } + reset(); +} + + +// link(): called to insert a hyperlink. It will use the selected text +// if there is some, or the URL entered if not. If clicked when over a +// link, that link is allowed to be edited. +function link(on) +{ + if (!RichEditor.txtView) return; // Disabled in View Source mode + + var strURL = "http://"; + var strText; + + // First, pick up the current selection. + doc.focus(); + var r = document.selection.createRange(); + var el = r.parentElement(); + + // Is this aready a link? + if (el && el.nodeName == "A") { + r.moveToElementText(el); + if (!on) { // If removing the link, then replace all with + r.pasteHTML(el.innerHTML); + return; + } + strURL = el.href; + } + + // Get the text associated with this link + strText = r.text; + + // Prompt for the URL + strURL = window.prompt("Enter URL", strURL); + if (strURL) { + // Default the TEXT to the url if non selected + if (!strText || !strText.length) { + strText = strURL; + } + + // Replace with new URL + r.pasteHTML('' + strText + ''); + } + + reset(); +} + +// sel(); similar to doStyle() but called from the dropdown list boxes +// for font and style commands. +function sel(el) +{ + if (!RichEditor.txtView) return; // Disabled in View Source mode + checkRange(); + switch(el.id) + { + case "ctlFont": + document.execCommand('FontName', false, el[el.selectedIndex].value); + break; + case "ctlSize": + document.execCommand('FontSize', false, el[el.selectedIndex].value); + break; + case "ctlStyle": + document.execCommand('FormatBlock', false, el[el.selectedIndex].text); + break; + } + doc.focus(); + reset(); +} + +// pickColor(): called when the text or fill color icons are clicked. Displays +// the color chooser control. The color setting is completed by the event +// handler of this control (see richedit.html) +function pickColor(fg) +{ + if (!RichEditor.txtView) return; // Disabled in View Source mode + checkRange(); + var el = window.event.srcElement; + if (el && el.nodeName == "IMG") { + setState(el, true); + } + color.style.top = window.event.clientY + 10; + color.style.left = window.event.clientX - 100; + color.style.display = 'block'; + color._fg = fg; +} + +// setColor(): called from the fore/back color selection dialog event handler +// to set/reset the fore/background color. +function setColor(name, data) +{ + color.style.display = 'none'; + checkRange(); + if (!data) { + removeFormat(document.selection.createRange(), color._fg); + } else { + document.execCommand(color._fg, false, data); + } + setState(btnText, false); + setState(btnFill, false); + doc.focus(); +} + +// removeFormat(): Called to remove specific formats from the selected text. +// The 'removeFormat' command removes all formatting. The principle behind +// this routine is to have a list of the possible formats the selection may +// have, check the selection for the current formats, ignoreing the one we +// want to use, then remove all formatting and then re-apply all but the +// one we wanted to remove. +function removeFormat(r, name) +{ + var cmd = [ "Bold", "Italic", "Underline", "Strikethrough", "FontName", "FontSize", "ForeColor", "BackColor" ]; + var on = new Array(cmd.length); + for (var i = 0; i < cmd.length; i++) { + on[i] = name == cmd[i] ? null : r.queryCommandValue(cmd[i]); + } + r.execCommand('RemoveFormat'); + for (var i = 0; i < cmd.length; i++) { + if (on[i]) r.execCommand(cmd[i], false, on[i]); + } +} + +// setValue(): called from reset() to make a select list show the current font +// or style attributes +function selValue(el, str) +{ + if (!RichEditor.txtView) return; // Disabled in View Source mode + for (var i = 0; i < el.length; i++) { + if ((!el[i].value && el[i].text == str) || el[i].value == str) { + el.selectedIndex = i; + return; + } + } + el.selectedIndex = 0; +} + +// setState(): called from reset() to make a button represent the state +// of the current text. Pressed is on, unpressed is off. +function setState(el, on) +{ + if (!RichEditor.txtView) return; // Disabled in View Source mode + if (!el.disabled) { + if (on) { + el.defaultState = el.className = "down"; + } else { + el.defaultState = el.className = null; + } + } +} + +// getStyle(): called to obtain the class or type of formatting applied to an element, +// This is used by reset() to set the state of the toolbar to indicate the class of +// the current element. +function getStyle() { + var style = document.queryCommandValue('FormatBlock'); + if (style == "Normal") { + doc.focus(); + var rng = document.selection.createRange(); + if (typeof(rng.parentElement) != "undefined") { + var el = rng.parentElement(); + var tag = el.nodeName.toUpperCase(); + var str = el.className.toLowerCase(); + if (!(tag == "DIV" && el.id == "doc" && str == "textedit")) { + if (tag == "SPAN") { + style = "." + str; + } else if (str == "") { + style = tag; + } else { + style = tag + "." + str; + } + } + return style; + } + } + return style; +} + +// getfontface(): called to obtain the face attribute applied to a font tag, +// This is used by reset() to set the state of the toolbar to indicate the class of +// the current element. +function getfontface() +{ +var family = document.selection.createRange(); //create text range + +// don't get font face for image or table +if (document.selection.type == 'Control') { + return; +} + +var el = family.parentElement(); //get parent element +var tag = el.nodeName.toUpperCase(); //convert tag element to upper case + + if (typeof(el.parentElement) != "undefined" && tag == "FONT") { //only do function if tag is font - this is for greater execution speed + var elface = el.getAttribute('FACE'); //get the font tags FACE attribute + return elface; //return the value of the face attribute to the reset() function + } +} + +// markSelectedElement(): called by onClick and onKeyup events +// on the contectEditable area +function markSelectedElement() { + + RichEditor.selectedImage = null; + + var r = document.selection.createRange(); + + if (document.selection.type != 'Text') { + if (r.length == 1) { + if (r.item(0).tagName == "IMG") { + RichEditor.selectedImage = r.item(0); + } + } + } +} + +// reset(): called from all over the place to make the toolbar +// represent the current text. If el specified, it was called from +// hover(off) +function reset(el) +{ + if (!RichEditor.txtView) return; // Disabled in View Source mode + if (!el) color.style.display = 'none'; + if (!el || el == ctlStyle) selValue(ctlStyle, getStyle()); + if (!el || el == ctlFont) selValue(ctlFont, getfontface()); + if (!el || el == ctlSize) selValue(ctlSize, document.queryCommandValue('FontSize')); + if (!el || el == btnBold) setState(btnBold, document.queryCommandValue('Bold')); + if (!el || el == btnItalic) setState(btnItalic, document.queryCommandValue('Italic')); + if (!el || el == btnUnderline) setState(btnUnderline, document.queryCommandValue('Underline')); + if (!el || el == btnStrikethrough) setState(btnStrikethrough, document.queryCommandValue('Strikethrough')); + if (!el || el == btnLeftJustify) setState(btnLeftJustify, document.queryCommandValue('JustifyLeft')); + if (!el || el == btnCenter) setState(btnCenter, document.queryCommandValue('JustifyCenter')); + if (!el || el == btnRightJustify) setState(btnRightJustify, document.queryCommandValue('JustifyRight')); + if (!el || el == btnFullJustify) setState(btnFullJustify, document.queryCommandValue('JustifyFull')); + if (!el || el == btnNumList) setState(btnNumList, document.queryCommandValue('InsertOrderedList')); + if (!el || el == btnBulList) setState(btnBulList, document.queryCommandValue('InsertUnorderedList')); +} + +// hover(): Handles mouse hovering over toolbar buttons +function hover(on) +{ + if (!RichEditor.txtView) return; // Disabled in View Source mode + var el = window.event.srcElement; + if (el && !el.disabled && el.nodeName == "IMG" && el.className != "spacer") { + if (on) { + el.className = "hover"; + } else { + el.className = el.defaultState ? el.defaultState : null; + } + } +} +// hover(): Handles mouse clicks on toolbar buttons +function press(on) +{ + if (!RichEditor.txtView) return; // Disabled in View Source mode + var el = window.event.srcElement; + if (el && !el.disabled && el.nodeName == "IMG" && el.className != "spacer") { + if (on) { + el.className = "down"; + } else { + el.className = el.className == "down" ? "hover" : el.defaultState ? el.defaultState : null; + } + } +} + +// addTag(): This is the handler for the style dropdown. This takes value +// selected and interprates it and makes the necessary changes to the HTML to +// apply this style. +function addTag(obj) { + + if (!RichEditor.txtView) return; // Disabled in View Source mode + + // Determine the type of element we are dealing with. + // TYPE 0 IS NORMAL-TAG, 1 IS CLASS, 2 IS SUBCLASS, 3 = Format Block command + var value = obj[obj.selectedIndex].value; + if (!value) { // Format Block + sel(obj); + return; + } + + var type = 0; // TAG + + if (value.indexOf(".") == 0) { // .className + type = 1; + } else if (value.indexOf(".") != -1) { // TAG.className + type = 2; + } + + doc.focus(); + + // Pick up the highlighted text + var r = document.selection.createRange(); + r.select(); + var s = r.htmlText; + + // If we have some selected text, then ignore silly selections + if (s == " " || s == " ") { + return; + } + + // How we apply formatting is based upon the type of formitting being + // done. + switch(type) + { + case 1: + // class: Wrap the selected text with a span of the specified + // class name + value = value.substring(1,value.length); + r.pasteHTML("" + r.htmlText + "") + break; + + case 2: + // subclass: split the value into tag + class + value = value.split("."); + r.pasteHTML('<' + value[0] + ' class="' + value[1] +'">' + + r.htmlText + + '' + ); + break; + + default: + // TAG: wrap up the highlighted text with the specified tag + r.pasteHTML("<"+value+">"+r.htmlText+"") + break; + } +} + +// initStyleDropdown(): This takes the passed styleList and generates the style +// dropdown list box from it. +function initStyleDropdown(styleList) { + + // Build the option list for the styles dropdown from the passed styles + for (var i = 0; i < styleList.length; i++) { + var oOption = document.createElement("OPTION"); + if (styleList[i][0]) oOption.value = styleList[i][0]; + oOption.text = styleList[i][1]; + oOption.style.backgroundColor = 'white'; + document.all.ctlStyle.add(oOption); + } +} + +// applyOptions(): This takes the passed options string and actions them. +// Called during the init process. +function applyOptions(str) +{ + var options = str.split(";"); + for (var i = 0; i < options.length; i++) { + var eq = options[i].indexOf('='); + var on = eq == -1 ? true : "yes;true;1".indexOf(options[i].substr(eq+1).toLowerCase()) != -1; + var name = eq == -1 ? options[i] : options[i].substr(0,eq); + var el = document.all("feature" + name); + if (el) { + el.runtimeStyle.display = (on ? 'inline' : 'none'); + } else { + if (!RichEditor.aOptions) RichEditor.aOptions = new Array; + RichEditor.aOptions[name] = on; + } + } +} + +// getOption(): Get the value for a previously set option or return undefined if +// the option is not set. +function getOption(name) +{ + if (RichEditor.aOptions) return RichEditor.aOptions[name]; + return; // Undefined +} + +// Handle drag and drop events into the editor window. Until we +// work out how to handle these better (which requires co-operation +// from the code being dragged from as far as I can tell) we simply +// disable the functionality. +function handleDrag(n) +{ + // if drag and drop is disabled, then cancel the dragdrop + // events + if (!getOption("dragdrop")) + { + switch(n) { + case 0: // ondragenter + window.event.dataTransfer.dropEffect = "none"; + break; + } + // Cancel the event + window.event.returnValue = false; + } +} + diff --git a/lib/rte/rte_codesweep.js b/lib/rte/rte_codesweep.js new file mode 100644 index 0000000000..4033805678 --- /dev/null +++ b/lib/rte/rte_codesweep.js @@ -0,0 +1,115 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// HTML Text Editing Component for hosting in Web Pages +// Copyright (C) 2001 Ramesys (Contracting Services) Limited +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU LesserGeneral Public License +// along with this program; if not a copy can be obtained from +// +// http://www.gnu.org/copyleft/lesser.html +// +// or by writing to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330, +// Boston, +// MA 02111-1307, +// USA. +// +// Original Developer: +// +// Austin David France +// Ramesys (Contracting Services) Limited +// Mentor House +// Ainsworth Street +// Blackburn +// Lancashire +// BB1 6AY +// United Kingdom +// email: Austin.France@Ramesys.com +// +// Home Page: http://richtext.sourceforge.net/ +// Support: http://richtext.sourceforge.net/ +// +//////////////////////////////////////////////////////////////////////////////// +// +// Author(s): leonreinders@hetnet.nl LEON +// +// History: +// +// LEON 04-08-2001 +// Initial Implementation +// +//////////////////////////////////////////////////////////////////////////////// + +function replaceCharacters(html) { + + // Special characters and their HTML equivelent + var set = [ + ["€","‘","’","’","“","”","–","—","¡","¢","£","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ü","ý","þ","ÿ"], + ["€","‘","’","’","“","”","–","—","¡","¢","£","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ü","ý","þ","ÿ"] + ]; + + // Replace each instance of one of the above special characters with it's HTML equivelent + if (html) { + for(var j = 0; j < set[0].length; j++){ + html = html.replace(eval("/"+set[0][j]+"/g"),set[1][j]); + } + } + + // Return the HTML or an empty string if no HTML was supplied + return html || ""; +} + +// removes empty tags and tags with only non-breaking-spaces unlimited levels +function removeEmptyTags(html) { + var re = /<[^(>|\/)]+>[ | ]*<\/[^>]+>/gi; + while(re.test(html)) { + html = html.replace(re,""); + while(re.test(html)) { + html = html.replace(re,""); + } + } + return html; +} + +// replaceAbsoluteUrls(): replaces absolute URL's with relative urls +// assuming the editor is in a level equal-to or above the image. +function replaceAbsoluteUrls(html) { + var docLoc = document.location.toString(); + docLoc = docLoc.substring(0,docLoc.lastIndexOf("/")+1); + docLoc = docLoc.replace(/\//gi,"\\\/"); + var re = eval("/"+docLoc+"/gi"); + return html.replace(re, ""); +} + +// replaceTags(): replace tags for better formatting +// set: [[tag,replacement],[tag,replacm.... +function replaceTags(set, html) { + var re; + for(var i = 0; i < set.length; i++) { + re = eval("/(<[\/]{0,1})"+set[i][0]+">/gi"); + html=html.replace(re,"$1"+set[i][1]+">"); + } + return html +} + +// codeSweeper(): apply several code-modifications +function codeSweeper() { + var html = doc.innerHTML; + if (html) html = replaceCharacters(html); + if (html) html = replaceAbsoluteUrls(html); + // if (html) html = removeEmptyTags(html) + if (html) html = replaceTags([["strong","B"],["em","I"]],html); + return html; +} diff --git a/lib/rte/rte_debug.js b/lib/rte/rte_debug.js new file mode 100644 index 0000000000..88964b922b --- /dev/null +++ b/lib/rte/rte_debug.js @@ -0,0 +1,106 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// HTML Text Editing Component for hosting in Web Pages +// Copyright (C) 2001 Ramesys (Contracting Services) Limited +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU LesserGeneral Public License +// along with this program; if not a copy can be obtained from +// +// http://www.gnu.org/copyleft/lesser.html +// +// or by writing to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330, +// Boston, +// MA 02111-1307, +// USA. +// +// Original Developer: +// +// Austin David France +// Ramesys (Contracting Services) Limited +// Mentor House +// Ainsworth Street +// Blackburn +// Lancashire +// BB1 6AY +// United Kingdom +// email: Austin.France@Ramesys.com +// +// Home Page: http://richtext.sourceforge.net/ +// Support: http://richtext.sourceforge.net/ +// +//////////////////////////////////////////////////////////////////////////////// +// +// Authors & Contributers: +// +// OZ Austin David France [austin.france@ramesys.com] +// Primary Developer +// +//////////////////////////////////////////////////////////////////////////////// + +// DBG(): Get the debug window handle in a safe manaer. +function DBGGetWindow(el) { + if (el) { + // Debug window closed? + try { el.className; } catch(e) { + if (e.number == -2147418094) { + return null; + } + } + } + return el; +} + +// DBG(): Debug routine activated by the debugWindow property +function DBG(n, str) +{ + // Initialise debug functionality, first time in or if DBG() is called + // with no arguments (as called from put_debugWindow). + if (typeof(n) == "undefined" || !DBG.fInitialised) { + var el = DBGGetWindow(public_description.debugWindow); + if (el) { + el.className = "debugWindow"; + el.innerHTML = '' + + '' + + '
SeqCallerDebug
'; + DBG.idTable = el.all("debug"); + } + DBG.fInitialised = true; + DBG.seq = 0; + } + + // If debug window supplied, then output debug message, assuming one was + // supplied. + if (typeof(str) != "undefined") { + var el = DBGGetWindow(DBG.idTable); + if (el) { + var row = el.insertRow(1); + var caller = DBG.caller.toString().substr(9); + var cell = row.insertCell(); + cell.innerText = DBG.seq++; + cell.nowrap = ''; + cell = row.insertCell(); + cell.innerText = caller.substr(0, caller.indexOf('\n')); + cell.nowrap = ''; + row.insertCell().innerText = str; + } else { + // If no debug window, but RichEdit.debug is true, then output + // debugs to status bar. + if (RichEditor.debug) { + window.status = str; + } + } + } +} diff --git a/lib/rte/rte_dunno.css b/lib/rte/rte_dunno.css new file mode 100644 index 0000000000..dc3a5de2cd --- /dev/null +++ b/lib/rte/rte_dunno.css @@ -0,0 +1,54 @@ + .text{ + font-family : Arial, Helvetica, sans-serif; + font-size : x-small; + color : black; + } + .red{ + font-family : Arial, Helvetica, sans-serif; + color : red; +} + .acomment{ + background-color : #E7E7E7; + color : Gray; + font-family : Arial, Helvetica, sans-serif; + font-size : x-small; +} + DIV.red{ + font-family : Arial, Helvetica, sans-serif; + color : red; + font-size : x-small; +} + LI.red{ + font-family : Arial, Helvetica, sans-serif; + color : red; + font-size : x-small; +} + H1{ + font-family : "Lucida Console"; + font-variant : small-caps; + font-size : larger; + color : ButtonHighlight; + font-style : italic; + font-weight : 300; + letter-spacing : 3px; + } + address{ + font-family : "Lucida Console"; + font-variant : small-caps; + font-size : smaller; + color : Gray; + font-style : normal; + font-weight : bolder; + letter-spacing : normal; + text-align : center; + } + H1.purple{ + font-family : "Lucida Console"; + font-variant : small-caps; + font-size : larger; + color : Violet; + font-style : italic; + font-weight : 300; + letter-spacing : 3px; + border : #9966FF; + } \ No newline at end of file diff --git a/lib/rte/rte_editmode.js b/lib/rte/rte_editmode.js new file mode 100644 index 0000000000..1d07499d3c --- /dev/null +++ b/lib/rte/rte_editmode.js @@ -0,0 +1,125 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// HTML Text Editing Component for hosting in Web Pages +// Copyright (C) 2001 Ramesys (Contracting Services) Limited +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU LesserGeneral Public License +// along with this program; if not a copy can be obtained from +// +// http://www.gnu.org/copyleft/lesser.html +// +// or by writing to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330, +// Boston, +// MA 02111-1307, +// USA. +// +// Original Developer: +// +// Austin David France +// Ramesys (Contracting Services) Limited +// Mentor House +// Ainsworth Street +// Blackburn +// Lancashire +// BB1 6AY +// United Kingdom +// email: Austin.France@Ramesys.com +// +// Home Page: http://richtext.sourceforge.net/ +// Support: http://richtext.sourceforge.net/ +// +//////////////////////////////////////////////////////////////////////////////// +// +// Author(s): leonreinders@hetnet.nl LEON +// +// Austin.France@Ramesys.com OZ +// +// History: +// +// LEON 04-08-2001 +// Initial Implementation +// +// OZ Disable/enable post button during view source mode. +// +//////////////////////////////////////////////////////////////////////////////// + +// setEditMode(): switch between html and textview +function setEditMode() { + switchMode.blur(); // htmlview + if (switchMode.checked == true) { + ctlStyle.disabled = ctlFont.disabled = ctlSize.disabled = btnPost.disabled = true; + btnPost.className = 'disabled'; + doc.style.fontFamily = "Courier"; + doc.style.fontSize = "10px"; + RichEditor.txtView = false; + doc.innerText = codeSweeper(); + doc.innerHTML = ccParser(doc.innerHTML); + } else { + ctlStyle.disabled = ctlFont.disabled = ctlSize.disabled = btnPost.disabled = false; + doc.style.fontFamily = doc.style.fontSize = ""; + btnPost.className = ''; + RichEditor.txtView = true; + doc.focus(); + doc.innerHTML = doc.innerText; + } +} + +// resetMode(); +function resetMode(){ + if (switchMode.checked == true) { + switchMode.click(); + } +} + +// ccParser(): colorcode-parser for html-editing view +function ccParser(html) { + + html = html.replace(/@/gi,"_AT_"); + html = html.replace(/#/gi,"_HASH_"); + + var htmltag = /(<[\w\/]+[ ]*[\w\=\"\'\.\/\;\: \)\(-]*>)/gi; + html = html.replace(htmltag,"$1"); + + var imgtag = /(<IMG[ ]*[\w\=\"\'\.\/\;\: \)\(-]*>)<\/span>/gi; + html = html.replace(imgtag,"$1"); + + var formtag = /(<[\/]*(form|input){1}[ ]*[\w\=\"\'\.\/\;\: \)\(-]*>)<\/span>/gi; + html = html.replace(formtag,"
$1"); + + var tabletag = /(<[\/]*(table|tbody|th|tr|td){1}([ ]*[\w\=\"\'\.\/\;\:\)\(-]*){0,}>)<\/span>/gi; + html = html.replace(tabletag,"$1"); + + //var Atag = /(<(\/a>|[\W _\w\=\"\'\.\/\;\:\)\(-]>){1})<\/span>/gi; + var Atag = /(<\/a>){1}<\/span>/gi; + html = html.replace(Atag,"$1"); + + var Atag = /(<a [\W _\w\=\"\'\.\/\;\:\)\(-]+>){1,}<\/span>/gi; + html = html.replace(Atag,"$1"); + + var parameter = /=("[ \w\'\.\/\;\:\)\(-]+"|'[ \w\"\.\/\;\:\)\(-]+')/gi; + html = html.replace(parameter,"=$1"); + + var entity = /&([\w]+);/gi; + html = html.replace(entity,"&$1;"); + + var comment = /(<\!--[\W _\w\=\"\'\.\/\;\:\)\(-]*-->)/gi; + html = html.replace(comment,"
$1"); + + html = html.replace(/_AT_/gi,"@"); + html = html.replace(/_HASH_/gi,"#"); + + return html; +} diff --git a/lib/rte/rte_history.js b/lib/rte/rte_history.js new file mode 100644 index 0000000000..6a6dda095d --- /dev/null +++ b/lib/rte/rte_history.js @@ -0,0 +1,125 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// HTML Text Editing Component for hosting in Web Pages +// Copyright (C) 2001 Ramesys (Contracting Services) Limited +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU LesserGeneral Public License +// along with this program; if not a copy can be obtained from +// +// http://www.gnu.org/copyleft/lesser.html +// +// or by writing to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330, +// Boston, +// MA 02111-1307, +// USA. +// +// Original Developer: +// +// Austin David France +// Ramesys (Contracting Services) Limited +// Mentor House +// Ainsworth Street +// Blackburn +// Lancashire +// BB1 6AY +// United Kingdom +// email: Austin.France@Ramesys.com +// +// Home Page: http://richtext.sourceforge.net/ +// Support: http://richtext.sourceforge.net/ +// +//////////////////////////////////////////////////////////////////////////////// +// +// Author(s): leonreinders@hetnet.nl LEON +// +// History: +// +// LEON 04-08-2001 +// Initial Implementation +// +// OZ 30-08-2001 +// * Correct a problem where the last amendment could not be re-done. +// * Alter the way the buttons are disabled so that the background of +// the button is transparent and matches the user rebar background +// color - specifically - buttonface. +// +// OZ 22-01-2002 +// Only do any saving if the history option is enabled. This should +// speed up the editor in the default case. This is because the +// history option takes entire copies of the buffer being edited which +// can consume large amounts of memory. +// +//////////////////////////////////////////////////////////////////////////////// + +var history = new Object; +history.items = []; +history.cursor = -1; + +// saveHistory(): Saves a copy of the document in the history.items.items buffer +function saveHistory() { + if (!getOption("history")) return; + codeSweeper(); + history.items[history.items.length] = doc.innerHTML; + history.cursor = history.items.length; + // window.status = 'saveHistory() cursor=' + history.cursor + ', items = ' + history.items.length; + showHistory(); +} + +// goHistory(): Advance or retreat the history.items.items cursor and show the +// document as it was at that point in time. +function goHistory(value) { + + if (!RichEditor.txtView) return; + switch(value) { + case -1: + i = history.cursor - 1; + // when first start undoing, save final state at end of history buffer + // so it can be re-done. + if (history.cursor == history.items.length) { + saveHistory(); + } + history.cursor = i; + break; + case 1: + history.cursor ++; + break; + } + if (history.items[history.cursor]) { + doc.innerHTML = history.items[history.cursor]; + } + // window.status = 'goHistory(' + value + ') cursor=' + history.cursor + ', items = ' + history.items.length; + showHistory() +} + +// showHistory(): enable and disable the history.items buttons as appropriate +function showHistory() { + + if (history.cursor > 0) { + btnPrev.className = ""; + btnPrev.disabled = false; + } else { + btnPrev.className = "disabled"; + btnPrev.disabled = true; + } + + if (history.cursor < history.items.length - 1) { + btnNext.className = ""; + btnNext.disabled = false; + } else { + btnNext.className = "disabled"; + btnNext.disabled = true; + } +} diff --git a/lib/rte/rte_interface.js b/lib/rte/rte_interface.js new file mode 100644 index 0000000000..086db51e7b --- /dev/null +++ b/lib/rte/rte_interface.js @@ -0,0 +1,300 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// HTML Text Editing Component for hosting in Web Pages +// Copyright (C) 2001 Ramesys (Contracting Services) Limited +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU LesserGeneral Public License +// along with this program; if not a copy can be obtained from +// +// http://www.gnu.org/copyleft/lesser.html +// +// or by writing to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330, +// Boston, +// MA 02111-1307, +// USA. +// +// Original Developer: +// +// Austin David France +// Ramesys (Contracting Services) Limited +// Mentor House +// Ainsworth Street +// Blackburn +// Lancashire +// BB1 6AY +// United Kingdom +// email: Austin.France@Ramesys.com +// +// Home Page: http://richtext.sourceforge.net/ +// Support: http://richtext.sourceforge.net/ +// +//////////////////////////////////////////////////////////////////////////////// +// +// Author(s): austin.france@ramesys.com OZ +// leonreinders@hetnet.nl LEON +// +// History: +// +// LEON 04-08-2001 +// Added styleData functionality for extending the style dropdown +// +// OZ 30-08-2001 +// Re-worked styleData to restore FormatBlock logic which works better +// for some styles, for example, heading styles - as these can be +// applied without having to select text. +// +// OZ 02-09-2001 +// Extended the richeditor interface to make the docHtml property read +// write. +// +// OZ 08-01-2002 +// Extended the richeditor interface to include an options property. +// This property can be set to enable/disable functionality in the +// editor. +// +// OZ 21-01-2002 +// After set editor options, apply them. In some circumstances the +// options property is set after the editor has initialised and so the +// options need to be re-applied. +// +// OZ 12-02-2002 +// Add new property debugWindow which should be a reference to an HTML +// element that can contain innerHTML. A table is inserted into this +// element and debug statements are output. +// +// OZ 12-06-2002 [ richtext-Bugs-567677 ] Cursor at bottom of document on load +// When initialising HTML throught the docHtml property, get a text range +// object before inserting HTML (this will reflect the cursor position for +// the empty document), insert the HTML (this moves the cursor position) +// and then collapse the resulting range which now covers the entire document +// to the beginning (i.e. move the insertion point to the start of the +// selection). All changes isolated to the put_docHtml() routine. +// +// OZ 18-06-2002 +// Add support for a docXHtml property to allow an XHMTL representation +// of the document to be extracted. See rte_xhtml.js for the +// implementation. +// +// OZ 01-07-2002 +// If the editor is slow at initialisation (for example if an alert box +// is placed inside initEditor() in rte.js) then it is possible for +// the docHtml property to be called before the editor is properly +// initialised. This is ok except that we can't put focus on the editor +// until it is visible. +// +//////////////////////////////////////////////////////////////////////////////// + +// object: RichEditor() +// description: This object provides the interface to the calling page. +function RichEditor() +{ + var selectedImage = null; // currently selected image + + this.put_docHtml = put_docHtml; + this.get_docHtml = get_docHtml; // OZ + this.get_docXHtml = get_docXHtml; // OZ + this.put_defaultFont = put_defaultFont; + this.put_defaultFontSize = put_defaultFontSize; + this.put_styleData = put_styleData; // LEON + this.put_options = put_options; + this.addField = addField; + this.getValue = getValue; + this.put_debugWindow = put_debugWindow; // OZ +} + +// property: docHtml +// access: read/write +// description: Set this property to define the initial HTML to be +// edited. +// author: austin.france@ramesys.com +function put_docHtml(passedValue) { + var r = document.selection.createRange(); + doc.innerHTML = passedValue; + r.collapse(true); + r.select(); + + // Only if editor initialisation has completed (and therfore visible) + if (editor.style.visibility == "visible") { + doc.focus(); + reset(); + } +} + +function get_docHtml() { + return doc.innerHTML; +} + +// property: docXHtml +// access: read only +// description: Return an XHTML representation of the document. +// author: austin.france@ramesys.com +function get_docXHtml() { // OZ + // Ignore any contenteditable attributes seen as these are + // inherited from the editor and not relevent to the document + // HTML. + return innerXHTML(doc, new RegExp("contenteditable")); +} + +// property: defaultFont +// access: write only +// description: Sets the default font for the editor. The default +// if this is not specified is whatever the microsoft +// html editing component decides (Times New Roman +// typically) +// author: austin.france@ramesys.com +function put_defaultFont(passedValue) { + doc.style.fontFamily = passedValue; +} + +// property: defaultFontSize +// access: write only +// description: Sets the default font size for the editor. +// author: austin.france@ramesys.com +function put_defaultFontSize(passedValue) { + switch(passedValue) { + case "1": passedValue = "xx-small"; break; + case "2": passedValue = "x-small"; break; + case "3": passedValue = "small"; break; + case "4": passedValue = "medium"; break; + case "5": passedValue = "large"; break; + case "6": passedValue = "x-large"; break; + case "7": passedValue = "xx-large"; break; + } + doc.style.fontSize = passedValue; +} + +// property: styleData +// access: writeOnly +// description: Defines extended style data for the style dropdown +// author: leonreinders@hetnet.nl +function put_styleData(passedValue) { + + var a,b; + + // Define the default style list + this.styleList = [ + // element description Active + [null, "Normal", 0], + [null, "Heading 1", 0], + [null, "Heading 2", 0], + [null, "Heading 3", 0], + [null, "Heading 4", 0], + [null, "Heading 5", 0], + [null, "Heading 6", 0], + [null, "Address", 0], + [null, "Formatted", 0], + ["BLOCKQUOTE", "Blockquote", 0], + ["CITE", "Citation", 0], + ["BDO", "Reversed", 0], + ["BIG", "Big", 0], + ["SMALL", "Small", 0], + ["DIV", "Div", 0], + ["SUP", "Superscript", 0], + ["SUB", "Subscript", 0] + ]; + + // Add the passed styles to the documents stylesheet + for (var i = 0; passedValue && i < passedValue.length; i++) + { + for (var j = 0; j < passedValue[i].rules.length; j++) + { + // Extract the rule and the rule definition from the passed style + // data. + a = passedValue[i].rules[j].selectorText.toString().toLowerCase(); + b = passedValue[i].rules[j].style.cssText.toLowerCase(); + + // Ignore non-style entries + if (!a || !b) continue; + + // Add this rule to our style sheet + document.styleSheets[0].addRule(a,b); + + // Id: These are added to the document style sheet but are not + // available in the style dropdown + if (a.indexOf("#") != -1) { + continue; + } + + // Class: Append a cless element to the style list + if (a.indexOf(".") == 0) { + this.styleList[this.styleList.length] = [a, "Class " + a, 1]; + } + + // SubClass: Append the sub-class to the style list + else if(a.indexOf(".") > 0) { + this.styleList[this.styleList.length] = [a, a, 1]; + } + + // Otherwise, assume it's a tag and select the existing tag entry + // in the style list. + else { + for (var k = 0; k < this.styleList.length; k++) { + if (this.styleList[k][0] == a) { + this.styleList[k][2] = 1; + break; + } + } + } + } + } + + // Initialise the style dropdown with the new style list + initStyleDropdown(this.styleList); +} + +function addField(name, label, maxlen, value, size) { + var row = rebarBottom.parentElement.insertRow(rebarBottom.rowIndex); + var cell = row.insertCell(); + cell.className = 'rebar'; + cell.width = '100%'; + cell.innerHTML = '' + + '' + + '' + + '' + label + ':' + + '  ' + + '' + + ''; +} + +function getValue(name) { + return document.all(name).value; +} + +// property: options +// access: writeOnly +// description: Sets options for the editor. Used by the editor to control +// certain features +// +// viewsource=;... +// +// author: austin.france@ramesys.com +function put_options(passedValue) { + this.options = passedValue; + applyOptions(this.options); +} + +// property: debugWindow +// access: writeOnly +// description: Tells the editor to emit debugs to the debug window. +// author: austin.france@ramesys.com +function put_debugWindow(passedValue) { + this.debugWindow = passedValue; + DBG(); +} diff --git a/lib/rte/rte_lang.js b/lib/rte/rte_lang.js new file mode 100644 index 0000000000..6ad64ae66e --- /dev/null +++ b/lib/rte/rte_lang.js @@ -0,0 +1,392 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// HTML Text Editing Component for hosting in Web Pages +// Copyright (C) 2001 Ramesys (Contracting Services) Limited +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU LesserGeneral Public License +// along with this program; if not a copy can be obtained from +// +// http://www.gnu.org/copyleft/lesser.html +// +// or by writing to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330, +// Boston, +// MA 02111-1307, +// USA. +// +// Original Developer: +// +// Austin David France +// Ramesys (Contracting Services) Limited +// Mentor House +// Ainsworth Street +// Blackburn +// Lancashire +// BB1 6AY +// United Kingdom +// email: Austin.France@Ramesys.com +// +// Home Page: http://richtext.sourceforge.net/ +// Support: http://richtext.sourceforge.net/ +// +//////////////////////////////////////////////////////////////////////////////// +// +// Authors & Contributers: +// +// OZ Austin David France [austin.france@ramesys.com] +// Primary Developer +// +// TE Torbjørn Engedal [torbjoen@stud.ntnu.no] +// Doc. Translator +// +// GE Herfurth, Gerrit [gerrit.herfurth@gs-druckfarben.de] +// +// BC Bill Chalmers [bill_paula@btinternet.com] +// +// History: +// +// OZ 16-02-2002 +// Initial Implementation +// +// TE 17-02-2002 +// Norwegian Translation +// +// GE 05-06-2002 +// German Translation +// +// OZ 01-07-2002 +// Extended EN translation to include table editing. Other languages +// to follow. +// +// BC 21-07-2002 +// Fixed bug no: 584424, trying to set lang equal to local[lang] caused error +// if the users local lang was not in the predefined locale array. +// +// BC 31-07-2002 +// Added french translation courtesy of Arnaud Vatel. +//////////////////////////////////////////////////////////////////////////////// + +var locale = new Object; + +// locale.getLanguage(): Called to work out what language to use. +locale.getLanguage = function() +{ + return locale.language ? locale.language : navigator.userLanguage; +} + +// locale.getString(): Called to return the language variant of a @code string. +// this routin will fall back to en-us is no language variant is found. If no +// english version exists, the code is returned. +locale.getString = function(str, lang) +{ + // If not supplied, pick up the language to use + if (!lang) lang = locale.getLanguage(); + + // Get references to required languages + if (!locale[lang]) + { + lang = locale["en-us"]; + } + else + { + lang = locale[lang]; + } + + // Find the end of the text code + var i = str.indexOf('@{'); + while (i != -1) + { + // Find the closing } + var j = str.indexOf('}', i+1); + + // Extrace the language code + var code = str.substr(i+2,j-i-2); + + // Return the language version of the text + if (lang[code]) { + str = str.substr(0,i) + lang[code] + str.substr(i+j+1); + } + // Find the next code if any + i = str.indexOf('@{', i+1); + } + + // Untranslated + return str; +} + +// locale.setLocale(): Called once the editor has loaded to replace all language +// codes in alt, title and innerText with thier language counterparts. +locale.setLocale = function() +{ + // Work out which language to apply + var lang = locale.getLanguage(); + + for (var i = 0; i < document.all.length; i++) + { + var el = document.all(i); + if (el.alt && el.alt.indexOf('@{') != -1) { + el.alt = locale.getString(el.alt, lang); + } + if (el.title && el.title.indexOf('@{') != -1) { + el.title = locale.getString(el.title, lang); + } + if (el.src && el.src.indexOf('@{') != -1) { + el.src = locale.getString(el.src, lang); + } + if (!el.children.length && el.innerText && el.innerText.indexOf('@{') != -1) { + el.innerText = locale.getString(el.innerText, lang); + } + } +} + +window.attachEvent("onload", locale.setLocale); + +//////////////////////////////////////////////////////////////////////////////// +// +// English (American & British) +// +//////////////////////////////////////////////////////////////////////////////// + +var o = locale["en-us"] = locale["en-gb"] = new Object; + + // Icon Titles (alt="") + o["PostTopic"] = "Post Topic"; + o["Cut"] = "Cut"; + o["Copy"] = "Copy"; + o["Paste"] = "Paste"; + o["SpellCheck"] = "Spell Check"; + o["SelectAll"] = "Select All"; + o["RemoveFormatting"] = "Remove Formatting"; + o["InsertLink"] = "Insert Link"; + o["RemoveLink"] = "Remove Link"; + o["InsertImage"] = "Insert Image"; + o["InsertTable"] = "Insert Table"; + o["EditTable"] = "Edit Table"; + o["InsertLine"] = "Insert Horizontal Line"; + o["InsertSmily"] = "Insert Smily 8-)"; + o["InsertCharacter"] = "Insert special character"; + o["About"] = "About Richtext Editor"; + o["Bold"] = "Bold"; + o["Italic"] = "Italic"; + o["Underline"] = "Underline"; + o["Strikethrough"] = "Strikethrough"; + o["AlignLeft"] = "Align Left"; + o["Center"] = "Center"; + o["AlignRight"] = "Align Right"; + o["AlignBlock"] = "Align Block"; + o["NumberedList"] = "Numbered List"; + o["BulettedList"] = "Buletted List"; + o["DecreaseIndent"] = "Decrease Indent"; + o["IncreaseIndent"] = "Increase Indent"; + o["HistoryBack"] = "History back"; + o["HistoryForward"] = "History forward"; + o["TextColor"] = "Text Color"; + o["BackgroundColor"] = "Background Color"; + + o["RemoveColspan"] = "Remove Colspan"; + o["RemoveRowspan"] = "Remove Rowspan"; + o["IncreaseColspan"] = "Increase Colspan"; + o["IncreaseRowspan"] = "Increase Rowspan"; + o["AddColumn"] = "Add Column"; + o["AddRow"] = "Add Row"; + o["RemoveColumn"] = "Remove Column"; + o["RemoveRow"] = "Remove Row"; + + // Label Text + o["Style"] = "Style"; + o["Font"] = "Font"; + o["Size"] = "Size"; + o["Source"] = "Source"; + + // Titles + o["SourceTitle"] = "Click here to toggle between WYSIWYG and Source mode."; + + // Image Sources + o["icon_post"] = "images/icon_post.gif"; + o["hdr_tables"] = "images/hdr_tables.gif"; + +//////////////////////////////////////////////////////////////////////////////// +// +// Norwegian Bokmål +// +//////////////////////////////////////////////////////////////////////////////// + +o = locale["no"] = new Object; + + // Icon Titles (alt="") + o["PostTopic"] = "Send"; + o["Cut"] = "Klipp"; + o["Copy"] = "Kopier"; + o["Paste"] = "Lim"; + o["SpellCheck"] = "Stavekontroll"; + o["SelectAll"] = "Marker alt"; + o["RemoveFormatting"] = "Fjern formatering"; + o["InsertLink"] = "Sett inn link"; + o["RemoveLink"] = "Fjern link"; + o["InsertImage"] = "Sett inn bilde"; + o["InsertTable"] = "Sett inn tabell"; + o["EditTable"] = "Endre tabell"; + o["InsertLine"] = "Sett inn horisontal linje"; + o["InsertSmily"] = "Sett inn smily 8-)"; + o["InsertCharacter"] = "Sett inn spesialtegn"; + o["About"] = "Om Richtext Editor"; + o["Bold"] = "Fet"; + o["Italic"] = "Kursiv"; + o["Underline"] = "Understrekning"; + o["Strikethrough"] = "Gjennomstrekning"; + o["AlignLeft"] = "Venstrejustering"; + o["Center"] = "Sentrering"; + o["AlignRight"] = "Høyrejustering"; + o["AlignBlock"] = "Blokkjustering"; + o["NumberedList"] = "Nummerert liste"; + o["BulettedList"] = "Punktliste"; + o["DecreaseIndent"] = "Mink innrykksverdi"; + o["IncreaseIndent"] = "Øk innrykksverdi"; + o["HistoryBack"] = "Historie bakover"; + o["HistoryForward"] = "Historie forover"; + o["TextColor"] = "Tekstfarge"; + o["BackgroundColor"] = "Bakgrunnsfarge"; + + // Label Text + o["Style"] = "Stil"; + o["Font"] = "Type"; + o["Size"] = "Størrelse"; + o["Source"] = "Kilde"; + + // Titles + o["SourceTitle"] = "Klikk her for å bytte mellom WYSIWYG og kilde modus."; + + // Image Sources + o["icon_post"] = "images/lang/no.icon_post.gif"; + +//////////////////////////////////////////////////////////////////////////////// +// +// German +// +//////////////////////////////////////////////////////////////////////////////// + +var o = locale["de"] = new Object; + + // Icon Titles (alt="") + o["PostTopic"] = "Speichern"; + o["Cut"] = "Ausschneiden"; + o["Copy"] = "Kopieren"; + o["Paste"] = "Einfügen"; + o["SpellCheck"] = "Rechschreibprüfung"; + o["SelectAll"] = "Alles markieren"; + o["RemoveFormatting"] = "Formatierung entfernen"; + o["InsertLink"] = "Link einfügen"; + o["RemoveLink"] = "Link entfernen"; + o["InsertImage"] = "Bild einfügen"; + o["InsertTable"] = "Tabelle einfügen"; + o["EditTable"] = "Tabelle bearbeiten"; + o["InsertLine"] = "Horizontale Linie einfügen"; + o["InsertSmily"] = "Smily 8-) einfügen"; + o["InsertCharacter"] = "Sonderzeichen einfügen"; + o["About"] = "Über Richtext Editor"; + o["Bold"] = "Fett"; + o["Italic"] = "Kursiv"; + o["Underline"] = "Unterstrichen"; + o["Strikethrough"] = "Durchgestrichen"; + o["AlignLeft"] = "Linksbündig"; + o["Center"] = "Zentriert"; + o["AlignRight"] = "Rechtsbündig"; + o["AlignBlock"] = "Blocksatz"; + o["NumberedList"] = "Nummerierung"; + o["BulettedList"] = "Aufzählungszeichen"; + o["DecreaseIndent"] = "Einzug verkleinern"; + o["IncreaseIndent"] = "Einzug vergrößern"; + o["HistoryBack"] = "Rückgängig"; + o["HistoryForward"] = "Wiederherstellen"; + o["TextColor"] = "Zeichenfarbe"; + o["BackgroundColor"] = "Hintergrundfarbe"; + + // Label Text + o["Style"] = "Absatzformat"; + o["Font"] = "Schriftart"; + o["Size"] = "Größe"; + o["Source"] = "Quelltext"; + + // Titles + o["SourceTitle"] = "Hier klicken, um zwischen WYSIWYG- und Quelltext-Modus umzuschalten."; + + // Image Sources + o["icon_post"] = "images/lang/de.icon_post.gif"; + +//////////////////////////////////////////////////////////////////////////////// +// +// Français +// +//////////////////////////////////////////////////////////////////////////////// + +var o = locale["fr"] = new Object; + + // Icon Titles (alt="") + o["PostTopic"] = "Poster le sujet"; + o["Cut"] = "Couper"; + o["Copy"] = "Copier"; + o["Paste"] = "Coller"; + o["Find Text"] = "Rechercher"; + o["SpellCheck"] = "Vérifier l'orthographe"; + o["SelectAll"] = "Sélectionner tout"; + o["RemoveFormatting"] = "Supprimer le formattage"; + o["InsertLink"] = "Insérer un lien"; + o["RemoveLink"] = "Supprimer un lien"; + o["InsertImage"] = "Insérer une image"; + o["InsertTable"] = "Insérer un tableau"; + o["EditTable"] = "Editer le tableau"; + o["InsertLine"] = "Insérer une ligne horizontale"; + o["InsertSmily"] = "Insérer un Smiley 8-)"; + o["InsertCharacter"] = "Insérer des caractères spéciaux"; + o["About"] = "A propos de Richtext Editor"; + o["Bold"] = "Gras"; + o["Italic"] = "Italique"; + o["Underline"] = "Souligné"; + o["Strikethrough"] = "Barré"; + o["AlignLeft"] = "Aligné à gauche"; + o["Center"] = "Centré"; + o["AlignRight"] = "Aligné à droite"; + o["AlignBlock"] = "Justifié"; + o["NumberedList"] = "Liste numérotée"; + o["BulettedList"] = "Liste à puces"; + o["DecreaseIndent"] = "Diminuer le retrait"; + o["IncreaseIndent"] = "Augmenter le retrait"; + o["HistoryBack"] = "Annuler"; + o["HistoryForward"] = "Rétablir"; + o["TextColor"] = "Couleur du texte"; + o["BackgroundColor"] = "Couleur de l'arrière plan"; + + o["RemoveColspan"] = "Fractionner la cellule"; + o["RemoveRowspan"] = "Fusionner la cellule"; + o["IncreaseColspan"] = "Augmenter l'étendue de la colonne"; + o["IncreaseRowspan"] = "Augmenter l'étendue de la ligne"; + o["AddColumn"] = "Ajouter une colonne"; + o["AddRow"] = "Ajouter une ligne"; + o["RemoveColumn"] = "Supprimer une colonne"; + o["RemoveRow"] = "Supprimer une ligne"; + + // Label Text + o["Style"] = "Style"; + o["Font"] = "Police"; + o["Size"] = "Taille"; + o["Source"] = "Code source"; + + // Titles + o["SourceTitle"] = "Cliquez ici pour basculer entre Aperçu et mode Source."; + + // Image Sources + o["icon_post"] = "images/icon_post.gif"; + +//////////////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/lib/rte/rte_xhtml.js b/lib/rte/rte_xhtml.js new file mode 100644 index 0000000000..dbde1458e4 --- /dev/null +++ b/lib/rte/rte_xhtml.js @@ -0,0 +1,185 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// HTML Text Editing Component for hosting in Web Pages +// Copyright (C) 2001 Ramesys (Contracting Services) Limited +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU LesserGeneral Public License +// along with this program; if not a copy can be obtained from +// +// http://www.gnu.org/copyleft/lesser.html +// +// or by writing to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330, +// Boston, +// MA 02111-1307, +// USA. +// +// Original Developer: +// +// Austin David France +// Ramesys (Contracting Services) Limited +// Mentor House +// Ainsworth Street +// Blackburn +// Lancashire +// BB1 6AY +// United Kingdom +// email: Austin.France@Ramesys.com +// +// Home Page: http://richtext.sourceforge.net/ +// Support: http://richtext.sourceforge.net/ +// +//////////////////////////////////////////////////////////////////////////////// +// +// Author(s): austin.france@ramesys.com OZ +// +//////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////// +// +// Description: +// Escape XHTML text +// + +function escapeXHTML(str) +{ + return str.replace(/[&]/g, "&") + .replace(/[<]/g, "<") + .replace(/[>]/g, ">") + ; +} + +function escapeXHTMLAttribute(str) +{ + return str.replace(/[\"]/g, """); +} + +/////////////////////////////////////////////////////////////////////////// +// +// Description: +// Return the XHTML attribute list (space separated) for the given element +// +// Notes: +// The ignore list is a JavaScript Regular expression that matches those +// attribute that should not be output. +// + +function innerXHTMLAttributes(el, ignore) +{ + // Start with an empty attribute list + var str = ''; + + // Output attributes for the element + for (var i = 0; i < el.attributes.length; i++) + { + // Get this attribute + var attr = el.attributes[i]; + + // Only output if it has a value of type string + if (attr.nodeValue && typeof(attr.nodeValue) == "string") + { + // and it's not one we want to ignore + if (!ignore || attr.nodeName.toLowerCase().search(ignore) == -1) + { + // Output the attribute (space separated if necessary) + if (str.length) str += ' '; + str += attr.nodeName.toLowerCase(); + str += '="' + escapeXHTMLAttribute(attr.nodeValue) + '"'; + } + } + } + + // Return the resulting attribute string + return str; +} + +/////////////////////////////////////////////////////////////////////////// +// +// Description: +// Get the inner XHTML from the supplied element. +// +// Return Value: +// XHTML string +// +// Notes: +// The ignore list is a JavaScript Regular expression that matches those +// attribute that should not be output. +// + +function innerXHTML(el, ignore) +{ + // Default innerXTHML is empty + var str = ''; + + // Create a text range for the element we are converting to source + var r2; var r = document.body.createTextRange(); + r.moveToElementText(el); + + // Scan the child nodes of this element. + for (var i = 0; i < el.children.length; i++) + { + // Create a text range for this child node + r2 = document.body.createTextRange(); + r2.moveToElementText(el.children[i]); + + // Set the end of our range to the start of this child node. + // so that r.text contains all the text up to this element. + r.setEndPoint("EndToStart", r2); + str += escapeXHTML(r.text); + + // Emit the child node + str += outerXHTML(el.children[i], ignore); + + // Now, reset the text range for the main element and then move + // the start point of our range to the end of the element just + // output in preperation for the next chunk of text (or last chunk + // if this was the last child node) + r.moveToElementText(el); + r.setEndPoint("StartToEnd", r2); + } + + // Output the HTML (if any) plus the last chunk of text (again, if any). + // Note: if no child nodes existed, the r.text contains the entire text + // however, if child nodes did exist, then r.text contains just the + return str + escapeXHTML(r.text); +} + +/////////////////////////////////////////////////////////////////////////// +// +// Description: +// Get the outer XHTML from the supplied element. +// +// Return Value: +// XHTML string +// +// Notes: +// The ignore list is a JavaScript Regular expression that matches those +// attribute that should not be output. +// + +function outerXHTML(el, ignore) +{ + // First, get the attribute values + var attrs = innerXHTMLAttributes(el, ignore); + + // And any inner XHTML + var inner = innerXHTML(el, ignore); + + // Then build the tag. Note: We use the XML abbreviation if the element is empty + return '<' + el.nodeName.toLowerCase() + + (attrs.length ? ' ' + attrs : '') + + (inner.length ? '>' + inner + '' + : ' />'); +} diff --git a/lib/rte/syntax.css b/lib/rte/syntax.css new file mode 100644 index 0000000000..94356c4fc5 --- /dev/null +++ b/lib/rte/syntax.css @@ -0,0 +1,97 @@ +/******************************************************************************* +** +** HTML Text Editing Component for hosting in Web Pages +** Copyright (C) 2001 Ramesys (Contracting Services) Limited +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License as published by the Free Software Foundation; either +** version 2.1 of the License, or (at your option) any later version. +** +** This library is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** Lesser General Public License for more details. +** +** You should have received a copy of the GNU LesserGeneral Public License +** along with this program; if not a copy can be obtained from +** +** http://www.gnu.org/copyleft/lesser.html +** +** or by writing to: +** +** Free Software Foundation, Inc. +** 59 Temple Place - Suite 330, +** Boston, +** MA 02111-1307, +** USA. +** +** Original Developer: +** +** Austin David France +** Ramesys (Contracting Services) Limited +** Mentor House +** Ainsworth Street +** Blackburn +** Lancashire +** BB1 6AY +** United Kingdom +** email: Austin.France@Ramesys.com +** +** Home Page: http://richtext.sourceforge.net/ +** Support: http://richtext.sourceforge.net/ +** +*******************************************************************************/ + +.ccp_paramvalue { + color : #0000FF ; + font-family : "Courier New"; + font-size : 13px; +} +.ccp_htmlcomment { + color : #808080 ; + font-family : "Courier New"; + font-size : 12px; + font-style : italic; +} +.ccp_tag { + color : #000080; + font-family : "Courier New"; + font-size : 12px; +} +.ccp_img { + color : #800080; + font-family : "Courier New"; + font-size : 12px; +} +.ccp_A { + color : #008000; + font-family : "Courier New"; + font-size : 12px; +} +.ccp_form { + color : #FF8000; + font-family : "Courier New"; + font-size : 12px; +} +.ccp_table { + color : #008080; + font-family : "Courier New"; + font-size : 12px; +} +.ccp_entity { + color : #000000; + font-family : "Courier New"; + font-size : 12px; + font-weight : bold; +} +.ccp_styletag { + color : #800080; + font-family : "Courier New"; + font-size : 12px; +} +.ccp_styleitem { + color : #800080; + font-family : "Courier New"; + font-size : 12px; +} diff --git a/lib/rte/tableEditor.js b/lib/rte/tableEditor.js new file mode 100644 index 0000000000..e40c668f70 --- /dev/null +++ b/lib/rte/tableEditor.js @@ -0,0 +1,743 @@ +/////////////////////////////////////////////////////////////// +// Table Editing Class +// Author: Billy Cook (wcook@nuvox.net) +// Date: 2002-05-07 +// Purpose: Provide methods to edit a table. Only +// works in Internet Explorer version 5.5 +// and above for now. +// + +function tableEditor(docID, pntCell) { + + this.docID = docID; // ID of editable portion of document + this.pntCell = pntCell; // TD contentarea is contained in if any + this.tableCell = null; // cell currently selected + this.tableElem = null; // table currently selected + this.cellResizeObj = null; // object that user clicks on to resize cell + this.cellWidth = null; // selected cell's current width + this.cellHeight = null; // selected cell's current height + this.cellX = null; // x coord of selected cell's bottom right + this.cellY = null; // y coord of selected cell's bottom right + this.moveable = null; // moveable div + + // define methods only once + if (typeof(_tableEditor_prototype_called) == 'undefined') { + _tableEditor_prototype_called = true; + + // public methods + tableEditor.prototype.mergeDown = mergeDown; + tableEditor.prototype.unMergeDown = unMergeDown; + tableEditor.prototype.mergeRight = mergeRight; + tableEditor.prototype.splitCell = splitCell; + tableEditor.prototype.addCell = addCell; + tableEditor.prototype.removeCell = removeCell; + tableEditor.prototype.processRow = processRow; + tableEditor.prototype.processColumn = processColumn; + tableEditor.prototype.buildTable = buildTable; + tableEditor.prototype.setTableElements = setTableElements; + tableEditor.prototype.unSetTableElements = unSetTableElements; + tableEditor.prototype.setDrag = setDrag; + tableEditor.prototype.stopCellResize = stopCellResize; + tableEditor.prototype.markCellResize = markCellResize; + tableEditor.prototype.resizeCell = resizeCell; + tableEditor.prototype.changePos = changePos; + tableEditor.prototype.resizeColumn = resizeColumn; + tableEditor.prototype.resizeRow = resizeRow; + tableEditor.prototype.repositionArrows = repositionArrows; + tableEditor.prototype.explore = explore; + + // private methods + tableEditor.prototype.__addOrRemoveCols = __addOrRemoveCols; + tableEditor.prototype.__findParentTable = __findParentTable; + tableEditor.prototype.__hideArrows = __hideArrows; + tableEditor.prototype.__showArrows = __showArrows; + tableEditor.prototype.__resizeColumn = __resizeColumn; + } + + // create divs for editing cell width and height + document.body.innerHTML += ' '; + + + + //////////////////////////////////////////////////////////////// + // method: setTableElements + // args: none + // purpose: look to see if the cursor is inside a TD or TABLE and + // if so assign the TD to this.tableCell or the TABLE to + // this.tableElem + // + function setTableElements(){ + + // stop resizing cell if already resizing one + this.stopCellResize(true); + this.tableCell = null; + + cursorPos=document.selection.createRange(); + + if (document.selection.type == 'Text') { + var elt = cursorPos.parentElement(); + while (elt) { + if (elt.tagName == "TD") { + break; + } + elt = elt.parentElement; + } + + + if (elt) { + // don't select document area + if (elt.id == this.docID) + return; + + // don't select parent TD + if (this.pntCell) + if (this.pntCell == elt.id) + return; + + this.tableCell = elt; + + // set width and height as globals for + // resizing + this.cellWidth = this.tableCell.offsetWidth; + this.cellHeight = this.tableCell.offsetHeight; + this.__showArrows(); + } + } else { + if (cursorPos.length == 1) { + if (cursorPos.item(0).tagName == "TABLE") { + this.tableElem = cursorPos.item(0); + this.__hideArrows(); + this.tableCell = null; + } + } + } + } + + //////////////////////////////////////////////////////////////// + // method: unSetTableElements + // args: none + // purpose: unset references to currently selected cell or table + // + function unSetTableElements(){ + + this.tableCell = null; + this.tableElem = null; + return; + } + + //////////////////////////////////////////////////////////////// + // method: mergeDown + // args: none + // purpose: merge the currently selected cell with the one below it + // + function mergeDown() { + if (!this.tableCell) + return; + + if (!this.tableCell.parentNode.nextSibling) { + alert("There is not a cell below this one to merge with."); + return; + } + + var topRowIndex = this.tableCell.parentNode.rowIndex; + + // [ TD ] [ TR ] [ TBODY ] [ TR ] [ TD ] + var bottomCell = this.tableCell.parentNode.parentNode.childNodes[ topRowIndex + this.tableCell.rowSpan ].childNodes[ this.tableCell.cellIndex ]; + + if (!bottomCell) { + alert("There is not a cell below this one to merge with."); + return; + } + + // don't allow merging rows with different colspans + if (this.tableCell.colSpan != bottomCell.colSpan) { + alert("Can't merge cells with different colSpans."); + return; + } + + // do the merge + this.tableCell.innerHTML += bottomCell.innerHTML; + this.tableCell.rowSpan += bottomCell.rowSpan; + bottomCell.removeNode(true); + this.repositionArrows(); + } + + //////////////////////////////////////////////////////////////// + // method: unMergeDown + // args: none + // purpose: merge the currently selected cell with the one below it + // + function unMergeDown() { + if (!this.tableCell) + return; + + if (this.tableCell.rowSpan <= 1) { + alert("RowSpan is already set to 1."); + return; + } + + var topRowIndex = this.tableCell.parentNode.rowIndex; + + // add a cell to the beginning of the next row + this.tableCell.parentNode.parentNode.childNodes[ topRowIndex + this.tableCell.rowSpan - 1 ].appendChild( document.createElement("TD") ); + + this.tableCell.rowSpan -= 1; + + } + + //////////////////////////////////////////////////////////////// + // method: mergeRight + // args: none + // purpose: merge the currently selected cell with the one to + // the immediate right. Won't allow user to merge cells + // with different rowspans. + // + function mergeRight() { + if (!this.tableCell) + return; + if (!this.tableCell.nextSibling) + return; + + // don't allow user to merge rows with different rowspans + if (this.tableCell.rowSpan != this.tableCell.nextSibling.rowSpan) { + alert("Can't merge cells with different rowSpans."); + return; + } + + this.tableCell.innerHTML += this.tableCell.nextSibling.innerHTML; + this.tableCell.colSpan += this.tableCell.nextSibling.colSpan; + this.tableCell.nextSibling.removeNode(true); + + + this.repositionArrows(); + this.__hideArrows(); + this.tableCell = null; + } + + //////////////////////////////////////////////////////////////// + // method: splitCell + // args: none + // purpose: split the currently selected cell back into two cells + // it the cell has a colspan > 1. + // + function splitCell() { + if (!this.tableCell) + return; + if (this.tableCell.colSpan < 2) { + alert("Cell can't be divided. Add another cell instead"); + return; + } + + this.tableCell.colSpan = this.tableCell.colSpan - 1; + var newCell = this.tableCell.parentNode.insertBefore( document.createElement("TD"), this.tableCell); + newCell.rowSpan = this.tableCell.rowSpan; + this.repositionArrows(); + } + + //////////////////////////////////////////////////////////////// + // method: removeCell + // args: none + // purpose: remove the currently selected cell + // + function removeCell() { + if (!this.tableCell) + return; + + // can't remove all cells for a row + if (!this.tableCell.previousSibling && !this.tableCell.nextSibling) { + alert("You can't remove the only remaining cell in a row."); + return; + } + + this.tableCell.removeNode(false); + + this.repositionArrows(); + this.tableCell = null; + } + + //////////////////////////////////////////////////////////////// + // method: addCell + // args: none + // purpose: add a cell to the right of the selected cell + // + function addCell() { + if (!this.tableCell) + return; + + this.tableCell.parentElement.insertBefore(document.createElement("TD"), this.tableCell.nextSibling); + } + + //////////////////////////////////////////////////////////////// + // method: processRow + // args: (string)action = "add" or "remove" + // purpose: add a row above the row that + // contains the currently selected cell or + // remove the row containing the selected cell + // + function processRow(action) { + if (!this.tableCell) + return; + + // go back to TABLE def and keep track of cell index + var idx = 0; + var rowidx = -1; + var tr = this.tableCell.parentNode; + var numcells = tr.childNodes.length; + + + while (tr) { + if (tr.tagName == "TR") + rowidx++; + tr = tr.previousSibling; + } + // now we should have a row index indicating where the + // row should be added / removed + + var tbl = this.__findParentTable(this.tableCell); + + if (!tbl) { + alert("Could not " + action + " row."); + return; + } + + if (action == "add") { + var r = tbl.insertRow(rowidx); + for (var i = 0; i < numcells; i++) { + var c = r.appendChild( document.createElement("TD") ); + if (this.tableCell.parentNode.childNodes[i].colSpan) + c.colSpan = this.tableCell.parentNode.childNodes[i].colSpan; + } + } else { + tbl.deleteRow(rowidx); + this.stopCellResize(true); + this.tableCell = null; + } + } + + //////////////////////////////////////////////////////////////// + // method: processColumn + // args: (string)action = "add" or "remove" + // purpose: add a column to the right column containing + // the selected cell + // + function processColumn(action) { + if (!this.tableCell) + return; + + // store cell index in a var because the cell will be + // deleted when processing the first row + var cellidx = this.tableCell.cellIndex; + + var tbl = this.__findParentTable(this.tableCell); + + if (!tbl) { + alert("Could not " + action + " column."); + return; + } + + // now we have the table containing the cell + this.__addOrRemoveCols(tbl, cellidx, action); + + // clear out global this.tableCell value for remove + if (action == 'remove') { + this.stopCellResize(true); + this.tableCell = null; + } else { + this.repositionArrows(); + } + } + + //////////////////////////////////////////////////////////////// + // method: __addOrRemoveCols + // args: (table object)tbl, (int)cellidx, (string)action + // tbl = the table containing the selected cell + // cellidx = the index of the selected cell in its row + // action = "add" or "remove" the column + // + // purpose: add or remove the column at the cell index + // + function __addOrRemoveCols(tbl, cellidx, action) { + if (!tbl.childNodes.length) + return; + var i; + for (i = 0; i < tbl.childNodes.length; i++) { + if (tbl.childNodes[i].tagName == "TR") { + var cell = tbl.childNodes[i].childNodes[ cellidx ]; + if (!cell) + break; // can't add cell after cell that doesn't exist + if (action == "add") { + cell.insertAdjacentElement("AfterEnd", document.createElement("TD") ); + } else { + // don't delete too many cells because or a rowspan setting + + if (cell.rowSpan > 1) { + i += (cell.rowSpan - 1); + } + cell.removeNode(true); + } + } else { + // keep looking for a "TR" + this.__addOrRemoveCols(tbl.childNodes[i], cellidx, action); + } + } + } + + //////////////////////////////////////////////////////////////// + // method: __findParentTable + // args: (TD object)cell + // cell = the selected cell object + // + // purpose: locate the table object that contains the + // cell object passed in + // + function __findParentTable(cell) { + var tbl = cell.parentElement + while (tbl) { + if (tbl.tagName == "TABLE") { + return tbl; + } + tbl = tbl.parentElement; + } + return false; + } + + //////////////////////////////////////////////////////////////// + // method: exploreTree + // args: (obj)obj, (obj)pnt + // obj = object to explore + // pnt = object to append output to + // + // purpose: traverse the dom tree printing out all properties + // of the object, its children.....recursive. helpful + // when looking for object properties. + // + function exploreTree(obj, pnt) { + if (!obj.childNodes.length) + return; + var i; + var ul = pnt.appendChild( document.createElement("UL") ); + for (i = 0; i < obj.childNodes.length; i++) { + var li = document.createElement("LI"); + explore(obj.childNodes[i], li); + ul.appendChild(li); + exploreTree(obj.childNodes[i], li); + /* + var n = document.createTextNode(obj.childNodes[i].tagName); + li.appendChild(n); + */ + } + } + + //////////////////////////////////////////////////////////////// + // method: explore + // args: (obj)obj, (obj)pnt + // obj = object to explore + // pnt = object to append output to + // + // purpose: show all properties for the object "obj" + // + function explore(obj, pnt) { + var i; + for (i in obj) { + var n = document.createTextNode(i +"="+obj[i]); + pnt.appendChild(n); + pnt.appendChild( document.createElement("BR") ); + } + } + + //////////////////////////////////////////////////////////////// + // method: buildTable + // args: pnt = parent to append table to + // + // purpose: build a test table for debugging + // + function buildTable(pnt) { + var t = pnt.appendChild( document.createElement("TABLE") ); + t.border=1; + t.cellPadding=2; + t.cellSpacing=0; + var tb = t.appendChild( document.createElement("TBODY") ); + for(var r = 0; r < 10; r++) { + var tr = tb.appendChild( document.createElement("TR") ); + for(var c = 0; c < 10; c++) { + var cell = tr.appendChild( document.createElement("TD") ); + cell.appendChild( document.createTextNode(r+"-"+c) ); + } + } + } + + //////////////////////////////////////////////////////////////// + // method: setDrag + // args: obj = object (DIV) that is currently draggable + // + // purpose: set the object to be moved with the mouse + // + function setDrag(obj) { + if (this.moveable) + this.moveable = null; + else + this.moveable = obj; + } + + + //////////////////////////////////////////////////////////////// + // method: changePos + // args: none + // mouse pointer appear inside the object set by "setDrag" + // function above. + // + // purpose: move the object selected in the "setDrag" function defined + // above. + // + function changePos() { + if (!this.moveable) + return; + + this.moveable.style.posTop = event.clientY - 10; + this.moveable.style.posLeft = event.clientX - 25; + } + + + //////////////////////////////////////////////////////////////// + // method: markCellResize + // args: (object)obj = the square table div object that + // was clicked on by the user to resize a cell + // + // purpose: store the object in "this.cellResizeObj" to be referenced + // in the "resizeCell" function. + // + // + function markCellResize(obj) { + if (this.cellResizeObj) { + this.cellResizeObj = null; + } else { + this.cellResizeObj = obj; + } + } + + //////////////////////////////////////////////////////////////// + // method: stopCellResize + // args: (bool)hideArrows + // + // purpose: stop changing cell width and height + // + function stopCellResize(hidearrows) { + this.cellResizeObj = null; + if (hidearrows) + this.__hideArrows(); + } + + //////////////////////////////////////////////////////////////// + // method: __hideArrows() + // args: none + // + // purpose: hide editing tabs that are positioned in the selected + // cell + // + function __hideArrows() { + document.getElementById("rArrow").style.visibility = 'hidden'; + document.getElementById("dArrow").style.visibility = 'hidden'; + } + + //////////////////////////////////////////////////////////////// + // method: __showArrows() + // args: none + // + // purpose: position editing tabs in the middle or the right cell + // wall and middle of the bottom wall to be used to drag + // the cell's width and height dimensions + // + function __showArrows() { + if (!this.tableCell) + return; + + var cell_hgt = this.tableCell.offsetTop; + var cell_wdt = this.tableCell.offsetLeft; + var par = this.tableCell.offsetParent; + while (par) { + cell_hgt = cell_hgt + par.offsetTop; + cell_wdt = cell_wdt + par.offsetLeft; + current_obj = par; + par = current_obj.offsetParent; + } + this.cellX = cell_wdt + this.tableCell.offsetWidth; //bottom right X + this.cellY = cell_hgt + this.tableCell.offsetHeight; // bottom right Y + + var scrollTop = document.getElementById(this.docID).scrollTop; + var scrollLeft = document.getElementById(this.docID).scrollLeft; + + document.getElementById("rArrow").style.posLeft = cell_wdt + this.tableCell.offsetWidth - 6 - scrollLeft; + document.getElementById("rArrow").style.posTop = cell_hgt + (this.tableCell.offsetHeight / 2) - 2 - scrollTop; + + document.getElementById("dArrow").style.posLeft = cell_wdt + (this.tableCell.offsetWidth / 2) - 2 - scrollLeft; + document.getElementById("dArrow").style.posTop = cell_hgt + this.tableCell.offsetHeight - 6 - scrollTop; + + document.getElementById("rArrow").style.visibility = 'visible'; + document.getElementById("dArrow").style.visibility = 'visible'; + } + + //////////////////////////////////////////////////////////////// + // method: repositionArrows() + // args: none + // + // purpose: reposition editing tabs in the middle or the right cell + // wall and middle of the bottom wall to be used to drag + // the cell's width and height dimensions. this must be + // run while changing the cell's dimensions. + // + function repositionArrows() { + + if (!this.tableCell) + return; + + var cell_hgt = this.tableCell.offsetTop; + var cell_wdt = this.tableCell.offsetLeft; + var par = this.tableCell.offsetParent; + while (par) { + cell_hgt = cell_hgt + par.offsetTop; + cell_wdt = cell_wdt + par.offsetLeft; + current_obj = par; + par = current_obj.offsetParent; + } + + var scrollTop = document.getElementById(this.docID).scrollTop; + var scrollLeft = document.getElementById(this.docID).scrollLeft; + + document.getElementById("rArrow").style.posLeft = cell_wdt + this.tableCell.offsetWidth - 6 - scrollLeft; + document.getElementById("rArrow").style.posTop = cell_hgt + (this.tableCell.offsetHeight / 2) - 2 - scrollTop; + + document.getElementById("dArrow").style.posLeft = cell_wdt + (this.tableCell.offsetWidth / 2) - 2 - scrollLeft; + document.getElementById("dArrow").style.posTop = cell_hgt + this.tableCell.offsetHeight - 6 - scrollTop; + } + + //////////////////////////////////////////////////////////////// + // method: resizeCell() + // args: none + // + // purpose: resize the selected cell based on the direction of the mouse + // + function resizeCell() { + if (!this.cellResizeObj) + return; + + if (this.cellResizeObj.id == 'dArrow') { + var scrollTop = document.getElementById(this.docID).scrollTop; + var newHeight = (event.clientY - (this.cellY - scrollTop) ) + this.cellHeight; + + if (newHeight > 0) + // don't resize entire row if rowspan > 1 + if (this.tableCell.rowSpan > 1) + this.tableCell.style.height = newHeight; + else + this.resizeRow(newHeight); + + this.repositionArrows(); + + } else if (this.cellResizeObj.id == 'rArrow') { + var scrollLeft = document.getElementById(this.docID).scrollLeft; + var newWidth = (event.clientX - (this.cellX - scrollLeft) ) + this.cellWidth; + + if (newWidth > 0) + // don't resize entire column if colspan > 1 + if (this.tableCell.colSpan > 1) + this.tableCell.style.width = newWidth; + else + this.resizeColumn(newWidth); + + this.repositionArrows(); + + } else { + // do nothing + } + } + + //////////////////////////////////////////////////////////////// + // method: resizeRow + // args: (int)size + // purpose: set cell.style.height on all cells in a row that + // have rowspan = 1 + // + function resizeRow(size) { + if (!this.tableCell) + return; + + // go back to TABLE def and keep track of cell index + var idx = 0; + var rowidx = -1; + var tr = this.tableCell.parentNode; + var numcells = tr.childNodes.length; + + while (tr) { + if (tr.tagName == "TR") + rowidx++; + tr = tr.previousSibling; + } + // now we should have a row index indicating where the + // row should be added / removed + + var tbl = this.__findParentTable(this.tableCell); + + if (!tbl) { + return; + } + + // resize cells in the row + for (var j = 0; j < tbl.rows(rowidx).cells.length; j++) { + if (tbl.rows(rowidx).cells(j).rowSpan == 1) + tbl.rows(rowidx).cells(j).style.height = size; + } + } + + + //////////////////////////////////////////////////////////////// + // method: resizeColumn + // args: (int)size = size in pixels + // purpose: set column width + // + function resizeColumn(size) { + if (!this.tableCell) + return; + + // store cell index in a var because the cell will be + // deleted when processing the first row + var cellidx = this.tableCell.cellIndex; + + var tbl = this.__findParentTable(this.tableCell); + + if (!tbl) { + alert("Could not resize column."); + return; + } + + // now we have the table containing the cell + this.__resizeColumn(tbl, cellidx, size); + } + + //////////////////////////////////////////////////////////////// + // method: __resizeColumn + // args: (table object)tbl, (int)cellidx, (int)size + // tbl = the table containing the selected cell + // cellidx = the index of the selected cell in its row + // size = size in pixels + // + // purpose: resize all cells in the a column + // + function __resizeColumn(tbl, cellidx, size) { + if (!tbl.childNodes.length) + return; + var i; + for (i = 0; i < tbl.childNodes.length; i++) { + if (tbl.childNodes[i].tagName == "TR") { + var cell = tbl.childNodes[i].childNodes[ cellidx ]; + if (!cell) + break; // can't add cell after cell that doesn't exist + + if (cell.colSpan == 1) + cell.style.width = size; + } else { + // keep looking for a "TR" + this.__resizeColumn(tbl.childNodes[i], cellidx, size); + } + } + } +}