Index: openacs-4/packages/acs-templating/www/resources/htmlarea/popups/select_color.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/htmlarea/popups/select_color.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/htmlarea/popups/select_color.html 4 Mar 2004 18:32:14 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/htmlarea/popups/select_color.html 30 Jan 2005 16:13:32 -0000 1.2 @@ -1,346 +1,694 @@ - + -Select Color + - +Select Color - -function Init() { // run on page load - __dlg_init(); // - document.body.onkeypress = _CloseOnEsc; + - var color = window.dialogArguments; - color = ValidateColor(color) || '000000'; - View(color); // set default color -} + - - + -
- - - - - - -
-
+function Init() { // run on page load - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ __dlg_init(); // - + document.body.onkeypress = _CloseOnEsc; + + + + var color = window.dialogArguments; + + color = ValidateColor(color) || '000000'; + + View(color); // set default color + +} + + + +function View(color) { // preview color + + document.getElementById("ColorPreview").style.backgroundColor = '#' + color; + + document.getElementById("ColorHex").value = '#' + color; + +} + + + +function Set(string) { // select color + + var color = ValidateColor(string); + + if (color == null) { alert("Invalid color code: " + string); } // invalid color + + else { // valid color + + View(color); // show selected color + + __dlg_close(color); + + } + +} + + + +function ValidateColor(string) { // return valid color code + + string = string || ''; + + string = string + ""; + + string = string.toUpperCase(); + + var chars = '0123456789ABCDEF'; + + var out = ''; + + + + for (var i=0; i + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +