function conflictingName(name, modal) {
if (filex.files.some(function(item) { return item.get('name') == name })) {
- modal.find('.alert').remove();
-
$('<div>', {
'class': 'alert alert-danger',
html: '<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> Plik o podanej już nazwie istnieje!'
$('#btn-rename').toggleClass('disabled', selected != 1);
$('#btn-delete').toggleClass('disabled', selected == 0);
- $('#btn-compress').toggleClass('disabled', selected == 0);
+ $('#btn-compress').toggleClass('disabled', filex.host != 'moss.man.poznan.pl' || selected == 0);
- if (selected == 1) {
+ if (filex.host == 'moss.man.poznan.pl' && selected == 1) {
var filename = filex.selectedFiles()[0].get('name'),
is_archive = _.some(['.zip', '.tar.gz', '.tgz', '.tar.bz2', 'tbz'], function(ext) {
return filename.endsWith(ext);
}
});
+ $('form').on('show.bs.modal', function() {
+ $(this).find('.alert').remove();
+ this.reset();
+ }).on('shown.bs.modal', function() {
+ $(this).find('input[type="text"]')[0].focus();
+ });
+
$('#btn-upload').on('click', function() {
var url = '{% url 'gridftp_upload' %}?' + $.param({host: filex.host, path: filex.path.full()});