X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=filex%2Fstatic%2Ffilex%2Ffilex.js;fp=filex%2Fstatic%2Ffilex%2Ffilex.js;h=ac71ea549224049788ed7575b13ea3ab48430b88;hb=74825710a26c280188b544d6c3a11d654cdae536;hp=26bec82553fd4182fe75b679f377482818201fb2;hpb=0be92069d46130aad675fa715184e9c209140ce9;p=qcg-portal.git diff --git a/filex/static/filex/filex.js b/filex/static/filex/filex.js index 26bec82..ac71ea5 100644 --- a/filex/static/filex/filex.js +++ b/filex/static/filex/filex.js @@ -265,6 +265,7 @@ $(function(){ callback_called = false; $form[0].reset(); + $form.find('.alert-danger').remove(); $form.find('#id_host').val(parts.shift()); if (parts.length) @@ -277,6 +278,7 @@ $(function(){ e.preventDefault(); $btn.button('loading'); + $this.find('.alert-danger').remove(); $.post($this.attr('action'), $this.serialize(), function(data) { callback(data); @@ -288,6 +290,13 @@ $(function(){ console.error(arguments); var error = (xhr.responseJSON || {}).error || undefined; + if (error.__all__) { + error = 'Podana lokalizacja jest już zapisana' + } + else if (xhr.status == 400) { + error = 'Niepoprawna nazwa hosta lub ścieżka' + } + if (typeof error === 'string') { $('
', { 'class': 'alert alert-danger',