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:
@@ -8,40 +8,13 @@
|
||||
/**
|
||||
* Add Ajax event handlers here for db_operations.php
|
||||
*
|
||||
* no id for any form, will need to add for all
|
||||
* Create table - make ajax call, open dialog, submit form, show success/error, ask and refreshMain()
|
||||
* Rename Database - make ajax call, show success/error, ask and refresh()
|
||||
* Copy Database - make ajax call, show success/error, ask and refreshMain()
|
||||
* Change charset - make ajax call, show success/error
|
||||
* Rename Database
|
||||
* Copy Database
|
||||
* Change charset
|
||||
*/
|
||||
|
||||
$(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_db_form").live('submit', function(event) {
|
||||
event.preventDefault();
|
||||
|
@@ -1936,3 +1936,34 @@ $(document).ready(function() {
|
||||
})
|
||||
|
||||
}, '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');
|
Reference in New Issue
Block a user