X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/dfd1b7f527415baf99c181a057bfeb12a0976c75..4aa539e5d93da275c6d882a864a735d5a23e98db:/stage2/static/js/checkfile.js diff --git a/stage2/static/js/checkfile.js b/stage2/static/js/checkfile.js index f15c134..6d3782c 100644 --- a/stage2/static/js/checkfile.js +++ b/stage2/static/js/checkfile.js @@ -8,7 +8,10 @@ $(function() { var ext = this.getAttribute('data-ext'); var re = new RegExp('\\.(' + ext + ')$', 'i'); if (!re.exec(name)) { - alert('Błędne rozszerzenie! Powinno być jedno z: ' + ext.replace(/\|/g, ', ')); + if (/\|/.exec(ext)) + alert('Błędne rozszerzenie! Powinno być jedno z: ' + ext.replace(/\|/g, ', ')); + else + alert('Błędne rozszerzenie! Powinno być: ' + ext); ok = false; } }