+
+
+
+
+
+
+
Index: openacs-4/packages/acs-templating/www/resources/rte/changelog.txt
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/rte/Attic/changelog.txt,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-templating/www/resources/rte/changelog.txt 18 Mar 2005 17:14:55 -0000 1.1
@@ -0,0 +1,64 @@
+Cross-Browser Rich Text Editor change log
+
+3/4/2005 - Updated insert link function to automatically place highlighted text in link text field
+3/2/2005 - Replaced insert image icon
+3/2/2005 - To satisfy a handful of people who have a problem with my "no license" policy I have added "// This code is public domain. Redistribution and use of this code, with or without modification, is permitted." to top of richtext.js.
+3/1/2005 - Fixed display of buttons when submitting in view source mode
+3/1/2005 - Fixed toggleHTMLSrc() function to update view source textbox with XHTML-converted code
+3/1/2005 - Removed XHTML demo and included genXHTML option in initRTE function is standard demo
+3/1/2005 - Changed back default behaviour of IE (again) to insert
tags when hitting return. Previous fix broke list items and indenting functionality in IE.
+2/24/2005 - Added XHTML output demo (demo_xhtml.htm)
+2/24/2005 - Fixed view source checkbox for RTEs not displaying buttons
+2/24/2005 - Added label tag to view source checkbox
+2/24/2005 - Updated insert link function to display more advanced dialog window
+2/24/2005 - popup dialogs (insert table and insert link) now are centered in the user's screen
+2/24/2005 - Updated demo.php and demo.asp to allow actual submission of the forms, to demonstrate getting the submitted value of the RTE
+2/24/2005 - Fixed corrupt demo.php file
+2/24/2005 - Changed behaviour in IE so that when return is pressed, a is inserted instead of a new paragraph (now functions same as Gecko browsers)
+2/10/2005 - Fixed IE crash when back button is clicked (changed doctype in blank.htm)
+2/10/2005 - Added table insert functionality (thanks dannyuk1982!)
+2/10/2005 - Cleaned up code considerably
+2/10/2005 - Updated default rte widths (IE and Gecko are now the same width by default)
+2/10/2005 - Tried to turn off useCSS in Gecko by default (to keep generated html consistent with IE), but enabling this disables the ability to use the 'hilitecolor' command in Firefox for some reason
+11/12/2004 - Fixed palette position when rte is embedded within multiple divs.
+11/12/2004 - Fixed button events for non-IE browsers (now uses CSS)
+11/9/2004 - Fixed bug when using SSL saying page has unsecured items (re-added blank.htm).
+11/9/2004 - Changed back default behaviour of IE to insert
tags when hitting return. Previous fix broke list items and indenting functionality in IE
+11/2/2004 - Changed default behaviour of IE to insert tags instead of
tags upon hitting return - thanks TotalJSNoob and archv1le!
+7/14/2004 - Changed rte.css to maintain td styles under parent objects
+5/18/2004 - Added CSS file for RTE button styles. css is no longer printed every time a new rte is created.
+5/18/2004 - Made color palette smaller
+5/18/2004 - Fixed placement of color pallette for rtes embedded within divs - thanks Ernst!
+5/18/2004 - If a css is specified, the body tag is no longer overruled - thanks Ernst!
+5/18/2004 - Fixed headings dropdown, replacing < and > characters
+4/13/2004 - Fixed bug with standard textarea and updateRTE function
+4/12/2004 - Fixed bug with IE where toggle source would err if only content was horizontal rules
+4/12/2004 - Fixed bug where nothing would be returned if the only content was horizontal rules and/or images
+4/9/2004 - Fixed bug for Konqueror browser
+4/9/2004 - Added multi.htm to demonstrate using multiple RTEs on one page.
+4/9/2004 - Fixed bug in IE where you could set style on document objects not in iframe.
+4/9/2004 - Updated buttons look and feel - thanks Ernst!
+3/31/2004 - Fixed bug in stripHTML function - thanks valli!
+3/19/2004 - Fixed bug with Gecko browsers where is returned when empty content submitted.
+2/23/2004 - Fixed bug with Mac Safari 1.2
+1/16/2004 - Added Justify Full button
+1/9/2004 - Added updateRTEs function to update all rtes on page
+1/9/2004 - Fixed bug with updateRTE in readOnly mode
+1/8/2004 - Added parameter to writeRichText function, readOnly
+1/8/2004 - Fixed bug with Mozilla when adding blank url links
+1/8/2004 - Fixed init bug for Konqueror and Mac IE browsers. Added parameters to init function for images path, includes path, and css file
+1/6/2004 - Added compressed richtext_compressed.js file to zip. File size is 37% smaller
+1/5/2004 - Removed reference to style.css
+1/5/2004 - Fixed demo form submit code
+1/2/2004 - Fixed crashing with Mozilla 1.3
+1/2/2004 - Fixed bug with Mozilla 1.3
+1/2/2004 - Fixed problem with html view on submit
+12/26/2003 - Fixed color palette dropdowns for multiple RTEs. Improved enableDesignMode function.
+12/23/2003 - Fixed several bugs with multiple RTEs on one page.
+12/22/2003 - Added support for IE5.
+12/22/2003 - Modified code to remove all timeout settings. Fixed IE stylesheet support. Blank.htm is no longer needed.
+12/17/2003 - Changed code for IE enableDesignMode function to load quicker and to eliminate use of timeout.
+12/8/2003 - Fixed bug with IE5.
+12/8/2003 - Added in keyboard shortcut support for Mozilla. Code contributed by Anti Veeranna
+12/5/2003 - Removed dependence on browserdetect.js and removed js link. Also updated initRTE function to speed up load.
+12/5/2003 - Created changelog.txt to keep track of version history from now on.
\ No newline at end of file
Index: openacs-4/packages/acs-templating/www/resources/rte/demo.asp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/rte/Attic/demo.asp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-templating/www/resources/rte/demo.asp 18 Mar 2005 17:14:55 -0000 1.1
@@ -0,0 +1,100 @@
+
+
+
+
The cross-browser rich-text editor (RTE) is based on the designMode() functionality introduced in Internet Explorer 5, and implemented in Mozilla 1.3+ using the Mozilla Rich Text Editing API. The cross-browser rich-text editor now includes table support (as of 2/10/2005) as well as an option to generate xhtml-compliant code (as of 2/24/2005).
+
Requires: IE5+/Mozilla 1.3+/Mozilla Firebird/Firefox 0.6.1+/Netscape 7.1+, or any other browser that fully supports designMode() for all rich-text features to function properly. All other browsers will display a standard textarea box instead. For frequently asked questions and support, please visit http://www.kevinroth.com/forums/index.php?c=2
If you feel that the work I've done has value to you, I would greatly appreciate a paypal donation (click button below). Another way you can help me out is to sign up for a free flat screen, to help me get mine. Again, I am very grateful for any and all contributions.
The cross-browser rich-text editor (RTE) is based on the designMode() functionality introduced in Internet Explorer 5, and implemented in Mozilla 1.3+ using the Mozilla Rich Text Editing API. The cross-browser rich-text editor now includes table support (as of 2/10/2005) as well as an option to generate xhtml-compliant code (as of 2/24/2005).
+
This code is public domain. Redistribution and use of this code, with or without modification, is permitted.
Requires: IE5+/Mozilla 1.3+/Mozilla Firebird/Firefox 0.6.1+/Netscape 7.1+, or any other browser that fully supports designMode() for all rich-text features to function properly. All other browsers will display a standard textarea box instead.
If you feel that the work I've done has value to you, I would greatly appreciate a paypal donation (click button below). Another way you can help me out is to sign up for a free flat screen, to help me get mine. Again, I am very grateful for any and all contributions.
The cross-browser rich-text editor (RTE) is based on the designMode() functionality introduced in Internet Explorer 5, and implemented in Mozilla 1.3+ using the Mozilla Rich Text Editing API. The cross-browser rich-text editor now includes table support (as of 2/10/2005) as well as an option to generate xhtml-compliant code (as of 2/24/2005).
+
This code is public domain. Redistribution and use of this code, with or without modification, is permitted.
Requires: IE5+/Mozilla 1.3+/Mozilla Firebird/Firefox 0.6.1+/Netscape 7.1+, or any other browser that fully supports designMode() for all rich-text features to function properly. All other browsers will display a standard textarea box instead.
If you feel that the work I've done has value to you, I would greatly appreciate a paypal donation (click button below). Another way you can help me out is to sign up for a free flat screen, to help me get mine. Again, I am very grateful for any and all contributions.
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/acs-templating/www/resources/rte/html2xhtml.js
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/rte/Attic/html2xhtml.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-templating/www/resources/rte/html2xhtml.js 18 Mar 2005 17:14:55 -0000 1.1
@@ -0,0 +1,274 @@
+/*==============================================================================
+
+ HTML2XHTML Converter 1.0
+ ========================
+ Copyright (c) 2004 Vyacheslav Smolin
+
+
+Author:
+-------
+Vyacheslav Smolin (http://www.richarea.com, http://html2xhtml.richarea.com,
+re@richarea.com)
+
+About the script:
+-----------------
+HTML2XHTML Converter (H2X) generates a well formed XHTML string from a HTML DOM
+object.
+
+Requirements:
+-------------
+H2X works in MS IE 5.0 for Windows or above, in Netscape 7.1, Mozilla 1.3 or
+above. It should work in all Mozilla based browsers.
+
+Usage:
+------
+Please see description of function get_xhtml below.
+
+Demo:
+-----
+http://html2xhtml.richarea.com/, http://www.richarea.com/demo/
+
+License:
+--------
+Free for non-commercial using. Please contact author for commercial licenses.
+
+
+==============================================================================*/
+
+
+//add \n before opening tag
+var need_nl_before = '|div|p|table|tbody|tr|td|th|title|head|body|script|comment|li|meta|h1|h2|h3|h4|h5|h6|hr|ul|ol|option|';
+//add \n after opening tag
+var need_nl_after = '|html|head|body|p|th|style|';
+
+var re_comment = new RegExp();
+re_comment.compile("^$");
+
+var re_hyphen = new RegExp();
+re_hyphen.compile("-$");
+
+
+// Convert inner text of node to xhtml
+// Call: get_xhtml(node);
+// get_xhtml(node, lang, encoding) -- to convert whole page
+// other parameters are for inner usage and should be omitted
+// Parameters:
+// node - dom node to convert
+// lang - document lang (need it if whole page converted)
+// encoding - document charset (need it if whole page converted)
+// need_nl - if true, add \n before a tag if it is in list need_nl_before
+// inside_pre - if true, do not change content, as it is inside a
+function get_xhtml(node, lang, encoding, need_nl, inside_pre) {
+ var i;
+ var text = '';
+ var children = node.childNodes;
+ var child_length = children.length;
+ var tag_name;
+ var do_nl = need_nl ? true : false;
+ var page_mode = true;
+
+ for (i = 0; i < child_length; i++) {
+ var child = children[i];
+
+ switch (child.nodeType) {
+ case 1: { //ELEMENT_NODE
+ var tag_name = String(child.tagName).toLowerCase();
+
+ if (tag_name == '') break;
+
+ if (tag_name == 'meta') {
+ var meta_name = String(child.name).toLowerCase();
+ if (meta_name == 'generator') break;
+ }
+
+ if (!need_nl && tag_name == 'body') { //html fragment mode
+ page_mode = false;
+ }
+
+ if (tag_name == '!') { //COMMENT_NODE in IE 5.0/5.5
+ //get comment inner text
+ var parts = re_comment.exec(child.text);
+
+ if (parts) {
+ //the last char of the comment text must not be a hyphen
+ var inner_text = parts[1];
+ text += fix_comment(inner_text);
+ }
+ } else {
+ if (tag_name == 'html') {
+ text = '\n\n';
+ }
+
+ //inset \n to make code more neat
+ if (need_nl_before.indexOf('|'+tag_name+'|') != -1) {
+ if ((do_nl || text != '') && !inside_pre) text += '\n';
+ } else {
+ do_nl = true;
+ }
+
+ text += '<'+tag_name;
+
+ //add attributes
+ var attr = child.attributes;
+ var attr_length = attr.length;
+ var attr_value;
+
+ var attr_lang = false;
+ var attr_xml_lang = false;
+ var attr_xmlns = false;
+
+ var is_alt_attr = false;
+
+ for (j = 0; j < attr_length; j++) {
+ var attr_name = attr[j].nodeName.toLowerCase();
+
+ if (!attr[j].specified &&
+ (attr_name != 'selected' || !child.selected) &&
+ (attr_name != 'style' || child.style.cssText == '') &&
+ attr_name != 'value') continue; //IE 5.0
+
+ if (attr_name == '_moz_dirty' ||
+ attr_name == '_moz_resizing' ||
+ tag_name == 'br' &&
+ attr_name == 'type' &&
+ child.getAttribute('type') == '_moz') continue;
+
+ var valid_attr = true;
+
+ switch (attr_name) {
+ case "style":
+ attr_value = child.style.cssText;
+ break;
+ case "class":
+ attr_value = child.className;
+ break;
+ case "http-equiv":
+ attr_value = child.httpEquiv;
+ break;
+ case "noshade": break; //this set of choices will extend
+ case "checked": break;
+ case "selected": break;
+ case "multiple": break;
+ case "nowrap": break;
+ case "disabled": break;
+ attr_value = attr_name;
+ break;
+ default:
+ try {
+ attr_value = child.getAttribute(attr_name, 2);
+ } catch (e) {
+ valid_attr = false;
+ }
+ break;
+ }
+
+ //html tag attribs
+ if (attr_name == 'lang') {
+ attr_lang = true;
+ attr_value = lang;
+ }
+ if (attr_name == 'xml:lang') {
+ attr_xml_lang = true;
+ attr_value = lang;
+ }
+ if (attr_name == 'xmlns') attr_xmlns = true;
+ if (valid_attr) {
+ //value attribute set to "0" is not handled correctly in Mozilla
+ if (!(tag_name == 'li' && attr_name == 'value')) {
+ text += ' '+attr_name+'="'+fix_attribute(attr_value)+'"';
+ }
+ }
+
+ if (attr_name == 'alt') is_alt_attr = true;
+ }
+
+ if (tag_name == 'img' && !is_alt_attr) {
+ text += ' alt=""';
+ }
+
+ if (tag_name == 'html') {
+ if (!attr_lang) text += ' lang="'+lang+'"';
+ if (!attr_xml_lang) text += ' xml:lang="'+lang+'"';
+ if (!attr_xmlns) text += ' xmlns="http://www.w3.org/1999/xhtml"';
+ }
+
+ if (child.canHaveChildren || child.hasChildNodes()){
+ text += '>';
+// if (need_nl_after.indexOf('|'+tag_name+'|') != -1) {
+// text += '\n';
+// }
+ text += get_xhtml(child, lang, encoding, true, inside_pre || tag_name == 'pre' ? true : false);
+ text += ''+tag_name+'>';
+ } else {
+ if (tag_name == 'style' || tag_name == 'title' || tag_name == 'script') {
+ text += '>';
+ var inner_text;
+ if (tag_name == 'script') {
+ inner_text = child.text;
+ } else {
+ inner_text = child.innerHTML;
+ }
+
+ if (tag_name == 'style') {
+ inner_text = String(inner_text).replace(/[\n]+/g,'\n');
+ }
+
+ text += inner_text+''+tag_name+'>';
+ } else {
+ text += ' />';
+ }
+ }
+ }
+ break;
+ }
+ case 3: { //TEXT_NODE
+ if (!inside_pre) { //do not change text inside
tag
+ if (child.nodeValue != '\n') {
+ text += fix_text(child.nodeValue);
+ }
+ } else {
+ text += child.nodeValue;
+ }
+ break;
+ }
+ case 8: { //COMMENT_NODE
+ text += fix_comment(child.nodeValue);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ if (!need_nl && !page_mode) { //delete head and body tags from html fragment
+ text = text.replace(/<\/?head>[\n]*/gi, "");
+ text = text.replace(/
[\n]*/gi, "");
+ text = text.replace(/<\/?body>[\n]*/gi, "");
+ }
+
+ return text;
+}
+
+//fix inner text of a comment
+function fix_comment(text) {
+ //delete double hyphens from the comment text
+ text = text.replace(/--/g, "__");
+
+ if(re_hyphen.exec(text)) { //last char must not be a hyphen
+ text += " ";
+ }
+
+ return "";
+}
+
+//fix content of a text node
+function fix_text(text) {
+ //convert <,> and & to the corresponding entities
+ return String(text).replace(/\n{2,}/g, "\n").replace(/\&/g, "&").replace(//g, ">").replace(/\u00A0/g, " ");
+}
+
+//fix content of attributes href, src or background
+function fix_attribute(text) {
+ //convert <,>, & and " to the corresponding entities
+ return String(text).replace(/\&/g, "&").replace(//g, ">").replace(/\"/g, """);
+}
Index: openacs-4/packages/acs-templating/www/resources/rte/insert_link.htm
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/rte/Attic/insert_link.htm,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-templating/www/resources/rte/insert_link.htm 18 Mar 2005 17:14:55 -0000 1.1
@@ -0,0 +1,67 @@
+
+
+
+
+ Insert Link
+
+
+
+
+
+
+
The cross-browser rich-text editor (RTE) is based on the designMode() functionality introduced in Internet Explorer 5, and implemented in Mozilla 1.3+ using the Mozilla Rich Text Editing API. The cross-browser rich-text editor now includes table support (as of 2/10/2005) as well as an option to generate xhtml-compliant code (as of 2/24/2005).
+
This code is public domain. Redistribution and use of this code, with or without modification, is permitted.
Requires: IE5+/Mozilla 1.3+/Mozilla Firebird/Firefox 0.6.1+/Netscape 7.1+, or any other browser that fully supports designMode() for all rich-text features to function properly. All other browsers will display a standard textarea box instead.
If you feel that the work I've done has value to you, I would greatly appreciate a paypal donation (click button below). Another way you can help me out is to sign up for a free flat screen, to help me get mine. Again, I am very grateful for any and all contributions.