From 796cec82cf500dd4f14a7451ea0d993b3ee18a7e Mon Sep 17 00:00:00 2001 From: skygo Date: Sat, 25 May 2013 15:43:04 +0000 Subject: [PATCH] Change require.2.1.6.js add some nbactions.xml to help skygo to launch tomcat7 remove ordered by name folder introduce order field in menu to allow sort onevery callback git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-1756@1486339 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-web/archiva-webapp/nbactions.xml | 13 ++++++ .../archiva-web/archiva-webapp/pom.xml | 1 + .../archiva-webapp/src/main/webapp/index.html | 2 +- .../{20generaladmin => generaladmin}/main.js | 12 +++--- .../main.js | 4 +- .../repository/{20legacy => legacy}/main.js | 3 +- .../repository/{10maven2 => maven2}/main.js | 9 ++-- .../proxy-connectors-rules.js | 4 +- .../{10maven2 => maven2}/proxy-connectors.js | 2 +- .../{10maven2 => maven2}/repositories.js | 2 +- .../{10maven2 => maven2}/repository-groups.js | 4 +- .../src/main/webapp/js/archiva/archiva.js | 28 ++----------- .../webapp/js/archiva/cookie-information.js | 41 +++++++++++++++++++ .../src/main/webapp/js/archiva/main.js | 12 +++++- .../src/main/webapp/js/require.2.1.6.js | 36 ++++++++++++++++ 15 files changed, 126 insertions(+), 47 deletions(-) create mode 100644 archiva-modules/archiva-web/archiva-webapp/nbactions.xml rename archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/{20generaladmin => generaladmin}/main.js (98%) rename archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/{10networkproxies => networkproxies}/main.js (97%) rename archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/{20legacy => legacy}/main.js (99%) rename archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/{10maven2 => maven2}/main.js (69%) rename archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/{10maven2 => maven2}/proxy-connectors-rules.js (98%) rename archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/{10maven2 => maven2}/proxy-connectors.js (99%) rename archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/{10maven2 => maven2}/repositories.js (99%) rename archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/{10maven2 => maven2}/repository-groups.js (98%) create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/cookie-information.js create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/require.2.1.6.js diff --git a/archiva-modules/archiva-web/archiva-webapp/nbactions.xml b/archiva-modules/archiva-web/archiva-webapp/nbactions.xml new file mode 100644 index 000000000..6f4d0393b --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/nbactions.xml @@ -0,0 +1,13 @@ + + + + CUSTOM-T + T + + tomcat7:run + -pl + :archiva-webapp + -am + + + diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml index 4e201b764..7707630fe 100644 --- a/archiva-modules/archiva-web/archiva-webapp/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml @@ -869,6 +869,7 @@ apache-rat-plugin + nbactions.xml src/main/webapp/css/*.css src/main/webapp/js/*.js src/site/resources/css/*.css diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/index.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/index.html index 4326e674a..c2411eb54 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/index.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/index.html @@ -34,7 +34,7 @@ - + Apache Archiva diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/20generaladmin/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/generaladmin/main.js similarity index 98% rename from archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/20generaladmin/main.js rename to archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/generaladmin/main.js index 4aa130e61..6c7201411 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/20generaladmin/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/generaladmin/main.js @@ -16,16 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva/admin/features/20generaladmin/main",["jquery","i18n","utils","jquery.tmpl","knockout","knockout.simpleGrid", +define("archiva/admin/features/generaladmin/main",["jquery","i18n","utils","jquery.tmpl","knockout","knockout.simpleGrid", "knockout.sortable","jquery.ui","jquery.validate","bootstrap","select2","knockout.select2"] , function(jquery,i18n,utils,jqueryTmpl,ko,simpleGrid,sortable,jqueryUi,validate,bootstrap,select2) { showMenu = function( administrationMenuItems) { - administrationMenuItems.push({ text : $.i18n.prop('menu.repository-scanning') , id: "menu-repository-scanning-list-a" , href: "#scanningList" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRepositoryScanning();}}); - administrationMenuItems.push({ text : $.i18n.prop('menu.runtime-configuration') , id: "menu-runtime-configuration-list-a" , href: "#runtimeconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRuntimeConfiguration();}}); - administrationMenuItems.push({ text : $.i18n.prop('menu.system-status') , id: "menu-system-status-list-a" , href: "#status" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displaySystemStatus();}}); - administrationMenuItems.push({ text : $.i18n.prop('menu.ui-configuration') , id: "menu-ui-configuration-list-a" , href: "#uiconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayUiConfiguration();}}); - administrationMenuItems.push({ text : $.i18n.prop('menu.reports') , id: "menu-report-list-a" , href: "#reports" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayReportsPage();}}); + administrationMenuItems.push({ text : $.i18n.prop('menu.repository-scanning') , order:2000, id: "menu-repository-scanning-list-a" , href: "#scanningList" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRepositoryScanning();}}); + administrationMenuItems.push({ text : $.i18n.prop('menu.runtime-configuration') , order:2010, id: "menu-runtime-configuration-list-a" , href: "#runtimeconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRuntimeConfiguration();}}); + administrationMenuItems.push({ text : $.i18n.prop('menu.system-status') , order:2020, id: "menu-system-status-list-a" , href: "#status" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displaySystemStatus();}}); + administrationMenuItems.push({ text : $.i18n.prop('menu.ui-configuration') , order:2030, id: "menu-ui-configuration-list-a" , href: "#uiconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayUiConfiguration();}}); + administrationMenuItems.push({ text : $.i18n.prop('menu.reports') , order:2040, id: "menu-report-list-a" , href: "#reports" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayReportsPage();}}); }; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/10networkproxies/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/networkproxies/main.js similarity index 97% rename from archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/10networkproxies/main.js rename to archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/networkproxies/main.js index c2d7a0711..4925694f5 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/10networkproxies/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/networkproxies/main.js @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva/admin/features/10networkproxies/main",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","knockout" +define("archiva/admin/features/networkproxies/main",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","knockout" ,"knockout.simpleGrid"], function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { showMenu = function(administrationMenuItems) { administrationMenuItems.push( - { text : $.i18n.prop('menu.network-proxies') , id: "menu-network-proxies-list-a" , href: "#networkproxies" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayNetworkProxies()}} + { text : $.i18n.prop('menu.network-proxies') ,order:1000, id: "menu-network-proxies-list-a" , href: "#networkproxies" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayNetworkProxies()}} ); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/20legacy/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/legacy/main.js similarity index 99% rename from archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/20legacy/main.js rename to archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/legacy/main.js index 907cdf02e..bc6db19e1 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/20legacy/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/legacy/main.js @@ -16,13 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva/admin/repository/20legacy/main", ["jquery", 'i18n','knockout'], +define("archiva/admin/repository/legacy/main", ["jquery", 'i18n','knockout'], function(jquery,i18n,ko) { showMenu = function(administrationMenuItems) { administrationMenuItems.push( { text: $.i18n.prop('menu.legacy-artifact-support'), + order:600, id: "menu-legacy-support-list-a", href: "#legacy", redback: "{permissions: ['archiva-manage-configuration']}", diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/main.js similarity index 69% rename from archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/main.js rename to archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/main.js index b669fa00f..301ecc1c8 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/main.js @@ -16,11 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva/admin/repository/10maven2/main",["jquery",'i18n',"archiva/admin/repository/10maven2/repository-groups","archiva/admin/repository/10maven2/proxy-connectors-rules","archiva/admin/repository/10maven2/proxy-connectors"], +define("archiva/admin/repository/maven2/main",["jquery",'i18n',"archiva/admin/repository/maven2/repository-groups","archiva/admin/repository/maven2/proxy-connectors-rules","archiva/admin/repository/maven2/proxy-connectors"], function() { showMenu = function(administrationMenuItems) { administrationMenuItems.push( {text: $.i18n.prop('menu.repository.groups'), + order:500, id: "menu-repository-groups-list-a", href: "#repositorygroup", redback: "{permissions: ['archiva-manage-configuration']}", @@ -28,13 +29,13 @@ define("archiva/admin/repository/10maven2/main",["jquery",'i18n',"archiva/admin/ displayRepositoryGroups(); } }); - administrationMenuItems.push({text: $.i18n.prop('menu.repositories'), id: "menu-repositories-list-a", href: "#repositorylist", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { + administrationMenuItems.push({text: $.i18n.prop('menu.repositories'), order:510, id: "menu-repositories-list-a", href: "#repositorylist", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { displayRepositoriesGrid(); }}); - administrationMenuItems.push({text: $.i18n.prop('menu.proxy-connectors'), id: "menu-proxy-connectors-list-a", href: "#proxyconnectors", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { + administrationMenuItems.push({text: $.i18n.prop('menu.proxy-connectors'), order:520, id: "menu-proxy-connectors-list-a", href: "#proxyconnectors", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { displayProxyConnectors(); }}); - administrationMenuItems.push({text: $.i18n.prop('menu.proxy-connectors-rules'), id: "menu.proxy-connectors-rules-list-a", href: "#proxyconnectorsrules", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { + administrationMenuItems.push({text: $.i18n.prop('menu.proxy-connectors-rules'), order:530, id: "menu.proxy-connectors-rules-list-a", href: "#proxyconnectorsrules", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { displayProxyConnectorsRules(); }}); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/proxy-connectors-rules.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/proxy-connectors-rules.js similarity index 98% rename from archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/proxy-connectors-rules.js rename to archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/proxy-connectors-rules.js index 99976117d..74b08eaea 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/proxy-connectors-rules.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/proxy-connectors-rules.js @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva/admin/repository/10maven2/proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstrap","jquery.ui","knockout" - ,"knockout.simpleGrid","knockout.sortable","archiva/admin/repository/10maven2/proxy-connectors"], +define("archiva/admin/repository/maven2/proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstrap","jquery.ui","knockout" + ,"knockout.simpleGrid","knockout.sortable","archiva/admin/repository/maven2/proxy-connectors"], function(jquery,i18n,jqueryTmpl,bootstrap,jqueryUi,ko) { ProxyConnectorRulesViewModel=function(proxyConnectorRules,proxyConnectors){ diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/proxy-connectors.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/proxy-connectors.js similarity index 99% rename from archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/proxy-connectors.js rename to archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/proxy-connectors.js index afdc7c146..7c498f3cf 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/proxy-connectors.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/proxy-connectors.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva/admin/repository/10maven2/proxy-connectors",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","knockout" +define("archiva/admin/repository/maven2/proxy-connectors",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","knockout" ,"knockout.simpleGrid","knockout.sortable","select2"], function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/repositories.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js similarity index 99% rename from archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/repositories.js rename to archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js index cfaad6ec2..eb590bf6b 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva/admin/repository/10maven2/repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","knockout","knockout.simpleGrid"], +define("archiva/admin/repository/maven2/repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","knockout","knockout.simpleGrid"], function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { // FIXME this must be dynamic if we do a plugin mechanism with dynamic repositories types diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/repository-groups.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repository-groups.js similarity index 98% rename from archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/repository-groups.js rename to archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repository-groups.js index be7956de0..6af71b002 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/repository-groups.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repository-groups.js @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva/admin/repository/10maven2/repository-groups",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","jquery.ui","knockout" - ,"knockout.simpleGrid","knockout.sortable","archiva/admin/repository/10maven2/repositories"], +define("archiva/admin/repository/maven2/repository-groups",["jquery","i18n","jquery.tmpl","bootstrap","jquery.validate","jquery.ui","knockout" + ,"knockout.simpleGrid","knockout.sortable","archiva/admin/repository/maven2/repositories"], function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) { RepositoryGroup=function(id,repositories,mergedIndexPath){ diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/archiva.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/archiva.js index c2beda5e7..eda3184d2 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/archiva.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/archiva.js @@ -88,7 +88,7 @@ $.ajax({ "redback.user": "redback/user", "redback.users": "redback/users", "redback.templates": "redback/redback-tmpl", - // "archiva.general-admin":"archiva/general-admin", + "archiva.cookie-information":"archiva/cookie-information", "archiva.templates": "archiva/main-tmpl", // "archiva.repositories": "archiva/repositories", // "archiva.network-proxies": "archiva/network-proxies", @@ -103,32 +103,10 @@ $.ajax({ }); - CookieInformation=function(path,domain,secure,timeout,rememberMeEnabled){ - //private String path; - this.path=path; - - //private String domain; - this.domain=domain; - - //private String secure; - this.secure=secure; - - //private String timeout; - this.timeout=timeout; - - //private boolean rememberMeEnabled; - this.rememberMeEnabled=rememberMeEnabled; - } - - mapCookieInformation=function(data){ - if(!data){ - return new CookieInformation(); - } - return new CookieInformation(data.path,data.domain,data.secure,data.timeout,data.rememberMeEnabled); - } + - requirejs(['jquery','jquery.tmpl','jquery.ui','i18n','sammy','startup','utils','domReady!','archiva.main'/*,'archiva.general-admin'*/], function () { + requirejs(['jquery','jquery.tmpl','jquery.ui','i18n','sammy','startup','utils','domReady!','archiva.main','archiva.cookie-information'], function () { loadi18n(function () { $.ajax({ url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(), diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/cookie-information.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/cookie-information.js new file mode 100644 index 000000000..ae764ce28 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/cookie-information.js @@ -0,0 +1,41 @@ +/* + * Copyright 2013 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +define("archiva.cookie-information",function() { +CookieInformation=function(path,domain,secure,timeout,rememberMeEnabled){ + //private String path; + this.path=path; + + //private String domain; + this.domain=domain; + + //private String secure; + this.secure=secure; + + //private String timeout; + this.timeout=timeout; + + //private boolean rememberMeEnabled; + this.rememberMeEnabled=rememberMeEnabled; + } + + mapCookieInformation=function(data){ + if(!data){ + return new CookieInformation(); + } + return new CookieInformation(data.path,data.domain,data.secure,data.timeout,data.rememberMeEnabled); + } + +}); \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js index 0e088b01a..24676aca8 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js @@ -222,20 +222,28 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa { text : $.i18n.prop('menu.artifacts.upload') , id: "menu-find-upload-a", href: "#upload" , redback: "{permissions: ['archiva-upload-repository']}", func: function(){displayUploadArtifact(true)}} ]); this.administrationMenuItems = ko.observableArray([ - {text: $.i18n.prop('menu.administration'), id: null} ]); + {text: $.i18n.prop('menu.administration'), id: null ,order : 1} ]); var pluginsURL = "restServices/archivaServices/pluginsService/getAdminPlugins"; $.ajax(pluginsURL, { type: "GET", dataType: 'text', + success: function(data) { - $.each(data.split("|"), function(key, value) { + $.each(data.split("|"), function(key, value) { require([value], function() { showMenu(self.administrationMenuItems); + // sort menu according to order field + // + self.administrationMenuItems.sort(function(left, right) { + return left.order == right.order ? 0 : (left.order < right.order ? -1 : 1) + }) }); }); + } + }); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/require.2.1.6.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/require.2.1.6.js new file mode 100644 index 000000000..b2dfc2550 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/require.2.1.6.js @@ -0,0 +1,36 @@ +/* + RequireJS 2.1.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + Available via the MIT or new BSD license. + see: http://github.com/jrburke/requirejs for details +*/ +var requirejs,require,define; +(function(ba){function J(b){return"[object Function]"===N.call(b)}function K(b){return"[object Array]"===N.call(b)}function z(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(J(n)){if(this.events.error&&this.map.isDefine||h.onError!==ca)try{e=k.execCb(c,n,b,e)}catch(d){a=d}else e=k.execCb(c,n,b,e);this.map.isDefine&&((b=this.module)&&void 0!==b.exports&&b.exports!== +this.exports?e=b.exports:void 0===e&&this.usingExports&&(e=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else e=n;this.exports=e;if(this.map.isDefine&&!this.ignore&&(r[c]=e,h.onResourceLoad))h.onResourceLoad(k,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete= +!0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=l(a.prefix);this.depMaps.push(d);u(d,"defined",v(this,function(e){var n,d;d=this.map.name;var g=this.map.parentMap?this.map.parentMap.name:null,C=k.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(e.normalize&&(d=e.normalize(d,function(a){return c(a,g,!0)})||""),e=l(a.prefix+"!"+d,this.map.parentMap),u(e,"defined",v(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})), +d=m(q,e.id)){this.depMaps.push(e);if(this.events.error)d.on("error",v(this,function(a){this.emit("error",a)}));d.enable()}}else n=v(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),n.error=v(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];H(q,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),n.fromText=v(this,function(e,c){var d=a.name,g=l(d),i=Q;c&&(e=c);i&&(Q=!1);s(g);t(j.config,b)&&(j.config[d]=j.config[b]);try{h.exec(e)}catch(D){return w(B("fromtexteval", +"fromText eval for "+b+" failed: "+D,D,[b]))}i&&(Q=!0);this.depMaps.push(g);k.completeLoad(d);C([d],n)}),e.load(a.name,C,n,j)}));k.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){W[this.map.id]=this;this.enabling=this.enabled=!0;z(this.depMaps,v(this,function(a,b){var c,e;if("string"===typeof a){a=l(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(P,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;u(a,"defined",v(this,function(a){this.defineDep(b, +a);this.check()}));this.errback&&u(a,"error",v(this,this.errback))}c=a.id;e=q[c];!t(P,c)&&(e&&!e.enabled)&&k.enable(a,this)}));H(this.pluginMaps,v(this,function(a){var b=m(q,a.id);b&&!b.enabled&&k.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){z(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};k={config:j,contextName:b,registry:q,defined:r,urlFetched:V,defQueue:I,Module:$,makeModuleMap:l, +nextTick:h.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.pkgs,c=j.shim,e={paths:!0,config:!0,map:!0};H(a,function(a,b){e[b]?"map"===b?(j.map||(j.map={}),S(j[b],a,!0,!0)):S(j[b],a,!0):j[b]=a});a.shim&&(H(a.shim,function(a,b){K(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=k.makeShimExports(a);c[b]=a}),j.shim=c);a.packages&&(z(a.packages,function(a){a="string"===typeof a?{name:a}:a;b[a.name]={name:a.name, +location:a.location||a.name,main:(a.main||"main").replace(ka,"").replace(fa,"")}}),j.pkgs=b);H(q,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=l(b))});if(a.deps||a.callback)k.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,f){function d(e,c,g){var i,j;f.enableBuildCallback&&(c&&J(c))&&(c.__requireJsBuild=!0);if("string"===typeof e){if(J(c))return w(B("requireargs", +"Invalid require call"),g);if(a&&t(P,e))return P[e](q[a.id]);if(h.get)return h.get(k,e,a,d);i=l(e,a,!1,!0);i=i.id;return!t(r,i)?w(B("notloaded",'Module name "'+i+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[i]}M();k.nextTick(function(){M();j=s(l(null,a));j.skipMap=f.skipMap;j.init(e,c,g,{enabled:!0});E()});return d}f=f||{};S(d,{isBrowser:A,toUrl:function(b){var d,f=b.lastIndexOf("."),g=b.split("/")[0];if(-1!==f&&(!("."===g||".."===g)||1g.attachEvent.toString().indexOf("[native code"))&&!Z?(Q=!0,g.attachEvent("onreadystatechange",b.onScriptLoad)):(g.addEventListener("load",b.onScriptLoad,!1),g.addEventListener("error",b.onScriptError,!1)),g.src=d,M=g,E?y.insertBefore(g,E):y.appendChild(g), +M=null,g;if(ea)try{importScripts(d),b.completeLoad(c)}catch(l){b.onError(B("importscripts","importScripts failed for "+c+" at "+d,l,[c]))}};A&&O(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(L=b.getAttribute("data-main"))return s=L,u.baseUrl||(F=s.split("/"),s=F.pop(),ga=F.length?F.join("/")+"/":"./",u.baseUrl=ga),s=s.replace(fa,""),h.jsExtRegExp.test(s)&&(s=L),u.deps=u.deps?u.deps.concat(s):[s],!0});define=function(b,c,d){var h,g;"string"!==typeof b&&(d=c,c=b,b=null); +K(c)||(d=c,c=null);!c&&J(d)&&(c=[],d.length&&(d.toString().replace(ma,"").replace(na,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(Q){if(!(h=M))R&&"interactive"===R.readyState||O(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return R=b}),h=R;h&&(b||(b=h.getAttribute("data-requiremodule")),g=G[h.getAttribute("data-requirecontext")])}(g?g.defQueue:U).push([b,c,d])};define.amd={jQuery:!0};h.exec=function(b){return eval(b)}; +h(u)}})(this); -- 2.39.5