| 1 | <?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 | <!DOCTYPE html |
|---|
| 3 | PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
|---|
| 4 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|---|
| 5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|---|
| 6 | <head> |
|---|
| 7 | |
|---|
| 8 | <!--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- |
|---|
| 9 | -- Xinha example usage. This file shows how a developer might make use of |
|---|
| 10 | -- Xinha, it forms the primary example file for the entire Xinha project. |
|---|
| 11 | -- This file can be copied and used as a template for development by the |
|---|
| 12 | -- end developer who should simply removed the area indicated at the bottom |
|---|
| 13 | -- of the file to remove the auto-example-generating code and allow for the |
|---|
| 14 | -- use of the file as a boilerplate. |
|---|
| 15 | -- |
|---|
| 16 | -- $HeadURL$ |
|---|
| 17 | -- $LastChangedDate$ |
|---|
| 18 | -- $LastChangedRevision$ |
|---|
| 19 | -- $LastChangedBy$ |
|---|
| 20 | ---------------------------------------------------------------------------> |
|---|
| 21 | |
|---|
| 22 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| 23 | <title>Example of Xinha</title> |
|---|
| 24 | <link rel="stylesheet" href="files/full_example.css" /> |
|---|
| 25 | |
|---|
| 26 | <script type="text/javascript"> |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | _editor_url = document.location.href.replace(/examples\/.*/, '') |
|---|
| 34 | _editor_lang = "en"; |
|---|
| 35 | </script> |
|---|
| 36 | |
|---|
| 37 | <!-- Load up the actual editor core --> |
|---|
| 38 | <script type="text/javascript" src="../XinhaCore.js"></script> |
|---|
| 39 | |
|---|
| 40 | <script type="text/javascript"> |
|---|
| 41 | xinha_editors = null; |
|---|
| 42 | xinha_init = null; |
|---|
| 43 | xinha_config = null; |
|---|
| 44 | xinha_plugins = null; |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | xinha_init = xinha_init ? xinha_init : function() |
|---|
| 48 | { |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | xinha_plugins = xinha_plugins ? xinha_plugins : |
|---|
| 56 | [ |
|---|
| 57 | 'CharacterMap', 'SpellChecker', 'Linker', 'ContextMenu' |
|---|
| 58 | ]; |
|---|
| 59 | |
|---|
| 60 | if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | xinha_editors = xinha_editors ? xinha_editors : |
|---|
| 68 | [ |
|---|
| 69 | 'myTextArea' |
|---|
| 70 | ]; |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | xinha_config = xinha_config ? xinha_config : new Xinha.Config(); |
|---|
| 86 | xinha_config.fullPage = true; |
|---|
| 87 | xinha_config.CharacterMap.mode = 'panel'; |
|---|
| 88 | xinha_config.ContextMenu.customHooks = { 'a': [ ['Label', function() { alert('Action'); }, 'Tooltip', '/xinha/images/ed_copy.gif' ] ] } |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); |
|---|
| 119 | |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | |
|---|
| 131 | |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | |
|---|
| 136 | Xinha.startEditors(xinha_editors); |
|---|
| 137 | window.onload = null; |
|---|
| 138 | } |
|---|
| 139 | |
|---|
| 140 | window.onload = xinha_init; |
|---|
| 141 | </script> |
|---|
| 142 | </head> |
|---|
| 143 | |
|---|
| 144 | <body> |
|---|
| 145 | |
|---|
| 146 | <form action="javascript:void(0);" id="editors_here" onsubmit="alert(this.myTextArea.value);"> |
|---|
| 147 | <div> |
|---|
| 148 | <textarea id="myTextArea" name="myTextArea" style="width:100%;height:320px;"> |
|---|
| 149 | <html> |
|---|
| 150 | <head> |
|---|
| 151 | <title>Hello</title> |
|---|
| 152 | <style type="text/css"> |
|---|
| 153 | li { color:red; } |
|---|
| 154 | </style> |
|---|
| 155 | </head> |
|---|
| 156 | <body><span style="color:purple"> |
|---|
| 157 | <img src="../images/xinha_logo.gif" usemap="#m1"> |
|---|
| 158 | <map name="m1"> |
|---|
| 159 | <area shape="rect" coords="137,101,255,124" href="http://www.mydomain.com"> |
|---|
| 160 | </map> |
|---|
| 161 | |
|---|
| 162 | <p> |
|---|
| 163 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. |
|---|
| 164 | Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis |
|---|
| 165 | velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique |
|---|
| 166 | ante elementum turpis. <span style="color:green">Aliquam </span> nisl. Nulla posuere neque non |
|---|
| 167 | tellus. Morbi vel nibh. <font face="Arial"><font color="#009933">Cum sociis natoque</font></font> penatibus et magnis dis |
|---|
| 168 | parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi. |
|---|
| 169 | Curabitur pharetra bibendum lectus. |
|---|
| 170 | </p> |
|---|
| 171 | |
|---|
| 172 | <ul> |
|---|
| 173 | <li style="color:green"> Phasellus et massa sed diam viverra semper. </li> |
|---|
| 174 | <li> Mauris tincidunt felis in odio. </li> |
|---|
| 175 | <li> Nulla placerat nunc ut pede. </li> |
|---|
| 176 | <li> Vivamus ultrices mi sit amet urna. </li> |
|---|
| 177 | <li> Quisque sed augue quis nunc laoreet volutpat.</li> |
|---|
| 178 | <li> Nunc sit amet metus in tortor semper mattis. </li> |
|---|
| 179 | </ul> |
|---|
| 180 | </span></body> |
|---|
| 181 | </html> |
|---|
| 182 | </textarea> |
|---|
| 183 | |
|---|
| 184 | <input type="submit" /> <input type="reset" /> |
|---|
| 185 | </div> |
|---|
| 186 | </form> |
|---|
| 187 | <script type="text/javascript"> |
|---|
| 188 | document.write(document.compatMode); |
|---|
| 189 | </script> |
|---|
| 190 | <div> |
|---|
| 191 | <a href="#" onclick="xinha_editors.myTextArea.hidePanels();">Hide</a> |
|---|
| 192 | <a href="#" onclick="xinha_editors.myTextArea.showPanels();">Show</a> |
|---|
| 193 | </div> |
|---|
| 194 | |
|---|
| 195 | </body> |
|---|
| 196 | </html> |
|---|