add a method to display info messages and use it when call scanRepo

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1233616 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-01-19 22:39:14 +00:00
parent 28a7a9cee8
commit 38b64bd49d
3 changed files with 15 additions and 2 deletions

View 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);

View File

@ -34,4 +34,10 @@
<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>

View 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
*/