[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8049-g9fad9b9

Marc Delisle lem9 at users.sourceforge.net
Tue Jul 12 14:49:49 CEST 2011


The branch, master has been updated
       via  9fad9b98105b89af6e8d25f21a45179184f35b37 (commit)
       via  4c14aa97b0280c97f5b4053db43bfcb02f85e499 (commit)
       via  215eb80df9b5456d4b2131bb98d8448797ef2c74 (commit)
       via  290cf579b29017d79cf955a4fa3e816e91ba2070 (commit)
       via  d8b578b6ab5661485ddb2aafec66c929b6cefb96 (commit)
       via  3d7cfa7b979178dafb3b7e87928d9b94ec87331a (commit)
      from  4bb11fd55a3dcb2c22a6df47af3453a4caa004e7 (commit)


- Log -----------------------------------------------------------------
commit 9fad9b98105b89af6e8d25f21a45179184f35b37
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Tue Jul 12 06:52:08 2011 +0530

    Changed variable name according to jquery objects

commit 4c14aa97b0280c97f5b4053db43bfcb02f85e499
Merge: 215eb80df9b5456d4b2131bb98d8448797ef2c74 4bb11fd55a3dcb2c22a6df47af3453a4caa004e7
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Mon Jul 11 22:58:46 2011 +0530

    Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

commit 215eb80df9b5456d4b2131bb98d8448797ef2c74
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Mon Jul 11 22:58:05 2011 +0530

    Fixed bugs in table change and table index

commit 290cf579b29017d79cf955a4fa3e816e91ba2070
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Mon Jul 11 12:00:40 2011 +0530

    Added tableCheckEditForm option to the table change

commit d8b578b6ab5661485ddb2aafec66c929b6cefb96
Merge: 3d7cfa7b979178dafb3b7e87928d9b94ec87331a 4b80c81536aa9dee63aff1d2e0197572760b5a72
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Mon Jul 11 11:04:00 2011 +0530

    Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

commit 3d7cfa7b979178dafb3b7e87928d9b94ec87331a
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Mon Jul 11 11:03:35 2011 +0530

    Fixed bug in check index type in initiation

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

Summary of changes:
 js/functions.js     |   70 ++++++++++++++++++++++++++++++++++++++++++
 js/tbl_structure.js |   84 +++++++++++++--------------------------------------
 2 files changed, 91 insertions(+), 63 deletions(-)

diff --git a/js/functions.js b/js/functions.js
index ae5cdba..9367797 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -1817,6 +1817,76 @@ $(document).ready(function() {
 }, 'top.frame_content'); //end $(document).ready for 'Create Table'
 
 /**
+ * jQuery coding for 'Change Table'.  Used on tbl_structure.php *
+ * Attach Ajax Event handlers for Change Table
+ */
+$(document).ready(function() {
+    /**
+     *Ajax action for submitting the column change form
+    **/
+    $("#append_fields_form input[name=do_save_data]").live('click', function(event) {
+        event.preventDefault();
+        /**
+         *  @var    the_form    object referring to the export form
+         */
+        var $form = $("#append_fields_form");
+
+        /*
+         * First validate the form; if there is a problem, avoid submitting it
+         *
+         * checkTableEditForm() needs a pure element and not a jQuery object,
+         * this is why we pass $form[0] as a parameter (the jQuery object
+         * is actually an array of DOM elements)
+         */
+        if (checkTableEditForm($form[0], $form.find('input[name=orig_num_fields]').val())) {
+            // OK, form passed validation step
+            if ($form.hasClass('ajax')) {
+                PMA_prepareForAjaxRequest($form);
+                //User wants to submit the form
+                $.post($form.attr('action'), $form.serialize()+"&do_save_data=Save", function(data) {
+                    if ($("#sqlqueryresults").length != 0) {
+                        $("#sqlqueryresults").remove();
+                    } else if ($(".error").length != 0) {
+                        $(".error").remove();
+                    }
+                    if (data.success == true) {
+                        PMA_ajaxShowMessage(data.message);
+                        $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
+                        $("#sqlqueryresults").html(data.sql_query);
+                        $("#result_query .notice").remove();
+                        $("#result_query").prepend((data.message));
+                        if ($("#change_column_dialog").length > 0) {
+                            $("#change_column_dialog").dialog("close").remove();
+                        }
+                        /*Reload the field form*/
+                        $.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize()+"&ajax_request=true", function(form_data) {
+                            $("#fieldsForm").remove();
+                            var $temp_div = $("<div id='temp_div'><div>").append(form_data);
+                            if ($("#sqlqueryresults").length != 0) {
+                                $temp_div.find("#fieldsForm").insertAfter("#sqlqueryresults");
+                            } else {
+                                $temp_div.find("#fieldsForm").insertAfter(".error");
+                            }
+                            /*Call the function to display the more options in table*/
+                            displayMoreTableOpts();
+                        });
+                    } else {
+                        var $temp_div = $("<div id='temp_div'><div>").append(data);
+                        var $error = $temp_div.find(".error code").addClass("error");
+                        PMA_ajaxShowMessage($error);
+                    }
+                }) // end $.post()
+            } else {
+                // non-Ajax submit
+                $form.append('<input type="hidden" name="do_save_data" value="Save" />');
+                $form.submit();
+            }
+        }
+    }) // end change table button "do_save_data"
+
+}, 'top.frame_content'); //end $(document).ready for 'Change Table'
+
+/**
  * Attach Ajax event handlers for Drop Database. Moved here from db_structure.js
  * as it was also required on db_create.php
  *
diff --git a/js/tbl_structure.js b/js/tbl_structure.js
index c58bd54..a9b9ada 100644
--- a/js/tbl_structure.js
+++ b/js/tbl_structure.js
@@ -18,7 +18,7 @@
  *
  */
 $(document).ready(function() {
-    
+
     /**
      * Attach Event Handler for 'Drop Column'
      *
@@ -182,53 +182,6 @@ $(document).ready(function() {
      });
 
     /**
-     *Ajax action for submitting the column change form
-    **/
-    $("#append_fields_form input[name=do_save_data].ajax").live('click', function(event) {
-        event.preventDefault();
-        /**
-         *  @var    the_form    object referring to the export form
-         */
-        var $form = $("#append_fields_form");
-
-        PMA_prepareForAjaxRequest($form);
-        //User wants to submit the form
-        $.post($form.attr('action'), $form.serialize()+"&do_save_data=Save", function(data) {
-            if ($("#sqlqueryresults").length != 0) {
-                $("#sqlqueryresults").remove();
-            } else if ($(".error").length != 0) {
-                $(".error").remove();
-            }
-            if (data.success == true) {
-                PMA_ajaxShowMessage(data.message);
-                $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
-                $("#sqlqueryresults").html(data.sql_query);
-                $("#result_query .notice").remove();
-                $("#result_query").prepend((data.message));
-                if ($("#change_column_dialog").length > 0) {
-                    $("#change_column_dialog").dialog("close").remove();
-                }
-                /*Reload the field form*/
-                $.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize()+"&ajax_request=true", function(form_data) {
-                    $("#fieldsForm").remove();
-                    var $temp_div = $("<div id='temp_div'><div>").append(form_data);
-                    if ($("#sqlqueryresults").length != 0) {
-                        $temp_div.find("#fieldsForm").insertAfter("#sqlqueryresults");
-                    } else {
-                        $temp_div.find("#fieldsForm").insertAfter(".error");
-                    }
-                    /*Call the function to display the more options in table*/
-                    displayMoreTableOpts();
-                });
-            } else {
-                var $temp_div = $("<div id='temp_div'><div>").append(data);
-                var $error = $temp_div.find(".error code").addClass("error");
-                PMA_ajaxShowMessage($error);
-            }
-        }) // end $.post()
-    }) // end insert table button "do_save_data"
-
-    /**
      *Ajax event handler for index edit
     **/
     $("#table_index tbody tr td.edit_index.ajax").live('click', function(event){
@@ -239,7 +192,11 @@ $(document).ready(function() {
         }
         url = url + "&ajax_request=true";
 
-        var div = $('<div id="edit_index_dialog"></div>');
+        /*Remove the hidden dialogs if there are*/
+        if ($('#edit_index_dialog').length != 0) {
+            $('#edit_index_dialog').remove();
+        }
+        var $div = $('<div id="edit_index_dialog"></div>');
 
         /**
          *  @var    button_options  Object that stores the options passed to jQueryUI
@@ -256,7 +213,7 @@ $(document).ready(function() {
         $.get( "tbl_indexes.php" , url ,  function(data) {
             //in the case of an error, show the error message returned.
             if (data.success != undefined && data.success == false) {
-                div
+                $div
                 .append(data.error)
                 .dialog({
                     title: PMA_messages['strEdit'],
@@ -267,7 +224,7 @@ $(document).ready(function() {
                     buttons : button_options_error
                 })// end dialog options
             } else {
-                div
+                $div
                 .append(data)
                 .dialog({
                     title: PMA_messages['strEdit'],
@@ -280,6 +237,7 @@ $(document).ready(function() {
                 //Remove the top menu container from the dialog
                 .find("#topmenucontainer").hide()
                 ; // end dialog options
+                checkIndexType();
                 checkIndexName("index_frm");
             }
             PMA_ajaxRemoveMessage($msgbox);
@@ -311,22 +269,22 @@ $(document).ready(function() {
 
                 /*Reload the field form*/
                 $("#table_index").remove();
-                var temp_div = $("<div id='temp_div'><div>").append(data.index_table);
-                $(temp_div).find("#table_index").insertAfter("#index_header");
+                var $temp_div = $("<div id='temp_div'><div>").append(data.index_table);
+                $temp_div.find("#table_index").insertAfter("#index_header");
                 if ($("#edit_index_dialog").length > 0) {
                     $("#edit_index_dialog").dialog("close").remove();
                 }
 
             } else {
                 if(data.error != undefined) {
-                    var temp_div = $("<div id='temp_div'><div>").append(data.error);
-                    if($(temp_div).find(".error code").length != 0) {
-                        var error = $(temp_div).find(".error code").addClass("error");
+                    var $temp_div = $("<div id='temp_div'><div>").append(data.error);
+                    if ($temp_div.find(".error code").length != 0) {
+                        var $error = $temp_div.find(".error code").addClass("error");
                     } else {
-                        var error = temp_div;
+                        var $error = $temp_div;
                     }
                 }
-                PMA_ajaxShowMessage(error);
+                PMA_ajaxShowMessage($error);
             }
 
         }) // end $.post()
@@ -346,8 +304,8 @@ $(document).ready(function() {
         //User wants to submit the form
         $.post($form.attr('action'), $form.serialize()+"&add_fields=Go", function(data) {
             $("#index_columns").remove();
-            var temp_div = $("<div id='temp_div'><div>").append(data);
-            $(temp_div).find("#index_columns").appendTo("#index_edit_fields");
+            var $temp_div = $("<div id='temp_div'><div>").append(data);
+            $temp_div.find("#index_columns").appendTo("#index_edit_fields");
         }) // end $.post()
     }) // end insert table button "Go"
 
@@ -394,7 +352,7 @@ function changeColumns(action,url) {
     if ($('#change_column_dialog').length != 0) {
         $('#change_column_dialog').remove();
     }
-    var div = $('<div id="change_column_dialog"></div>');
+    var $div = $('<div id="change_column_dialog"></div>');
 
     /**
      *  @var    button_options  Object that stores the options passed to jQueryUI
@@ -411,7 +369,7 @@ function changeColumns(action,url) {
     $.get( action , url ,  function(data) {
         //in the case of an error, show the error message returned.
         if (data.success != undefined && data.success == false) {
-            div
+            $div
             .append(data.error)
             .dialog({
                 title: PMA_messages['strChangeTbl'],
@@ -422,7 +380,7 @@ function changeColumns(action,url) {
                 buttons : button_options_error
             })// end dialog options
         } else {
-            div
+            $div
             .append(data)
             .dialog({
                 title: PMA_messages['strChangeTbl'],


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list