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-2007 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
var bIsLoaded = false ;
35
function FCKeditor_OnComplete( editorInstance )
40
var oCombo = document.getElementById( 'cmbLanguages' ) ;
42
var aLanguages = new Array() ;
44
for ( code in editorInstance.Language.AvailableLanguages )
45
aLanguages.push( { Code : code, Name : editorInstance.Language.AvailableLanguages[code] } ) ;
47
aLanguages.sort( SortLanguage ) ;
49
for ( var i = 0 ; i < aLanguages.length ; i++ )
50
AddComboOption( oCombo, aLanguages[i].Name + ' (' + aLanguages[i].Code + ')', aLanguages[i].Code ) ;
52
oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
54
document.getElementById('eNumLangs').innerHTML = '(' + aLanguages.length + ' languages available!)' ;
59
function SortLanguage( langA, langB )
61
return ( langA.Name < langB.Name ? -1 : langA.Name > langB.Name ? 1 : 0 ) ;
64
function AddComboOption(combo, optionText, optionValue)
66
var oOption = document.createElement("OPTION") ;
68
combo.options.add(oOption) ;
70
oOption.innerHTML = optionText ;
71
oOption.value = optionValue ;
76
function ChangeLanguage( languageCode )
78
window.location.href = window.location.pathname + "?" + languageCode ;
84
FCKeditor - JavaScript - Sample 3</h1>
86
This sample shows the editor in all its available languages.
89
<table cellpadding="0" cellspacing="0" border="0">
92
Select a language:
95
<select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
99
<span id="eNumLangs"></span>
104
<form action="sampleposteddata.asp" method="post" target="_blank">
105
<script type="text/javascript">
107
// Automatically calculates the editor base path based on the _samples directory.
108
// This is usefull only for these samples. A real application should use something like this:
109
// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
110
var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
113
if ( document.location.search.length > 1 )
114
sLang = document.location.search.substr(1) ;
116
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
117
oFCKeditor.BasePath = sBasePath ;
120
oFCKeditor.Config["AutoDetectLanguage"] = true ;
121
oFCKeditor.Config["DefaultLanguage"] = "en" ;
125
oFCKeditor.Config["AutoDetectLanguage"] = false ;
126
oFCKeditor.Config["DefaultLanguage"] = sLang ;
128
oFCKeditor.Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ;
129
oFCKeditor.Create() ;
133
<input type="submit" value="Submit" />