You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2005/12/17 19:26:04 UTC
svn commit: r357361 - in /incubator/roller/trunk/web: editor/ editor/images/
weblog/
Author: snoopdave
Date: Sat Dec 17 10:25:57 2005
New Revision: 357361
URL: http://svn.apache.org/viewcvs?rev=357361&view=rev
Log:
Upgrading to Feb 24, 2005 release of RTE
Added:
incubator/roller/trunk/web/editor/blank.htm (with props)
incubator/roller/trunk/web/editor/html2xhtml.js (with props)
incubator/roller/trunk/web/editor/insert_link.htm (with props)
incubator/roller/trunk/web/editor/insert_table.htm (with props)
Modified:
incubator/roller/trunk/web/editor/images/image.gif
incubator/roller/trunk/web/editor/multi.htm
incubator/roller/trunk/web/editor/palette.htm
incubator/roller/trunk/web/editor/richtext.js
incubator/roller/trunk/web/editor/richtext_compressed.js
incubator/roller/trunk/web/weblog/editor-rte.jsp
Added: incubator/roller/trunk/web/editor/blank.htm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/editor/blank.htm?rev=357361&view=auto
==============================================================================
--- incubator/roller/trunk/web/editor/blank.htm (added)
+++ incubator/roller/trunk/web/editor/blank.htm Sat Dec 17 10:25:57 2005
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <title></title>
+</head>
+
+<body>
+
+</body>
+</html>
Propchange: incubator/roller/trunk/web/editor/blank.htm
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/roller/trunk/web/editor/html2xhtml.js
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/editor/html2xhtml.js?rev=357361&view=auto
==============================================================================
--- incubator/roller/trunk/web/editor/html2xhtml.js (added)
+++ incubator/roller/trunk/web/editor/html2xhtml.js Sat Dec 17 10:25:57 2005
@@ -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 <pre>
+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 = '<?xml version="1.0" encoding="'+encoding+'"?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\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 <pre> 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(/<head \/>[\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 "<!--"+text+"-->";
+}
+
+//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(/>/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, ">").replace(/\"/g, """);
+}
Propchange: incubator/roller/trunk/web/editor/html2xhtml.js
------------------------------------------------------------------------------
svn:executable = *
Modified: incubator/roller/trunk/web/editor/images/image.gif
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/editor/images/image.gif?rev=357361&r1=357360&r2=357361&view=diff
==============================================================================
Binary files - no diff available.
Added: incubator/roller/trunk/web/editor/insert_link.htm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/editor/insert_link.htm?rev=357361&view=auto
==============================================================================
--- incubator/roller/trunk/web/editor/insert_link.htm (added)
+++ incubator/roller/trunk/web/editor/insert_link.htm Sat Dec 17 10:25:57 2005
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <title>Insert Link</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<script language="JavaScript" type="text/javascript">
+<!--
+function AddLink() {
+ var oForm = document.linkForm;
+
+ //validate form
+ if (oForm.url.value == '') {
+ alert('Please enter a url.');
+ return false;
+ }
+ if (oForm.linkText.value == '') {
+ alert('Please enter link text.');
+ return false;
+ }
+
+ var html = '<a href="' + document.linkForm.url.value + '" target="' + document.linkForm.linkTarget.options[document.linkForm.linkTarget.selectedIndex].value + '">' + document.linkForm.linkText.value + '</a>';
+
+ window.opener.insertHTML(html);
+ window.close();
+ return true;
+}
+//-->
+</script>
+</head>
+
+<body style="margin: 10px; background: #D3D3D3;">
+
+<form name="linkForm" onSubmit="return AddLink();">
+<table cellpadding="4" cellspacing="0" border="0">
+ <tr><td colspan="2"><span style="font-style: italic; font-size: x-small;"><b>Tip:</b> To insert an email link, start your URL with "mailto:"</span></td></tr>
+ <tr>
+ <td align="right">URL:</td>
+ <td><input name="url" type="text" id="url" size="40"></td>
+ </tr>
+ <tr>
+ <td align="right">Text:</td>
+ <td><input name="linkText" type="text" id="linkText" size="40"></td>
+ </tr>
+ <tr>
+ <td align="right">Target:</td>
+ <td align="left">
+ <select name="linkTarget" id="linkTarget">
+ <option value="_blank">_blank</option>
+ <option value="_parent">_parent</option>
+ <option value="_self" selected>_self</option>
+ <option value="_top">_top</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" align="center">
+ <input type="submit" value="Insert Link" />
+ <input type="button" value="Cancel" onClick="window.close();" />
+ </td>
+ </tr>
+</table>
+
+</form>
+
+</body>
+</html>
Propchange: incubator/roller/trunk/web/editor/insert_link.htm
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/roller/trunk/web/editor/insert_table.htm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/editor/insert_table.htm?rev=357361&view=auto
==============================================================================
--- incubator/roller/trunk/web/editor/insert_table.htm (added)
+++ incubator/roller/trunk/web/editor/insert_table.htm Sat Dec 17 10:25:57 2005
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <title>Insert Table</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<script language="JavaScript" type="text/javascript">
+<!--
+function AddTable() {
+ var widthType = (document.tableForm.widthType.value == "pixels") ? "" : "%";
+ var html = '<table border="' + document.tableForm.border.value + '" cellpadding="' + document.tableForm.padding.value + '" ';
+
+ html += 'cellspacing="' + document.tableForm.spacing.value + '" width="' + document.tableForm.width.value + widthType + '">\n';
+ for (var rows = 0; rows < document.tableForm.rows.value; rows++) {
+ html += "<tr>\n";
+ for (cols = 0; cols < document.tableForm.columns.value; cols++) {
+ html += "<td> </td>\n";
+ }
+ html+= "</tr>\n";
+ }
+ html += "</table>\n";
+
+ window.opener.insertHTML(html);
+ window.close();
+}
+//-->
+</script>
+</head>
+
+<body style="margin: 10px; background: #D3D3D3;">
+
+<form name="tableForm">
+<table cellpadding="4" cellspacing="0" border="0">
+ <tr>
+ <td align="right">Rows:</td>
+ <td><input name="rows" type="text" id="rows" value="2" size="4"></td>
+ <td align="left">Columns: <input name="columns" type="text" id="columns" value="2" size="4"></td>
+ </tr>
+ <tr>
+ <td align="right">Table width:</td>
+ <td><input name="width" type="text" id="width" value="100" size="4"></td>
+ <td align="left">
+ <select name="widthType" id="widthType">
+ <option value="pixels">pixels</option>
+ <option value="percent" selected>percent</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Border thickness:</td>
+ <td><input name="border" type="text" id="border" value="1" size="4"></td>
+ <td align="left">pixels</td>
+ </tr>
+ <tr>
+ <td align="right">Cell padding:</td>
+ <td><input name="padding" type="text" id="padding" value="4" size="4"></td>
+ <td>Cell spacing: <input name="spacing" type="text" id="0" value="0" size="4"></td>
+ </tr>
+ <tr>
+ <td colspan="3" align="center">
+ <input type="button" value="Insert Table" onClick="AddTable();" />
+ <input type="button" value="Cancel" onClick="window.close();" />
+ </td>
+ </tr>
+</table>
+
+</form>
+
+</body>
+</html>
Propchange: incubator/roller/trunk/web/editor/insert_table.htm
------------------------------------------------------------------------------
svn:executable = *
Modified: incubator/roller/trunk/web/editor/multi.htm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/editor/multi.htm?rev=357361&r1=357360&r2=357361&view=diff
==============================================================================
--- incubator/roller/trunk/web/editor/multi.htm (original)
+++ incubator/roller/trunk/web/editor/multi.htm Sat Dec 17 10:25:57 2005
@@ -1,23 +1,25 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Cross-Browser Rich Text Editor</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <meta name="PageURL" content="http://www.kevinroth.com/rte/demo.htm" />
- <meta name="PageTitle" content="Cross-Browser Rich Text Editor" />
- <!-- To decrease bandwidth, change the src to richtext_compressed.js //-->
+ <meta name="PageURL" content="http://www.kevinroth.com/rte/multi.htm" />
+ <meta name="PageTitle" content="Cross-Browser Rich Text Editor (Multiple Demo)" />
+ <script language="JavaScript" type="text/javascript" src="html2xhtml.js"></script>
+ <!-- To decrease bandwidth, use richtext_compressed.js instead of richtext.js //-->
<script language="JavaScript" type="text/javascript" src="richtext.js"></script>
</head>
<body>
<h2>Cross-Browser Rich Text Editor</h2>
<p><a href="http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=3508&lngWId=2" target="_blank"><img src="/images/PscContestWinner.jpg" height="88" width="409" alt="PscContestWinner" border="0"></a></p>
-<p>The cross-browser rich-text editor implements the <a href="http://www.mozilla.org/editor/midas-spec.html" target="_blank">Mozilla Rich Text Editing API</a> included with Mozilla 1.3+. There is <b>NO LICENSE</b>, so just take the code and use it for any purpose. This code is 100% free. Enjoy!</p>
+<p>The cross-browser rich-text editor (RTE) is based on the <a href="http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/internet/ie55/EditRegions/default.asp" target="_blank">designMode()</a> functionality introduced in Internet Explorer 5, and implemented in Mozilla 1.3+ using the <a href="http://www.mozilla.org/editor/midas-spec.html" target="_blank">Mozilla Rich Text Editing API</a>. The cross-browser rich-text editor now includes <b>table support</b> (as of 2/10/2005) as well as an option to generate <b>xhtml-compliant code</b> (as of 2/24/2005).</p>
+<p><b>This code is public domain.</b> Redistribution and use of this code, with or without modification, is permitted.</p>
<p>For frequently asked question and support, please visit <a href="http://www.kevinroth.com/forums/index.php?c=2">http://www.kevinroth.com/forums/index.php?c=2</a></p>
-<p><b>Requires:</b> IE5+/<a href="http://www.mozilla.org/">Mozilla</a> 1.3+/<a href="http://www.mozilla.org/products/firefox/" target="_blank">Mozilla Firebird/Firefox</a> 0.6.1+ for all rich-text features to function properly. If browser does not support rich-text, it should display a standard textarea box.</p>
+<p><b>Requires:</b> IE5+/<a href="http://www.mozilla.org/products/mozilla1.x/">Mozilla</a> 1.3+/<a href="http://www.mozilla.org/products/firefox/" target="_blank">Mozilla Firebird/Firefox</a> 0.6.1+/<a href="http://channels.netscape.com/ns/browsers/download.jsp" target="_blank">Netscape</a> 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.</p>
<p><b>Source:</b> <a href="rte.zip">rte.zip</a>, <a href="rte.tar.gz">rte.tar.gz</a><br>
-Included in the zip are <a href="demo.htm">HTML</a>, <a href="demo.asp">ASP</a>, and <a href="demo.php">PHP</a> demos. Also, here is an <a href="multi.htm">html demo</a> showing multiple RTEs on one page.</p>
+Included in the zip are <a href="demo.htm">HTML</a>, <a href="demo.asp">ASP</a>, and <a href="demo.php">PHP</a> demos. Also, here is an html demo showing <a href="multi.htm">multiple RTEs</a> on one page.</p>
<p><b>Change Log:</b> <a href="changelog.txt">changelog.txt</a></p>
<p><b>If you feel that the work I've done has value to you,</b> I would greatly appreciate a paypal donation (click button below). Another way you can help me out is to <a href="http://www.FreeFlatScreens.com/default.aspx?referer=11055453" target="_blank">sign up for a free flat screen</a>, to help me get mine. Again, I am very grateful for any and all contributions.</p>
@@ -28,11 +30,11 @@
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="lc" value="US">
-<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
+<input type="image" src="/images/paypal_donate.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
-<form name="RTEDemo" action="demo.htm" method="post" onsubmit="return submitForm();">
-
+<!-- START Demo Code -->
+<form name="RTEDemo" action="multi.htm" method="post" onsubmit="return submitForm();">
<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {
@@ -49,8 +51,8 @@
return false;
}
-//Usage: initRTE(imagesPath, includesPath, cssFile)
-initRTE("images/", "", "");
+//Usage: initRTE(imagesPath, includesPath, cssFile, genXHTML)
+initRTE("images/", "", "", true);
//-->
</script>
<noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
@@ -61,7 +63,7 @@
writeRichText('rte1', 'here's the "<em>preloaded</em> <b>content</b>"', 520, 200, true, false);
document.writeln('<br><br>');
-writeRichText('rte2', 'preloaded <b>text</b>', 560, 100, true, false);
+writeRichText('rte2', 'preloaded <b>text</b>', 560, 100, false, false);
document.writeln('<br><br>');
writeRichText('rte3', 'preloaded <b>text</b>', 450, 100, true, true);
@@ -71,6 +73,7 @@
<p>Click submit to show the value of the text box.</p>
<p><input type="submit" name="submit" value="Submit"></p>
</form>
+<!-- END Demo Code -->
</body>
-</html>
\ No newline at end of file
+</html>
Modified: incubator/roller/trunk/web/editor/palette.htm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/editor/palette.htm?rev=357361&r1=357360&r2=357361&view=diff
==============================================================================
--- incubator/roller/trunk/web/editor/palette.htm (original)
+++ incubator/roller/trunk/web/editor/palette.htm Sat Dec 17 10:25:57 2005
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
@@ -14,7 +14,7 @@
var x = document.getElementsByTagName('TD');
else if (document.all)
var x = document.all.tags('TD');
- for (var i=0;i<x.length;i++) {
+ for (var i=0; i < x.length; i++) {
x[i].onmouseover = over;
x[i].onmouseout = out;
x[i].onclick = click;
@@ -22,11 +22,11 @@
}
function over() {
- this.style.border='1px dotted white';
+ this.style.border = '1px dotted white';
}
function out() {
- this.style.border='1px solid gray';
+ this.style.border = '1px solid gray';
}
function click() {
Modified: incubator/roller/trunk/web/editor/richtext.js
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/editor/richtext.js?rev=357361&r1=357360&r2=357361&view=diff
==============================================================================
--- incubator/roller/trunk/web/editor/richtext.js (original)
+++ incubator/roller/trunk/web/editor/richtext.js Sat Dec 17 10:25:57 2005
@@ -2,6 +2,7 @@
// http://www.kevinroth.com/rte/demo.htm
// Written by Kevin Roth (kevin@NOSPAMkevinroth.com - remove NOSPAM)
// Visit the support forums at http://www.kevinroth.com/forums/index.php?c=2
+// This code is public domain. Redistribution and use of this code, with or without modification, is permitted.
//init variables
var isRichText = false;
@@ -17,9 +18,13 @@
var imagesPath;
var includesPath;
var cssFile;
+var generateXHTML;
+var lang = "en";
+var encoding = "iso-8859-1";
-function initRTE(imgPath, incPath, css) {
+
+function initRTE(imgPath, incPath, css, genXHTML) {
//set browser vars
var ua = navigator.userAgent.toLowerCase();
isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1));
@@ -27,10 +32,14 @@
isSafari = (ua.indexOf("safari") != -1);
isKonqueror = (ua.indexOf("konqueror") != -1);
+ generateXHTML = genXHTML;
+
//check to see if designMode mode is available
+ //Safari/Konqueror think they are designMode capable even though they are not
if (document.getElementById && document.designMode && !isSafari && !isKonqueror) {
isRichText = true;
}
+
if (isIE) {
document.onmouseover = raiseButton;
document.onmouseout = normalButton;
@@ -44,7 +53,7 @@
cssFile = css;
if (isRichText) document.writeln('<style type="text/css">@import "' + includesPath + 'rte.css";</style>');
-
+
//for testing standard textarea, uncomment the following line
//isRichText = false;
}
@@ -53,150 +62,114 @@
if (isRichText) {
if (allRTEs.length > 0) allRTEs += ";";
allRTEs += rte;
- writeRTE(rte, html, width, height, buttons, readOnly);
- } else {
- writeDefault(rte, html, width, height, buttons, readOnly);
- }
-}
-
-function writeDefault(rte, html, width, height, buttons, readOnly) {
- if (!readOnly) {
- document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;">' + html + '</textarea>');
- } else {
- document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;" readonly>' + html + '</textarea>');
- }
-}
-
-function raiseButton(e) {
- //IE-Only Function
- var el = window.event.srcElement;
-
- className = el.className;
- if (className == 'rteImage' || className == 'rteImageLowered') {
- el.className = 'rteImageRaised';
- }
-}
-
-function normalButton(e) {
- //IE-Only Function
- var el = window.event.srcElement;
-
- className = el.className;
- if (className == 'rteImageRaised' || className == 'rteImageLowered') {
- el.className = 'rteImage';
- }
-}
-
-function lowerButton(e) {
- //IE-Only Function
- var el = window.event.srcElement;
-
- className = el.className;
- if (className == 'rteImage' || className == 'rteImageRaised') {
- el.className = 'rteImageLowered';
- }
-}
-
-function writeRTE(rte, html, width, height, buttons, readOnly) {
- if (readOnly) buttons = false;
-
- //adjust minimum table widths
- if (isIE) {
- if (buttons && (width < 600)) width = 600;
- var tablewidth = width;
- } else {
- if (buttons && (width < 500)) width = 500;
- var tablewidth = width + 4;
- }
-
- document.writeln('<div class="rteDiv">');
- if (buttons == true) {
- document.writeln('<table class="rteBack" cellpadding=2 cellspacing=0 id="Buttons1_' + rte + '" width="' + tablewidth + '">');
- document.writeln(' <tr>');
- document.writeln(' <td>');
- document.writeln(' <select id="formatblock_' + rte + '" onchange="Select(\'' + rte + '\', this.id);">');
- document.writeln(' <option value="">[Style]</option>');
- document.writeln(' <option value="<p>">Paragraph</option>');
- document.writeln(' <option value="<h1>">Heading 1 <h1></option>');
- document.writeln(' <option value="<h2>">Heading 2 <h2></option>');
- document.writeln(' <option value="<h3>">Heading 3 <h3></option>');
- document.writeln(' <option value="<h4>">Heading 4 <h4></option>');
- document.writeln(' <option value="<h5>">Heading 5 <h5></option>');
- document.writeln(' <option value="<h6>">Heading 6 <h6></option>');
- document.writeln(' <option value="<address>">Address <ADDR></option>');
- document.writeln(' <option value="<pre>">Formatted <pre></option>');
- document.writeln(' </select>');
- document.writeln(' </td>');
- document.writeln(' <td>');
- document.writeln(' <select id="fontname_' + rte + '" onchange="Select(\'' + rte + '\', this.id)">');
- document.writeln(' <option value="Font" selected>[Font]</option>');
- document.writeln(' <option value="Arial, Helvetica, sans-serif">Arial</option>');
- document.writeln(' <option value="Courier New, Courier, mono">Courier New</option>');
- document.writeln(' <option value="Times New Roman, Times, serif">Times New Roman</option>');
- document.writeln(' <option value="Verdana, Arial, Helvetica, sans-serif">Verdana</option>');
- document.writeln(' </select>');
- document.writeln(' </td>');
- document.writeln(' <td>');
- document.writeln(' <select unselectable="on" id="fontsize_' + rte + '" onchange="Select(\'' + rte + '\', this.id);">');
- document.writeln(' <option value="Size">[Size]</option>');
- document.writeln(' <option value="1">1</option>');
- document.writeln(' <option value="2">2</option>');
- document.writeln(' <option value="3">3</option>');
- document.writeln(' <option value="4">4</option>');
- document.writeln(' <option value="5">5</option>');
- document.writeln(' <option value="6">6</option>');
- document.writeln(' <option value="7">7</option>');
- document.writeln(' </select>');
- document.writeln(' </td>');
- document.writeln(' <td width="100%">');
- document.writeln(' </td>');
- document.writeln(' </tr>');
- document.writeln('</table>');
- document.writeln('<table class="rteBack" cellpadding="0" cellspacing="0" id="Buttons2_' + rte + '" width="' + tablewidth + '">');
- document.writeln(' <tr>');
- document.writeln(' <td><img id="bold" class="rteImage" src="' + imagesPath + 'bold.gif" width="25" height="24" alt="Bold" title="Bold" onClick="FormatText(\'' + rte + '\', \'bold\', \'\')"></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'italic.gif" width="25" height="24" alt="Italic" title="Italic" onClick="FormatText(\'' + rte + '\', \'italic\', \'\')"></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'underline.gif" width="25" height="24" alt="Underline" title="Underline" onClick="FormatText(\'' + rte + '\', \'underline\', \'\')"></td>');
- document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'left_just.gif" width="25" height="24" alt="Align Left" title="Align Left" onClick="FormatText(\'' + rte + '\', \'justifyleft\', \'\')"></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'centre.gif" width="25" height="24" alt="Center" title="Center" onClick="FormatText(\'' + rte + '\', \'justifycenter\', \'\')"></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'right_just.gif" width="25" height="24" alt="Align Right" title="Align Right" onClick="FormatText(\'' + rte + '\', \'justifyright\', \'\')"></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'justifyfull.gif" width="25" height="24" alt="Justify Full" title="Justify Full" onclick="FormatText(\'' + rte + '\', \'justifyfull\', \'\')"></td>');
- document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'hr.gif" width="25" height="24" alt="Horizontal Rule" title="Horizontal Rule" onClick="FormatText(\'' + rte + '\', \'inserthorizontalrule\', \'\')"></td>');
- document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'numbered_list.gif" width="25" height="24" alt="Ordered List" title="Ordered List" onClick="FormatText(\'' + rte + '\', \'insertorderedlist\', \'\')"></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'list.gif" width="25" height="24" alt="Unordered List" title="Unordered List" onClick="FormatText(\'' + rte + '\', \'insertunorderedlist\', \'\')"></td>');
- document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'outdent.gif" width="25" height="24" alt="Outdent" title="Outdent" onClick="FormatText(\'' + rte + '\', \'outdent\', \'\')"></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'indent.gif" width="25" height="24" alt="Indent" title="Indent" onClick="FormatText(\'' + rte + '\', \'indent\', \'\')"></td>');
- document.writeln(' <td><div id="forecolor_' + rte + '"><img class="rteImage" src="' + imagesPath + 'textcolor.gif" width="25" height="24" alt="Text Color" title="Text Color" onClick="FormatText(\'' + rte + '\', \'forecolor\', \'\')"></div></td>');
- document.writeln(' <td><div id="hilitecolor_' + rte + '"><img class="rteImage" src="' + imagesPath + 'bgcolor.gif" width="25" height="24" alt="Background Color" title="Background Color" onClick="FormatText(\'' + rte + '\', \'hilitecolor\', \'\')"></div></td>');
- document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'hyperlink.gif" width="25" height="24" alt="Insert Link" title="Insert Link" onClick="FormatText(\'' + rte + '\', \'createlink\')"></td>');
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'image.gif" width="25" height="24" alt="Add Image" title="Add Image" onClick="AddImage(\'' + rte + '\')"></td>');
+
+ if (readOnly) buttons = false;
+
+ //adjust minimum table widths
if (isIE) {
- document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'spellcheck.gif" width="25" height="24" alt="Spell Check" title="Spell Check" onClick="checkspell()"></td>');
+ if (buttons && (width < 540)) width = 540;
+ var tablewidth = width;
+ } else {
+ if (buttons && (width < 540)) width = 540;
+ var tablewidth = width + 4;
}
-// document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
-// document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'cut.gif" width="25" height="24" alt="Cut" title="Cut" onClick="FormatText(\'' + rte + '\', \'cut\')"></td>');
-// document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'copy.gif" width="25" height="24" alt="Copy" title="Copy" onClick="FormatText(\'' + rte + '\', \'copy\')"></td>');
-// document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'paste.gif" width="25" height="24" alt="Paste" title="Paste" onClick="FormatText(\'' + rte + '\', \'paste\')"></td>');
-// document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
-// document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'undo.gif" width="25" height="24" alt="Undo" title="Undo" onClick="FormatText(\'' + rte + '\', \'undo\')"></td>');
-// document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'redo.gif" width="25" height="24" alt="Redo" title="Redo" onClick="FormatText(\'' + rte + '\', \'redo\')"></td>');
- document.writeln(' <td width="100%"></td>');
- document.writeln(' </tr>');
- document.writeln('</table>');
- }
- document.writeln('<iframe id="' + rte + '" name="' + rte + '" width="' + width + 'px" height="' + height + 'px" src="' + includesPath + 'blank.htm"></iframe>');
- if (!readOnly) document.writeln('<br /><input type="checkbox" id="chkSrc' + rte + '" onclick="toggleHTMLSrc(\'' + rte + '\');" /> View Source');
- document.writeln('<iframe width="154" height="104" id="cp' + rte + '" src="' + includesPath + 'palette.htm" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; display: none; position: absolute;"></iframe>');
- document.writeln('<input type="hidden" id="hdn' + rte + '" name="' + rte + '" value="">');
- document.writeln('</div>');
-
- document.getElementById('hdn' + rte).value = html;
- enableDesignMode(rte, html, readOnly);
+
+ document.writeln('<div class="rteDiv">');
+ if (buttons == true) {
+ document.writeln('<table class="rteBack" cellpadding=2 cellspacing=0 id="Buttons1_' + rte + '" width="' + tablewidth + '">');
+ document.writeln(' <tr>');
+ document.writeln(' <td>');
+ document.writeln(' <select id="formatblock_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id);">');
+ document.writeln(' <option value="">[Style]</option>');
+ document.writeln(' <option value="<p>">Paragraph <p></option>');
+ document.writeln(' <option value="<h1>">Heading 1 <h1></option>');
+ document.writeln(' <option value="<h2>">Heading 2 <h2></option>');
+ document.writeln(' <option value="<h3>">Heading 3 <h3></option>');
+ document.writeln(' <option value="<h4>">Heading 4 <h4></option>');
+ document.writeln(' <option value="<h5>">Heading 5 <h5></option>');
+ document.writeln(' <option value="<h6>">Heading 6 <h6></option>');
+ document.writeln(' <option value="<address>">Address <ADDR></option>');
+ document.writeln(' <option value="<pre>">Formatted <pre></option>');
+ document.writeln(' </select>');
+ document.writeln(' </td>');
+ document.writeln(' <td>');
+ document.writeln(' <select id="fontname_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id)">');
+ document.writeln(' <option value="Font" selected>[Font]</option>');
+ document.writeln(' <option value="Arial, Helvetica, sans-serif">Arial</option>');
+ document.writeln(' <option value="Courier New, Courier, mono">Courier New</option>');
+ document.writeln(' <option value="Times New Roman, Times, serif">Times New Roman</option>');
+ document.writeln(' <option value="Verdana, Arial, Helvetica, sans-serif">Verdana</option>');
+ document.writeln(' </select>');
+ document.writeln(' </td>');
+ document.writeln(' <td>');
+ document.writeln(' <select unselectable="on" id="fontsize_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id);">');
+ document.writeln(' <option value="Size">[Size]</option>');
+ document.writeln(' <option value="1">1</option>');
+ document.writeln(' <option value="2">2</option>');
+ document.writeln(' <option value="3">3</option>');
+ document.writeln(' <option value="4">4</option>');
+ document.writeln(' <option value="5">5</option>');
+ document.writeln(' <option value="6">6</option>');
+ document.writeln(' <option value="7">7</option>');
+ document.writeln(' </select>');
+ document.writeln(' </td>');
+ document.writeln(' <td width="100%">');
+ document.writeln(' </td>');
+ document.writeln(' </tr>');
+ document.writeln('</table>');
+ document.writeln('<table class="rteBack" cellpadding="0" cellspacing="0" id="Buttons2_' + rte + '" width="' + tablewidth + '">');
+ document.writeln(' <tr>');
+ document.writeln(' <td><img id="bold" class="rteImage" src="' + imagesPath + 'bold.gif" width="25" height="24" alt="Bold" title="Bold" onClick="rteCommand(\'' + rte + '\', \'bold\', \'\')"></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'italic.gif" width="25" height="24" alt="Italic" title="Italic" onClick="rteCommand(\'' + rte + '\', \'italic\', \'\')"></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'underline.gif" width="25" height="24" alt="Underline" title="Underline" onClick="rteCommand(\'' + rte + '\', \'underline\', \'\')"></td>');
+ document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'left_just.gif" width="25" height="24" alt="Align Left" title="Align Left" onClick="rteCommand(\'' + rte + '\', \'justifyleft\', \'\')"></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'centre.gif" width="25" height="24" alt="Center" title="Center" onClick="rteCommand(\'' + rte + '\', \'justifycenter\', \'\')"></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'right_just.gif" width="25" height="24" alt="Align Right" title="Align Right" onClick="rteCommand(\'' + rte + '\', \'justifyright\', \'\')"></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'justifyfull.gif" width="25" height="24" alt="Justify Full" title="Justify Full" onclick="rteCommand(\'' + rte + '\', \'justifyfull\', \'\')"></td>');
+ document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'hr.gif" width="25" height="24" alt="Horizontal Rule" title="Horizontal Rule" onClick="rteCommand(\'' + rte + '\', \'inserthorizontalrule\', \'\')"></td>');
+ document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'numbered_list.gif" width="25" height="24" alt="Ordered List" title="Ordered List" onClick="rteCommand(\'' + rte + '\', \'insertorderedlist\', \'\')"></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'list.gif" width="25" height="24" alt="Unordered List" title="Unordered List" onClick="rteCommand(\'' + rte + '\', \'insertunorderedlist\', \'\')"></td>');
+ document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'outdent.gif" width="25" height="24" alt="Outdent" title="Outdent" onClick="rteCommand(\'' + rte + '\', \'outdent\', \'\')"></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'indent.gif" width="25" height="24" alt="Indent" title="Indent" onClick="rteCommand(\'' + rte + '\', \'indent\', \'\')"></td>');
+ document.writeln(' <td><div id="forecolor_' + rte + '"><img class="rteImage" src="' + imagesPath + 'textcolor.gif" width="25" height="24" alt="Text Color" title="Text Color" onClick="dlgColorPalette(\'' + rte + '\', \'forecolor\', \'\')"></div></td>');
+ document.writeln(' <td><div id="hilitecolor_' + rte + '"><img class="rteImage" src="' + imagesPath + 'bgcolor.gif" width="25" height="24" alt="Background Color" title="Background Color" onClick="dlgColorPalette(\'' + rte + '\', \'hilitecolor\', \'\')"></div></td>');
+ document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'hyperlink.gif" width="25" height="24" alt="Insert Link" title="Insert Link" onClick="dlgInsertLink(\'' + rte + '\', \'link\')"></td>');
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'image.gif" width="25" height="24" alt="Add Image" title="Add Image" onClick="addImage(\'' + rte + '\')"></td>');
+ document.writeln(' <td><div id="table_' + rte + '"><img class="rteImage" src="' + imagesPath + 'insert_table.gif" width="25" height="24" alt="Insert Table" title="Insert Table" onClick="dlgInsertTable(\'' + rte + '\', \'table\', \'\')"></div></td>');
+ if (isIE) {
+ document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'spellcheck.gif" width="25" height="24" alt="Spell Check" title="Spell Check" onClick="checkspell()"></td>');
+ }
+ // document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
+ // document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'cut.gif" width="25" height="24" alt="Cut" title="Cut" onClick="rteCommand(\'' + rte + '\', \'cut\')"></td>');
+ // document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'copy.gif" width="25" height="24" alt="Copy" title="Copy" onClick="rteCommand(\'' + rte + '\', \'copy\')"></td>');
+ // document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'paste.gif" width="25" height="24" alt="Paste" title="Paste" onClick="rteCommand(\'' + rte + '\', \'paste\')"></td>');
+ // document.writeln(' <td><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
+ // document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'undo.gif" width="25" height="24" alt="Undo" title="Undo" onClick="rteCommand(\'' + rte + '\', \'undo\')"></td>');
+ // document.writeln(' <td><img class="rteImage" src="' + imagesPath + 'redo.gif" width="25" height="24" alt="Redo" title="Redo" onClick="rteCommand(\'' + rte + '\', \'redo\')"></td>');
+ document.writeln(' <td width="100%"></td>');
+ document.writeln(' </tr>');
+ document.writeln('</table>');
+ }
+ document.writeln('<iframe id="' + rte + '" name="' + rte + '" width="' + width + 'px" height="' + height + 'px" src="' + includesPath + 'blank.htm"></iframe>');
+ if (!readOnly) document.writeln('<br /><input type="checkbox" id="chkSrc' + rte + '" onclick="toggleHTMLSrc(\'' + rte + '\',' + buttons + ');" /> <label for="chkSrc' + rte + '">View Source</label>');
+ document.writeln('<iframe width="154" height="104" id="cp' + rte + '" src="' + includesPath + 'palette.htm" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; position: absolute;"></iframe>');
+ document.writeln('<input type="hidden" id="hdn' + rte + '" name="' + rte + '" value="">');
+ document.writeln('</div>');
+
+ document.getElementById('hdn' + rte).value = html;
+ enableDesignMode(rte, html, readOnly);
+ } else {
+ if (!readOnly) {
+ document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;">' + html + '</textarea>');
+ } else {
+ document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;" readonly>' + html + '</textarea>');
+ }
+ }
}
function enableDesignMode(rte, html, readOnly) {
@@ -225,7 +198,10 @@
oRTE.open();
oRTE.write(frameHtml);
oRTE.close();
- if (!readOnly) oRTE.designMode = "On";
+ if (!readOnly) {
+ oRTE.designMode = "On";
+ frames[rte].document.attachEvent("onkeypress", function evt_ie_keypress(event) {ieKeyPress(event, rte);});
+ }
} else {
try {
if (!readOnly) document.getElementById(rte).contentDocument.designMode = "on";
@@ -236,7 +212,7 @@
oRTE.close();
if (isGecko && !readOnly) {
//attach a keyboard handler for gecko browsers to make keyboard shortcuts work
- oRTE.addEventListener("keypress", kb_handler, true);
+ oRTE.addEventListener("keypress", geckoKeyPress, true);
}
} catch (e) {
alert("Error preloading content.");
@@ -253,22 +229,11 @@
}
}
-function updateRTEs() {
- var vRTEs = allRTEs.split(";");
- for (var i = 0; i < vRTEs.length; i++) {
- updateRTE(vRTEs[i]);
- }
-}
-
function updateRTE(rte) {
if (!isRichText) return;
- //set message value
- var oHdnMessage = document.getElementById('hdn' + rte);
- var oRTE = document.getElementById(rte);
- var readOnly = false;
-
//check for readOnly mode
+ var readOnly = false;
if (document.all) {
if (frames[rte].document.designMode != "On") readOnly = true;
} else {
@@ -277,57 +242,96 @@
if (isRichText && !readOnly) {
//if viewing source, switch back to design view
- if (document.getElementById("chkSrc" + rte).checked) {
- document.getElementById("chkSrc" + rte).checked = false;
- toggleHTMLSrc(rte);
+ if (document.getElementById("chkSrc" + rte).checked) document.getElementById("chkSrc" + rte).click();
+ setHiddenVal(rte);
+ }
+}
+
+function setHiddenVal(rte) {
+ //set hidden form field value for current rte
+ var oHdnField = document.getElementById('hdn' + rte);
+
+ //convert html output to xhtml (thanks Timothy Bell and Vyacheslav Smolin!)
+ if (oHdnField.value == null) oHdnField.value = "";
+ if (document.all) {
+ if (generateXHTML) {
+ oHdnField.value = get_xhtml(frames[rte].document.body, lang, encoding);
+ } else {
+ oHdnField.value = frames[rte].document.body.innerHTML;
}
-
- if (oHdnMessage.value == null) oHdnMessage.value = "";
- if (document.all) {
- oHdnMessage.value = frames[rte].document.body.innerHTML;
+ } else {
+ if (generateXHTML) {
+ oHdnField.value = get_xhtml(document.getElementById(rte).contentWindow.document.body, lang, encoding);
} else {
- oHdnMessage.value = oRTE.contentWindow.document.body.innerHTML;
+ oHdnField.value = document.getElementById(rte).contentWindow.document.body.innerHTML;
}
-
- //if there is no content (other than formatting) set value to nothing
- if (stripHTML(oHdnMessage.value.replace(" ", " ")) == ""
- && oHdnMessage.value.toLowerCase().search("<hr") == -1
- && oHdnMessage.value.toLowerCase().search("<img") == -1) oHdnMessage.value = "";
- //fix for gecko
- if (escape(oHdnMessage.value) == "%3Cbr%3E%0D%0A%0D%0A%0D%0A") oHdnMessage.value = "";
}
+
+ //if there is no content (other than formatting) set value to nothing
+ if (stripHTML(oHdnField.value.replace(" ", " ")) == "" &&
+ oHdnField.value.toLowerCase().search("<hr") == -1 &&
+ oHdnField.value.toLowerCase().search("<img") == -1) oHdnField.value = "";
}
-function toggleHTMLSrc(rte) {
- //contributed by Bob Hutzel (thanks Bob!)
+function updateRTEs() {
+ var vRTEs = allRTEs.split(";");
+ for (var i = 0; i < vRTEs.length; i++) {
+ updateRTE(vRTEs[i]);
+ }
+}
+
+function rteCommand(rte, command, option) {
+ //function to perform command
var oRTE;
if (document.all) {
- oRTE = frames[rte].document;
+ oRTE = frames[rte];
} else {
- oRTE = document.getElementById(rte).contentWindow.document;
+ oRTE = document.getElementById(rte).contentWindow;
}
+ try {
+ oRTE.focus();
+ oRTE.document.execCommand(command, false, option);
+ oRTE.focus();
+ } catch (e) {
+// alert(e);
+// setTimeout("rteCommand('" + rte + "', '" + command + "', '" + option + "');", 10);
+ }
+}
+
+function toggleHTMLSrc(rte, buttons) {
+ //contributed by Bob Hutzel (thanks Bob!)
+ var oHdnField = document.getElementById('hdn' + rte);
+
if (document.getElementById("chkSrc" + rte).checked) {
- document.getElementById("Buttons1_" + rte).style.visibility = "hidden";
- document.getElementById("Buttons2_" + rte).style.visibility = "hidden";
+ //we are checking the box
+ if (buttons) {
+ showHideElement("Buttons1_" + rte, "hide");
+ showHideElement("Buttons2_" + rte, "hide");
+ }
+ setHiddenVal(rte);
if (document.all) {
- oRTE.body.innerText = oRTE.body.innerHTML;
+ frames[rte].document.body.innerText = oHdnField.value;
} else {
- var htmlSrc = oRTE.createTextNode(oRTE.body.innerHTML);
+ var oRTE = document.getElementById(rte).contentWindow.document;
+ var htmlSrc = oRTE.createTextNode(oHdnField.value);
oRTE.body.innerHTML = "";
oRTE.body.appendChild(htmlSrc);
}
} else {
- document.getElementById("Buttons1_" + rte).style.visibility = "visible";
- document.getElementById("Buttons2_" + rte).style.visibility = "visible";
+ //we are unchecking the box
+ if (buttons) {
+ showHideElement("Buttons1_" + rte, "show");
+ showHideElement("Buttons2_" + rte, "show");
+ }
if (document.all) {
//fix for IE
- var output = escape(oRTE.body.innerText);
+ var output = escape(frames[rte].document.body.innerText);
output = output.replace("%3CP%3E%0D%0A%3CHR%3E", "%3CHR%3E");
output = output.replace("%3CHR%3E%0D%0A%3C/P%3E", "%3CHR%3E");
-
- oRTE.body.innerHTML = unescape(output);
+ frames[rte].document.body.innerHTML = unescape(output);
} else {
+ var oRTE = document.getElementById(rte).contentWindow.document;
var htmlSrc = oRTE.body.ownerDocument.createRange();
htmlSrc.selectNodeContents(oRTE.body);
oRTE.body.innerHTML = htmlSrc.toString();
@@ -335,131 +339,104 @@
}
}
-//Function to format text in the text box
-function FormatText(rte, command, option) {
- var oRTE;
- if (document.all) {
- oRTE = frames[rte];
-
- //get current selected range
- var selection = oRTE.document.selection;
- if (selection != null) {
- rng = selection.createRange();
+function dlgColorPalette(rte, command) {
+ //function to display or hide color palettes
+ setRange(rte);
+
+ //get dialog position
+ var oDialog = document.getElementById('cp' + rte);
+ var buttonElement = document.getElementById(command + '_' + rte);
+ var iLeftPos = getOffsetLeft(buttonElement);
+ var iTopPos = getOffsetTop(buttonElement) + (buttonElement.offsetHeight + 4);
+ oDialog.style.left = (iLeftPos) + "px";
+ oDialog.style.top = (iTopPos) + "px";
+
+ if ((command == parent.command) && (rte == currentRTE)) {
+ //if current command dialog is currently open, close it
+ if (oDialog.style.visibility == "hidden") {
+ showHideElement(oDialog, 'show');
+ } else {
+ showHideElement(oDialog, 'hide');
}
} else {
- oRTE = document.getElementById(rte).contentWindow;
-
- //get currently selected range
- var selection = oRTE.getSelection();
- rng = selection.getRangeAt(selection.rangeCount - 1).cloneRange();
+ //if opening a new dialog, close all others
+ var vRTEs = allRTEs.split(";");
+ for (var i = 0; i < vRTEs.length; i++) {
+ showHideElement('cp' + vRTEs[i], 'hide');
+ }
+ showHideElement(oDialog, 'show');
}
+ //save current values
+ parent.command = command;
+ currentRTE = rte;
+}
+
+function dlgInsertTable(rte, command) {
+ //function to open/close insert table dialog
+ //save current values
+ parent.command = command;
+ currentRTE = rte;
+ InsertTable = popUpWin(includesPath + 'insert_table.htm', 'InsertTable', 360, 180, '');
+}
+
+function dlgInsertLink(rte, command) {
+ //function to open/close insert table dialog
+ //save current values
+ parent.command = command;
+ currentRTE = rte;
+ InsertLink = popUpWin(includesPath + 'insert_link.htm', 'InsertLink', 360, 180, '');
+
+ //get currently highlighted text and set link text value
+ setRange(rte);
+ var linkText = '';
+ if (isIE) {
+ linkText = stripHTML(rng.htmlText);
+ } else {
+ linkText = stripHTML(rng.toString());
+ }
+ setLinkText(linkText);
+}
+
+function setLinkText(linkText) {
+ //set link text value in insert link dialog
try {
- if ((command == "forecolor") || (command == "hilitecolor")) {
- //save current values
- parent.command = command;
- currentRTE = rte;
-
- //position and show color palette
- buttonElement = document.getElementById(command + '_' + rte);
- var iLeftPos = getOffsetLeft(buttonElement);
- var iTopPos = getOffsetTop(buttonElement) + (buttonElement.offsetHeight + 4);
- document.getElementById('cp' + rte).style.left = (iLeftPos) + "px";
- document.getElementById('cp' + rte).style.top = (iTopPos) + "px";
- if (document.getElementById('cp' + rte).style.visibility == "hidden") {
- document.getElementById('cp' + rte).style.visibility = "visible";
- document.getElementById('cp' + rte).style.display = "inline";
- } else {
- document.getElementById('cp' + rte).style.visibility = "hidden";
- document.getElementById('cp' + rte).style.display = "none";
- }
- } else if (command == "createlink") {
- var szURL = prompt("Enter a URL:", "");
- try {
- //ignore error for blank urls
- oRTE.document.execCommand("Unlink", false, null);
- oRTE.document.execCommand("CreateLink", false, szURL);
- } catch (e) {
- //do nothing
- }
- } else {
- oRTE.focus();
- oRTE.document.execCommand(command, false, option);
- oRTE.focus();
- }
+ window.InsertLink.document.linkForm.linkText.value = linkText;
} catch (e) {
- alert(e);
+ //may take some time to create dialog window.
+ //Keep looping until able to set.
+ setTimeout("setLinkText('" + linkText + "');", 10);
}
}
-//Function to set color
+function popUpWin (url, win, width, height, options) {
+ var leftPos = (screen.availWidth - width) / 2;
+ var topPos = (screen.availHeight - height) / 2;
+ options += 'width=' + width + ',height=' + height + ',left=' + leftPos + ',top=' + topPos;
+ return window.open(url, win, options);
+}
+
function setColor(color) {
+ //function to set color
var rte = currentRTE;
- var oRTE;
- if (document.all) {
- oRTE = frames[rte];
- } else {
- oRTE = document.getElementById(rte).contentWindow;
- }
-
var parentCommand = parent.command;
+
if (document.all) {
- //retrieve selected range
- var sel = oRTE.document.selection;
if (parentCommand == "hilitecolor") parentCommand = "backcolor";
- if (sel != null) {
- var newRng = sel.createRange();
- newRng = rng;
- newRng.select();
- }
- }
- oRTE.focus();
- oRTE.document.execCommand(parentCommand, false, color);
- oRTE.focus();
- document.getElementById('cp' + rte).style.visibility = "hidden";
- document.getElementById('cp' + rte).style.display = "none";
-}
-
-//Function to add image
-function AddImage(rte) {
- var oRTE;
- if (document.all) {
- oRTE = frames[rte];
- //get current selected range
- var selection = oRTE.document.selection;
- if (selection != null) {
- rng = selection.createRange();
- }
- } else {
- oRTE = document.getElementById(rte).contentWindow;
-
- //get currently selected range
- var selection = oRTE.getSelection();
- rng = selection.getRangeAt(selection.rangeCount - 1).cloneRange();
+ //retrieve selected range
+ rng.select();
}
- imagePath = prompt('Enter Image URL:', 'http://');
- if ((imagePath != null) && (imagePath != "")) {
- oRTE.focus();
- oRTE.document.execCommand('InsertImage', false, imagePath);
- oRTE.focus();
- }
+ rteCommand(rte, parentCommand, color);
+ showHideElement('cp' + rte, "hide");
}
-//function to perform spell check
-function checkspell() {
- try {
- var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
- tmpis.CheckAllLinkedDocuments(document);
- }
- catch(exception) {
- if(exception.number==-2146827859) {
- if (confirm("ieSpell not detected. Click Ok to go to download page."))
- window.open("http://www.iespell.com/download.php","DownLoad");
- } else {
- alert("Error Loading ieSpell: Exception " + exception.number);
- }
+function addImage(rte) {
+ //function to add image
+ imagePath = prompt('Enter Image URL:', 'http://');
+ if ((imagePath != null) && (imagePath != "")) {
+ rteCommand(rte, 'InsertImage', imagePath);
}
}
@@ -495,64 +472,71 @@
return mOffsetLeft;
}
-function Select(rte, selectname) {
- var oRTE;
- if (document.all) {
- oRTE = frames[rte];
-
- //get current selected range
- var selection = oRTE.document.selection;
- if (selection != null) {
- rng = selection.createRange();
- }
- } else {
- oRTE = document.getElementById(rte).contentWindow;
-
- //get currently selected range
- var selection = oRTE.getSelection();
- rng = selection.getRangeAt(selection.rangeCount - 1).cloneRange();
- }
-
+function selectFont(rte, selectname) {
+ //function to handle font changes
var idx = document.getElementById(selectname).selectedIndex;
// First one is always a label
if (idx != 0) {
var selected = document.getElementById(selectname).options[idx].value;
var cmd = selectname.replace('_' + rte, '');
- oRTE.focus();
- oRTE.document.execCommand(cmd, false, selected);
- oRTE.focus();
+ rteCommand(rte, cmd, selected);
document.getElementById(selectname).selectedIndex = 0;
}
}
-function kb_handler(evt) {
- var rte = evt.target.id;
+function insertHTML(html) {
+ //function to add HTML -- thanks dannyuk1982
+ var rte = currentRTE;
- //contributed by Anti Veeranna (thanks Anti!)
- if (evt.ctrlKey) {
- var key = String.fromCharCode(evt.charCode).toLowerCase();
- var cmd = '';
- switch (key) {
- case 'b': cmd = "bold"; break;
- case 'i': cmd = "italic"; break;
- case 'u': cmd = "underline"; break;
- };
+ var oRTE;
+ if (document.all) {
+ oRTE = frames[rte];
+ } else {
+ oRTE = document.getElementById(rte).contentWindow;
+ }
+
+ oRTE.focus();
+ if (document.all) {
+ var oRng = oRTE.document.selection.createRange();
+ oRng.pasteHTML(html);
+ oRng.collapse(false);
+ oRng.select();
+ } else {
+ oRTE.document.execCommand('insertHTML', false, html);
+ }
+}
- if (cmd) {
- FormatText(rte, cmd, true);
- //evt.target.ownerDocument.execCommand(cmd, false, true);
- // stop the event bubble
- evt.preventDefault();
- evt.stopPropagation();
- }
- }
+function showHideElement(element, showHide) {
+ //function to show or hide elements
+ //element variable can be string or object
+ if (document.getElementById(element)) {
+ element = document.getElementById(element);
+ }
+
+ if (showHide == "show") {
+ element.style.visibility = "visible";
+ } else if (showHide == "hide") {
+ element.style.visibility = "hidden";
+ }
}
-function docChanged (evt) {
- alert('changed');
+function setRange(rte) {
+ //function to store range of current selection
+ var oRTE;
+ if (document.all) {
+ oRTE = frames[rte];
+ var selection = oRTE.document.selection;
+ if (selection != null) rng = selection.createRange();
+ } else {
+ oRTE = document.getElementById(rte).contentWindow;
+ var selection = oRTE.getSelection();
+ rng = selection.getRangeAt(selection.rangeCount - 1).cloneRange();
+ }
+ return rng;
}
function stripHTML(oldString) {
+ //function to strip all html
var newString = oldString.replace(/(<([^>]+)>)/ig,"");
//replace carriage returns and line feeds
@@ -591,4 +575,95 @@
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ") + 1, retValue.length);
}
return retValue; // Return the trimmed string back to the user
+}
+
+//********************
+//Gecko-Only Functions
+//********************
+function geckoKeyPress(evt) {
+ //function to add bold, italic, and underline shortcut commands to gecko RTEs
+ //contributed by Anti Veeranna (thanks Anti!)
+ var rte = evt.target.id;
+
+ if (evt.ctrlKey) {
+ var key = String.fromCharCode(evt.charCode).toLowerCase();
+ var cmd = '';
+ switch (key) {
+ case 'b': cmd = "bold"; break;
+ case 'i': cmd = "italic"; break;
+ case 'u': cmd = "underline"; break;
+ };
+
+ if (cmd) {
+ rteCommand(rte, cmd, null);
+
+ // stop the event bubble
+ evt.preventDefault();
+ evt.stopPropagation();
+ }
+ }
+}
+
+//*****************
+//IE-Only Functions
+//*****************
+function ieKeyPress(evt, rte) {
+ var key = (evt.which || evt.charCode || evt.keyCode);
+ var stringKey = String.fromCharCode(key).toLowerCase();
+
+//the following breaks list and indentation functionality in IE (don't use)
+// switch (key) {
+// case 13:
+// //insert <br> tag instead of <p>
+// //change the key pressed to null
+// evt.keyCode = 0;
+//
+// //insert <br> tag
+// currentRTE = rte;
+// insertHTML('<br>');
+// break;
+// };
+}
+
+function checkspell() {
+ //function to perform spell check
+ try {
+ var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
+ tmpis.CheckAllLinkedDocuments(document);
+ }
+ catch(exception) {
+ if(exception.number==-2146827859) {
+ if (confirm("ieSpell not detected. Click Ok to go to download page."))
+ window.open("http://www.iespell.com/download.php","DownLoad");
+ } else {
+ alert("Error Loading ieSpell: Exception " + exception.number);
+ }
+ }
+}
+
+function raiseButton(e) {
+ var el = window.event.srcElement;
+
+ className = el.className;
+ if (className == 'rteImage' || className == 'rteImageLowered') {
+ el.className = 'rteImageRaised';
+ }
+}
+
+function normalButton(e) {
+ var el = window.event.srcElement;
+
+ className = el.className;
+ if (className == 'rteImageRaised' || className == 'rteImageLowered') {
+ el.className = 'rteImage';
+ }
+}
+
+function lowerButton(e) {
+ var el = window.event.srcElement;
+
+ className = el.className;
+ if (className == 'rteImage' || className == 'rteImageRaised') {
+ el.className = 'rteImageLowered';
+ }
}
Modified: incubator/roller/trunk/web/editor/richtext_compressed.js
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/editor/richtext_compressed.js?rev=357361&r1=357360&r2=357361&view=diff
==============================================================================
--- incubator/roller/trunk/web/editor/richtext_compressed.js (original)
+++ incubator/roller/trunk/web/editor/richtext_compressed.js Sat Dec 17 10:25:57 2005
@@ -1 +1 @@
-$="Û=ú;rng;curr»®;all®s¯¢;isIE;isGecko;isSafari;isK¼quÖor;iÔsPath;Ù;cssFið;µýit®(imgPath,ýcPath,cssãua=navigator.usÖAg»óÉisIE=((uaÎmsie¢)!=-1)&&(uaÎopÖa¢)==-1)&&(uaÎwebtv¢)==-1)ÉisGecko=(uaÎgecko¢)!=-1ÉisSafari=(uaÎsafari¢)!=-1ÉisK¼quÖor=(uaÎk¼quÖor¢)!=-1)º¤ðm»ById&&¨dÏ&&!isSafari&&!isK¼quÖorãÛ=true;}âisIE㨼mouseovÖ=raiseBÇ;¨¼mouseout=normalBÇ;¨¼mousedown=lowÖBÇ;¨¼mouseup=raiseBÇ;}iÔsPath=imgPath;Ù=ýcPath;cssFið=cssºÛ)ìstyð type¯text/css¢>@import ¢'+Ù+'È.css¢;</styð>'É}µwriteRichTextçãâÛãâall®sÞ>0)all®s+¯;¢;all®s+=È;write®çÉÅwriteDefaultçÉ}}µwriteDefaultçãâ!·yãìtextarea name¯ª¢îª¢ styð¯Ó: '+Ó+'px; height: ôx;¢>'+hï+'</textarea>'ÉÅìtextarea name¯ª¢îª¢ styð¯Ó: '+Ó+'px; height: ôx;¢ read¼ly>'+hï+'</textarea>'É}}µraiseÿmeºÁ='ÈIÔ'||Á='ÈIÔLowÖed'ãel.Á'ÈIÔRaised';}}µnormalÿmeºÁ='ÈIÔRaised'||Á='ÈI�
�LowÖed'ãel.Á'ÈIÔ';}}µlowÖÿmeºÁ='ÈIÔ'||Á='ÈIÔRaised'ãel.Á'ÈIÔLowÖed';}}µwrite®çãâ·y)bÇs=úºisIEãâbÇs&&(Ó<600))Ó=600;tabðÓ=Ó;ÅâbÇs&&(Ó<500))Ó=500;tabðÓ=Ó+4;}ìdiv§eDiv¢>')ºbÇs==trueãìtabð§eBack¢ cellpaddýg=2 cellspacýg=0îBÇs1_ª¢©'+tabðÓ+'¢Ð <tr¦<td¦ <s¬îformatblock_ª¢ ¼chû¯S¬(\\'ª\\', this.idÉ¢¦ <« value¯¢>[Styð]ü<p>¢>Paragraphü<h1Ú1 <h1>ü<h2Ú2 <h2>ü<h3Ú3 <h3>ü<h4Ú4 <h4>ü<h5Ú5 <h5>ü<h6Ú6 <h6>ü<address>¢>Address <ADDR>ü<pre>¢>Formatted <pre></«¦ </s¬¦</td¦<td¦ <s¬îf¼tname_ª¢ ¼chû¯S¬(\\'ª\\', this.id)¢¦ <« value¯F¼t¢ s¬ed>[F¼t]üArial, Helvetica, sans-sÖif¢>ArialüCouriÖ New, CouriÖ, m¼o¢>CouriÖ NewüTimes New Roman, Times, sÖif¢>Times New RomanüVÖdana, Arial, Helvetica, sans-sÖif¢>VÖdana</«¦ </s¬¦</td¦<td¦ <s¬ uns¬ab𯼢îf¼tsize_ª¢ ¼chû¯S¬(\\'ª\\', this.idÉ¢¦ <« value¯Size¢>[Size]ü1¢>1ü2¢>2ü3¢>3ü4¢>4
ü5¢>5ü6¢>6ü7¢>7</«¦ </s¬¦</td¦<td©100%¢¦</tdÐ </trÐ</tabðÐ<tabð§eBack¢ cellpaddýg¯0¢ cellspacýg¯0¢îBÇs2_ª¢©'+tabðÓ+'¢Ð <tr¦<td><imgîbold¢³h+'bold½t¯BoldÃBold¿boldàÄitalic½t¯ItalicÃItalic¿italicàÄundÖlýe½t¯UndÖlýeÃUndÖlýe¿undÖlýeàèalt¯²Äðft_just½t¯Align LeftÃAlign Left¿jùðftàÄc»re½t¯C»ÖÃC»Ö¿jùc»ÖàÄright_just½t¯Align RightÃAlign Right¿jùrightàÄjùfull½t¯Jù FullÃJù Full¢ ¼c¾xt(\\'ª¸jùfullàèalt¯²Ähr½t¯Horiz¼tal RuðÃHoriz¼tal Ruð¿ýsÖthoriz¼talruðàèalt¯²ÄnumbÖed_list½t¯OõÃOõ¿ýsÖtordÖedlistàÄlist½t¯UnoõÃUnoõ¿ýsÖtunordÖedlistàèalt¯²Äoutd»½t¯Outd»ÃOutd»¿outd»àÄýd»½t¯Ind»ÃInd»¿ýd»àdivîforeí_ª¢><Ätextí½t¯Text ColorÃText Color¿foreí¸\\')¢></div></td¦<td><divîhiliteí_ª¢><Äbgí½t¯Background ColorÃBackground Color¿hiliteí¸\\')¢></div></td¦<td><èalt¯²ÄhypÖlýk½t¯InsÖt LýkÃInsÖt
Lýk¿createlýk\\')²ÄiÔ½t¯Add IÔÃAdd IÔ¢ ¼Click¯AddIÔ(\\'ª\\')¢></td>')ºisIEã£ln(' <td><Äspellcheck½t¯Spell CheckÃSpell Check¢ ¼Click¯checkspell()¢></td>'É}£ln(' <td©100%¢></tdÐ </trÐ</tabð>'É}ìi¹îª¢ name¯ª¢©'+Ó+'px¢ height¯ôx¢ src¯'+Ù+'blank.htm¢></i¹>')º!·y)ìbr /><ýput type¯checkbox¢îchkSrcª¢ ¼click¯toggðHTMLSrc(\\'ª\\'É¢ /> View Source'Éìi¹©154¢ height¯104¢îcpª¢ src¯'+Ù+'paðtte.htm¢ margýÓ¯0¢ margýheight¯0¢ scrollýg¯no¢ styð¯visibility:hidden; display: n¼e; positi¼: absolute;¢></i¹Ð<ýput typeë¢îhdnª¢ name¯ª¢ value¯¢Ð</div>'É¥'hdn'+È).value=hï;enabðDÏ(È,hï,·yÉ}µenabðDÏ(È,hï,·yã¹Hï¯<hï id=\\¢¢+È+¢\\¢>Í<head>\\n¢ºcssFiðÞ>0ã¹Hï+¯<lýk media=\\¢all\\¢ type=\\¢text/css\\¢ href=\\¢¢+cssFið+¢\\¢ rel=\\¢styðsheet\\¢>\\n¢;ŹHï+¯<styð>Íbody {Í background: #FFFFFF;Í margý: 0px;Í paddýg: 0px;Í}Í</styð>\\n�
�;}¹Hï+¯</head>Í<body>\\n¢;¹Hï+=hï+¢Í</body>Í</hï>¢Ño®=¹s[È].docum»;Õopen(ÉÕwrite(¹HïÉÕclose()º!·y)ÕdϯOn¢;Åtry{â!·y)¥È).c¼t»Docum».dϯ¼¢;try{×dow.docum»;Õopen(ÉÕwrite(¹HïÉÕclose()ºisGecko&&!·yãÕaddEv»ListenÖ(¢keypress¢,kb_handlÖ,trueÉ}}catch(eãalÖt(¢Error preloadýg c¼t».¢É}}catch(eãâisGeckoãsetTimeout(¢enabðDÏ('¢+È+¢', '¢+hï+¢', ¢+·y+¢É¢,10ÉÅøú;}}}}µupdate®s(ãv®s=all®s.split(¢;¢Éfor(i=0;i<v®sÞ;i++ãupdate®(v®s[i]É}}µupdate®(Èãâ!Û)return;oHdnMessage=¥'hdn'+ÈÉo®=¥ÈÉ·y=úÑâ¹s[È].¨dÏ!¯On¢)·y=true;Åâ¥È).c¼t»Docum».dÏ!¯¼¢)·y=true;}âÛ&&!·yã⥢chkSrc¢+È).checked㥢chkSrc¢+È).checked=ú;toggðHTMLSrc(ÈÉ}âÊlue==null)Êlue¯¢ÑÊlue=¹s[È].¨ËL;ÅÊlue=Õc¼t»Wýdow.¨ËL;}âstripHTML(ÊlueÜ¢ ¢,¢ ¢))=¯¢&&Êlueó).search(¢<hr¢)==-1&&Êlueó).search(¢<img¢)==-1)Êlue¯¢ºescape(Êlue)=¯%3Cbr%3E%0D
%0A%0D%0A%0D%0A¢)Êlue¯¢;}}µtoggðHTMLSrc(Èò.docum»;Å×dow.docum»;}⥢chkSrc¢+È).checked㥢BÇs1_¢Ìë¢;¥¢BÇs2_¢Ìë¢ÑÕbody.ýnÖText=ÕËL;ÅhïSrc=ÕcreateTextNode(ÕËLÉÕËL¯¢;Õbody.appendChild(hïSrcÉ}Å¥¢BÇs1_¢Ì¯visibð¢;¥¢BÇs2_¢Ì¯visibð¢Ñoutput=escape(Õbody.ýnÖTextÉoutput=outputÜ¢%3CP%3E%0D%0A%3CHR%3E¢,¢%3CHR%3E¢Éoutput=outputÜ¢%3CHR%3E%0D%0A%3C/P%3E¢,¢%3CHR%3E¢ÉÕËL=unescape(outputÉÅhïSrc=Õbody.ownÖDocum».creatÝhïSrc.s¬NodeC¼t»s(ÕbodyÉÕËL=hïSrc.toSÆ(É}}}µFormatText(È,cÒ,«ò;á=Õ¨áºá!=nullãrng=á.creatÝ}Å×dow;á=ÕgetS¬i¼(Érng=á.getRûAt(á.rûCount-1).cl¼Ý}try{â(cÒ=¯foreí¢)||(cÒ=¯hiliteí¢)ãpar».cÒ=cÒ;curr»®=È;bÇEðm»=¥cÒ+'_'+ÈÉiLeftPos=getßLeft(bÇEðm»ÉiTopPos=getßTop(bÇEðm»)+(bÇEðm».offsetHeight+4É¥'cp'À.ðft=(iLeftPos)+¢px¢;¥'cp'À.top=(iTopPos)+¢px¢º¥'cp'Ì=ë¢ã¥'cp'̯visibð¢;¥'cp'À.display¯ýlýe¢
;Å¥'cp'Ìë¢;¥'cp'À.display¯n¼e¢;}}else âcÒ=¯createlýk¢ãszURL=prompt(¢EntÖ a URL:¢,¢¢Étry{ö¢Unlýk¢,ú,nullÉö¢CreateLýk¢,ú,szURLÉ}catch(eã}ÅêöcÒ,ú,«Éê}}catch(eãalÖt(eÉ}}µsetColor(íãÈ=curr»®;o®Ño®=¹s[È];Å×dow;}par»CÒ=par».cÒÑsel=Õ¨áºpar»CÒ=¯hiliteí¢)par»CÒ¯backí¢ºsel!=nullãnewRng=sel.creatÝnewRng=rng;newRng.s¬(É}}êöpar»CÒ,ú,íÉê¥'cp'Ìë¢;¥'cp'À.display¯n¼e¢;}µAddIÔ(Èò;á=Õ¨áºá!=nullãrng=á.creatÝ}Å×dow;á=ÕgetS¬i¼(Érng=á.getRûAt(á.rûCount-1).cl¼Ý}iÔPath=prompt('EntÖ IÔ URL:','http://')º(iÔPath!=null)&&(iÔPath!¯¢)ãêö'InsÖtIÔ',ú,iÔPathÉê}}µcheckspell(ãtry{tmpis=new ActiveXObject(¢ieSpell.ieSpellExtensi¼¢Étmpis.CheckAllLýkedDocum»s(docum»É}catch(excepti¼ãâexcepti¼.numbÖ==-2146827859ãâc¼firm(¢ieSpell not detected. Click Ok to go to download page.¢))wýdow.open(¢http://www.iespell.com/download.php¢,¢DownLoad
¢ÉÅalÖt(¢Error Loadýg ieSpell: Excepti¼ ¢+excepti¼.numbÖÉ}}}µgetßTop(elmãmßTop=elm.offsetTop;mOÂ=elm.oÂ;÷=2;whið(÷>0ãmßTop+=mOÂ.offsetTop;mOÂ=mOÂ.oÂ;÷--;}ømßTop;}µgetßLeft(elmãmßLeft=elm.offsetLeft;mOÂ=elm.oÂ;÷=2;whið(÷>0ãmßLeft+=mOÂ.offsetLeft;mOÂ=mOÂ.oÂ;÷--;}ømßLeft;}µS¬(È,s¬nameò;á=Õ¨áºá!=nullãrng=á.creatÝ}Å×dow;á=ÕgetS¬i¼(Érng=á.getRûAt(á.rûCount-1).cl¼Ý}idx=¥s¬name).s¬edIndexºidx!=0ãs¬ed=¥s¬name).«s[idx].value;cmd=s¬nameÜ'_'+È,''Éêöcmd,ú,s¬edÉê¥s¬name).s¬edIndex=0;}}µkb_handlÖ(evtãÈ=evt.target.idºevt.ctrlKeyãkey=SÆ.fromCharCode(evt.charCode)óÉcmd='';switch(keyãcase 'b':cmd¯bold¢;break;case 'i':cmd¯italic¢;break;case 'u':cmd¯undÖlýe¢;break;}ºcmdãFormatText(È,cmd,trueÉevt.prev»Default(Éevt.stopPropagati¼(É}}}µdocChûd(evtãalÖt('chûd'É}µstripHTML(oldSÆãnewSÆ=oldSÆÜ/(<([^>]+)>)/ig,¢¢ÉnewSÆ=newSÆÜ/\\r\\n/g,¢
¢ÉnewSÆ=newSÆÜ/\\n/g,¢ ¢ÉnewSÆ=newSÆÜ/\\r/g,¢ ¢ÉnewSÆ=trim(newSÆÉønewSÆ;}µtrim(ýputSÆãâtypeof ýputSÆ!¯sÆ¢)øýputSÆ;¶=ýputSÆ;ché0,1Éwhið(ch=¯ ¢ã¶é1,¶ÞÉché0,1É}ché¶Þ-1,¶ÞÉwhið(ch=¯ ¢ã¶é0,¶Þ-1Éché¶Þ-1,¶ÞÉ}whið(¶Î ¢)!=-1ã¶é0,¶Î ¢))+¶.subsÆ(¶Î ¢)+1,¶ÞÉ}ø¶;}";for(I=92;I>=0;)$=$.replace(eval("/"+String.fromCharCode(163+I)+"/g"),"document.write¡document.getE¡¤lementById(¡>');£ln(' ¡ class=¢rt¡document.¡ width=¢¡'+rte+'¡option¡elect¡var ¡RTE¡=¢¡¢ src¯'+images¡</«¦ <« valu¡¢></td¦<td><¡§eImage°Pat¡¢ height¯2¡function ¡retValue¡readOnl¡\\', \\'¡frame¡;if(¡ent¡on¡.gif¢©25´4¢ al¡lick¯FormatTe¡¢ ¼C¾xt(\\'ª¸¡+rte).style¡className=¡ffsetPar»¡¢ title¯¡img³h+'¡}else{¡tring¡utt¼¡rte¡);¡oHdnMessage.va¡body.innerHTM¡À.visibility¡\\n¢;¹Html+¯¡.indexOf(¢¡esignMode¡>'É£ln('¡º¨all){¡ommand¡width¡mage¡o®.¡er¡o®=
¥È).c¼t»Win¡(È,html,Ó,hei¡includesPath¡>¢>Heading ¡isRichText¡.replace(¡eRange(É¡.length¡Offset¡¸\\')²¡s¬i¼¡if(¡){¡img§eVÖtSep°Pa¡äth+'blackdot¡å.gif¢©1´0¢ ¡Øght,bÇs,·y¡æbordÖ¯0¢ ¡=¶.subsÆ(¡Õfocus(É¡¯hidden¡£ln('<¡color¡ id¯¡tml¡le¡BÇ(eãel=windo¡ão®Ño®=¹s[È]¡.toLowÖCase(¡'+height+'p¡rdÖed List¡Õ¨execCÒ(¡par»s_up¡return ¡ustify¡false¡ange¡±e¯¡in¡ñw.ev».srcEðm»¡þ;Áel.classNa".split("¡")[I--]);eval($.replace(/¢/g,"\""));
\ No newline at end of file
+$="ýRichÔ=fðse;rng;ê;ðlRTEs¯¢;ýIE;ýGecko;ýSafari;ýKonquãor;iûsPath;Í;cssFile;çL;lang¯en¢;encod¼g¯ýo-8859-1¢;functü ¼itRTE(imgPath,¼cPath,css,genXHTMLÖua=navigator.usãAg»ØÉýIE=(Ùmsie¢)!=-1)&&Ùopãa¢)==-1)&&Ùwebtv¢)==-1)ÉýGecko=Ùgecko¢)!=-1ÉýSafari=Ùsafari¢)!=-1ÉýKonquãor=Ùkonquãor¢)!=-1ÉçL=genXHTMLǨgetªById&&¨dÜ&&!ýSafari&&!ýKonquãorÖýRichÔ=true;}âýIEÖ¨onmouseovã=raýeôout=normðôdown=lowãôup=raýeBÆ;}iûsPath=imgPath;Í=¼cPath;cssFile=cssÇýRichÔ)ùí type¯text/css¢>@import ¢'+Í+'®.css¢;</í>'ɧwriteRichÔ(®,î,Ó,ß,bÆs,Ï{âýRichÔÖâðlRTEsÑ>0)ðlRTEs+¯;¢;ðlRTEs+=®ÇÏbÆs=fðseÇýIEÖâbÆs&&(Ó<540))Ó=540;táÓ=ÓÄâbÆs&&(Ó<540))Ó=540;táÓ=Ó+4;}ùdiv¦Div¢>')ÇbÆs==trueÖùtá¦Back¢ cellpadd¼g=2 cellspac¼g=0 id¯BÆs1_Õ¢©'+táÓ+'¢Ð <trÐ <¤ <s¹ id¯formatblockò.idÉ¢¥ <« vðue¯¢>[Style]±¯<p>¢>Paragraph <p÷1Û
1 <h1÷2Û2 <h2÷3Û3 <h3÷4Û4 <h4÷5Û5 <h5÷6Û6 <h6>±¯<address>¢>Address <ADDR>±¯<pre>¢>Formatted <pre>ó/¤<¤ <s¹ id¯fontnÈò.id)¢¥ <« vðue¯Font¢ s¹ed>[Font]±¯Arið, Helvetica, sans-sãif¢>Arið±¯Couriã New, Couriã, mono¢>Couriã New±¯Times New Roman, Times, sãif¢>Times New Roman±¯Vãdana, Arið, Helvetica, sans-sãif¢>Vãdanaó/¤<¤ <s¹ uns¹á¯on¢ id¯fontsizeò.idÉ¢¥ <« vðue¯Size¢>[Size]±¯1¢>1±¯2¢>2±¯3¢>3±¯4¢>4±¯5¢>5±¯6¢>6±¯7¢>7ó/¤<td©100%¢Ð </tdÐ </trÐ</táÐ<tá¦Back¢ cellpadd¼g¯0¢ cellspac¼g¯0¢ id¯BÆs2_Õ¢©'+táÓ+'¢Ð <trÐ <td><img id¯bold¢²'boldÂBoldÃBold¿boldÁµàitðicÂItðicÃItðic¿itðicÁµàundãl¼eÂUndãl¼eÃUndãl¼e¿undãl¼eöleft_justÂAlign LeftÃAlign Left¿justifyleftÁµàc»reÂC»ãÃC»ã¿justifyc»ãÁµàright_justÂAlign RightÃAlign Right¿justifyrightÁµàjustifyfullÂJustify FullÃJustify Full¢ onc½\\',
\\'justifyfullöhrÂHorizontð RuleÃHorizontð Rule¿¼sãthorizontðruleönumbãed_lýtÂOrdãed LýtÃOrdãed Lýt¿¼sãtordãedlýtÁµàlýtÂUnordãed LýtÃUnordãed Lýt¿¼sãtunordãedlýtöoutd»ÂOutd»ÃOutd»¿outd»Áµà¼d»ÂInd»ÃInd»¿¼d»Áµdiv id¯foreú_Õ¢><àtextúÂÔ ColorÃÔ Colorèþì, \\'foreúÁ></divµdiv id¯hiliteú_Õ¢><àbgúÂBackground ColorÃBackground Colorèþì, \\'hiliteúÁ></divå ðt¯¢µàhypãl¼kÂÒ L¼kÃÒ L¼kèdlgÒL¼kì, \\'l¼k\\')¢µàiûÂAdd IûÃAdd IûèaddIûì)¢µdiv id¯tá_Õ¢><à¼sãt_táÂÒ TáÃÒ TáèdlgÒTáì, \\'táÁ></div></td>')ÇýIEÖ£ln(' <td><àspellcheckÂSpell CheckÃSpell Checkècheckspell()¢></td>'É}£ln(' <td©100%¢></tdÐ </trÐ</tá>'É}ùifrÈ id¯Õ¢ nȯբ©'+Ó+'px¢ ߯'+ß+'px¢ src¯'+Í+'blank.htm¢></ifrÈ>')Ç!Ïùbr /><¼put type¯checkbox¢ id¯chkSrcÕ¢ onclick¯toggleHTMLSrcì,'+bÆs+'É¢ /> <label for¯chkSrcÕ¢>View Source</labelÐ<ifrÈ�
�154¢ ߯104¢ id¯cpÕ¢ src¯'+Í+'pðette.htm¢ marg¼Ó¯0¢ marg¼ß¯0¢ scroll¼g¯no¢ í¯výibility:hidden; positü: absolute;¢></ifrÈÐ<¼put type¯hidden¢ id¯hdnÕ¢ nȯբ vðue¯¢Ð</div>'É´'hdn¬).vðue=î;enáDÜ(®,î,ÏÄâ!Ï{ùtextarea nȯբ id¯Õ¢ í¯Ó: '+Ó+'px; ß: '+ß+'px;¢>'+î+'</textarea>')Äùtextarea nȯբ id¯Õ¢ í¯Ó: '+Ó+'px; ß: '+ß+'px;¢ readonly>'+î+'</textarea>'É}}§enáDÜ(®,î,Ï{frÈHtml¯<î id=\\¢¢+®+¢\\¢>\\n¢;À<head>\\n¢ÇcssFileÑ>0ÖÀ<l¼k media=\\¢ðl\\¢ type=\\¢text/css\\¢ href=\\¢¢+cssFile+¢\\¢ rel=\\¢ísheet\\¢>\\n¢ÄÀ<í>\\n¢;Àbody {\\n¢;À background: #FFFFFF;\\n¢;À marg¼: 0px;\\n¢;À padd¼g: 0px;\\n¢;À}\\n¢;À</í>\\n¢;}À</head>\\n¢;À<body>\\n¢;frÈHtml+=î+¢\\n¢;À</body>\\n¢;À</î>¢Ç¨ðlÖº=Þ.docum»;º.open(ɺ.write(frÈHtmlɺ.close()Ç!Ï{º.dܯOn¢;Þ.¨attachEv»(¢onkeypress¢,functü evt_ie_keypress(ev»ÖieKeyPress(ev»,®É}�
�}}else{try{â!Ï´®).cont»Docum».dܯon¢;try{º=Ê.docum»;º.open(ɺ.write(frÈHtmlɺ.close()ÇýGecko&&!Ï{º.addEv»Lýtenã(¢keypress¢,geckoKeyPress,trueÉ}}catch(eÖðãt(¢Error preload¼g cont».¢É}}catch(eÖâýGeckoÖsetTimeout(¢enáDÜ('¢+®+¢', '¢+î+¢', ¢+readOnly+¢É¢,10)Äøfðse;}}}§updateRTE(®Öâ!ýRichÔ)return;readOnly=fðseǨðlÖâÞ.¨dÜ!¯On¢)readOnly=trueÄâ´®).cont»Docum».dÜ!¯on¢)readOnly=true;}âýRichÔ&&!Ï{âÿchecked)ÿclick(ÉsetHiddenVð(®É}§setHiddenVð(®ÖoHdnField=´'hdn¬)Ǿue==null)¾ue¯¢Ç¨ðlÖâçLÖ¾ue=get_xî(Þ.¨body,lang,encod¼g)ľue=Þ.¨æ;}}else{âçLÖ¾ue=get_xî(Ê.¨body,lang,encod¼g)ľue=Ê.¨æ;}}âstripHTML(¾ueé¢ ¢,¢ ¢))=¯¢&&¾ueØ).search(¢<hr¢)==-1&&¾ueØ).search(¢<img¢)==-1)¾ue¯¢;§updateRTEs(ÖvRTEs=ðlRTEs.split(¢;¢Éfor(i=0;i<vRTEsÑ;i++ÖupdateRTE(vRTEs[i]É}§®C¸(®,c¸,«ÖºÇ¨ðlÖº=Þĺ=Ê;}try{º.focus(ɺ.¨execC¸
(c¸,fðse,«Éº.focus(É}catch(eÖ}§toggleHTMLSrc(®,bÆsÖoHdnField=´'hdn¬)ÇÿcheckedÖâbÆsÖ΢BÆs1_¢+®,¢hide¢É΢BÆs2_¢+®,¢hide¢É}setHiddenVð(®)ǨðlÖÞ.¨body.¼nãÔ=¾ueĺ=Ê.docum»;îSrc=º.createÔNode(¾ueɺ.毢;º.body.appendChild(îSrcÉ}}else{âbÆsÖ΢BÆs1_¢+®,¢show¢É΢BÆs2_¢+®,¢show¢É}â¨ðlÖoutput=escape(Þ.¨body.¼nãÔÉoutput=outputé¢%3CP%3E%0D%0A%3CHR%3E¢,¢%3CHR%3E¢Éoutput=outputé¢%3CHR%3E%0D%0A%3C/P%3E¢,¢%3CHR%3E¢ÉÞ.¨æ=unescape(output)ĺ=Ê.docum»;îSrc=º.body.ownãDocum».createRange(ÉîSrc.s¹NodeCont»s(º.bodyɺ.æ=îSrc.toStr¼g(É}}§þ(®,c¸ÖsetRange(®ÉoDiðog=´'cp¬Ébƪ=´c¸+'_¬ÉiLeftPos=getÅLeft(bƪÉiTopPos=getÅTop(bƪ)+(bƪëHeight+4ÉoDiðog.í.left=(iLeftPos)+¢px¢;oDiðog.í.top=(iTopPos)+¢px¢Ç(c¸==pï.c¸)&&(®==ê)ÖâoDiðog.í.výibility=¯hidden¢ÖÎoDiðog,'show')ÄÎoDiðog,'hide'É}}else{vRTEs=ðlRTEs.split(¢;¢
Éfor(i=0;i<vRTEsÑ;i++ÖÎ'cp'+vRTEs[i],'hide'É}ÎoDiðog,'show'É}pï.c¸=c¸;ê=®;§dlgÒTá(®,c¸Öpï.c¸=c¸;ê=®;ÒTá=popUpW¼(Í+'¼sãt_tá.htm','ÒTá',360,180,''ɧdlgÒL¼k(®,c¸Öpï.c¸=c¸;ê=®;ÒL¼k=popUpW¼(Í+'¼sãt_l¼k.htm','ÒL¼k',360,180,''ÉsetRange(®Él¼kÔ=''ÇýIEÖl¼kÔ=stripHTML(rng.îÔ)Äl¼kÔ=stripHTML(rng.toStr¼g()É}setL¼kÔ(l¼kÔɧsetL¼kÔ(l¼kÔÖtry{w¼dow.ÒL¼k.¨l¼kForm.l¼kÔ.vðue=l¼kÔ;}catch(eÖsetTimeout(¢setL¼kÔ('¢+l¼kÔ+¢'É¢,10É}§popUpW¼(url,w¼,Ó,ß,«sÖleftPos=(screen.availWidth-Ó)/2;topPos=(screen.availHeight-ß)/2;«s+='Ó='+Ó+',ß='+ß+',left='+leftPos+',top='+topPos;øw¼dow.open(url,w¼,«sɧsetColor(úÖ®=ê;pïC¸=pï.c¸Ç¨ðlÖâpïC¸=¯hiliteú¢)pïC¸¯backú¢;rng.s¹(É}®C¸(®,pïC¸,úÉÎ'cp¬,¢hide¢É§addIû(®ÖiûPath=prompt('Entã Iû URL:','http://')Ç(iûPath!=null)&&(iûPath!¯¢)Ö®C¸(®,'ÒIû',iûPathÉ}§getÅTop(elmÖmÅTop=elmëTop;m�
�Pï=elmëPï;pïs_up=2;while(pïs_up>0ÖmÅTop+=mÅPïëTop;mÅPï=mÅPïëPï;pïs_up--;}ømÅTop;§getÅLeft(elmÖmÅLeft=elmëLeft;mÅPï=elmëPï;pïs_up=2;while(pïs_up>0ÖmÅLeft+=mÅPïëLeft;mÅPï=mÅPïëPï;pïs_up--;}ømÅLeft;§s¹Font(®,s¹nÈÖidx=´s¹nÈ).s¹edIndexÇidx!=0Ös¹ed=´s¹nÈ).«s[idx].vðue;cmd=s¹nÈé'_¬,''É®C¸(®,cmd,s¹edÉ´s¹nÈ).s¹edIndex=0;}§¼sãtHTML(îÖ®=ê;ºÇ¨ðlÖº=Þĺ=Ê;}º.focus()ǨðlÖoRng=º.¨s¹ü.createRange(ÉoRng.pasteHTML(îÉoRng.collapse(fðseÉoRng.s¹()ĺ.¨execC¸('¼sãtHTML',fðse,îÉ}§Îelem»,showHideÖâ´elem»)Öelem»=´elem»É}âshowHide=¯show¢Öelem».í.výibility¯výible¢;}else âshowHide=¯hide¢Öelem».í.výibility¯hidden¢;}§setRange(®ÖºÇ¨ðlÖº=Þ;s¹ü=º.¨s¹üÇs¹ü!=null)rng=s¹ü.createRange()ĺ=Ê;s¹ü=º.getS¹ü(Érng=s¹ü.getRangeAt(s¹ü.rangeCount-1).cloneRange(É}ørng;§stripHTML(oldStr¼gÖÝ=oldStr¼gé/(<([^>]+
)>)/ig,¢¢ÉÝ=Ýé/\\r\\n/g,¢ ¢ÉÝ=Ýé/\\n/g,¢ ¢ÉÝ=Ýé/\\r/g,¢ ¢ÉÝ=trim(ÝÉøÝ;§trim(¼putStr¼gÖâtypeof ¼putStr¼g!¯str¼g¢)ø¼putStr¼g;¶=¼putStr¼g;chÌ0,1Éwhile(ch=¯ ¢Ö¶Ì1,¶ÑÉchÌ0,1É}ch̶Ñ-1,¶ÑÉwhile(ch=¯ ¢Ö¶Ì0,¶Ñ-1Éch̶Ñ-1,¶ÑÉ}while(¶.¼dexOf(¢ ¢)!=-1Ö¶Ì0,¶.¼dexOf(¢ ¢))+¶.substr¼g(¶.¼dexOf(¢ ¢)+1,¶ÑÉ}ø¶;§geckoKeyPress(evtÖ®=evt.target.idÇevt.ctrlKeyÖkey=Str¼g.fromCharCode(evt.charCode)ØÉcmd='';switch(keyÖcase 'b':cmd¯bold¢;break;case 'i':cmd¯itðic¢;break;case 'u':cmd¯undãl¼e¢;break;}ÇcmdÖ®C¸(®,cmd,nullÉevt.prev»Default(Éevt.stopPropagatü(É}}§ieKeyPress(evt,®Ökey=(evt.which||evt.charCode||evt.keyCodeÉstr¼gKey=Str¼g.fromCharCode(key)Øɧcheckspell(Ötry{tmpý=new ActiveXObject(¢ieSpell.ieSpellExtensü¢Étmpý.CheckAllL¼kedDocum»s(docum»É}catch(exceptüÖâexceptü.numbã==-2146827859Öâconfirm(¢ieSpell not detected. Click Ok to go t
o download page.¢))w¼dow.open(¢http://www.iespell.com/download.php¢,¢DownLoad¢)Äðãt(¢Error Load¼g ieSpell: Exceptü ¢+exceptü.numbãÉ}}§raýeBÆ(eÖel=w¼dow.ev».srcª;classNÈ=õÇËage'||ËageLowãed'Öõ='®IûRaýed';}§normðBÆ(eÖel=w¼dow.ev».srcª;classNÈ=õÇËageRaýed'||ËageLowãed'Öõ='®Iû';}§lowãBÆ(eÖel=w¼dow.ev».srcª;classNÈ=õÇËage'||ËageRaýed'Öõ='®IûLowãed';}}";for(I=92;I>=0;)$=$.replace(eval("/"+String.fromCharCode(163+I)+"/g"),"document.write¡td>');£ln(' ¡>');£ln(' ¡ class=¢rte¡}function ¡document.¡ width=¢¡Element¡option¡'+rte¡var ¡rte¡=¢¡¢ src¯'+images¡</«¥ <« value¡¦Image°Path+¡.gif¢©25¢ h¡¨getªById(¡></¤<td><¡retValue¡eight¯2¡ommand¡elect¡oRTE¡ent¡in¡lick¯®C¸(\\'¬+'¡oHdnField.val¡¢ onC½\\', \\'¡frameHtml+¯¡\\', \\'\\')¢¡³·4¢ alt¯¡¢ title¯¡;}else{¡Offset¡utton¡;if(¡ame¡);¡´®).cont»W¼dow¡classNÈ=='®Im¡=¶.substr¼g(¡¼cludesPat
h¡showHideª(¡readOnly)¡>'É£ln('¡.length¡Insert¡width¡Text¡¬+'¡){¡µimg¦VertSep°P¡.toLowerCase(¡(ua.¼dexOf(¢¡×ath+'black¡>¢>Head¼g ¡esignMode¡newStr¼g¡frÈs[®]¡height¡img²'¡able¡if(¡er¡Údot.gif¢©1¢ h¡ä·0¢ bordã¯0¢¡body.¼nãHTML¡genãateXHTM¡¢ onClick¯¡.replace(¡curr»RTE¡.offset¡(\\'Õ\\'¡style¡html¡ar»¡al¡_Õ¢ onchange¯s¡ñ¹Fontì, this¡</«¥</s¹Ð <¡BÆ;¨onmouse¡el.classNÈ¡Áå ðt¯¢µà¡>±¯<h¡return ¡£ln('<¡color¡mage¡ion¡is¡dlgColorPðette¡´¢chkSrc¢+®).".split("¡")[I--]);eval($.replace(/¢/g,"\""));
\ No newline at end of file
Modified: incubator/roller/trunk/web/weblog/editor-rte.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/weblog/editor-rte.jsp?rev=357361&r1=357360&r2=357361&view=diff
==============================================================================
--- incubator/roller/trunk/web/weblog/editor-rte.jsp (original)
+++ incubator/roller/trunk/web/weblog/editor-rte.jsp Sat Dec 17 10:25:57 2005
@@ -4,8 +4,8 @@
<%@ include file="/taglibs.jsp" %>
<html:hidden property="text" />
-
<script type="text/javascript" src="richtext.js" ></script>
+<script type="text/javascript" src="html2xhtml.js" ></script>
<script type="text/javascript">
<!--
function postWeblogEntry(publish)
@@ -15,8 +15,8 @@
if (publish) document.weblogEntryFormEx.publishEntry.value = "true";
document.weblogEntryFormEx.submit();
}
- // Usage: initRTE(imagesPath, includesPath, cssFile)
- initRTE("images/", "<%= request.getContextPath() %>/editor/", "");
+ //Usage: initRTE(imagesPath, includesPath, cssFile, genXHTML)
+ initRTE("images/", "<%= request.getContextPath() %>/editor/", "", true);
//-->
</script>
<noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>