| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 |
|
| 3 |
<!-- |
| 4 |
|
| 5 |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
| 6 |
|
| 7 |
* Copyright (C) 2003-2009 Frederico Caldeira Knabben |
| 8 |
|
| 9 |
* |
| 10 |
|
| 11 |
* == BEGIN LICENSE == |
| 12 |
|
| 13 |
* |
| 14 |
|
| 15 |
* Licensed under the terms of any of the following licenses at your |
| 16 |
|
| 17 |
* choice: |
| 18 |
|
| 19 |
* |
| 20 |
|
| 21 |
* - GNU General Public License Version 2 or later (the "GPL") |
| 22 |
|
| 23 |
* http://www.gnu.org/licenses/gpl.html |
| 24 |
|
| 25 |
* |
| 26 |
|
| 27 |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
| 28 |
|
| 29 |
* http://www.gnu.org/licenses/lgpl.html |
| 30 |
|
| 31 |
* |
| 32 |
|
| 33 |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
| 34 |
|
| 35 |
* http://www.mozilla.org/MPL/MPL-1.1.html |
| 36 |
|
| 37 |
* |
| 38 |
|
| 39 |
* == END LICENSE == |
| 40 |
|
| 41 |
* |
| 42 |
|
| 43 |
* Sample page. |
| 44 |
|
| 45 |
--> |
| 46 |
|
| 47 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 48 |
|
| 49 |
<head> |
| 50 |
|
| 51 |
<title>FCKeditor - Sample</title> |
| 52 |
|
| 53 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 54 |
|
| 55 |
<meta name="robots" content="noindex, nofollow" /> |
| 56 |
|
| 57 |
<link href="../sample.css" rel="stylesheet" type="text/css" /> |
| 58 |
|
| 59 |
<script type="text/javascript" src="../../fckeditor.js"></script> |
| 60 |
|
| 61 |
<script type="text/javascript"> |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
function FCKeditor_OnComplete( editorInstance ) |
| 66 |
|
| 67 |
{ |
| 68 |
|
| 69 |
editorInstance.Events.AttachEvent( 'OnBlur' , FCKeditor_OnBlur ) ; |
| 70 |
|
| 71 |
editorInstance.Events.AttachEvent( 'OnFocus', FCKeditor_OnFocus ) ; |
| 72 |
|
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
function FCKeditor_OnBlur( editorInstance ) |
| 78 |
|
| 79 |
{ |
| 80 |
|
| 81 |
editorInstance.ToolbarSet.Collapse() ; |
| 82 |
|
| 83 |
} |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
function FCKeditor_OnFocus( editorInstance ) |
| 88 |
|
| 89 |
{ |
| 90 |
|
| 91 |
editorInstance.ToolbarSet.Expand() ; |
| 92 |
|
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
</script> |
| 98 |
|
| 99 |
</head> |
| 100 |
|
| 101 |
<body> |
| 102 |
|
| 103 |
<h1> |
| 104 |
|
| 105 |
FCKeditor - JavaScript - Sample 9</h1> |
| 106 |
|
| 107 |
<div> |
| 108 |
|
| 109 |
This sample shows FCKeditor in a more complex form with two different instances.<br /> |
| 110 |
|
| 111 |
It also shows and interesting usage of the "OnFocus" and "OnBlur" events available |
| 112 |
|
| 113 |
in the JavaScript API. |
| 114 |
|
| 115 |
</div> |
| 116 |
|
| 117 |
<hr /> |
| 118 |
|
| 119 |
<form action="../php/sampleposteddata.php" method="post" target="_blank"> |
| 120 |
|
| 121 |
Normal text field:<br /> |
| 122 |
|
| 123 |
<input name="NormaText" value="Plain Text" /> |
| 124 |
|
| 125 |
<br /> |
| 126 |
|
| 127 |
<br /> |
| 128 |
|
| 129 |
FCKeditor with Basic toolbar: |
| 130 |
|
| 131 |
<script type="text/javascript"> |
| 132 |
|
| 133 |
<!-- |
| 134 |
|
| 135 |
// Automatically calculates the editor base path based on the _samples directory. |
| 136 |
|
| 137 |
// This is usefull only for these samples. A real application should use something like this: |
| 138 |
|
| 139 |
// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value. |
| 140 |
|
| 141 |
var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ; |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
var oFCKeditor = new FCKeditor( 'FCKeditor_Basic' ) ; |
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
oFCKeditor.Config['ToolbarStartExpanded'] = false ; |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
oFCKeditor.BasePath = sBasePath ; |
| 154 |
|
| 155 |
oFCKeditor.ToolbarSet = 'Basic' ; |
| 156 |
|
| 157 |
oFCKeditor.Value = '<p>This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ; |
| 158 |
|
| 159 |
oFCKeditor.Create() ; |
| 160 |
|
| 161 |
//--> |
| 162 |
|
| 163 |
</script> |
| 164 |
|
| 165 |
<br /> |
| 166 |
|
| 167 |
FCKeditor with Default toolbar: |
| 168 |
|
| 169 |
<script type="text/javascript"> |
| 170 |
|
| 171 |
<!-- |
| 172 |
|
| 173 |
oFCKeditor = new FCKeditor( 'FCKeditor_Default' ) ; |
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
oFCKeditor.Config['ToolbarStartExpanded'] = false ; |
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
oFCKeditor.BasePath = sBasePath ; |
| 182 |
|
| 183 |
oFCKeditor.Value = '<p>This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ; |
| 184 |
|
| 185 |
oFCKeditor.Create() ; |
| 186 |
|
| 187 |
//--> |
| 188 |
|
| 189 |
</script> |
| 190 |
|
| 191 |
<br /> |
| 192 |
|
| 193 |
<input type="submit" value="Submit" /> |
| 194 |
|
| 195 |
</form> |
| 196 |
|
| 197 |
</body> |
| 198 |
|
| 199 |
</html> |
| 200 |
|
| 201 |
|