remove inline js from main.php

This commit is contained in:
Marc Delisle
2010-03-27 15:01:13 -04:00
parent bbad02a5a1
commit 6ff307b546
4 changed files with 50 additions and 38 deletions

28
js/main_custom_color.js Normal file
View File

@@ -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();
}
});
});