summaryrefslogtreecommitdiff
path: root/tex/context/base/java-exa.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/java-exa.tex')
-rw-r--r--tex/context/base/java-exa.tex17
1 files changed, 15 insertions, 2 deletions
diff --git a/tex/context/base/java-exa.tex b/tex/context/base/java-exa.tex
index 0617f5e56..f40f70f84 100644
--- a/tex/context/base/java-exa.tex
+++ b/tex/context/base/java-exa.tex
@@ -289,14 +289,27 @@
f = this.getField(fake) ;
if (f) {
f.browseForFileToSubmit() ;
- if (suffixes != "") {
+ if ((suffixes != "") && (f.value != "")) {
+ %
s = suffixes.replace(/,/g,"|") ;
r = new RegExp() ;
s = "\\\\.(" + s + ")$" ;
r.compile(s, "i") ;
- if ((f.value != "")&&(f.value.search(r)<=0)) {
+ if (f.value.search(r)<=0) {
f.value = "" ;
app.alert('This filetype is not permitted.') ;
+ %
+ % lst = suffixes.split(/,/) ;
+ % ok = false ;
+ % for (i=0;i<lst.length;i++) {
+ % if (f.value == lst[i]) {
+ % ok = true ;
+ % }
+ % }
+ % if (! ok) {
+ % f.value = "" ;
+ % app.alert('This filetype is not permitted.') ;
+ %
}
}
g = this.getField(name) ;