X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/dfd1b7f527415baf99c181a057bfeb12a0976c75..de2579db9a8aa4a0810af5c465af1816a65c7616:/stage2/static/js/checkfile.js diff --git a/stage2/static/js/checkfile.js b/stage2/static/js/checkfile.js index f15c134..9d1ae97 100644 --- a/stage2/static/js/checkfile.js +++ b/stage2/static/js/checkfile.js @@ -8,13 +8,20 @@ $(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; + } + if (name.length > 65) { + alert('Za dÅuga nazwa pliku! Maksymalna dÅugoÅÄ: 65 znaków (jest: ' + name.length + ')'); ok = false; } } var size = this.files[0].size; - if (size > 10 * 1024 * 1024) { - alert('Rozmiar pliku nie może przekraczaÄ 10 MB!'); + if (size > 20 * 1024 * 1024) { + alert('Rozmiar pliku nie może przekraczaÄ 20 MB!'); ok = false; } if (!ok) {