From dd1ec1c0191d461c3451c195ebf735d6ad6ac268 Mon Sep 17 00:00:00 2001 From: ninadsp Date: Wed, 23 Jun 2010 10:51:47 +0530 Subject: [PATCH] Fixed the issue with the content frame not refreshing after the 'Reload Database? Y/N' dialog. When copying the database, the database is now switched with JS. Create Table action still a work in progress --- js/db_operations.js | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/js/db_operations.js b/js/db_operations.js index a5f5df1d1..c6a6bac90 100644 --- a/js/db_operations.js +++ b/js/db_operations.js @@ -18,22 +18,49 @@ $(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() { + //handle form here + }, + "Cancel" : function() {$(this).dialog('close');} + } + }); + }) + }) //Rename Database $("#rename_db_form").live('submit', function(event) { event.preventDefault(); var question = 'CREATE DATABASE ... and then DROP DATABASE ' + window.parent.db; + $(this).append(''); + $(this).PMA_confirm(question, $(this).attr('action'), function(url) { PMA_ajaxShowMessage(PMA_messages['strRenamingDatabases']); - $(this).append(''); $.get(url, $("#rename_db_form").serialize() + '&is_js_confirmed=1', function(data) { if(data.success == true) { + PMA_ajaxShowMessage(data.message); + window.parent.db = data.newname; + $("" + PMA_messages['strReloadDatabase'] + "?").dialog({ buttons: {"Yes": function() { - refreshMain("main.php"); + window.parent.refreshMain(); }, "No" : function() { $(this).dialog("close"); @@ -59,7 +86,8 @@ $(document).ready(function() { if(data.success == true) { PMA_ajaxShowMessage(data.message); if( $("#checkbox_switch").is(":checked")) { - refreshMain("main.php"); + window.parent.db = data.newname; + window.parent.refreshMain(); } } else {