diff --git a/js/db_operations.js b/js/db_operations.js index b48c42ed9..bddc66a29 100644 --- a/js/db_operations.js +++ b/js/db_operations.js @@ -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(''); - - $.get($(this).attr('action'), $(this).serialize(), function(data) { - $('
') - .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(); diff --git a/js/functions.js b/js/functions.js index ea2db949f..aa1ced89c 100755 --- a/js/functions.js +++ b/js/functions.js @@ -1935,4 +1935,35 @@ $(document).ready(function() { }) }) -}, 'top.frame_content'); //end $(document).ready() for db_structure.php \ No newline at end of file +}, '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(''); + + $.get($(this).attr('action'), $(this).serialize(), function(data) { + $('') + .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'); \ No newline at end of file