summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-05-23 14:39:05 +0000
committerhallgren <hallgren@chalmers.se>2012-05-23 14:39:05 +0000
commit215ec25a41f2280572f7b6d6e6c529ec8d9d345d (patch)
tree5784696acb103644c0f67520921ee3651f11edfb /src
parentf4c17cb7aa1517739c5aea5155e17fc9d1b2f05e (diff)
translator: use a more robust test for localStorage support and show a warning if it is missing
Diffstat (limited to 'src')
-rw-r--r--src/www/translator/translator.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/www/translator/translator.js b/src/www/translator/translator.js
index a92cffc5b..cf3a033ca 100644
--- a/src/www/translator/translator.js
+++ b/src/www/translator/translator.js
@@ -5,6 +5,10 @@
function Translator() {
this.local=tr_local();
this.view=element("document")
+ if(!supports_html5_storage()) {
+ var warning=span_class("error",text("It appears that localStorage is unsupported or disabled in this browser. Documents will not be preserved after you leave or reload this page!"))
+ insertAfter(warning,this.view)
+ }
this.current=this.local.get("current")
this.document=this.current && this.current!="/" && this.local.get("/"+this.current) || empty_document()
this.server=pgf_online({})
@@ -395,7 +399,7 @@ function tr_local() {
}
}
}
- return window.localStorage ? real(localStorage) : real([])
+ return supports_html5_storage() ? real(localStorage) : real([])
}
// Collect alternative texts in the output from PGF service translate command