From a67abc4333dd69698d52193300ad105f05f8eb16 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 29 Feb 2012 09:55:00 +0000 Subject: add spinner and modify button state when searching git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295047 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/archiva/i18n/default.properties | 1 + .../src/main/webapp/js/archiva/search.js | 7 ++++++- .../src/main/webapp/js/archiva/templates/search.html | 19 ++++++++++--------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties index 1e5da8bc2..c9070b78c 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties @@ -222,3 +222,4 @@ search.artifact.noresults=No results found. search.artifact.results.groupId=Group ID search.artifact.results.artifactId=Artifact ID search.artifact.results.version=Version +search.artifact.searching=Searching ..... 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 7885cc422..3ee0f0060 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 @@ -688,7 +688,8 @@ $(function() { customShowError("#main-content #search-basic-form", null, null, []); } var searchResultsGrid=$("#main-content #search-results #search-results-grid" ); - $("#main-content #user-messages").html(mediumSpinnerImg()); + $("#main-content #btn-basic-search" ).button("loading"); + $("#user-messages").html(mediumSpinnerImg()); this.searchRequest().repositories=this.selectedRepoIds; $.ajax("restServices/archivaServices/searchService/quickSearchWithRepositories", { @@ -715,6 +716,10 @@ $(function() { error: function(data) { var res = $.parseJSON(data.responseText); displayRestError(res); + }, + complete:function() { + $("#main-content #btn-basic-search" ).button("reset"); + removeMediumSpinnerImg("#user-messages"); } } ); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html index 48edbcd6d..129ae9e08 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html @@ -201,15 +201,16 @@ {{/each}} - -
- -
-
-
- +
+ +
+ +
+
+ +
@@ -251,7 +252,7 @@
- +
-- cgit v1.2.3