Moved the jQuery script for handling Create Table action from

js/db_operations.js to js/functions.js as this action is used on
multiple pages.
This commit is contained in:
ninadsp
2010-06-25 11:01:19 +05:30
parent 217968fb92
commit dcdde2f99f
2 changed files with 35 additions and 31 deletions

View File

@@ -8,40 +8,13 @@
/** /**
* Add Ajax event handlers here for db_operations.php * Add Ajax event handlers here for db_operations.php
* *
* no id for any form, will need to add for all * Rename Database
* Create table - make ajax call, open dialog, submit form, show success/error, ask and refreshMain() * Copy Database
* Rename Database - make ajax call, show success/error, ask and refresh() * Change charset
* Copy Database - make ajax call, show success/error, ask and refreshMain()
* Change charset - make ajax call, show success/error
*/ */
$(document).ready(function() { $(document).ready(function() {
//Create Table
$("#create_table_form_minimal").live('submit', function(event) {
event.preventDefault();
/* @todo Validate this form! */
PMA_ajaxShowMessage();
$(this).append('<input type="hidden" name="ajax_request" value="true" />');
$.get($(this).attr('action'), $(this).serialize(), function(data) {
$('<div id="create_table_dialog"></div>')
.append(data)
.dialog({
title: PMA_messages['strCreateTable'],
width: 900,
buttons : {
"Create Table" : function() {
$('#create_table_form').trigger("submit");
},
"Cancel" : function() {$(this).dialog('close').remove() ;}
}
});
})
})
//Rename Database //Rename Database
$("#rename_db_form").live('submit', function(event) { $("#rename_db_form").live('submit', function(event) {
event.preventDefault(); event.preventDefault();

View File

@@ -1935,4 +1935,35 @@ $(document).ready(function() {
}) })
}) })
}, 'top.frame_content'); //end $(document).ready() for db_structure.php }, 'top.frame_content'); //end $(document).ready() for db_structure.php
/**
* jQuery coding for 'Create Table'. Used on db_operations.php,
* db_structure.php and db_tracking.php (i.e., wherever
* libraries/display_create_table.lib.php is used)
*/
$(document).ready(function() {
$("#create_table_form_minimal").live('submit', function(event) {
event.preventDefault();
/* @todo Validate this form! */
PMA_ajaxShowMessage();
$(this).append('<input type="hidden" name="ajax_request" value="true" />');
$.get($(this).attr('action'), $(this).serialize(), function(data) {
$('<div id="create_table_dialog"></div>')
.append(data)
.dialog({
title: PMA_messages['strCreateTable'],
width: 900,
buttons : {
"Create Table" : function() {
$('#create_table_form').trigger("submit");
},
"Cancel" : function() {$(this).dialog('close').remove() ;}
}
});
})
})
}, 'top.frame_content');