From 18f3888b23cebbbe4139ed56b9d5a711e82d288a Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 7 Mar 2012 22:00:39 +0000 Subject: [PATCH] simplify code git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1298147 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/main.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js index d8f33fb33..b9265106e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js @@ -80,22 +80,30 @@ $(function() { } var screen = $.urlParam('screen'); - $.log("screen:"+screen+',operations:'+window.redbackModel.operatioNames); + if(screen){ - if(screen=='proxy-connectors'&& $.inArray('archiva-manage-configuration',window.redbackModel.operatioNames)>=0){ + if(screen=='proxy-connectors'&& hasKarma('archiva-manage-configuration')){ displayProxyConnectors(); return; } - if(screen=="legacy-artifact-path-support"&& $.inArray('archiva-manage-configuration',window.redbackModel.operatioNames)>=0){ + if(screen=="legacy-artifact-path-support"&& hasKarma('archiva-manage-configuration')){ displayLegacyArtifactPathSupport(); return; } + if (screen=='repository-scanning'&& hasKarma('archiva-manage-configuration')){ + displayRepositoryScanning(); + return; + } } // by default display search screen displaySearch(); } + hasKarma=function(karmaName){ + return $.inArray(karmaName,window.redbackModel.operatioNames)>=0; + } + decorateMenuWithKarma=function(user) { var username = user.username; $.log("decorateMenuWithKarma"); -- 2.39.5