| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 2 | <!-- |
|---|
| 3 | * FCKeditor - The text editor for Internet - http://www.fckeditor.net |
|---|
| 4 | * Copyright (C) 2003-2008 Frederico Caldeira Knabben |
|---|
| 5 | * |
|---|
| 6 | * == BEGIN LICENSE == |
|---|
| 7 | * |
|---|
| 8 | * Licensed under the terms of any of the following licenses at your |
|---|
| 9 | * choice: |
|---|
| 10 | * |
|---|
| 11 | * - GNU General Public License Version 2 or later (the "GPL") |
|---|
| 12 | * http://www.gnu.org/licenses/gpl.html |
|---|
| 13 | * |
|---|
| 14 | * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
|---|
| 15 | * http://www.gnu.org/licenses/lgpl.html |
|---|
| 16 | * |
|---|
| 17 | * - Mozilla Public License Version 1.1 or later (the "MPL") |
|---|
| 18 | * http://www.mozilla.org/MPL/MPL-1.1.html |
|---|
| 19 | * |
|---|
| 20 | * == END LICENSE == |
|---|
| 21 | * |
|---|
| 22 | * Sample page. |
|---|
| 23 | --> |
|---|
| 24 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 25 | <head> |
|---|
| 26 | <title>FCKeditor - Sample</title> |
|---|
| 27 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| 28 | <meta name="robots" content="noindex, nofollow" /> |
|---|
| 29 | <link href="../sample.css" rel="stylesheet" type="text/css" /> |
|---|
| 30 | <script type="text/javascript" src="../../fckeditor.js"></script> |
|---|
| 31 | <script type="text/javascript"> |
|---|
| 32 | |
|---|
| 33 | function FCKeditor_OnComplete( editorInstance ) |
|---|
| 34 | { |
|---|
| 35 | editorInstance.Events.AttachEvent( 'OnBlur' , FCKeditor_OnBlur ) ; |
|---|
| 36 | editorInstance.Events.AttachEvent( 'OnFocus', FCKeditor_OnFocus ) ; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | function FCKeditor_OnBlur( editorInstance ) |
|---|
| 40 | { |
|---|
| 41 | editorInstance.ToolbarSet.Collapse() ; |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | function FCKeditor_OnFocus( editorInstance ) |
|---|
| 45 | { |
|---|
| 46 | editorInstance.ToolbarSet.Expand() ; |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | </script> |
|---|
| 50 | </head> |
|---|
| 51 | <body> |
|---|
| 52 | <h1> |
|---|
| 53 | FCKeditor - JavaScript - Sample 9</h1> |
|---|
| 54 | <div> |
|---|
| 55 | This sample shows FCKeditor in a more complex form with two different instances.<br /> |
|---|
| 56 | It also shows and interesting usage of the "OnFocus" and "OnBlur" events available |
|---|
| 57 | in the JavaScript API. |
|---|
| 58 | </div> |
|---|
| 59 | <hr /> |
|---|
| 60 | <form action="../cfm/sampleposteddata.cfm" method="post" target="_blank" name="testform"> |
|---|
| 61 | Normal text field:<br /> |
|---|
| 62 | <input name="NormaText" value="Plain Text" /> |
|---|
| 63 | <br /> |
|---|
| 64 | <br /> |
|---|
| 65 | |
|---|
| 66 | FCKeditor with Basic toolbar: |
|---|
| 67 | <textarea id="FCKeditor_Basic" name="FCKeditor_Basic">region one</textarea> |
|---|
| 68 | |
|---|
| 69 | <br /> |
|---|
| 70 | FCKeditor with Default toolbar: |
|---|
| 71 | <textarea id="FCKeditor_Default" name="FCKeditor_Default">region two</textarea> |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | <script type="text/javascript"> |
|---|
| 75 | <!-- |
|---|
| 76 | // Automatically calculates the editor base path based on the _samples directory. |
|---|
| 77 | // This is usefull only for these samples. A real application should use something like this: |
|---|
| 78 | // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value. |
|---|
| 79 | var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ; |
|---|
| 80 | |
|---|
| 81 | var oFCKeditor = new FCKeditor( 'FCKeditor_Basic' ) ; |
|---|
| 82 | |
|---|
| 83 | oFCKeditor.Config['ToolbarStartExpanded'] = false ; |
|---|
| 84 | |
|---|
| 85 | oFCKeditor.BasePath = sBasePath ; |
|---|
| 86 | oFCKeditor.ToolbarSet = 'Basic' ; |
|---|
| 87 | oFCKeditor.Value = '<p>This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ; |
|---|
| 88 | oFCKeditor.ReplaceTextarea(); |
|---|
| 89 | //--> |
|---|
| 90 | </script> |
|---|
| 91 | |
|---|
| 92 | <script type="text/javascript"> |
|---|
| 93 | <!-- |
|---|
| 94 | oFCKeditor = new FCKeditor( 'FCKeditor_Default' ) ; |
|---|
| 95 | |
|---|
| 96 | oFCKeditor.Config['ToolbarStartExpanded'] = false ; |
|---|
| 97 | |
|---|
| 98 | oFCKeditor.BasePath = sBasePath ; |
|---|
| 99 | oFCKeditor.Value = '<p>This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ; |
|---|
| 100 | oFCKeditor.ReplaceTextarea(); |
|---|
| 101 | //--> |
|---|
| 102 | </script> |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | <br /> |
|---|
| 107 | <input type="submit" value="Submit (button)" /> |
|---|
| 108 | <input type="button" value="Submit (javascript)" onclick="document.testform.submit()"/> |
|---|
| 109 | </form> |
|---|
| 110 | </body> |
|---|
| 111 | </html> |
|---|