aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-10 19:58:42 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-10 19:58:42 +0000
commit8ef6cb3fa0971f4a04eef5885f410af3fd7398ea (patch)
treecc77fbc06c51b9cb1d3eb92da6cb3dbb070abc69 /archiva-modules
parentfb43b1972ebf400f4e555e9bbcf69d27bf5c2724 (diff)
downloadarchiva-8ef6cb3fa0971f4a04eef5885f410af3fd7398ea.tar.gz
archiva-8ef6cb3fa0971f4a04eef5885f410af3fd7398ea.zip
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
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js10
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js10
2 files changed, 14 insertions, 6 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js
index 57a08c023..79dc190bc 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js
@@ -28,7 +28,15 @@ function() {
// no cache for ajax queries as we get datas from servers so preventing caching !!
jQuery.ajaxSetup( {
cache: false,//!window.archivaDevMode
- dataType: 'json'
+ dataType: 'json',
+ statusCode: {
+ 403: function() {
+ removeSmallSpinnerImg();
+ removeMediumSpinnerImg("#main-content");
+ clearUserMessages();
+ displayErrorMessage($.i18n.prop('authz.karma.needed'));
+ }
+ }
});
}); \ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
index 40700c80c..9581a24bb 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
@@ -196,18 +196,18 @@ require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) {
$("#small-spinner").remove();
}
- mediumSpinnerImg=function(){
- return "<img id=\"medium-spinner\" src=\"images/medium-spinner.gif\"/>";
- };
-
removeMediumSpinnerImg=function(){
$("#medium-spinner").remove();
}
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(){
window.modalConfirmDialog.modal('hide');
}