]> source.dussan.org Git - archiva.git/commitdiff
add a method to display info messages and use it when call scanRepo
authorOlivier Lamy <olamy@apache.org>
Thu, 19 Jan 2012 22:39:14 +0000 (22:39 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 19 Jan 2012 22:39:14 +0000 (22:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1233616 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/message.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js

index 04bdca456d283ea789affcdd58d7512acc7e7f26..09d691411c32b466f432b966aebcf40eb7ef211a 100644 (file)
@@ -267,10 +267,11 @@ $(function() {
             $.ajax(url,
               {
                 type: "GET",
+                  beforeSend:function(){
+                    displayInfoMessage($.i18n.prop("managedrepository.scan.started"));
+                  },
                   success: function(data) {
-                    self.managedRepositories.remove(managedRepository);
                     displaySuccessMessage($.i18n.prop("managedrepository.scanned",managedRepository.name()));
-
                   },
                   error: function(data) {
                     var res = $.parseJSON(data.responseText);
index e49808b846eaac31c6f2a92b2ef1f227efcbc0e8..62ca1463161c31e232dc6da3f1606f3eff5c8590 100644 (file)
     <p>${message}</p>
   </div>
 </script>
+<script id='alert-message-info' type='text/x-jquery-tmpl'>
+  <div class="alert-message fade in info" data-alert="alert">
+    <a class="close" href="#" id='alert-message-info-close-a'>&#215;</a>
+    <p>${message}</p>
+  </div>
+</script>
 
index 9e6fc7af9528fcc3d2b057b757c0653ed3924ee9..179b073133476f6afec50df2949ed75ca7276770 100644 (file)
@@ -73,6 +73,12 @@ displayWarningMessage=function(text,idToAppend){
   $(textId).focus();
 }
 
+displayInfoMessage=function(text,idToAppend){
+  var textId = idToAppend ? $("#"+idToAppend) : $("#user-messages");
+  $.tmpl($("#alert-message-info").html(), { "message" : text }).appendTo( textId );
+  $(textId).focus();
+}
+
 /**
  * clear #main-content and call clearUserMessages
   */