Removed inline calls to confirmLink() for Empty/Drop Table actions in libraries/tbl_links.inc.php

This commit is contained in:
ninadsp
2010-07-11 23:14:41 +05:30
parent a180017106
commit dd58a5bc23
2 changed files with 61 additions and 3 deletions

View File

@@ -1871,4 +1871,62 @@ $(document).ready(function() {
}
}) // end create table form submit button actions
}, 'top.frame_content'); //end $(document).ready for 'Create Table'
}, 'top.frame_content'); //end $(document).ready for 'Create Table'
/**
* jQuery coding for Empty Table and Drop Table. Used wherever libraries/
* tbl_links.inc.php is used.
*/
$(document).ready(function() {
//Empty Table
$("#empty_table_anchor").live('click', function(event) {
event.preventDefault();
var question = 'TRUNCATE TABLE ' + window.parent.table;
$(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) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
$("#topmenucontainer")
.next('div')
.remove()
.end()
.after(data.sql_query);
}
else {
PMA_ajaxShowMessage(data.error);
}
}) // end $.get
})
}) // end Empty Table
//Drop Table
$("#drop_table_anchor").live('click', function(event) {
event.preventDefault();
var question = 'DROP TABLE/VIEW ' + window.parent.table;
$(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) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
$("#topmenucontainer")
.next('div')
.remove()
.end()
.after(data.sql_query);
window.parent.table = '';
window.parent.refreshNavigation();
}
else {
PMA_ajaxShowMessage(data.error);
}
}) // end $.get
})
})
}); //end $(document).ready() for libraries/tbl_links.inc.php