| 1 | <!DOCTYPE BHTML PUBLIC "-//BC//DTD BHTML 3.2 Final//EN"> |
|---|
| 2 | <html> |
|---|
| 3 | <head> |
|---|
| 4 | |
|---|
| 5 | <!-- --------------------------------------------------------------------- |
|---|
| 6 | -- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/ext_example-body.html $ |
|---|
| 7 | -- $LastChangedDate: 2005-07-27 16:43:19 +0200 (Mi, 27 Jul 2005) $ |
|---|
| 8 | -- $LastChangedRevision: 287 $ |
|---|
| 9 | -- $LastChangedBy: gocher $ |
|---|
| 10 | ------------------------------------------------------------------------ --> |
|---|
| 11 | |
|---|
| 12 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| 13 | <title>Example of Xinha</title> |
|---|
| 14 | <link rel="stylesheet" href="full_example.css" /> |
|---|
| 15 | |
|---|
| 16 | <script type="text/javascript"> |
|---|
| 17 | function showError( sMsg, sUrl, sLine){ |
|---|
| 18 | document.getElementById('errors').value += 'Error: ' + sMsg + '\n' + |
|---|
| 19 | 'Source File: ' + sUrl + '\n' + |
|---|
| 20 | 'Line: ' + sLine + '\n'; |
|---|
| 21 | return false; |
|---|
| 22 | } |
|---|
| 23 | var f = top.frames["menu"].document.forms["fsettings"]; |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | _editor_url = document.location.href.replace(/examples\/ext_example-body\.html.*/, '') |
|---|
| 31 | _editor_lang = f.lang[f.lang.selectedIndex].value; |
|---|
| 32 | _editor_skin = f.skin[f.skin.selectedIndex].value; |
|---|
| 33 | </script> |
|---|
| 34 | |
|---|
| 35 | <!-- Load up the actual editor core --> |
|---|
| 36 | <script type="text/javascript" src="../htmlarea.js"></script> |
|---|
| 37 | |
|---|
| 38 | <script type="text/javascript"> |
|---|
| 39 | xinha_editors = null; |
|---|
| 40 | xinha_init = null; |
|---|
| 41 | xinha_config = null; |
|---|
| 42 | xinha_plugins = null; |
|---|
| 43 | |
|---|
| 44 | xinha_init = xinha_init ? xinha_init : function() { |
|---|
| 45 | window.onerror = showError; |
|---|
| 46 | document.onerror = showError; |
|---|
| 47 | |
|---|
| 48 | var f = top.frames["menu"].document.forms["fsettings"]; |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | xinha_plugins = [ ]; |
|---|
| 52 | for(var x = 0; x < f.plugins.length; x++) { |
|---|
| 53 | if(f.plugins[x].checked) xinha_plugins.push(f.plugins[x].value); |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return; |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | var num = 1; |
|---|
| 61 | num = parseInt(f.num.value); |
|---|
| 62 | if(isNaN(num)) { |
|---|
| 63 | num = 1; |
|---|
| 64 | f.num.value = 1; |
|---|
| 65 | } |
|---|
| 66 | var dest = document.getElementById("editors_here"); |
|---|
| 67 | var lipsum = window.parent.menu.document.getElementById('myTextarea0').value; |
|---|
| 68 | |
|---|
| 69 | xinha_editors = [ ] |
|---|
| 70 | for(var x = 0; x < num; x++) { |
|---|
| 71 | var ta = 'myTextarea' + x; |
|---|
| 72 | xinha_editors.push(ta); |
|---|
| 73 | |
|---|
| 74 | var div = document.createElement('div'); |
|---|
| 75 | div.className = 'area_holder'; |
|---|
| 76 | |
|---|
| 77 | var txta = document.createElement('textarea'); |
|---|
| 78 | txta.id = ta; |
|---|
| 79 | txta.name = ta; |
|---|
| 80 | txta.value = lipsum; |
|---|
| 81 | txta.style.width="100%"; |
|---|
| 82 | txta.style.height="420px"; |
|---|
| 83 | |
|---|
| 84 | div.appendChild(txta); |
|---|
| 85 | dest.appendChild(div); |
|---|
| 86 | } |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | settings = top.frames["menu"].settings; |
|---|
| 90 | xinha_config = new HTMLArea.Config(); |
|---|
| 91 | xinha_config.width = settings.width; |
|---|
| 92 | xinha_config.height = settings.height; |
|---|
| 93 | xinha_config.sizeIncludesBars = settings.sizeIncludesBars; |
|---|
| 94 | xinha_config.statusBar = settings.statusBar; |
|---|
| 95 | xinha_config.mozParaHandler = settings.mozParaHandler; |
|---|
| 96 | xinha_config.undoSteps = settings.undoSteps; |
|---|
| 97 | xinha_config.baseHref = settings.baseHref; |
|---|
| 98 | xinha_config.stripBaseHref = settings.stripBaseHref; |
|---|
| 99 | xinha_config.stripSelfNamedAnchors = settings.stripSelfNamedAnchors; |
|---|
| 100 | xinha_config.only7BitPrintablesInURLs = settings.only7BitPrintablesInURLs; |
|---|
| 101 | xinha_config.sevenBitClean = settings.sevenBitClean; |
|---|
| 102 | xinha_config.killWordOnPaste = settings.killWordOnPaste; |
|---|
| 103 | xinha_config.flowToolbars = settings.flowToolbars; |
|---|
| 104 | xinha_config.showLoading = settings.showLoading; |
|---|
| 105 | |
|---|
| 106 | if (typeof CharCounter != 'undefined') { |
|---|
| 107 | xinha_config.CharCounter.showChar = settings.showChar; |
|---|
| 108 | xinha_config.CharCounter.showWord = settings.showWord; |
|---|
| 109 | xinha_config.CharCounter.showHtml = settings.showHtml; |
|---|
| 110 | } |
|---|
| 111 | |
|---|
| 112 | if (typeof CharacterMap != 'undefined') xinha_config.CharacterMap.mode = settings.CharacterMapMode; |
|---|
| 113 | if (typeof ListType != 'undefined') xinha_config.ListType.mode = settings.ListTypeMode; |
|---|
| 114 | |
|---|
| 115 | if(typeof CSS != 'undefined') { |
|---|
| 116 | xinha_config.pageStyle = "@import url(custom.css);"; |
|---|
| 117 | } |
|---|
| 118 | |
|---|
| 119 | if(typeof Stylist != 'undefined') { |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css')); |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | xinha_config.stylistLoadStyles('p.red_text { color:red }'); |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | xinha_config.stylistLoadStyles('p.pink_text { color:pink }', {'p.pink_text' : 'Pretty Pink'}); |
|---|
| 130 | } |
|---|
| 131 | |
|---|
| 132 | if(typeof DynamicCSS != 'undefined') { |
|---|
| 133 | xinha_config.pageStyle = "@import url(dynamic.css);"; |
|---|
| 134 | } |
|---|
| 135 | |
|---|
| 136 | if(typeof InsertWords != 'undefined') { |
|---|
| 137 | |
|---|
| 138 | var keywrds1 = new Object(); |
|---|
| 139 | var keywrds2 = new Object(); |
|---|
| 140 | |
|---|
| 141 | keywrds1['-- Dropdown Label --'] = ''; |
|---|
| 142 | keywrds1['onekey'] = 'onevalue'; |
|---|
| 143 | keywrds1['twokey'] = 'twovalue'; |
|---|
| 144 | keywrds1['threekey'] = 'threevalue'; |
|---|
| 145 | |
|---|
| 146 | keywrds2['-- Insert Keyword --'] = ''; |
|---|
| 147 | keywrds2['Username'] = '%user%'; |
|---|
| 148 | keywrds2['Last login date'] = '%last_login%'; |
|---|
| 149 | xinha_config.InsertWords = { |
|---|
| 150 | combos : [ { options: keywrds1, context: "body" }, |
|---|
| 151 | { options: keywrds2, context: "li" } ] |
|---|
| 152 | } |
|---|
| 153 | } |
|---|
| 154 | |
|---|
| 155 | if(typeof InsertPicture != 'undefined') { |
|---|
| 156 | |
|---|
| 157 | InsertPicture.PicturePath = '/schmal/pictures/'; |
|---|
| 158 | } |
|---|
| 159 | |
|---|
| 160 | if(typeof Filter != 'undefined') { |
|---|
| 161 | xinha_config.Filters = ["Word", "Paragraph"]; |
|---|
| 162 | } |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | |
|---|
| 167 | |
|---|
| 168 | |
|---|
| 169 | |
|---|
| 170 | |
|---|
| 171 | |
|---|
| 172 | xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins); |
|---|
| 173 | |
|---|
| 174 | |
|---|
| 175 | |
|---|
| 176 | |
|---|
| 177 | |
|---|
| 178 | |
|---|
| 179 | |
|---|
| 180 | |
|---|
| 181 | HTMLArea.startEditors(xinha_editors); |
|---|
| 182 | } |
|---|
| 183 | |
|---|
| 184 | |
|---|
| 185 | |
|---|
| 186 | submitHandler = function(formname) { |
|---|
| 187 | var form = document.getElementById(formname); |
|---|
| 188 | |
|---|
| 189 | form.onsubmit(); |
|---|
| 190 | window.parent.menu.document.getElementById('myTextarea0').value = document.getElementById('myTextarea0').value; |
|---|
| 191 | form.submit(); |
|---|
| 192 | return true; |
|---|
| 193 | } |
|---|
| 194 | |
|---|
| 195 | window.onload = xinha_init; |
|---|
| 196 | |
|---|
| 197 | </script> |
|---|
| 198 | </head> |
|---|
| 199 | |
|---|
| 200 | <body> |
|---|
| 201 | <form id="to_submit" name="to_submit" method="post" action="ext_example-dest.php"> |
|---|
| 202 | <div id="editors_here" name="editors_here"></div> |
|---|
| 203 | <button type="button" onclick="submitHandler('to_submit');">Submit</button> |
|---|
| 204 | <textarea id="errors" name="errors" style="width:100%; height:100px; background:silver;"></textarea><!-- style="display:none;" --> |
|---|
| 205 | </form> |
|---|
| 206 | </body> |
|---|
| 207 | </html> |
|---|