diff --git a/js/main_custom_color.js b/js/main_custom_color.js new file mode 100644 index 000000000..eacc5b793 --- /dev/null +++ b/js/main_custom_color.js @@ -0,0 +1,28 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * for main custom color + * + */ +$(document).ready(function() { + $('#li_custom_color').show(); + // Choosing another id does not work! + $('#colorSelector').ColorPicker({ + color: '#0000ff', + onShow: function (colpkr) { + $(colpkr).fadeIn(500); + return false; + }, + onHide: function (colpkr) { + $(colpkr).fadeOut(500); + return false; + }, + onChange: function(hsb, hex, rgb) { + top.frame_content.document.body.style.backgroundColor = '#' + hex; + top.frame_navigation.document.body.style.backgroundColor = '#' + hex; + }, + onSubmit: function(hsb, hex, rgb) { + $('#custom_color').val('#' + hex); + $('#colorform').submit(); + } + }); +}); diff --git a/main.php b/main.php index 8c65bc588..f942b4015 100644 --- a/main.php +++ b/main.php @@ -14,6 +14,7 @@ require_once './libraries/common.inc.php'; $GLOBALS['js_include'][] = 'jquery/jquery-1.4.2-min.js'; $GLOBALS['js_include'][] = 'colorpicker/js/colorpicker.js'; +$GLOBALS['js_include'][] = 'main_custom_color.js'; // Handles some variables that may have been sent by the calling script $GLOBALS['db'] = ''; @@ -153,45 +154,18 @@ if ($GLOBALS['cfg']['ThemeManager']) { echo '