1
0
forked from GitHub/gf-core

minibar: bug fix for "Try Google Translate" button

This commit is contained in:
hallgren
2011-08-19 13:56:12 +00:00
parent 3a776d25b3
commit 6c8c0cdc24
2 changed files with 10 additions and 8 deletions

View File

@@ -1,7 +1,6 @@
// minibar.js, assumes that support.js has also been loaded /* minibar.js
needs: minibar_support.js, minibar_input.js, minibar_translations.js, support.js
var tree_icon="tree-btn.png"; */
var alignment_icon="align-btn.png";
/* /*
// This is essentially what happens when you call start_minibar: // This is essentially what happens when you call start_minibar:
@@ -116,11 +115,11 @@ Minibar.prototype.append_extra_buttons=function(extra,options) {
Minibar.prototype.try_google=function() { Minibar.prototype.try_google=function() {
with(this) { with(this) {
var to=target_lang(); var to=translations.target_lang();
var s=current.input; var s=input.current.input;
if(surface.typed) s+=surface.typed.value; if(input.surface.typed) s+=input.surface.typed.value;
var url="http://translate.google.com/?sl=" var url="http://translate.google.com/?sl="
+langpart(current.from,grammar.name); +langpart(input.current.from,grammar.name);
if(to!="All") url+="&tl="+to; if(to!="All") url+="&tl="+to;
url+="&q="+encodeURIComponent(s); url+="&q="+encodeURIComponent(s);
window.open(url); window.open(url);

View File

@@ -1,5 +1,8 @@
/* --- Translations object -------------------------------------------------- */ /* --- Translations object -------------------------------------------------- */
var tree_icon="tree-btn.png";
var alignment_icon="align-btn.png";
function Translations(server,opts) { function Translations(server,opts) {
this.server=server; this.server=server;