[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_1RC1-1357-g5c26356

Marc Delisle lem9 at users.sourceforge.net
Sat Apr 3 00:57:37 CEST 2010


The branch, master has been updated
       via  5c263563796e5cb8e8c4b90d1b64104b0b705aaf (commit)
      from  f32e8001e21ffb5643a245bc615c65a9db1e71b7 (commit)


- Log -----------------------------------------------------------------
commit 5c263563796e5cb8e8c4b90d1b64104b0b705aaf
Author: Marc Delisle <marc at infomarc.info>
Date:   Fri Apr 2 18:57:28 2010 -0400

    start porting Replication to jQuery

-----------------------------------------------------------------------

Summary of changes:
 js/replication.js                 |   25 +++++++++++++++++++++++++
 libraries/common.lib.php          |    4 ++--
 libraries/replication_gui.lib.php |   11 -----------
 server_replication.php            |    4 +---
 4 files changed, 28 insertions(+), 16 deletions(-)
 create mode 100644 js/replication.js

diff --git a/js/replication.js b/js/replication.js
new file mode 100644
index 0000000..0912125
--- /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 816bdbe..3e8a180 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 .= '</script>';
 
-  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 6027bec..9a015ff 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 7397d76..ddf681f 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 '<fieldset>';
         echo '<legend>' . $GLOBALS['strReplicationMaster'] . '</legend>';
         echo $GLOBALS['strReplicationConfiguredMaster'];
@@ -249,7 +249,6 @@ if (! isset($GLOBALS['repl_clear_scr'])) {
     echo '<fieldset>';
     echo '<legend>' . $GLOBALS['strReplicationSlave'] . '</legend>';
     if ($server_slave_status) {
-        echo PMA_js_mootools_domready($jscode['slave_control']);
         echo '<div id="slave_configuration_gui">';
 
         $_url_params = $GLOBALS['url_params'];
@@ -311,7 +310,6 @@ if (! isset($GLOBALS['repl_clear_scr'])) {
         echo ' <li><a href="#" id="slave_status_href">' . $GLOBALS['strReplicationSlaveSeeStatus'] . '</a></li>';
         echo PMA_replication_print_status_table('slave', true, false);
         if (isset($_SESSION['replication']['m_correct']) && $_SESSION['replication']['m_correct'] == true) {
-            echo PMA_js_mootools_domready($jscode['slave_control_sync']);
             echo ' <li><a href="#" id="slave_synchronization_href">' . $GLOBALS['strReplicationSynchronize'] . '</a></li>';
             echo ' <div id="slave_synchronization_gui" style="display: none">';
             echo '  <form method="post" action="server_replication.php">';


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list