1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
\r
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
\r
4 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
\r
6 * == BEGIN LICENSE ==
\r
8 * Licensed under the terms of any of the following licenses at your
\r
11 * - GNU General Public License Version 2 or later (the "GPL")
\r
12 * http://www.gnu.org/licenses/gpl.html
\r
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
\r
15 * http://www.gnu.org/licenses/lgpl.html
\r
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
\r
18 * http://www.mozilla.org/MPL/MPL-1.1.html
\r
22 * Color Selection dialog window.
\r
26 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
27 <meta name="robots" content="noindex, nofollow" />
\r
28 <style TYPE="text/css">
\r
29 #ColorTable { cursor: pointer ; cursor: hand ; }
\r
30 #hicolor { height: 74px ; width: 74px ; border-width: 1px ; border-style: solid ; }
\r
31 #hicolortext { width: 75px ; text-align: right ; margin-bottom: 7px ; }
\r
32 #selhicolor { height: 20px ; width: 74px ; border-width: 1px ; border-style: solid ; }
\r
33 #selcolor { width: 75px ; height: 20px ; margin-top: 0px ; margin-bottom: 7px ; }
\r
34 #btnClear { width: 75px ; height: 22px ; margin-bottom: 6px ; }
\r
35 .ColorCell { height: 15px ; width: 15px ; }
\r
37 <script src="common/fck_dialog_common.js" type="text/javascript"></script>
\r
38 <script type="text/javascript">
\r
40 var oEditor = window.parent.InnerDialogLoaded() ;
\r
44 // First of all, translate the dialog box texts
\r
45 oEditor.FCKLanguageManager.TranslatePage(document) ;
\r
47 CreateColorTable() ;
\r
49 window.parent.SetOkButton( true ) ;
\r
50 window.parent.SetAutoSize( true ) ;
\r
53 function CreateColorTable()
\r
55 // Get the target table.
\r
56 var oTable = document.getElementById('ColorTable') ;
\r
58 // Create the base colors array.
\r
59 var aColors = ['00','33','66','99','cc','ff'] ;
\r
61 // This function combines two ranges of three values from the color array into a row.
\r
62 function AppendColorRow( rangeA, rangeB )
\r
64 for ( var i = rangeA ; i < rangeA + 3 ; i++ )
\r
66 var oRow = oTable.insertRow(-1) ;
\r
68 for ( var j = rangeB ; j < rangeB + 3 ; j++ )
\r
70 for ( var n = 0 ; n < 6 ; n++ )
\r
72 AppendColorCell( oRow, '#' + aColors[j] + aColors[n] + aColors[i] ) ;
\r
78 // This function create a single color cell in the color table.
\r
79 function AppendColorCell( targetRow, color )
\r
81 var oCell = targetRow.insertCell(-1) ;
\r
82 oCell.className = 'ColorCell' ;
\r
83 oCell.bgColor = color ;
\r
85 oCell.onmouseover = function()
\r
87 document.getElementById('hicolor').style.backgroundColor = this.bgColor ;
\r
88 document.getElementById('hicolortext').innerHTML = this.bgColor ;
\r
91 oCell.onclick = function()
\r
93 document.getElementById('selhicolor').style.backgroundColor = this.bgColor ;
\r
94 document.getElementById('selcolor').value = this.bgColor ;
\r
98 AppendColorRow( 0, 0 ) ;
\r
99 AppendColorRow( 3, 0 ) ;
\r
100 AppendColorRow( 0, 3 ) ;
\r
101 AppendColorRow( 3, 3 ) ;
\r
103 // Create the last row.
\r
104 var oRow = oTable.insertRow(-1) ;
\r
106 // Create the gray scale colors cells.
\r
107 for ( var n = 0 ; n < 6 ; n++ )
\r
109 AppendColorCell( oRow, '#' + aColors[n] + aColors[n] + aColors[n] ) ;
\r
112 // Fill the row with black cells.
\r
113 for ( var i = 0 ; i < 12 ; i++ )
\r
115 AppendColorCell( oRow, '#000000' ) ;
\r
121 document.getElementById('selhicolor').style.backgroundColor = '' ;
\r
122 document.getElementById('selcolor').value = '' ;
\r
125 function ClearActual()
\r
127 document.getElementById('hicolor').style.backgroundColor = '' ;
\r
128 document.getElementById('hicolortext').innerHTML = ' ' ;
\r
131 function UpdateColor()
\r
133 try { document.getElementById('selhicolor').style.backgroundColor = document.getElementById('selcolor').value ; }
\r
134 catch (e) { Clear() ; }
\r
139 if ( typeof(window.parent.Args().CustomValue) == 'function' )
\r
140 window.parent.Args().CustomValue( document.getElementById('selcolor').value ) ;
\r
146 <body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
\r
147 <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
\r
149 <td align="center" valign="middle">
\r
150 <table border="0" cellspacing="5" cellpadding="0" width="100%">
\r
152 <td valign="top" align="center" nowrap width="100%">
\r
153 <table id="ColorTable" border="0" cellspacing="0" cellpadding="0" width="270" onmouseout="ClearActual();">
\r
156 <td valign="top" align="left" nowrap>
\r
157 <span fckLang="DlgColorHighlight">Highlight</span>
\r
158 <div id="hicolor"></div>
\r
159 <div id="hicolortext"> </div>
\r
160 <span fckLang="DlgColorSelected">Selected</span>
\r
161 <div id="selhicolor"></div>
\r
162 <input id="selcolor" type="text" maxlength="20" onchange="UpdateColor();">
\r
164 <input id="btnClear" type="button" fckLang="DlgColorBtnClear" value="Clear" onclick="Clear();" />
\r