Merge pull request #1145 from mebjas/feature-1518

patch for feature request 1518
This commit is contained in:
Marc Delisle 2014-04-19 07:48:32 -04:00
commit 8442db4dce
2 changed files with 15 additions and 0 deletions

View File

@ -160,6 +160,20 @@ var AJAX = {
event.preventDefault();
event.stopImmediatePropagation();
}
//sometime we accidently click on a url,refresh button or back button
//operation to confirm if user want to leave page in such cases
var flag = false;
$("input[type='text']").each(function(index){
if($(this).val().length > 0) {
flag = true;
}
});
//trigger confirm dialog
if (event.type === 'click' && flag && confirm(PMA_messages['strConfirmNavigation']) === false) {
return false;
}
if (AJAX.active === true) {
// Cancel the old request if abortable, when the user requests
// something else. Otherwise silently bail out, as there is already

View File

@ -43,6 +43,7 @@ $js_messages['strDroppingPrimaryKeyIndex'] = __('Dropping Primary Key/Index');
$js_messages['strOperationTakesLongTime'] = __('This operation could take a long time. Proceed anyway?');
$js_messages['strDropUserGroupWarning'] = __('Do you really want to delete user group "%s"?');
$js_messages['strConfirmDeleteQBESearch'] = __('Do you really want to delete the search "%s"?');
$js_messages['strConfirmNavigation'] = __('Are you sure you want to navigate away from this page? Press OK to continue or Cancel to stay on the current page.');
/* For indexes */
$js_messages['strFormEmpty'] = __('Missing value in the form!');