//myvocab1=-123-45-6789-x-123- var mvto; var subm_no_activated=false; var req = false; //ajax request object var edit_form_is_open=false; function update_hidden_list() { var hidden_list_str=""; sose = document.forms.sortform.sortsel; for (var i=0; i=0; i--) { if (sose.options[i].selected) { if(index2scrollto==0) index2scrollto=i; tmp_val = sose.options[i+1].value; tmp_txt = sose.options[i+1].text; sose.options[i+1].value = sose.options[i].value; sose.options[i+1].text = sose.options[i].text; sose.options[i].value = tmp_val; sose.options[i].text = tmp_txt; sose.options[i].selected=false; sose.options[i+1].selected=true; if (navigator.userAgent.indexOf('Firefox')!=-1) sose.options[i+1].scrollIntoView(true); } } update_hidden_list(); } function del_entries() { var j=0; var entries2delete = new Array(); var delindex=0; sose = document.forms.sortform.sortsel; if (sose.selectedIndex==-1) { //k || sose.options[sose.options.length-1].selected //k alert("Please select one or more entries! If you want to delete the whole list, first delete all entries, then choose 'Delete List' from the Overview page."); //k return; if (confirm("Do you want to remove all entries from this list?")) { for (var i=sose.options.length; i>=0; i--) { sose.options[i] = null; } update_hidden_list(); return true; } } for (var i=0; i=sose.options.length) delindex=sose.options.length-1; sose.selectedIndex=delindex; update_hidden_list(); } function speak_answer() { //k? if (speechlang=="DE" || speechlang=="EN" || speechlang=="ES" || speechlang=="FR" || speechlang=="IT") { if (speechlang+otherlang=="ENDE" || speechlang+otherlang=="DEEN") speak_nopop(entry_id, speechlang.toLowerCase()+"_rec_ip"); else speak_nopop("u"+entry_id, speechlang.toLowerCase()+"_rec_ip"); //"u" makes nopop fetch text //k? } answerfield.focus(); } function speak_question() { //k? if (otherlang=="DE" || otherlang=="EN" || otherlang=="ES" || otherlang=="FR" || otherlang=="IT") { if (speechlang+otherlang=="ENDE" || speechlang+otherlang=="DEEN") speak_nopop(entry_id, otherlang.toLowerCase()+"_rec_ip"); else speak_nopop("u"+entry_id, otherlang.toLowerCase()+"_rec_ip"); //k? } answerfield.focus(); } function is_correct_answer() { var a1 = answerfield.value.toLowerCase(); var a2 = document.tf.correct_answer.value.toLowerCase(); if (a1==a2) return true; else if (a1.replace(/[ .,!]/g, "")==a2.replace(/[ .,!]/g, "")) return true; else return false; } function check_answer() { var last_char = answerfield.value.substr(answerfield.value.length-1,1); if (!subm_no_activated && last_char!=" " && is_correct_answer()) { answerfield.style.backgroundColor='#6f0'; subm_yes(); } else { if (last_char==" ") show_next_letter(true); if (last_char=="." && document.tf.correct_answer.value.charAt(answerfield.value.length-1)!=".") speak_answer(); if (last_char=="+" && document.getElementById('toa')) { document.getElementById('toa').style.display="block"; document.getElementById("ictoa").src=img_base_url+"/minus.gif"; } if (last_char!="+" && document.getElementById('toa')) { document.getElementById('toa').style.display="none"; document.getElementById("ictoa").src=img_base_url+"/plus.gif"; } } } function subm_yes() { answerfield.value=document.tf.correct_answer.value; document.tf.ok.value='y'; setTimeout("document.tf.submit()", 400); } function subm_no_md() { answerfield.value=document.tf.correct_answer.value; answerfield.style.backgroundColor='#f63'; document.tf.ok.value='n'; } function subm_no() { subm_no_activated=true; subm_no_md(); setTimeout("document.tf.submit()", 3000); //400 return false; } function show_next_letter(called_from_kbd) { var myan = answerfield.value; var coan = document.tf.correct_answer.value; var newanswer = ""; if (called_from_kbd && coan.charAt(myan.length-1)==" ") return; // alert(coan.charAt(myan.length-1)); for (var i=0; i").replace(/</g, "<").substr(41); //35 - geaendert 2014-03-13 sortfutter = replace_special_chars_for_sort(sortfutter.toLowerCase()); sortarr[i] = sortfutter + ";$#" + sose.options[i].text + ";$#" + sose.options[i].value; //if (is_paul) alert(sortarr[i]); } sortarr.sort(); if (dir==1) sortarr.reverse(); for(i=0; i if (ck==45) del_entries(); //- if (ck==43) show_addfields(); //+ return false; } }