';
translation = translation + toLangCode+': ' +trans;
}
catch (error){
infoUpdate(error);
noError = false;
}
}
mainUpdate(translation);
if (noError)
infoUpdate("ha :-D 😃 su translation be success ya");
}}
}
function init(){
// algorithm:
// put listeners on main language selector
// put listeners on dictionary viewer
// put listeners on theme selector
// put listeners on syntax highlighting selector
// put listeners on synesthezia selector
// put listeners on compilation buttons
// put listeners on main language selector
var inLangSelect = document.getElementById("inLang");
inLangSelect.addEventListener("change",function(){
var inLangCode = inLangSelect.value;
if (inLangCode === "json")
infoUpdate(JSON.stringify(dictDefs));
else{
inLangL = languageGet(inLangCode);
var dictString = dictDefs.toLocaleString(inLangL, HtmlFormat);
infoUpdate(dictString);}
dictShown = true;
},false);
// put listeners on dictionary viewer
var dictButton = document.getElementById("dict");
var dictDefs = mwakText;
dictButton.onclick = function(){
if (dictShown === false){
var dictString = dictDefs.toLocaleString(inLangL, HtmlFormat);
infoUpdate(dictString);
dictShown = true;}
else {if (dictShown === true)
infoUpdate("");
dictShown = false;}
}
// put listeners on theme selector
var themeModeElem = document.getElementById( "theme");
themeModeElem.addEventListener("change",function(){
var themeMode = themeModeElem.value;
themeSet(themeMode);
},false);
// put listeners on syntax highlighting selector
var syntaxModeElem = document.getElementById( "syntax");
syntaxModeElem.addEventListener("change",function(){
var syntaxMode = syntaxModeElem.value;
syntaxSet(syntaxMode);
infoUpdate("click translate to apply changes");
},false);
var syntaxInfo = document.getElementById( "syntaxInfo");
syntaxInfo.addEventListener("click",function(){
if (syntaxInfoShown === false){
infoUpdate('syntax highlighting consists of
'
+'sentence head
'
+'phrase head
'
+'type head
'
+'genitive head
'
+'junction head
'
+'clause head
'
+'mood ya
');
syntaxInfoShown = true;
} else infoUpdate('');
},false);
// put listeners on synesthezia selector
var synButton = document.getElementById("syn");
synButton.addEventListener("change",function(){
var synModeElem = document.getElementById("syn");
var synMode = synModeElem.value;
synSet(synMode);
infoUpdate("click translate to apply changes");
},false);
var synInfo = document.getElementById( "synInfo");
synInfo.addEventListener("click",function(){
if (synInfoShown === false){
infoUpdate('Synesthesia training can boost IQ '
+'as shown in the study by University of Sussex ob '
+'Adults Can Be Trained to Acquire Synesthetic Experiences.'
+'
'
+'The synesthesia here is based on the study by MIT ob '
+''
+'Trends in colored letter synesthesia '
+'and maximizing hue distance between similar looking glyphs '
+'and similar sounding phonemes.
');
synInfoShown = true;
} else infoUpdate('');
},false);
// put listeners on compilation buttons
var inputForm = document.querySelector(
"input#submitButton");
inputForm.addEventListener("click",function(){
var /*Elem*/ userInputEl = document.getElementById(
"inputText");
var /*String*/ userInput = userInputEl.value;
infoUpdate('be flow translate ya');
mainUpdate("");
setTimeout( inputSubmit(userInput), 20);
},false);
}
//window.onload = init;
init();