2
* FCKeditor - The text editor for internet
3
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
5
* Licensed under the terms of the GNU Lesser General Public License:
6
* http://www.opensource.org/licenses/lgpl-license.php
8
* For further information visit:
9
* http://www.fckeditor.net/
11
* "Support Open Source software. What about a donation today?"
13
* File Name: sample04.html
17
* Frederico Caldeira Knabben (fredck@fckeditor.net)
19
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
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">
29
function FCKeditor_OnComplete( editorInstance )
31
var oCombo = document.getElementById( 'cmbToolbars' ) ;
32
oCombo.value = editorInstance.ToolbarSet.Name ;
33
oCombo.style.visibility = '' ;
36
function ChangeLanguage( languageCode )
38
window.location.href = window.location.pathname + "?" + languageCode ;
44
<h1>FCKeditor - Javascript - Sample 4</h1>
45
This sample shows how to change the editor toolbar.
47
<table cellpadding="0" cellspacing="0" border="0">
50
Select the toolbar to load:
53
<select id="cmbToolbars" onchange="ChangeLanguage(this.value);" style="VISIBILITY: hidden">
54
<option value="Default" selected>Default</option>
55
<option value="Basic">Basic</option>
61
<form action="sampleposteddata.asp" method="post" target="_blank">
62
<script type="text/javascript">
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/')+1) ;
69
// Get the toolbar from the URL.
71
if ( document.location.search.length > 1 )
72
sToolbar = document.location.search.substr(1) ;
74
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
75
oFCKeditor.BasePath = sBasePath ;
77
if ( sToolbar != null )
78
oFCKeditor.ToolbarSet = sToolbar ;
80
oFCKeditor.Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ;
85
<input type="submit" value="Submit">