summaryrefslogtreecommitdiff
path: root/src/www/js
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-04-09 20:51:31 +0000
committerhallgren <hallgren@chalmers.se>2014-04-09 20:51:31 +0000
commitd19e6d9d079bc2d3bfcf6b0f07f9327a7bdd5f86 (patch)
tree5d3f1bd8a0cac5632cb120dd16ccb25126de5463 /src/www/js
parent402cccc3ca1621acac217dac4c9297cb7b75d2ab (diff)
Wide Coverage Demo App: new buttons: to switch colors on/off & to try Google Translate
Diffstat (limited to 'src/www/js')
-rw-r--r--src/www/js/wc.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/www/js/wc.js b/src/www/js/wc.js
index 30737aad8..595394efb 100644
--- a/src/www/js/wc.js
+++ b/src/www/js/wc.js
@@ -29,6 +29,7 @@ wc.save=function() {
wc.local.put("from",f.from.value)
wc.local.put("to",f.to.value)
wc.local.put("input",f.input.value)
+ wc.local.put("colors",f.colors.checked)
}
wc.load=function() {
@@ -36,6 +37,8 @@ wc.load=function() {
f.input.value=wc.local.get("input",f.input.value)
f.from.value=wc.local.get("from",f.from.value)
f.to.value=wc.local.get("to",f.to.value)
+ f.colors.checked=wc.local.get("colors",f.colors.checked)
+ wc.colors()
wc.delayed_translate()
}
@@ -212,6 +215,11 @@ wc.speak=function(text,lang) {
}
}
+wc.colors=function() {
+ wc.o.className=wc.f.colors.checked ? "colors" : ""
+ wc.local.put("colors",wc.f.colors.checked)
+}
+
wc.swap=function() {
var f=wc.f
function txt(r) { return r.text }
@@ -228,13 +236,13 @@ wc.google_translate_url=function() {
+"/"+alangcode(wc.f.to.value)
+"/"+encodeURIComponent(wc.f.input.value)
}
-/*
+
wc.try_google=function() {
var w=window.open(wc.google_translate_url(),
"google_translate")
w.focus()
}
-*/
+
// Update language selection menus with the languages supported by the grammar
function init_languages() {