summaryrefslogtreecommitdiff
path: root/src/www/gfse/cloud2.js
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2013-08-19 15:00:55 +0000
committerhallgren <hallgren@chalmers.se>2013-08-19 15:00:55 +0000
commit2aa14bfef8a69145deaef28be7458cf8a3d73dbd (patch)
tree0cc6acf961bd2ef0da7261a0203a2744c6f8350f /src/www/gfse/cloud2.js
parent029f1d40e5bd98a01d30ee9583c25cedd2dc61c1 (diff)
gfse: only try to upload/compile grammars when browser is online
Show error message "Offline" if browser is offline.
Diffstat (limited to 'src/www/gfse/cloud2.js')
-rw-r--r--src/www/gfse/cloud2.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/www/gfse/cloud2.js b/src/www/gfse/cloud2.js
index ce5371145..dbb322ed8 100644
--- a/src/www/gfse/cloud2.js
+++ b/src/www/gfse/cloud2.js
@@ -71,7 +71,8 @@ function upload_grammars(gs,cont) {
else alert(res.errorcode+"\n"+res.command+"\n\n"+res.output);
}
- with_dir(upload2)
+ if(navigator.onLine) with_dir(upload2)
+ else cont({errorcode:"Offline",command:"",output:""})
}
function assign_unique_name(g,unique_id) {