Hello, you have come here looking for the meaning of the word
User:Hippietrail/perlanguage.js. In DICTIOUS you will not only get to know all the dictionary meanings for the word
User:Hippietrail/perlanguage.js, but we will also tell you about its etymology, its characteristics and you will know how to say
User:Hippietrail/perlanguage.js in singular and plural. Everything you need to know about the word
User:Hippietrail/perlanguage.js you have here. The definition of the word
User:Hippietrail/perlanguage.js will help you to be more precise and correct when speaking or writing your texts. Knowing the definition of
User:Hippietrail/perlanguage.js, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
function WiktApiProxy() {
// helper functions
function mwEncodeURIComponent(term) {
return encodeURIComponent(term).replace(/%2F/g, "/");
}
function add_dice(h2, lang) {
var a = document.createElement('a');
a.title = "Random " + lang + " entry.";
a.href = "http://toolserver.org/~hippietrail/randompage.fcgi?langname=" + lang;
var img = document.createElement('img');
img.alt = "random";
img.height="16";
img.width="24"
img.src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Two_red_dice_01.svg/32px-Two_red_dice_01.svg";
a.appendChild(img);
h2.appendChild(document.createTextNode(" "));
h2.appendChild(a);
}
function add_interlang(h2, code, term) {
var sup = document.createElement('sup');
sup.style.fontSize = '66%';
sup.style.fontWeight = "normal";
var a = document.createElement('a');
var href = "http://" + code + ".wiktionary.orghttps://dictious.com/en/";
href += mwEncodeURIComponent(term);
a.href = href;
a.appendChild(document.createTextNode("☞"+code));
sup.appendChild(a);
h2.appendChild(document.createTextNode(" "));
h2.appendChild(sup);
}
// toolserver has sent back results. add them to the page
this.gotproxyresults = function(stuff) {
// we will always give up if there's an error in the json response
if ("error" in stuff) return;
// links under the language headings
var bc = document.getElementById("bodyContent");
var h2s = bc.getElementsByTagName("h2");
outer: for (var i = 0; i < h2s.length; ++i) {
var spans = h2s.getElementsByTagName("span");
inner: for (var j = 0; j < spans.length; ++j) {
if (spans.className == "mw-headline") {
var langname = spans.textContent || spans.innerText;
// find a code for this lang
if (typeof this.langcodesgotten == "object") {
for (var k = 0; k < this.langcodesgotten.length; ++k) {
var code = this.langcodesgotten;
if (code in stuff.results && stuff.results != -1) {
add_interlang(h2s, code, wgTitle);
}
}
}
}
}
}
}
this.gotlangcodes = function(stuff) {
// we will always give up if there's an error in the json response
if ("error" in stuff) return;
this.langcodesgotten = stuff;
var codes = "";
for (lang in stuff) {
if (codes) codes += ",";
codes += stuff.join(",");
}
if (codes) {
mw.loader.load(
"http://toolserver.org/~hippietrail/apiproxy.fcgi?"
+ "term=" + wgTitle + "&langs=" + codes
+ "&callback=wiktApiProxy.gotproxyresults");
}
}
this.apiproxy = function() {
var bc = document.getElementById("bodyContent");
var langnames = "";
// article = page = entries
if (wgNamespaceNumber == 0) {
var h2s = bc.getElementsByTagName("h2");
outer: for (var i = 0; i < h2s.length; ++i) {
var spans = h2s.getElementsByTagName("span");
inner: for (var j = 0; j < spans.length; ++j) {
if (spans.className == "mw-headline") {
var langname = spans.textContent || spans.innerText;
if (langname != "English") {
if (langnames) langnames += "|";
langnames += langname;
}
// add random dice link
add_dice(h2s, langname);
continue outer;
}
}
}
getlangcodes(langnames);
}
function getlangcodes(langnames) {
mw.loader.load(
"http://toolserver.org/~hippietrail/getlangcodes.fcgi?"
+ "langs=" + langnames
+ "&callback=wiktApiProxy.gotlangcodes");
}
}
}
var wiktApiProxy;
$(function () {
wiktApiProxy = new WiktApiProxy();
wiktApiProxy.apiproxy();
})