Removed inline call to confirmLink() for 'Drop Event' action

This commit is contained in:
ninadsp
2010-07-11 02:08:47 +05:30
parent e98edae53b
commit 70a8735c07
3 changed files with 30 additions and 4 deletions

View File

@@ -1804,11 +1804,11 @@ jQuery.fn.PMA_confirm = function(question, url, callbackFn) {
callbackFn.call(this, url);
}
};
button_options[PMA_messages['strCancel']] = function() { $(this).dialog("close").remove(); }
button_options[PMA_messages['strCancel']] = function() {$(this).dialog("close").remove();}
$('<div id="confirm_dialog"></div>')
.prepend(question)
.dialog({ buttons: button_options });
.dialog({buttons: button_options});
};
/**
@@ -1935,7 +1935,32 @@ $(document).ready(function() {
}
})
})
})//end Add Primary Key
//Drop Event
$('.drop_event_anchor').live('click', function(event) {
event.preventDefault();
var curr_event_row = $(this).parents('tr');
var curr_event_name = $(curr_event_row).children('td:first').text();
var question = 'DROP EVENT ' + curr_event_name;
$(this).PMA_confirm(question, $(this).attr('href') , function(url) {
PMA_ajaxShowMessage(PMA_messages['strDroppingEvent']);
$.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function(data) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
$(curr_event_row).hide("medium").remove();
}
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
}
})
})
})
//end Drop Event
}, 'top.frame_content'); //end $(document).ready() for db_structure.php
@@ -1953,7 +1978,7 @@ $(document).ready(function() {
/* @todo Validate this form! */
var button_options = {};
button_options[PMA_messages['strCancel']] = function() {$(this).dialog('close').remove(); }
button_options[PMA_messages['strCancel']] = function() {$(this).dialog('close').remove();}
PMA_ajaxShowMessage();
$(this).append('<input type="hidden" name="ajax_request" value="true" />');

View File

@@ -29,6 +29,7 @@ $js_messages['strNoDropDatabases'] = __('"DROP DATABASE" statements are disabled
/* For confirmations */
$js_messages['strDoYouReally'] = __('Do you really want to ');
$js_messages['strDropDatabaseStrongWarning'] = __('You are about to DESTROY a complete database!');
$js_messages['strDroppingEvent'] = __('Dropping Event');
/* For blobstreaming */
$js_messages['strBLOBRepositoryDisableStrongWarning'] = __('You are about to DISABLE a BLOB Repository!');

View File

@@ -51,7 +51,7 @@ if ($events) {
($ct%2 == 0) ? 'even' : 'odd',
$event['EVENT_NAME'],
! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&amp;sql_query=' . urlencode($definition) . '&amp;show_query=1&amp;delimiter=' . urlencode($delimiter), $titles['Structure']) : '&nbsp;',
'<a href="sql.php?' . $url_query . '&amp;sql_query=' . urlencode($sqlDrop) . '" onclick="return confirmLink(this, \'' . PMA_jsFormat($sqlDrop, false) . '\')">' . $titles['Drop'] . '</a>',
'<a class="drop_event_anchor" href="sql.php?' . $url_query . '&amp;sql_query=' . urlencode($sqlDrop) . '" >' . $titles['Drop'] . '</a>',
$event['EVENT_TYPE']);
$ct++;
}