answer counts and other minor improvements
[edumed.git] / stage2 / static / js / checkfile.js
index f15c134..6d3782c 100644 (file)
@@ -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;
                 }
             }