From 08a76456232a06e62e32c1c7f7f341ec0f95deee Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 28 Sep 2012 14:00:56 +0000 Subject: [PATCH] use bootstrap toggle button feature git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1391470 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/general-admin.js | 8 +++++++- .../main/webapp/js/templates/archiva/general-admin.html | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) 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 index c5c27397a..d1701d836 100644 --- 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 @@ -521,10 +521,12 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" this.networkConfiguration=ko.observable(networkConfiguration); save=function(){ + $("#user-messages" ).html(mediumSpinnerImg()); + var mainContent=$("#main-content"); if (!$("#main-content" ).find("#network-configuration-edit-form").valid()){ return; } - clearUserMessages(); + mainContent.find("#network-configuration-btn-save" ).button('loading'); $.ajax("restServices/archivaServices/archivaAdministrationService/setNetworkConfiguration", { type: "POST", contentType: 'application/json', @@ -532,6 +534,10 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" dataType: 'json', success: function(data){ displaySuccessMessage( $.i18n.prop("network-configuration.updated")); + }, + complete: function(){ + removeMediumSpinnerImg("#user-messages"); + mainContent.find("#network-configuration-btn-save" ).button('reset'); } }); } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html index 9b165d993..77d2f61d0 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html @@ -311,7 +311,8 @@ - + -- 2.39.5