use loading button feature while saving remote repository

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1398298 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-10-15 14:10:40 +00:00
parent a92c8cf8d9
commit db80856a32
3 changed files with 8 additions and 2 deletions

View File

@ -785,6 +785,8 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
return;
}
clearUserMessages();
$("#user-messages").html(mediumSpinnerImg());
$("#remote-repository-save-button" ).button('loading');
if (update){
$.ajax("restServices/archivaServices/remoteRepositoriesService/updateRemoteRepository",
{
@ -800,6 +802,10 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
error: function(data) {
var res = $.parseJSON(data.responseText);
displayRestError(res);
},
complete: function(){
$("#remote-repository-save-button" ).button('reset');
removeMediumSpinnerImg("#user-messages");
}
}
);

View File

@ -627,7 +627,7 @@
</div>
</fieldset>
<button data-bind="click: save" class="btn">${$.i18n.prop('save')}</button>
<button data-bind="click: save" data-loading-text="${$.i18n.prop('common.loading')}" id="remote-repository-save-button" class="btn">${$.i18n.prop('save')}</button>
<button data-bind="click: displayGrid" class="btn">${$.i18n.prop('cancel')}</button>
</form>
</script>

View File

@ -38,6 +38,7 @@ import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.content.LegacyPathParser;
import org.apache.archiva.repository.content.ManagedDefaultRepositoryContent;
import org.apache.archiva.repository.content.RepositoryRequest;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.apache.commons.io.FileUtils;
import org.apache.jackrabbit.webdav.DavException;
import org.apache.jackrabbit.webdav.DavResourceLocator;
@ -57,7 +58,6 @@ import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
/**
* ArchivaDavResourceFactoryTest