Drop Table and Create Table work as expected now on db_create.php too

This commit is contained in:
ninadsp
2010-07-22 00:12:43 +05:30
parent 6e908dfeb2
commit 9640a580ff
3 changed files with 27 additions and 19 deletions

View File

@@ -11,6 +11,7 @@
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'functions.js'; $GLOBALS['js_include'][] = 'functions.js';
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
require_once './libraries/mysql_charsets.lib.php'; require_once './libraries/mysql_charsets.lib.php';
PMA_checkParameters(array('new_db')); PMA_checkParameters(array('new_db'));

View File

@@ -5,24 +5,6 @@
*/ */
$(document).ready(function() { $(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
$(".truncate_table_anchor").live('click', function(event) { $(".truncate_table_anchor").live('click', function(event) {
event.preventDefault(); event.preventDefault();

View File

@@ -1993,3 +1993,28 @@ $(document).ready(function() {
}) })
}) })
}, 'top.frame_content'); //end $(document).ready() for Drop Trigger }, '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
})