diff --git a/js/replication.js b/js/replication.js new file mode 100644 index 000000000..091212570 --- /dev/null +++ b/js/replication.js @@ -0,0 +1,25 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * for server_replication.php + * + */ +$(document).ready(function() { + $('#master_status_href').click(function() { + $('#replication_master_section').toggle(); + }); + $('#master_slaves_href').click(function() { + $('#replication_slaves_section').toggle(); + }); + $('#slave_status_href').click(function() { + $('#replication_slave_section').toggle(); + }); + $('#slave_control_href').click(function() { + $('#slave_control_gui').toggle(); + }); + $('#slave_errormanagement_href').click(function() { + $('#slave_errormanagement_gui').toggle(); + }); + $('#slave_synchronization_href').click(function() { + $('#slave_synchronization_gui').toggle(); + }); +}); diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 816bdbe46..3e8a180f7 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2750,8 +2750,8 @@ function PMA_js_mootools_domready($code, $print=true) $out .= "\n" . '// ]]>' . "\n"; $out .= ''; - if ($print) - echo $out; + //if ($print) + // echo $out; return $out; } diff --git a/libraries/replication_gui.lib.php b/libraries/replication_gui.lib.php index 6027bec6d..9a015ff56 100644 --- a/libraries/replication_gui.lib.php +++ b/libraries/replication_gui.lib.php @@ -9,9 +9,6 @@ if (! defined('PHPMYADMIN')) { exit; } -$jscode['master_replication'] = 'divShowHideFunc(\'master_status_href\', \'replication_master_section\');' . "\n" - . 'divShowHideFunc(\'master_slaves_href\', \'replication_slaves_section\');' . "\n"; - // Add JS events to generate example my.cnf config lines $jscode['configure_master'] = 'var c_output = "";' . "\n" . @@ -53,14 +50,6 @@ $jscode['configure_master'] = ' });' . "\n" . '});' . "\n"; -$jscode['slave_control'] = - 'divShowHideFunc(\'slave_status_href\', \'replication_slave_section\');' . "\n" . - 'divShowHideFunc(\'slave_control_href\', \'slave_control_gui\');' . "\n" . - 'divShowHideFunc(\'slave_errormanagement_href\',\'slave_errormanagement_gui\'); ' . "\n"; - -$jscode['slave_control_sync'] = - 'divShowHideFunc(\'slave_synchronization_href\', \'slave_synchronization_gui\');' . "\n"; - /** * returns code for selecting databases * diff --git a/server_replication.php b/server_replication.php index 7397d76aa..ddf681f26 100644 --- a/server_replication.php +++ b/server_replication.php @@ -17,6 +17,7 @@ require_once './libraries/common.inc.php'; $GLOBALS['js_include'][] = 'server_privileges.js'; $GLOBALS['js_include'][] = 'functions.js'; $GLOBALS['js_include'][] = 'mootools-more.js'; +$GLOBALS['js_include'][] = 'replication.js'; require './libraries/server_common.inc.php'; require './libraries/replication.inc.php'; @@ -177,7 +178,6 @@ if (isset($_SESSION['replication']['sr_action_status']) && isset($_SESSION['repl if ($server_master_status) { if (! isset($GLOBALS['repl_clear_scr'])) { - echo PMA_js_mootools_domready($jscode['master_replication']); echo '