MediaWiki:Common.js/User:Bawolff/sandbox/Wiktionary query

$(function {document.getElementById('wiktQ').innerHTML ='   Wiktionary Query  Word:   Language code of word  Language definition should be in:  English  French   Spanish   Japense   Italian   Dutch  Portugese Other   Number of definitions to return:  Title: None  Bolded  Linked   Pronounce word (if available. requires HTML5 browser): Disabled  Enabled  Autoplay   Use Mediawiki redirects <input type="checkbox" checked name="redirects"/> Do not use auto-case redirection <input type="checkbox" name="rd" value="200"> Hide link <input type="checkbox" name="exit" id="exit" value="true"/> <input type="submit" value="Find definition"/>  ';});

function wiktLang { var sel = document.getElementById('wiktLanguage'); var val = sel[sel.selectedIndex].value; if (val === 'qqqOther') { var lang = prompt("Enter language code of definition result. (Warning not all languages are supported)", "en"); if (!lang) return; var opt = document.createElement("option"); opt.value = lang; opt.appendChild(document.createTextNode(lang)); sel.appendChild(opt); sel.selectedIndex = opt.index; } var form=document.getElementById('wiktQForm');

form.setAttribute('action', form.getAttribute('action').replace(/^http\:\/\/[^\.]*/, "http://" + encodeURIComponent(sel[sel.selectedIndex].value))); }