1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3
* FCKeditor - The text editor for internet
4
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
6
* Licensed under the terms of the GNU Lesser General Public License:
7
* http://www.opensource.org/licenses/lgpl-license.php
9
* For further information visit:
10
* http://www.fckeditor.net/
12
* "Support Open Source software. What about a donation today?"
18
* Frederico Caldeira Knabben (fredck@fckeditor.net)
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="testcases.css" rel="stylesheet" type="text/css">
26
<script type="text/javascript" src="../fckeditor.js"></script>
29
function FCKeditor_OnComplete( editorInstance )
31
// Attach to the event fired when the editor's HTML is set.
32
editorInstance.Events.AttachEvent( 'OnAfterSetHTML', FCKeditor_OnAfterSetHTML ) ;
35
function FCKeditor_OnAfterSetHTML( editorInstance )
37
// Get the actual color from the combo.
38
var sColor = document.getElementById('ActualColor').value ;
40
// Set the color of the editor instance.
41
editorInstance.EditorDocument.body.style.backgroundColor = sColor ;
44
function SetActualColor()
46
// Get the editor instance that we want to interact with.
47
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
49
// Call the event function to set the color.
50
FCKeditor_OnAfterSetHTML( oEditor ) ;
56
<h1>FCKeditor - Test 009</h1>
58
<STRONG>Expected results</STRONG> : The user should be able to background color
59
of the editor by code.<BR>
60
<STRONG>Configurations</STRONG>: Default<BR>
61
<STRONG>Steps to Reproduce</STRONG>:
65
Wait the editor to load.
69
Change the background color using the combo.
73
Switch to source view.
75
Switch back to WYSIWYG. The background color must be the same.
79
Submit the form.</LI></OL>
83
Select a color for the background:<br>
84
<select id="ActualColor" onchange="SetActualColor();">
85
<option value="white" selected>White</option>
86
<option value="red">Red</option>
87
<option value="green">Green</option>
88
<option value="gold">Gold</option>
91
<form action="sampleposteddata.asp" method="post" target="_blank">
92
<script type="text/javascript">
94
// Automatically calculates the editor base path based on the _samples directory.
95
// This is usefull only for these samples. A real application should use something like this:
96
// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
97
var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_testcases')) ;
99
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
100
oFCKeditor.BasePath = sBasePath ;
101
oFCKeditor.Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ;
102
oFCKeditor.Create() ;
106
<input type="submit" value="Submit">