1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
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
22
* Color Selection dialog window.
26
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
27
<meta name="robots" content="noindex, nofollow" />
28
<style TYPE="text/css">
29
#ColorTable { cursor: pointer ; cursor: hand ; }
30
#hicolor { height: 74px ; width: 74px ; border-width: 1px ; border-style: solid ; }
31
#hicolortext { width: 75px ; text-align: right ; margin-bottom: 7px ; }
32
#selhicolor { height: 20px ; width: 74px ; border-width: 1px ; border-style: solid ; }
33
#selcolor { width: 75px ; height: 20px ; margin-top: 0px ; margin-bottom: 7px ; }
34
#btnClear { width: 75px ; height: 22px ; margin-bottom: 6px ; }
35
.ColorCell { height: 15px ; width: 15px ; }
37
<script type="text/javascript">
39
var oEditor = window.parent.InnerDialogLoaded() ;
43
// First of all, translate the dialog box texts
44
oEditor.FCKLanguageManager.TranslatePage(document) ;
48
window.parent.SetOkButton( true ) ;
49
window.parent.SetAutoSize( true ) ;
52
function CreateColorTable()
54
// Get the target table.
55
var oTable = document.getElementById('ColorTable') ;
57
// Create the base colors array.
58
var aColors = ['00','33','66','99','cc','ff'] ;
60
// This function combines two ranges of three values from the color array into a row.
61
function AppendColorRow( rangeA, rangeB )
63
for ( var i = rangeA ; i < rangeA + 3 ; i++ )
65
var oRow = oTable.insertRow(-1) ;
67
for ( var j = rangeB ; j < rangeB + 3 ; j++ )
69
for ( var n = 0 ; n < 6 ; n++ )
71
AppendColorCell( oRow, '#' + aColors[j] + aColors[n] + aColors[i] ) ;
77
// This function create a single color cell in the color table.
78
function AppendColorCell( targetRow, color )
80
var oCell = targetRow.insertCell(-1) ;
81
oCell.className = 'ColorCell' ;
82
oCell.bgColor = color ;
84
oCell.onmouseover = function()
86
document.getElementById('hicolor').style.backgroundColor = this.bgColor ;
87
document.getElementById('hicolortext').innerHTML = this.bgColor ;
90
oCell.onclick = function()
92
document.getElementById('selhicolor').style.backgroundColor = this.bgColor ;
93
document.getElementById('selcolor').value = this.bgColor ;
97
AppendColorRow( 0, 0 ) ;
98
AppendColorRow( 3, 0 ) ;
99
AppendColorRow( 0, 3 ) ;
100
AppendColorRow( 3, 3 ) ;
102
// Create the last row.
103
var oRow = oTable.insertRow(-1) ;
105
// Create the gray scale colors cells.
106
for ( var n = 0 ; n < 6 ; n++ )
108
AppendColorCell( oRow, '#' + aColors[n] + aColors[n] + aColors[n] ) ;
111
// Fill the row with black cells.
112
for ( var i = 0 ; i < 12 ; i++ )
114
AppendColorCell( oRow, '#000000' ) ;
120
document.getElementById('selhicolor').style.backgroundColor = '' ;
121
document.getElementById('selcolor').value = '' ;
124
function ClearActual()
126
document.getElementById('hicolor').style.backgroundColor = '' ;
127
document.getElementById('hicolortext').innerHTML = ' ' ;
130
function UpdateColor()
132
try { document.getElementById('selhicolor').style.backgroundColor = document.getElementById('selcolor').value ; }
133
catch (e) { Clear() ; }
138
if ( typeof(window.parent.dialogArguments.CustomValue) == 'function' )
139
window.parent.dialogArguments.CustomValue( document.getElementById('selcolor').value ) ;
145
<body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
146
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
148
<td align="center" valign="middle">
149
<table border="0" cellspacing="5" cellpadding="0" width="100%">
151
<td valign="top" align="center" nowrap width="100%">
152
<table id="ColorTable" border="0" cellspacing="0" cellpadding="0" width="270" onmouseout="ClearActual();">
155
<td valign="top" align="left" nowrap>
156
<span fckLang="DlgColorHighlight">Highlight</span>
157
<div id="hicolor"></div>
158
<div id="hicolortext"> </div>
159
<span fckLang="DlgColorSelected">Selected</span>
160
<div id="selhicolor"></div>
161
<input id="selcolor" type="text" maxlength="20" onchange="UpdateColor();">
163
<input id="btnClear" type="button" fckLang="DlgColorBtnClear" value="Clear" onclick="Clear();" />