[763] | 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 |
---|
| 4 | * Copyright (C) 2003-2006 Frederico Caldeira Knabben |
---|
| 5 | * |
---|
| 6 | * Licensed under the terms of the GNU Lesser General Public License: |
---|
| 7 | * http://www.opensource.org/licenses/lgpl-license.php |
---|
| 8 | * |
---|
| 9 | * For further information visit: |
---|
| 10 | * http://www.fckeditor.net/ |
---|
| 11 | * |
---|
| 12 | * "Support Open Source software. What about a donation today?" |
---|
| 13 | * |
---|
| 14 | * File Name: sample09.html |
---|
| 15 | * Sample page. |
---|
| 16 | * |
---|
| 17 | * File Authors: |
---|
| 18 | * Frederico Caldeira Knabben (fredck@fckeditor.net) |
---|
| 19 | --> |
---|
| 20 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
| 21 | <head> |
---|
| 22 | <title>FCKeditor - Sample</title> |
---|
| 23 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
| 24 | <meta name="robots" content="noindex, nofollow" /> |
---|
| 25 | <link href="../sample.css" rel="stylesheet" type="text/css" /> |
---|
| 26 | <script type="text/javascript" src="../../fckeditor.js"></script> |
---|
| 27 | <script type="text/javascript"> |
---|
| 28 | |
---|
| 29 | function FCKeditor_OnComplete( editorInstance ) |
---|
| 30 | { |
---|
| 31 | editorInstance.Events.AttachEvent( 'OnBlur' , FCKeditor_OnBlur ) ; |
---|
| 32 | editorInstance.Events.AttachEvent( 'OnFocus', FCKeditor_OnFocus ) ; |
---|
| 33 | } |
---|
| 34 | |
---|
| 35 | function FCKeditor_OnBlur( editorInstance ) |
---|
| 36 | { |
---|
| 37 | editorInstance.ToolbarSet.Collapse() ; |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | function FCKeditor_OnFocus( editorInstance ) |
---|
| 41 | { |
---|
| 42 | editorInstance.ToolbarSet.Expand() ; |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | </script> |
---|
| 46 | </head> |
---|
| 47 | <body> |
---|
| 48 | <h1> |
---|
| 49 | FCKeditor - JavaScript - Sample 9</h1> |
---|
| 50 | <div> |
---|
| 51 | This sample shows FCKeditor in a more complex form with two different instances.<br /> |
---|
| 52 | It also shows and interesting usage of the "OnFocus" and "OnBlur" events available |
---|
| 53 | in the JavaScript API. |
---|
| 54 | </div> |
---|
| 55 | <hr /> |
---|
| 56 | <form action="sampleposteddata.asp" method="post" target="_blank"> |
---|
| 57 | Normal text field:<br /> |
---|
| 58 | <input name="NormaText" value="Plain Text" /> |
---|
| 59 | <br /> |
---|
| 60 | <br /> |
---|
| 61 | FCKeditor with Basic toolbar: |
---|
| 62 | <script type="text/javascript"> |
---|
| 63 | <!-- |
---|
| 64 | // Automatically calculates the editor base path based on the _samples directory. |
---|
| 65 | // This is usefull only for these samples. A real application should use something like this: |
---|
| 66 | // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value. |
---|
| 67 | var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ; |
---|
| 68 | |
---|
| 69 | var oFCKeditor = new FCKeditor( 'FCKeditor_Basic' ) ; |
---|
| 70 | |
---|
| 71 | oFCKeditor.Config['ToolbarStartExpanded'] = false ; |
---|
| 72 | |
---|
| 73 | oFCKeditor.BasePath = sBasePath ; |
---|
| 74 | oFCKeditor.ToolbarSet = 'Basic' ; |
---|
| 75 | oFCKeditor.Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ; |
---|
| 76 | oFCKeditor.Create() ; |
---|
| 77 | //--> |
---|
| 78 | </script> |
---|
| 79 | <br /> |
---|
| 80 | FCKeditor with Default toolbar: |
---|
| 81 | <script type="text/javascript"> |
---|
| 82 | <!-- |
---|
| 83 | oFCKeditor = new FCKeditor( 'FCKeditor_Default' ) ; |
---|
| 84 | |
---|
| 85 | oFCKeditor.Config['ToolbarStartExpanded'] = false ; |
---|
| 86 | |
---|
| 87 | oFCKeditor.BasePath = sBasePath ; |
---|
| 88 | oFCKeditor.Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ; |
---|
| 89 | oFCKeditor.Create() ; |
---|
| 90 | //--> |
---|
| 91 | </script> |
---|
| 92 | <br /> |
---|
| 93 | <input type="submit" value="Submit" /> |
---|
| 94 | </form> |
---|
| 95 | </body> |
---|
| 96 | </html> |
---|