Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

demo.php

Go to the documentation of this file.
00001 <? 
00005 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
00006 
00007 <html>
00008 <head>
00009         <title>Cross-Browser Rich Text Editor</title>
00010         <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
00011         <meta name="PageURL" content="http://www.kevinroth.com/rte/demo.htm" />
00012         <meta name="PageTitle" content="Cross-Browser Rich Text Editor" />
00013         <!-- To decrease bandwidth, change the src to richtext_compressed.js //-->
00014         <script language="JavaScript" type="text/javascript" src="richtext.js"></script>
00015 </head>
00016 <body>
00017 
00018 <h2>Cross-Browser Rich Text Editor</h2>
00019 <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>
00020 <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>
00021 <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>
00022 <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+ for all rich-text features to function properly.  If browser does not support rich-text, it should display a standard textarea box.</p>
00023 <p><b>Source:</b> <a href="rte.zip">rte.zip</a>, <a href="rte.tar.gz">rte.tar.gz</a><br>
00024 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>
00025 <p><b>Change Log:</b> <a href="changelog.txt">changelog.txt</a></p>
00026 
00027 <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>
00028 <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
00029 <input type="hidden" name="cmd" value="_xclick">
00030 <input type="hidden" name="business" value="kevin@kevinroth.com">
00031 <input type="hidden" name="no_note" value="1">
00032 <input type="hidden" name="currency_code" value="USD">
00033 <input type="hidden" name="tax" value="0">
00034 <input type="hidden" name="lc" value="US">
00035 <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!">
00036 </form>
00037 
00038 <form name="RTEDemo" action="demo.htm" method="post" onsubmit="return submitForm();">
00039 
00040 <script language="JavaScript" type="text/javascript">
00041 <!--
00042 function submitForm() {
00043         //make sure hidden and iframe values are in sync before submitting form
00044         //to sync only 1 rte, use updateRTE(rte)
00045         //to sync all rtes, use updateRTEs
00046         //updateRTE('rte1');
00047         updateRTEs();
00048         alert("rte1 = " + document.RTEDemo.rte1.value);
00049         alert("rte2 = " + document.RTEDemo.rte2.value);
00050         alert("rte3 = " + document.RTEDemo.rte3.value);
00051         
00052         //change the following line to true to submit form
00053         return false;
00054 }
00055 
00056 //Usage: initRTE(imagesPath, includesPath, cssFile)
00057 initRTE("images/", "", "");
00058 //-->
00059 </script>
00060 <noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
00061 
00062 <script language="JavaScript" type="text/javascript">
00063 <!--
00064 //Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
00065 writeRichText('rte1', 'here&#39;s the "<em>preloaded</em> <b>content</b>"', 520, 200, true, false);
00066 
00067 document.writeln('<br><br>');
00068 writeRichText('rte2', 'preloaded <b>text</b>', 560, 100, true, false);
00069 
00070 document.writeln('<br><br>');
00071 writeRichText('rte3', 'preloaded <b>text</b>', 450, 100, true, true);
00072 //-->
00073 </script>
00074 
00075 <p>Click submit to show the value of the text box.</p>
00076 <p><input type="submit" name="submit" value="Submit"></p>
00077 </form>
00078 
00079 </body>
00080 </html>ing = str_replace(chr(146), chr(39), $tmpString);
00081         $tmpString = str_replace("'", "&#39;", $tmpString);
00082         
00083         //convert all types of double quotes
00084         $tmpString = str_replace(chr(147), chr(34), $tmpString);
00085         $tmpString = str_replace(chr(148), chr(34), $tmpString);
00086 //      $tmpString = str_replace("\"", "\"", $tmpString);
00087         
00088         //replace carriage returns & line feeds
00089         $tmpString = str_replace(chr(10), " ", $tmpString);
00090         $tmpString = str_replace(chr(13), " ", $tmpString);
00091         
00092         return $tmpString;
00093 }
00094 ?>

Generated on Fri Jun 23 00:12:45 2006 for phpcompta by  doxygen 1.4.4