From d85d9fd2fc8ad6bb01d85a0e42e3794609e42a4e Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 26 Jan 2012 22:57:15 +0000 Subject: [PATCH] [MRM-1578] add layout git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1236434 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/index.html | 1 + .../src/main/webapp/js/archiva/main-tmpl.js | 6 +- .../main/webapp/js/archiva/network-proxies.js | 94 +++++++++++++++++++ .../webapp/js/archiva/templates/menu.html | 3 + .../js/archiva/templates/network-proxies.html | 0 5 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js create mode 100644 archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html index d0168dfea..bbe95deca 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html @@ -70,6 +70,7 @@ $.ajax( .script("jquery.json-2.3.min.js").wait() .script("archiva/main-tmpl.js").wait() .script("archiva/repositories.js").wait() + .script("archiva/network-proxies.js").wait() .script("redback/operation.js").wait() .script("redback/redback-tmpl.js").wait() .script("bootstrap-tabs.js") diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js index 8acd644a6..a49d1d35d 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js @@ -19,8 +19,9 @@ require(["text!archiva/templates/menu.html?"+timestampNoCache(),"text!archiva/templates/topbar.html?"+timestampNoCache(), "text!archiva/templates/message.html?"+timestampNoCache(),"text!archiva/templates/modal.html?"+timestampNoCache(), "text!archiva/templates/grids-generics.html?"+timestampNoCache(), - "text!archiva/templates/repositories.html?"+timestampNoCache()], - function(menu,topbar,message,modal,grids_generics,repositories) { + "text!archiva/templates/repositories.html?"+timestampNoCache(), + "text!archiva/templates/network-proxies.html?"+timestampNoCache()], + function(menu,topbar,message,modal,grids_generics,repositories,network_proxies) { // template loading $.tmpl( menu ).appendTo("#html-fragments"); @@ -29,6 +30,7 @@ require(["text!archiva/templates/menu.html?"+timestampNoCache(),"text!archiva/te $.tmpl( modal ).appendTo("#html-fragments"); $("#html-fragments").append(grids_generics); $("#html-fragments").append(repositories); + $("#html-fragments").append(network_proxies); $.log("main-tmpl.js menu loaded"); } ); \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js new file mode 100644 index 000000000..e3dc7b609 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js @@ -0,0 +1,94 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +$(function() { + + + displayNetworkProxies=function(){ + + } + + NetworkProxy=function(id,protocol,host,port,username,password){ + //private String id; + this.id = ko.observable(id); + + //private String protocol = "http"; + this.protocol=ko.observable(protocol); + + //private String host; + this.host=ko.observable(host); + + //private int port = 8080; + this.port=ko.observable(port); + + //private String username; + this.username=ko.observable(username); + + //private String password; + this.password=ko.observable(password); + } + + NetworkProxyViewModel=function(networkProxy, update, networkProxiesViewModel){ + this.update=update; + this.networkProxy=networkProxy; + this.networkProxiesViewModel=networkProxiesViewModel; + var self=this; + + save=function(){ + + } + + displayGrid=function(){ + + } + } + + NetworkProxiesViewModel=function(){ + this.networkProxies=ko.observableArray([]); + + var self=this; + + editNetworkProxy=function(networkProxy){ + + } + + removeNetworkProxy=function(networkProxy){ + + } + } + + + displayNetworkProxies=function(){ + var networkProxiesViewModel = new NetworkProxiesViewModel(); + } + + mapNetworkProxy=function(data){ + if (data==null){ + return null; + } + return new NetworkProxy(data.id,data.protocol,data.host,data.port,data.username,data.password); + } + + mapNetworkProxies=function(data){ + var mappedNetworkProxies = $.map(data.networkProxy, function(item) { + return mapNetworkProxy(item); + }); + return mappedNetworkProxies; + } + +}); \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html index 50d1750b0..9972c7951 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html @@ -27,5 +27,8 @@
  • ${$.i18n.prop('repositories.list')}
  • +
  • + ${$.i18n.prop('repositories.list')} +
  • diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html new file mode 100644 index 000000000..e69de29bb -- 2.39.5