remove inline js from main.php
This commit is contained in:
28
js/main_custom_color.js
Normal file
28
js/main_custom_color.js
Normal 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();
|
||||
}
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user