[795] | 1 | <html> |
---|
| 2 | <head> |
---|
| 3 | <title>Example of HTMLArea 3.0</title> |
---|
| 4 | |
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
| 6 | |
---|
| 7 | <!-- Configure the path to the editor. We make it relative now, so that the |
---|
| 8 | example ZIP file will work anywhere, but please NOTE THAT it's better to |
---|
| 9 | have it an absolute path, such as '/htmlarea/'. --> |
---|
| 10 | <script type="text/javascript"> |
---|
| 11 | _editor_lang = "en"; |
---|
| 12 | _editor_url = "../"; |
---|
| 13 | </script> |
---|
| 14 | <!-- load the main HTMLArea files --> |
---|
| 15 | <script type="text/javascript" src="../htmlarea.js"></script> |
---|
| 16 | |
---|
| 17 | <style type="text/css"> |
---|
| 18 | html, body { |
---|
| 19 | font-family: Verdana,sans-serif; |
---|
| 20 | background-color: #fea; |
---|
| 21 | color: #000; |
---|
| 22 | } |
---|
| 23 | a:link, a:visited { color: #00f; } |
---|
| 24 | a:hover { color: #048; } |
---|
| 25 | a:active { color: #f00; } |
---|
| 26 | |
---|
| 27 | textarea { background-color: #fff; border: 1px solid 00f; } |
---|
| 28 | </style> |
---|
| 29 | |
---|
| 30 | <script type="text/javascript"> |
---|
| 31 | HTMLArea.loadPlugin("SpellChecker"); |
---|
| 32 | var editor = null; |
---|
| 33 | function initEditor() { |
---|
| 34 | // create an editor for the "ta" textbox |
---|
| 35 | editor = new HTMLArea("ta"); |
---|
| 36 | |
---|
| 37 | // register the SpellChecker plugin |
---|
| 38 | editor.registerPlugin(SpellChecker); |
---|
| 39 | |
---|
| 40 | editor.generate(); |
---|
| 41 | return false; |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | function insertHTML() { |
---|
| 45 | var html = prompt("Enter some HTML code here"); |
---|
| 46 | if (html) { |
---|
| 47 | editor.insertHTML(html); |
---|
| 48 | } |
---|
| 49 | } |
---|
| 50 | function highlight() { |
---|
| 51 | editor.surroundHTML('<span style="background-color: yellow">', '</span>'); |
---|
| 52 | } |
---|
| 53 | </script> |
---|
| 54 | |
---|
| 55 | </head> |
---|
| 56 | |
---|
| 57 | <!-- use <body onload="HTMLArea.replaceAll()" if you don't care about |
---|
| 58 | customizing the editor. It's the easiest way! :) --> |
---|
| 59 | <body onload="initEditor()"> |
---|
| 60 | |
---|
| 61 | <h1>HTMLArea 3.0</h1> |
---|
| 62 | |
---|
| 63 | <p>A replacement for <code>TEXTAREA</code> elements. © <a |
---|
| 64 | href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p> |
---|
| 65 | |
---|
| 66 | <p>Plugins: |
---|
| 67 | <tt>SpellChecker</tt> (sponsored by <a |
---|
| 68 | href="http://americanbible.org">American Bible Society</a>). |
---|
| 69 | </p> |
---|
| 70 | |
---|
| 71 | <form action="test.cgi" method="post" id="edit" name="edit"> |
---|
| 72 | |
---|
| 73 | <textarea id="ta" name="ta" style="width:100%" rows="24" cols="80"> |
---|
| 74 | |
---|
| 75 | <h1>The <tt>SpellChecker</tt> plugin</h1> |
---|
| 76 | |
---|
| 77 | <p>This file deminstrates the <tt>SpellChecker</tt> plugin of |
---|
| 78 | HTMLArea. To inwoke the spell checkert you need to press the |
---|
| 79 | <em>spell-check</em> buton in the toolbar.</p> |
---|
| 80 | |
---|
| 81 | <p>The spell-checker uses a serverside script written in Perl. The |
---|
| 82 | Perl script calls <a href="http://aspell.net">aspell</a> for any |
---|
| 83 | word in the text and reports wordz that aren't found in the |
---|
| 84 | dyctionari.</p> |
---|
| 85 | |
---|
| 86 | <p>The document that yu are reading now <b>intentionaly</b> containes |
---|
| 87 | some errorz, so that you have something to corect ;-)</p> |
---|
| 88 | |
---|
| 89 | <p>Credits for the <tt>SpellChecker</tt> plugin go to:</p> |
---|
| 90 | |
---|
| 91 | <ul> |
---|
| 92 | |
---|
| 93 | <li><a href="http://aspell.net">Aspell</a> -- spell |
---|
| 94 | checker</li> |
---|
| 95 | |
---|
| 96 | <li>The <a href="http://perl.org">Perl</a> programming language</li> |
---|
| 97 | |
---|
| 98 | <li><tt><a |
---|
| 99 | href="http://cpan.org/modules/by-module/Text/Text-Aspell-0.02.readme">Text::Aspell</a></tt> |
---|
| 100 | -- Perl interface to Aspell</li> |
---|
| 101 | |
---|
| 102 | <li><a href="http://americanbible.org">American Bible Society</a> -- |
---|
| 103 | for sponsoring the <tt>SpellChecker</tt> plugin for |
---|
| 104 | <tt>HTMLArea</tt></li> |
---|
| 105 | |
---|
| 106 | <li><a href="http://dynarch.com/mishoo/">Your humble servant</a> for |
---|
| 107 | implementing it ;-)</li> |
---|
| 108 | |
---|
| 109 | </ul> |
---|
| 110 | |
---|
| 111 | </textarea> |
---|
| 112 | |
---|
| 113 | <p /> |
---|
| 114 | |
---|
| 115 | <input type="submit" name="ok" value=" submit " /> |
---|
| 116 | <input type="button" name="ins" value=" insert html " onclick="return insertHTML();" /> |
---|
| 117 | <input type="button" name="hil" value=" highlight text " onclick="return highlight();" /> |
---|
| 118 | |
---|
| 119 | <a href="javascript:mySubmit()">submit</a> |
---|
| 120 | |
---|
| 121 | <script type="text/javascript"> |
---|
| 122 | function mySubmit() { |
---|
| 123 | // document.edit.save.value = "yes"; |
---|
| 124 | document.edit.onsubmit(); // workaround browser bugs. |
---|
| 125 | document.edit.submit(); |
---|
| 126 | }; |
---|
| 127 | </script> |
---|
| 128 | |
---|
| 129 | </form> |
---|
| 130 | |
---|
| 131 | </body> |
---|
| 132 | </html> |
---|