1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
8
* Licensed under the terms of any of the following licenses at your
11
* - GNU General Public License Version 2 or later (the "GPL")
12
* http://www.gnu.org/licenses/gpl.html
14
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
* http://www.gnu.org/licenses/lgpl.html
17
* - Mozilla Public License Version 1.1 or later (the "MPL")
18
* http://www.mozilla.org/MPL/MPL-1.1.html
24
<html xmlns="http://www.w3.org/1999/xhtml">
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">
33
function FCKeditor_OnComplete( editorInstance )
35
var oCombo = document.getElementById( 'cmbSkins' ) ;
37
// Get the active skin.
38
var sSkin = editorInstance.Config['SkinPath'] ;
39
sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
41
oCombo.value = sSkin ;
42
oCombo.style.visibility = '' ;
45
function ChangeLanguage( languageCode )
47
document.location.href = document.location.href.replace( /\?.*$/, '' ) + "?" + languageCode ;
54
FCKeditor - JavaScript - Sample 5</h1>
56
This sample shows how to change the editor skin.
59
<table cellpadding="0" cellspacing="0" border="0">
62
Select the skin to load:
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>
74
<form action="../php/sampleposteddata.php" method="post" target="_blank">
75
<script type="text/javascript">
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')) ;
82
// Get the skin from the URL.
84
if ( document.location.search.length > 1 )
85
sSkin = document.location.search.substr(1) ;
87
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
88
oFCKeditor.BasePath = sBasePath ;
92
var sSkinPath = sBasePath + 'editor/skins/' + sSkin + '/' ;
93
oFCKeditor.Config['SkinPath'] = sSkinPath ;
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.
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' ;
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' ;
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() ;
122
<input type="submit" value="Submit" />