[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_1-2938-g745877a

Michal Čihař nijel at users.sourceforge.net
Thu Jun 2 16:20:47 CEST 2011


The branch, master has been updated
       via  745877a6a0e59f8433c3b90056858a753da60330 (commit)
       via  961f170b51260cf79eda34b700c37730c6d975ef (commit)
       via  53431974b1abd36af205e15927b453e447797e49 (commit)
      from  469624c23d97848da668c787ae15d75199ac6272 (commit)


- Log -----------------------------------------------------------------
commit 745877a6a0e59f8433c3b90056858a753da60330
Author: Michal Čihař <mcihar at novell.com>
Date:   Thu Jun 2 16:20:37 2011 +0200

    Fix clearing the query box for non table based SQL

commit 961f170b51260cf79eda34b700c37730c6d975ef
Author: Michal Čihař <mcihar at novell.com>
Date:   Thu Jun 2 16:09:21 2011 +0200

    Whitespace cleanup

commit 53431974b1abd36af205e15927b453e447797e49
Author: Michal Čihař <mcihar at novell.com>
Date:   Thu Jun 2 16:08:25 2011 +0200

    Remove obsolete comment

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

Summary of changes:
 js/functions.js                  |   26 ++++++++++++++++++--------
 js/sql.js                        |   16 ++++++++--------
 libraries/header_scripts.inc.php |    1 -
 3 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/js/functions.js b/js/functions.js
index 98dbd1d..a8595a1 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -724,15 +724,31 @@ function setSelectOptions(the_form, the_select, do_check)
     return true;
 } // end of the 'setSelectOptions()' function
 
+/**
+ * Sets current value for query box.
+ */
+function setQuery(query) {
+    if (codemirror_editor) {
+        codemirror_editor.setValue(query);
+    } else {
+        document.sqlform.sql_query.value = query;
+    }
+}
+
 
 /**
   * Create quick sql statements.
   *
   */
 function insertQuery(queryType) {
+    if (queryType == "clear") {
+        setQuery('');
+        return;
+    }
+
     var myQuery = document.sqlform.sql_query;
-    var myListBox = document.sqlform.dummy;
     var query = "";
+    var myListBox = document.sqlform.dummy;
     var table = document.sqlform.table.value;
 
     if (myListBox.options.length > 0) {
@@ -762,14 +778,8 @@ function insertQuery(queryType) {
             query = "UPDATE `" + table + "` SET " + editDis + " WHERE 1";
         } else if(queryType == "delete") {
             query = "DELETE FROM `" + table + "` WHERE 1";
-        } else if(queryType == "clear") {
-            query = "";
-        }
-        if (codemirror_editor) {
-            codemirror_editor.setValue(query);
-        } else {
-            document.sqlform.sql_query.value = query;
         }
+        setQuery(query);
         sql_box_locked = false;
     }
 }
diff --git a/js/sql.js b/js/sql.js
index b334b5f..e4f8323 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -365,7 +365,7 @@ $(document).ready(function() {
             $("#sqlqueryresults").html(data);
             $("#sqlqueryresults").trigger('appendAnchor');
             PMA_init_slider();
-            
+
             PMA_ajaxRemoveMessage($msgbox);
         }) // end $.post()
     })// end Paginate results table
@@ -388,7 +388,7 @@ $(document).ready(function() {
                 $("#sqlqueryresults").html(data);
                 $("#sqlqueryresults").trigger('appendAnchor');
                 PMA_init_slider();
-                PMA_ajaxRemoveMessage($msgbox); 
+                PMA_ajaxRemoveMessage($msgbox);
             }) // end $.post()
         } else {
             $the_form.submit();
@@ -456,7 +456,7 @@ $(document).ready(function() {
         $edit_td.removeClass('inline_edit_anchor').addClass('inline_edit_active').parent('tr').addClass('noclick');
 
         // Adding submit and hide buttons to inline edit <td>.
-        // For "hide" button the original data to be restored is 
+        // For "hide" button the original data to be restored is
         //  kept in the jQuery data element 'original_data' inside the <td>.
         // Looping through all columns or rows, to find the required data and then storing it in an array.
 
@@ -840,7 +840,7 @@ $(document).ready(function() {
          */
         var relation_fields = {};
         /**
-         * @var relational_display string 'K' if relational key, 'D' if relational display column 
+         * @var relational_display string 'K' if relational key, 'D' if relational display column
          */
         var relational_display = $("#relational_display_K").attr('checked') ? 'K' : 'D';
         /**
@@ -858,7 +858,7 @@ $(document).ready(function() {
         var sql_query = 'UPDATE `' + window.parent.table + '` SET ';
 
         var need_to_post = false;
-        
+
         var new_clause = '';
         var prev_index = -1;
 
@@ -930,7 +930,7 @@ $(document).ready(function() {
             }
         })
 
-        /*  
+        /*
          * update the where_clause, remove the last appended ' AND '
          * */
 
@@ -1004,10 +1004,10 @@ $(document).ready(function() {
 
 
 /**
- * Visually put back the row in the state it was before entering Inline edit 
+ * Visually put back the row in the state it was before entering Inline edit
  *
  * (when called in the situation where no posting was done, the data
- * parameter is empty) 
+ * parameter is empty)
  */
 function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data, disp_mode) {
 
diff --git a/libraries/header_scripts.inc.php b/libraries/header_scripts.inc.php
index 98b28c4..2e0a9ca 100644
--- a/libraries/header_scripts.inc.php
+++ b/libraries/header_scripts.inc.php
@@ -40,7 +40,6 @@ if (isset($GLOBALS['db'])) {
 }
 $GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params);
 $GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
-/* We should rather use/define MySQL mode here */
 $GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
 
 /**


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list