blob: 220fb1d15b5e47a8e0defbc7823100521d47f3eb [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. The ASF licenses this file to You
under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. For additional information regarding
copyright in this work, please see the NOTICE file in the top level
directory of this distribution.
-->
<!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/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&amp;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 (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/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 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>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="kevin@kevinroth.com">
<input type="hidden" name="no_note" value="1">
<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="/images/paypal_donate.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
<!-- START Demo Code -->
<form name="RTEDemo" action="multi.htm" method="post" onsubmit="return submitForm();">
<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {
//make sure hidden and iframe values are in sync before submitting form
//to sync only 1 rte, use updateRTE(rte)
//to sync all rtes, use updateRTEs
//updateRTE('rte1');
updateRTEs();
alert("rte1 = " + document.RTEDemo.rte1.value);
alert("rte2 = " + document.RTEDemo.rte2.value);
alert("rte3 = " + document.RTEDemo.rte3.value);
//change the following line to true to submit form
return false;
}
//Usage: initRTE(imagesPath, includesPath, cssFile, genXHTML)
initRTE("images/", "", "", true);
//-->
</script>
<noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
<script language="JavaScript" type="text/javascript">
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
writeRichText('rte1', 'here&#39;s the "<em>preloaded</em> <b>content</b>"', 520, 200, true, false);
document.writeln('<br><br>');
writeRichText('rte2', 'preloaded <b>text</b>', 560, 100, false, false);
document.writeln('<br><br>');
writeRichText('rte3', 'preloaded <b>text</b>', 450, 100, true, true);
//-->
</script>
<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>