From 9640a580ffb9fcbdab98032dcecd5ee180fbbcbe Mon Sep 17 00:00:00 2001 From: ninadsp Date: Thu, 22 Jul 2010 00:12:43 +0530 Subject: [PATCH] Drop Table and Create Table work as expected now on db_create.php too --- db_create.php | 1 + js/db_structure.js | 18 ------------------ js/functions.js | 27 ++++++++++++++++++++++++++- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/db_create.php b/db_create.php index b55e04fad..ede59bf97 100755 --- a/db_create.php +++ b/db_create.php @@ -11,6 +11,7 @@ */ require_once './libraries/common.inc.php'; $GLOBALS['js_include'][] = 'functions.js'; +$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; require_once './libraries/mysql_charsets.lib.php'; PMA_checkParameters(array('new_db')); diff --git a/js/db_structure.js b/js/db_structure.js index eac8c2c10..95c5be91c 100644 --- a/js/db_structure.js +++ b/js/db_structure.js @@ -5,24 +5,6 @@ */ $(document).ready(function() { - //Drop Database - $("#drop_db_anchor").live('click', function(event) { - event.preventDefault(); - - //context is top.frame_content, so we need to use window.parent.db to access the db var - var question = PMA_messages['strDropDatabaseStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'DROP DATABASE ' + window.parent.db; - - $(this).PMA_confirm(question, $(this).attr('href') ,function(url) { - - PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']); - $.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function(data) { - //Database deleted successfully, refresh both the frames - window.parent.refreshNavigation(); - window.parent.refreshMain(); - }) - }); - }); //end of Drop Database Ajax action - //Truncate Table $(".truncate_table_anchor").live('click', function(event) { event.preventDefault(); diff --git a/js/functions.js b/js/functions.js index 221a46ff6..aa88858bd 100755 --- a/js/functions.js +++ b/js/functions.js @@ -1992,4 +1992,29 @@ $(document).ready(function() { }) // end $.get }) }) -}, 'top.frame_content'); //end $(document).ready() for Drop Trigger \ No newline at end of file +}, 'top.frame_content'); //end $(document).ready() for Drop Trigger + +/** + * jQuery coding for Drop Database. Moved here from db_structure.js as it was + * also required on db_create.php + * + */ +$(document).ready(function() { + //Drop Database + $("#drop_db_anchor").live('click', function(event) { + event.preventDefault(); + + //context is top.frame_content, so we need to use window.parent.db to access the db var + var question = PMA_messages['strDropDatabaseStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'DROP DATABASE ' + window.parent.db; + + $(this).PMA_confirm(question, $(this).attr('href') ,function(url) { + + PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']); + $.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function(data) { + //Database deleted successfully, refresh both the frames + window.parent.refreshNavigation(); + window.parent.refreshMain(); + }) + }); + }); //end of Drop Database Ajax action +}) \ No newline at end of file