From 0acf0c9e11580f8f44eb2898add0f8ca79b2e91a Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 6 Mar 2012 18:30:32 +0000 Subject: [PATCH] [MRM-1577] rewrite legacy path admin page add js layout. use a generic naming for small admin screen. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1297636 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/index.html | 1 + .../main/webapp/js/archiva/general-admin.js | 40 +++++++++++++++++++ .../src/main/webapp/js/archiva/search.js | 2 +- .../js/archiva/templates/general-admin.html | 25 ++++++++++++ .../webapp/js/archiva/templates/menu.html | 3 ++ 5 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js create mode 100644 archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.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 7079b3e53..0cd557eab 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 @@ -86,6 +86,7 @@ $.ajax( .script(buildLoadJsUrl("jquery.validate.js")).wait() .script("jquery.json-2.3.min.js").wait() .script(buildLoadJsUrl("archiva/main-tmpl.js")).wait() + .script(buildLoadJsUrl("archiva/general-admin.js")) .script(buildLoadJsUrl("archiva/repositories.js")).wait() .script(buildLoadJsUrl("archiva/network-proxies.js")).wait() .script(buildLoadJsUrl("archiva/proxy-connectors.js")).wait() diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js new file mode 100644 index 000000000..9711235e4 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js @@ -0,0 +1,40 @@ +/* + * 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() { + + //------------------------- + // legacy path part + //------------------------- + + LegacyPathViewModel=function(){ + + } + + displayLegacySupport=function(){ + clearUserMessages(); + var mainContent=$("#main-content"); + + mainContent.html($("#legacy-path-main" ).html()); + + var legacyPathViewModel=new LegacyPathViewModel(); + + ko.applyBindings(legacyPathViewModel,mainContent.find("#legacy-path-screen" ).get(0)) + } + +}); \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js index 9f372f277..21d31239c 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js @@ -851,7 +851,7 @@ $(function() { searchViewModel.observableRepoIds(repos); ko.applyBindings(searchViewModel,mainContent.find("#search-artifacts-div").get(0)); mainContent.find("#search-basic-repostories-select" ).chosen(); - if (successCallbackFn) successCallbackFn(); + if (successCallbackFn!=null) successCallbackFn(); } }); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html new file mode 100644 index 000000000..d484b0297 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html @@ -0,0 +1,25 @@ + + + + \ 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 d82253abf..1af0b573e 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 @@ -42,6 +42,9 @@
  • ${$.i18n.prop('menu.network-proxies')}
  • +
  • + ${$.i18n.prop('menu.legacy-support')} +