]> source.dussan.org Git - archiva.git/commitdiff
add spinner and modify button state when searching
authorOlivier Lamy <olamy@apache.org>
Wed, 29 Feb 2012 09:55:00 +0000 (09:55 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 29 Feb 2012 09:55:00 +0000 (09:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295047 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html

index 1e5da8bc2d14d38375e664c68d70b339a9d4db0e..c9070b78cd6749ac0d9918c39c2ef86d93b42926 100644 (file)
@@ -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 .....
index 7885cc422799e15779653f126c70696ef2f4f497..3ee0f0060c09f82682ef035e8941f9d913333486 100644 (file)
@@ -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");
           }
         }
       );
index 48edbcd6dc89eef14642c01874392dcc7467fe84..129ae9e08b8ac16fade0adedcd8153cbedf99b0e 100644 (file)
                         <option value="${repoId}">${repoId}</option>
                       {{/each}}
                     </select>
-                </div>
-                <div class="control-group">
-                  <label class="control-label" for="search-terms"></label>
-                  <div class="controls">
-                    <input type="text" class="input-medium search-query" id="search-terms" name="search-terms" size="50"
-                           data-bind="value: searchRequest().queryTerms" placeholder="${$.i18n.prop('search.artifact.search.form.query.terms')}"/>
                   </div>
-                </div>
-                <button type="submit" class="btn" data-bind="click: basicSearch">Search</button>
+                  <div class="control-group">
+                    <label class="control-label" for="search-terms"></label>
+                    <div class="controls">
+                      <input type="text" class="input-medium search-query" id="search-terms" name="search-terms" size="50"
+                             data-bind="value: searchRequest().queryTerms" placeholder="${$.i18n.prop('search.artifact.search.form.query.terms')}"/>
+                    </div>
+                  </div>
+                  <button type="submit" id="btn-basic-search" class="btn btn-primary" data-loading-text="${$.i18n.prop('search.artifact.searching')}" data-bind="click: basicSearch">Search</button>
+                </fieldset>
               </form>
             </div>
             <div class="pill-pane" id="search-advanced-form-pane">
                       </div>
                     </div>
                   </fieldset>
-                  <button type="submit" class="btn" data-bind="click: advancedSearch">Search</button>
+                  <button type="submit" id="btn-advanced-search" class="btn btn-primary" class="btn" data-bind="click: advancedSearch">Search</button>
                 </form>
             </div>
             <div class="pill-pane" id="search-osgi-form-pane">