[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-7879-gb4cd341

Marc Delisle lem9 at users.sourceforge.net
Sun Jul 10 22:14:47 CEST 2011


The branch, master has been updated
       via  b4cd34155024403bb430c259a2b4a71cb80a385b (commit)
       via  900f5c33687def24bcb9ffaa7e834d925058bcbd (commit)
       via  673ed34d94b549d0c316ed880c32d644c6a379eb (commit)
       via  ee2653639a7b73ec329cebeb8185a8bbd86c90f6 (commit)
       via  416f3e5639bc8664781d60d988640c1d15b40fcf (commit)
       via  fd9692218e4fa8d936ffd12ed63f4f74fbcb1b83 (commit)
       via  19bd37401cde8456aca67db1bd5bcabb415fab53 (commit)
       via  0750275cc2dd5ae36fa1db0afac5815340a5330d (commit)
       via  8db8671bfdd7a3d8862203189f13294ab6c8dcb6 (commit)
       via  8a6fc88a8cfb6858326e9ca1d9296d20000f43ac (commit)
       via  1e8cbeceb957874f4670ea06a4acb57421db4400 (commit)
      from  4ae5cb079944786b0d57fccda045e9ac72dc9fab (commit)


- Log -----------------------------------------------------------------
commit b4cd34155024403bb430c259a2b4a71cb80a385b
Author: Marc Delisle <marc at infomarc.info>
Date:   Sun Jul 10 16:14:35 2011 -0400

    ChangeLog entry for new feature

commit 900f5c33687def24bcb9ffaa7e834d925058bcbd
Merge: 4ae5cb079944786b0d57fccda045e9ac72dc9fab 673ed34d94b549d0c316ed880c32d644c6a379eb
Author: Marc Delisle <marc at infomarc.info>
Date:   Sun Jul 10 16:09:13 2011 -0400

    Merge commit '673ed34d94b549d0c316ed880c32d644c6a379eb'

commit 673ed34d94b549d0c316ed880c32d644c6a379eb
Merge: ee2653639a7b73ec329cebeb8185a8bbd86c90f6 99c1692b077403fceba39831ce2b559248d1a2ba
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Sun Jul 10 15:24:09 2011 +0530

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

commit ee2653639a7b73ec329cebeb8185a8bbd86c90f6
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Sun Jul 10 15:23:20 2011 +0530

    Fixed bugs in enum editor

commit 416f3e5639bc8664781d60d988640c1d15b40fcf
Merge: fd9692218e4fa8d936ffd12ed63f4f74fbcb1b83 65c8f659e0adc68e698d9d9be13a1092cb716d7a
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Sat Jul 9 07:14:44 2011 +0530

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

commit fd9692218e4fa8d936ffd12ed63f4f74fbcb1b83
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Sat Jul 9 07:14:13 2011 +0530

    Fixed the issue adding time picker to insert dialog

commit 19bd37401cde8456aca67db1bd5bcabb415fab53
Merge: 0750275cc2dd5ae36fa1db0afac5815340a5330d 5ce96bccbe217ae0e2c52cdb6624eabf8fc2f6af
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Sat Jul 9 00:15:25 2011 +0530

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

commit 0750275cc2dd5ae36fa1db0afac5815340a5330d
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Sat Jul 9 00:14:55 2011 +0530

    Added single column change option in table structure

commit 8db8671bfdd7a3d8862203189f13294ab6c8dcb6
Merge: 8a6fc88a8cfb6858326e9ca1d9296d20000f43ac 909c8ceb49b94f1a81eef8fa267fa457e54170f4
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Fri Jul 8 21:58:04 2011 +0530

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

commit 8a6fc88a8cfb6858326e9ca1d9296d20000f43ac
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Fri Jul 8 21:57:29 2011 +0530

    Added datapickers in insert form in dialog

commit 1e8cbeceb957874f4670ea06a4acb57421db4400
Merge: f778dfc5af9756e6ab438a279d3ec1d60af57add baa2efa1f123ea0a386c9b001781860aabb27aff
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Fri Jul 8 21:09:34 2011 +0530

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

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

Summary of changes:
 ChangeLog           |    1 +
 js/db_structure.js  |   43 +++++++++-------
 js/tbl_structure.js |  135 +++++++++++++++++++++++++++++++++------------------
 3 files changed, 112 insertions(+), 67 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index af1f275..a137c4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,7 @@ phpMyAdmin - ChangeLog
 - bug #3353856 [AJAX] AJAX dialogs use wrong font-size
 - bug #3354356 [interface] Timepicker does not work in AJAX dialogs
 + AJAX for table Structure Indexes Edit
++ AJAX for table Structure column Change
 
 3.4.4.0 (not yet released)
 - bug #3323060 [parser] SQL parser breaks AJAX requests if query has unclosed quotes
diff --git a/js/db_structure.js b/js/db_structure.js
index ad55341..b1c2ff0 100644
--- a/js/db_structure.js
+++ b/js/db_structure.js
@@ -61,12 +61,12 @@ $(document).ready(function() {
     $("td.insert_table a.ajax").live('click', function(event){
         event.preventDefault();
         currrent_insert_table = $(this);
-        var url = $(this).attr("href");
-        if (url.substring(0, 15) == "tbl_change.php?") {
-             url = url.substring(15);
+        var $url = $(this).attr("href");
+        if ($url.substring(0, 15) == "tbl_change.php?") {
+             $url = $url.substring(15);
         }
 
-       	var div = $('<div id="insert_table_dialog"></div>');
+       	var $div = $('<div id="insert_table_dialog"></div>');
        	var target = "tbl_change.php";
 
         /**
@@ -75,38 +75,43 @@ $(document).ready(function() {
          */
         var button_options = {};
         // in the following function we need to use $(this)
-        button_options[PMA_messages['strCancel']] = function() {$(this).parent().dialog('close').remove();}
+        button_options[PMA_messages['strCancel']] = function() {$(this).dialog('close').remove();}
 
         var button_options_error = {};
-        button_options_error[PMA_messages['strOK']] = function() {$(this).parent().dialog('close').remove();}
+        button_options_error[PMA_messages['strOK']] = function() {$(this).dialog('close').remove();}
 
         var $msgbox = PMA_ajaxShowMessage();
 
-        $.get( target , url+"&ajax_request=true" ,  function(data) {
+        $.get( target , $url+"&ajax_request=true" ,  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['strInsertTable'],
                     height: 230,
                     width: 900,
+                    modal: true,
                     open: PMA_verifyTypeOfAllColumns,
                     buttons : button_options_error
                 })// end dialog options
             } else {
-                div
-                .append(data)
-                .dialog({
-                    title: PMA_messages['strInsertTable'],
-                    height: 600,
-                    width: 900,
-                    open: PMA_verifyTypeOfAllColumns,
-                    buttons : button_options
-                })
+                var $dialog = $div
+                    .append(data)
+                    .dialog({
+                        title: PMA_messages['strInsertTable'],
+                        height: 600,
+                        width: 900,
+                        modal: true,
+                        open: PMA_verifyTypeOfAllColumns,
+                        buttons : button_options
+                    });// end dialog options
                 //Remove the top menu container from the dialog
-                .find("#topmenucontainer").hide()
-                ; // end dialog options
+                $dialog.find("#topmenucontainer").hide();
+                //Adding the datetime pikers for the dialog
+                $dialog.find('.datefield, .datetimefield').each(function () {
+                       PMA_addDatepicker($(this));
+                });
                 $(".insertRowTable").addClass("ajax");
                 $("#buttonYes").addClass("ajax");
             }
diff --git a/js/tbl_structure.js b/js/tbl_structure.js
index 49e3fe0..c58bd54 100644
--- a/js/tbl_structure.js
+++ b/js/tbl_structure.js
@@ -153,59 +153,35 @@ $(document).ready(function() {
         event.preventDefault();
 
         /*Check whether atleast one row is selected for change*/
-        if($("#tablestructure tbody tr").hasClass("marked")){
-            var div = $('<div id="change_column_dialog"></div>');
-
-            /**
-             *  @var    button_options  Object that stores the options passed to jQueryUI
-             *                          dialog
-             */
-            var button_options = {};
-            // in the following function we need to use $(this)
-            button_options[PMA_messages['strCancel']] = function() {$(this).parent().dialog('close').remove();}
-
-            var button_options_error = {};
-            button_options_error[PMA_messages['strOK']] = function() {$(this).parent().dialog('close').remove();}
+        if ($("#tablestructure tbody tr").hasClass("marked")) {
+            /*Define the action and $url variabls for the post method*/
             var $form = $("#fieldsForm");
-            var $msgbox = PMA_ajaxShowMessage();
-
-            $.get( $form.attr('action') , $form.serialize()+"&ajax_request=true&submit_mult=change" ,  function(data) {
-                //in the case of an error, show the error message returned.
-                if (data.success != undefined && data.success == false) {
-                    div
-                    .append(data.error)
-                    .dialog({
-                        title: PMA_messages['strChangeTbl'],
-                        height: 230,
-                        width: 900,
-                        open: PMA_verifyTypeOfAllColumns,
-                        modal: true,
-                        buttons : button_options_error
-                    })// end dialog options
-                } else {
-                    div
-                    .append(data)
-                    .dialog({
-                        title: PMA_messages['strChangeTbl'],
-                        height: 600,
-                        width: 900,
-                        open: PMA_verifyTypeOfAllColumns,
-                        modal: true,
-                        buttons : button_options
-                    })
-                    //Remove the top menu container from the dialog
-                    .find("#topmenucontainer").hide()
-                    ; // end dialog options
-                    $("#append_fields_form input[name=do_save_data]").addClass("ajax");
-                }
-                PMA_ajaxRemoveMessage($msgbox);
-            }) // end $.get()
+            var action = $form.attr('action');
+            var url = $form.serialize()+"&ajax_request=true&submit_mult=change";
+            /*Calling for the changeColumns fucntion*/
+            changeColumns(action,url);
         }  else {
             PMA_ajaxShowMessage(PMA_messages['strNoRowSelected']);
         }
     });
 
     /**
+     *Ajax event handler for single column change
+    **/
+    $("#fieldsForm.ajax #tablestructure tbody tr td.edit a").live('click', function(event){
+        event.preventDefault();
+        /*Define the action and $url variabls for the post method*/
+        var action = "tbl_alter.php";
+        var url = $(this).attr('href');
+        if (url.substring(0, 13) == "tbl_alter.php") {
+            url = url.substring(14, url.length);
+        }
+        url = url + "&ajax_request=true";
+        /*Calling for the changeColumns fucntion*/
+        changeColumns(action,url);
+     });
+
+    /**
      *Ajax action for submitting the column change form
     **/
     $("#append_fields_form input[name=do_save_data].ajax").live('click', function(event) {
@@ -309,7 +285,7 @@ $(document).ready(function() {
             PMA_ajaxRemoveMessage($msgbox);
         }) // end $.get()
     });
-    
+
     /**
      *Ajax action for submiting the index form
     **/
@@ -401,6 +377,69 @@ $(document).ready(function() {
              return false;
         });
     } //end show/hide table index
-    
+
 
 }) // end $(document).ready()
+
+/**
+ * Loads the append_fields_form to the Change dialog allowing users
+ * to change the columns
+ * @param   string	action  Variable which parses the name of the
+ * 							destination file
+ * @param   string	$url    Variable which parses the data for the
+ * 							post action
+ */
+function changeColumns(action,url) {
+    /*Remove the hidden dialogs if there are*/
+    if ($('#change_column_dialog').length != 0) {
+        $('#change_column_dialog').remove();
+    }
+    var div = $('<div id="change_column_dialog"></div>');
+
+    /**
+     *  @var    button_options  Object that stores the options passed to jQueryUI
+     *                          dialog
+     */
+    var button_options = {};
+    // in the following function we need to use $(this)
+    button_options[PMA_messages['strCancel']] = function() {$(this).dialog('close').remove();}
+
+    var button_options_error = {};
+    button_options_error[PMA_messages['strOK']] = function() {$(this).dialog('close').remove();}
+    var $msgbox = PMA_ajaxShowMessage();
+
+    $.get( action , url ,  function(data) {
+        //in the case of an error, show the error message returned.
+        if (data.success != undefined && data.success == false) {
+            div
+            .append(data.error)
+            .dialog({
+                title: PMA_messages['strChangeTbl'],
+                height: 230,
+                width: 900,
+                modal: true,
+                open: PMA_verifyTypeOfAllColumns,
+                buttons : button_options_error
+            })// end dialog options
+        } else {
+            div
+            .append(data)
+            .dialog({
+                title: PMA_messages['strChangeTbl'],
+                height: 600,
+                width: 900,
+                modal: true,
+                open: PMA_verifyTypeOfAllColumns,
+                buttons : button_options
+            })
+            //Remove the top menu container from the dialog
+            .find("#topmenucontainer").hide()
+            ; // end dialog options
+            $("#append_fields_form input[name=do_save_data]").addClass("ajax");
+            /*changed the z-index of the enum editor to allow the edit*/
+            $("#enum_editor").css("z-index", "1100");
+        }
+        PMA_ajaxRemoveMessage($msgbox);
+    }) // end $.get()
+}
+


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list