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-2009 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 | var oCombo = document.getElementById( 'cmbToolbars' ) ;
|
---|
36 | oCombo.value = editorInstance.ToolbarSet.Name ;
|
---|
37 | oCombo.style.visibility = '' ;
|
---|
38 | }
|
---|
39 |
|
---|
40 | function ChangeLanguage( languageCode )
|
---|
41 | {
|
---|
42 | document.location.href = document.location.href.replace( /\?.*$/, '' ) + "?" + languageCode ;
|
---|
43 | }
|
---|
44 |
|
---|
45 | </script>
|
---|
46 | </head>
|
---|
47 | <body>
|
---|
48 | <h1>
|
---|
49 | FCKeditor - JavaScript - Sample 4</h1>
|
---|
50 | <div>
|
---|
51 | This sample shows how to change the editor toolbar.
|
---|
52 | </div>
|
---|
53 | <hr />
|
---|
54 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
55 | <tr>
|
---|
56 | <td>
|
---|
57 | Select the toolbar to load:
|
---|
58 | </td>
|
---|
59 | <td>
|
---|
60 | <select id="cmbToolbars" onchange="ChangeLanguage(this.value);" style="visibility: hidden">
|
---|
61 | <option value="Default" selected="selected">Default</option>
|
---|
62 | <option value="Basic">Basic</option>
|
---|
63 | </select>
|
---|
64 | </td>
|
---|
65 | </tr>
|
---|
66 | </table>
|
---|
67 | <br />
|
---|
68 | <form action="../php/sampleposteddata.php" method="post" target="_blank">
|
---|
69 | <script type="text/javascript">
|
---|
70 | <!--
|
---|
71 | // Automatically calculates the editor base path based on the _samples directory.
|
---|
72 | // This is usefull only for these samples. A real application should use something like this:
|
---|
73 | // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
|
---|
74 | var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ;
|
---|
75 |
|
---|
76 | // Get the toolbar from the URL.
|
---|
77 | var sToolbar ;
|
---|
78 | if ( document.location.search.length > 1 )
|
---|
79 | sToolbar = document.location.search.substr(1) ;
|
---|
80 |
|
---|
81 | var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
|
---|
82 | oFCKeditor.BasePath = sBasePath ;
|
---|
83 |
|
---|
84 | if ( sToolbar != null )
|
---|
85 | oFCKeditor.ToolbarSet = sToolbar ;
|
---|
86 |
|
---|
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.Create() ;
|
---|
89 | //-->
|
---|
90 | </script>
|
---|
91 | <br />
|
---|
92 | <input type="submit" value="Submit" />
|
---|
93 | </form>
|
---|
94 | </body>
|
---|
95 | </html>
|
---|