From 043ab3e07af1bc793c751dfaedc642264ca81db0 Mon Sep 17 00:00:00 2001 From: hallgren Date: Mon, 19 Aug 2013 15:00:55 +0000 Subject: [PATCH] gfse: only try to upload/compile grammars when browser is online Show error message "Offline" if browser is offline. --- src/www/gfse/cloud2.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {