From d19e6d9d079bc2d3bfcf6b0f07f9327a7bdd5f86 Mon Sep 17 00:00:00 2001 From: hallgren Date: Wed, 9 Apr 2014 20:51:31 +0000 Subject: [PATCH] Wide Coverage Demo App: new buttons: to switch colors on/off & to try Google Translate --- src/www/js/wc.js | 12 ++++++++++-- src/www/wc.html | 13 +++++++------ 2 files changed, 17 insertions(+), 8 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() { diff --git a/src/www/wc.html b/src/www/wc.html index eddf9595a..41c80e1a5 100644 --- a/src/www/wc.html +++ b/src/www/wc.html @@ -17,9 +17,9 @@ body:target h1, body:target div.modtime { display: none; } small { color: #666; } #pick>* { padding: 0 0.5ex; } #speak { display: none; } -.default_quality { background-color: #ffc; } -.high_quality { background-color: #cfc; } -.low_quality { background-color: #fcc; } +.colors .default_quality { background-color: #ffc; } +.colors .high_quality { background-color: #cfc; } +.colors .low_quality { background-color: #fcc; } .placeholder { color: #999; } .error { color: #c00; } @@ -57,7 +57,8 @@ small { color: #666; } - + Colors + Enter text to translate above. @@ -72,13 +73,13 @@ small { color: #666; }
- +

-Last modified: Wed Apr 9 20:57:07 CEST 2014 +Last modified: Wed Apr 9 22:35:17 CEST 2014