1921 |
jp_milcent |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
|
1075 |
ddelon |
2 |
<!--
|
1921 |
jp_milcent |
3 |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
|
|
4 |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
|
|
5 |
*
|
|
|
6 |
* == BEGIN LICENSE ==
|
|
|
7 |
*
|
|
|
8 |
* Licensed under the terms of any of the following licenses at your
|
|
|
9 |
* choice:
|
|
|
10 |
*
|
|
|
11 |
* - GNU General Public License Version 2 or later (the "GPL")
|
|
|
12 |
* http://www.gnu.org/licenses/gpl.html
|
|
|
13 |
*
|
|
|
14 |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
|
|
15 |
* http://www.gnu.org/licenses/lgpl.html
|
|
|
16 |
*
|
|
|
17 |
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
|
|
18 |
* http://www.mozilla.org/MPL/MPL-1.1.html
|
|
|
19 |
*
|
|
|
20 |
* == END LICENSE ==
|
|
|
21 |
*
|
|
|
22 |
* Color Selection dialog window.
|
1075 |
ddelon |
23 |
-->
|
|
|
24 |
<html>
|
|
|
25 |
<head>
|
|
|
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 ; }
|
|
|
36 |
</style>
|
1921 |
jp_milcent |
37 |
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
|
1075 |
ddelon |
38 |
<script type="text/javascript">
|
1921 |
jp_milcent |
39 |
|
1075 |
ddelon |
40 |
var oEditor = window.parent.InnerDialogLoaded() ;
|
|
|
41 |
|
|
|
42 |
function OnLoad()
|
|
|
43 |
{
|
|
|
44 |
// First of all, translate the dialog box texts
|
|
|
45 |
oEditor.FCKLanguageManager.TranslatePage(document) ;
|
1921 |
jp_milcent |
46 |
|
1075 |
ddelon |
47 |
CreateColorTable() ;
|
1921 |
jp_milcent |
48 |
|
|
|
49 |
window.parent.SetOkButton( true ) ;
|
1075 |
ddelon |
50 |
window.parent.SetAutoSize( true ) ;
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
function CreateColorTable()
|
|
|
54 |
{
|
|
|
55 |
// Get the target table.
|
|
|
56 |
var oTable = document.getElementById('ColorTable') ;
|
|
|
57 |
|
|
|
58 |
// Create the base colors array.
|
|
|
59 |
var aColors = ['00','33','66','99','cc','ff'] ;
|
|
|
60 |
|
|
|
61 |
// This function combines two ranges of three values from the color array into a row.
|
|
|
62 |
function AppendColorRow( rangeA, rangeB )
|
|
|
63 |
{
|
1921 |
jp_milcent |
64 |
for ( var i = rangeA ; i < rangeA + 3 ; i++ )
|
|
|
65 |
{
|
|
|
66 |
var oRow = oTable.insertRow(-1) ;
|
1075 |
ddelon |
67 |
|
1921 |
jp_milcent |
68 |
for ( var j = rangeB ; j < rangeB + 3 ; j++ )
|
|
|
69 |
{
|
|
|
70 |
for ( var n = 0 ; n < 6 ; n++ )
|
|
|
71 |
{
|
|
|
72 |
AppendColorCell( oRow, '#' + aColors[j] + aColors[n] + aColors[i] ) ;
|
|
|
73 |
}
|
|
|
74 |
}
|
1075 |
ddelon |
75 |
}
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
// This function create a single color cell in the color table.
|
|
|
79 |
function AppendColorCell( targetRow, color )
|
|
|
80 |
{
|
|
|
81 |
var oCell = targetRow.insertCell(-1) ;
|
|
|
82 |
oCell.className = 'ColorCell' ;
|
|
|
83 |
oCell.bgColor = color ;
|
1921 |
jp_milcent |
84 |
|
1075 |
ddelon |
85 |
oCell.onmouseover = function()
|
|
|
86 |
{
|
|
|
87 |
document.getElementById('hicolor').style.backgroundColor = this.bgColor ;
|
|
|
88 |
document.getElementById('hicolortext').innerHTML = this.bgColor ;
|
|
|
89 |
}
|
1921 |
jp_milcent |
90 |
|
1075 |
ddelon |
91 |
oCell.onclick = function()
|
|
|
92 |
{
|
|
|
93 |
document.getElementById('selhicolor').style.backgroundColor = this.bgColor ;
|
|
|
94 |
document.getElementById('selcolor').value = this.bgColor ;
|
|
|
95 |
}
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
AppendColorRow( 0, 0 ) ;
|
|
|
99 |
AppendColorRow( 3, 0 ) ;
|
|
|
100 |
AppendColorRow( 0, 3 ) ;
|
|
|
101 |
AppendColorRow( 3, 3 ) ;
|
|
|
102 |
|
|
|
103 |
// Create the last row.
|
|
|
104 |
var oRow = oTable.insertRow(-1) ;
|
1921 |
jp_milcent |
105 |
|
1075 |
ddelon |
106 |
// Create the gray scale colors cells.
|
|
|
107 |
for ( var n = 0 ; n < 6 ; n++ )
|
|
|
108 |
{
|
1921 |
jp_milcent |
109 |
AppendColorCell( oRow, '#' + aColors[n] + aColors[n] + aColors[n] ) ;
|
1075 |
ddelon |
110 |
}
|
1921 |
jp_milcent |
111 |
|
1075 |
ddelon |
112 |
// Fill the row with black cells.
|
|
|
113 |
for ( var i = 0 ; i < 12 ; i++ )
|
|
|
114 |
{
|
1921 |
jp_milcent |
115 |
AppendColorCell( oRow, '#000000' ) ;
|
1075 |
ddelon |
116 |
}
|
|
|
117 |
}
|
|
|
118 |
|
|
|
119 |
function Clear()
|
|
|
120 |
{
|
|
|
121 |
document.getElementById('selhicolor').style.backgroundColor = '' ;
|
|
|
122 |
document.getElementById('selcolor').value = '' ;
|
|
|
123 |
}
|
|
|
124 |
|
|
|
125 |
function ClearActual()
|
|
|
126 |
{
|
|
|
127 |
document.getElementById('hicolor').style.backgroundColor = '' ;
|
|
|
128 |
document.getElementById('hicolortext').innerHTML = ' ' ;
|
|
|
129 |
}
|
|
|
130 |
|
|
|
131 |
function UpdateColor()
|
|
|
132 |
{
|
|
|
133 |
try { document.getElementById('selhicolor').style.backgroundColor = document.getElementById('selcolor').value ; }
|
|
|
134 |
catch (e) { Clear() ; }
|
|
|
135 |
}
|
|
|
136 |
|
|
|
137 |
function Ok()
|
|
|
138 |
{
|
1921 |
jp_milcent |
139 |
if ( typeof(window.parent.Args().CustomValue) == 'function' )
|
|
|
140 |
window.parent.Args().CustomValue( document.getElementById('selcolor').value ) ;
|
1075 |
ddelon |
141 |
|
|
|
142 |
return true ;
|
|
|
143 |
}
|
|
|
144 |
</script>
|
|
|
145 |
</head>
|
|
|
146 |
<body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
|
|
|
147 |
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
|
|
|
148 |
<tr>
|
|
|
149 |
<td align="center" valign="middle">
|
|
|
150 |
<table border="0" cellspacing="5" cellpadding="0" width="100%">
|
|
|
151 |
<tr>
|
|
|
152 |
<td valign="top" align="center" nowrap width="100%">
|
|
|
153 |
<table id="ColorTable" border="0" cellspacing="0" cellpadding="0" width="270" onmouseout="ClearActual();">
|
|
|
154 |
</table>
|
|
|
155 |
</td>
|
|
|
156 |
<td valign="top" align="left" nowrap>
|
|
|
157 |
<span fckLang="DlgColorHighlight">Highlight</span>
|
|
|
158 |
<div id="hicolor"></div>
|
|
|
159 |
<div id="hicolortext"> </div>
|
|
|
160 |
<span fckLang="DlgColorSelected">Selected</span>
|
|
|
161 |
<div id="selhicolor"></div>
|
|
|
162 |
<input id="selcolor" type="text" maxlength="20" onchange="UpdateColor();">
|
|
|
163 |
<br>
|
|
|
164 |
<input id="btnClear" type="button" fckLang="DlgColorBtnClear" value="Clear" onclick="Clear();" />
|
|
|
165 |
</td>
|
|
|
166 |
</tr>
|
|
|
167 |
</table>
|
|
|
168 |
</td>
|
|
|
169 |
</tr>
|
|
|
170 |
</table>
|
|
|
171 |
</body>
|
|
|
172 |
</html>
|