add a default 403 http error handling with jquery

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1383090 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-09-10 19:58:42 +00:00
parent fb43b1972e
commit 8ef6cb3fa0
2 changed files with 14 additions and 6 deletions

View File

@ -28,7 +28,15 @@ function() {
// no cache for ajax queries as we get datas from servers so preventing caching !! // no cache for ajax queries as we get datas from servers so preventing caching !!
jQuery.ajaxSetup( { jQuery.ajaxSetup( {
cache: false,//!window.archivaDevMode cache: false,//!window.archivaDevMode
dataType: 'json' dataType: 'json',
statusCode: {
403: function() {
removeSmallSpinnerImg();
removeMediumSpinnerImg("#main-content");
clearUserMessages();
displayErrorMessage($.i18n.prop('authz.karma.needed'));
}
}
}); });
}); });

View File

@ -196,18 +196,18 @@ require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) {
$("#small-spinner").remove(); $("#small-spinner").remove();
} }
mediumSpinnerImg=function(){
return "<img id=\"medium-spinner\" src=\"images/medium-spinner.gif\"/>";
};
removeMediumSpinnerImg=function(){ removeMediumSpinnerImg=function(){
$("#medium-spinner").remove(); $("#medium-spinner").remove();
} }
removeMediumSpinnerImg=function(selector){ removeMediumSpinnerImg=function(selector){
$(selector+" #medium-spinner").remove(); $(selector ).find("#medium-spinner").remove();
} }
mediumSpinnerImg=function(){
return "<img id=\"medium-spinner\" src=\"images/medium-spinner.gif\"/>";
};
closeDialogConfirm=function(){ closeDialogConfirm=function(){
window.modalConfirmDialog.modal('hide'); window.modalConfirmDialog.modal('hide');
} }