remove inline js from main.php
This commit is contained in:
50
main.php
50
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 '<li id="li_select_theme">';
|
||||
echo $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox();
|
||||
echo '</li>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
document.write('<li id="li_custom_color">');
|
||||
document.write('<?php echo PMA_escapeJsString($strCustomColor) . ': '; ?>');
|
||||
document.write('<form name="colorform" id="colorform" method="post" action="index.php" target="_parent">');
|
||||
document.write('<?php echo PMA_generate_common_hidden_inputs(); ?>');
|
||||
document.write('<input type="hidden" id="custom_color" name="custom_color" value="" />');
|
||||
document.write('<input type="submit" name="custom_color_reset" value="<?php echo $strReset; ?>" />');
|
||||
document.write('</form>');
|
||||
document.write('<div id="colorSelector">');
|
||||
document.write('</div>');
|
||||
document.write('</li>');
|
||||
|
||||
$(document).ready(function() {
|
||||
// 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();
|
||||
}
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
// see js/main_custom_color.js
|
||||
echo '<li id="li_custom_color" class="hide">';
|
||||
echo PMA_escapeJsString($strCustomColor) . ': ';
|
||||
echo '<form name="colorform" id="colorform" method="post" action="index.php" target="_parent">';
|
||||
echo PMA_generate_common_hidden_inputs();
|
||||
echo '<input type="hidden" id="custom_color" name="custom_color" value="" />';
|
||||
echo '<input type="submit" name="custom_color_reset" value="' . $strReset . '" />';
|
||||
echo '</form>';
|
||||
echo '<div id="colorSelector">';
|
||||
echo '</div>';
|
||||
echo '</li>';
|
||||
}
|
||||
echo '<li id="li_select_fontsize">';
|
||||
echo PMA_Config::getFontsizeForm();
|
||||
|
Reference in New Issue
Block a user