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( 'cmbSkins' ) ;
|
---|
36 |
|
---|
37 | // Get the active skin.
|
---|
38 | var sSkin = editorInstance.Config['SkinPath'] ;
|
---|
39 | sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
|
---|
40 |
|
---|
41 | oCombo.value = sSkin ;
|
---|
42 | oCombo.style.visibility = '' ;
|
---|
43 | }
|
---|
44 |
|
---|
45 | function ChangeLanguage( languageCode )
|
---|
46 | {
|
---|
47 | document.location.href = document.location.href.replace( /\?.*$/, '' ) + "?" + languageCode ;
|
---|
48 | }
|
---|
49 |
|
---|
50 | </script>
|
---|
51 | </head>
|
---|
52 | <body>
|
---|
53 | <h1>
|
---|
54 | FCKeditor - JavaScript - Sample 5</h1>
|
---|
55 | <div>
|
---|
56 | This sample shows how to change the editor skin.
|
---|
57 | </div>
|
---|
58 | <hr />
|
---|
59 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
60 | <tr>
|
---|
61 | <td>
|
---|
62 | Select the skin to load:
|
---|
63 | </td>
|
---|
64 | <td>
|
---|
65 | <select id="cmbSkins" onchange="ChangeLanguage(this.value);" style="visibility: hidden">
|
---|
66 | <option value="default" selected="selected">Default</option>
|
---|
67 | <option value="office2003">Office 2003</option>
|
---|
68 | <option value="silver">Silver</option>
|
---|
69 | </select>
|
---|
70 | </td>
|
---|
71 | </tr>
|
---|
72 | </table>
|
---|
73 | <br />
|
---|
74 | <form action="../php/sampleposteddata.php" method="post" target="_blank">
|
---|
75 | <script type="text/javascript">
|
---|
76 | <!--
|
---|
77 | // Automatically calculates the editor base path based on the _samples directory.
|
---|
78 | // This is usefull only for these samples. A real application should use something like this:
|
---|
79 | // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
|
---|
80 | var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ;
|
---|
81 |
|
---|
82 | // Get the skin from the URL.
|
---|
83 | var sSkin ;
|
---|
84 | if ( document.location.search.length > 1 )
|
---|
85 | sSkin = document.location.search.substr(1) ;
|
---|
86 |
|
---|
87 | var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
|
---|
88 | oFCKeditor.BasePath = sBasePath ;
|
---|
89 |
|
---|
90 | if ( sSkin != null )
|
---|
91 | {
|
---|
92 | var sSkinPath = sBasePath + 'editor/skins/' + sSkin + '/' ;
|
---|
93 | oFCKeditor.Config['SkinPath'] = sSkinPath ;
|
---|
94 |
|
---|
95 | // The following switch is optional. It is done to enhance the loading
|
---|
96 | // time of the toolbar, by preloading the images used on it.
|
---|
97 | switch ( sSkin )
|
---|
98 | {
|
---|
99 | case 'office2003' :
|
---|
100 | oFCKeditor.Config['PreloadImages'] =
|
---|
101 | sSkinPath + 'images/toolbar.start.gif' + ';' +
|
---|
102 | sSkinPath + 'images/toolbar.end.gif' + ';' +
|
---|
103 | sSkinPath + 'images/toolbar.bg.gif' + ';' +
|
---|
104 | sSkinPath + 'images/toolbar.buttonarrow.gif' ;
|
---|
105 | break ;
|
---|
106 |
|
---|
107 | case 'silver' :
|
---|
108 | oFCKeditor.Config['PreloadImages'] =
|
---|
109 | sSkinPath + 'images/toolbar.start.gif' + ';' +
|
---|
110 | sSkinPath + 'images/toolbar.end.gif' + ';' +
|
---|
111 | sSkinPath + 'images/toolbar.buttonbg.gif' + ';' +
|
---|
112 | sSkinPath + 'images/toolbar.buttonarrow.gif' ;
|
---|
113 | break ;
|
---|
114 | }
|
---|
115 | }
|
---|
116 |
|
---|
117 | oFCKeditor.Value = '<p>This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ;
|
---|
118 | oFCKeditor.Create() ;
|
---|
119 | //-->
|
---|
120 | </script>
|
---|
121 | <br />
|
---|
122 | <input type="submit" value="Submit" />
|
---|
123 | </form>
|
---|
124 | </body>
|
---|
125 | </html>
|
---|