MediaWiki:FilterTranslateRequests.js

if (wgArticleId === 10504) {

type = "translate"; //$("#request-type").val;

languages = { EN: 'en - English', AR: 'ar - العربية', BE: 'be - Беларуская', BG: 'bg - Български', BN: 'bn - বাংলা', BS: 'bs - Bosanski', CA: 'ca - Català', CS: 'cs - Česky', CY: 'cy - Cymraeg', DA: 'da - Dansk', DE: 'de - Deutsch', EO: 'eo - Esperanto', ES: 'es - Español', ET: 'et - Eesti', EU: 'eu - Euskara', FA: 'fa - فارسی', FI: 'fi - Suomi', FR: 'fr - Français', GA: 'ga - Gaeilge', GD: 'gd - Gàidhlig', GL: 'gl - Galego', HE: 'he - עברית', HI: 'hi - हिन्दी', HR: 'hr - Hrvatski', HU: 'hu - Magyar', HY: 'hy - Հայերեն', ID: 'id - Bahasa Indonesia', IT: 'it - Italiano', JA: 'ja - 日本語', JV: 'jv - Basa Jawa', KK: 'kk - Қазақша', KO: 'ko - 한국어', LA: 'la - Latina', LB: 'lb - Lëtzebuergesch', MI: 'mi - Māori', ML: 'ml - മലയാളം', MN: 'mn - Монгол', MO: 'mo - Молдовеняскэ', MS: 'ms - Malay', MT: 'mt - Malti', NL: 'nl - Nederlands', NN: 'nn - ‪Norsk (nynorsk)‬', NO: 'no - Norsk (bokmål)‬', NV: 'nv - Diné bizaad', PL: 'pl - Polski', PT: 'pt - Português', RO: 'ro - Română', RU: 'ru - Русский', SK: 'sk - Slovenčina', SL: 'sl - Slovenščina', SR: 'sr - Српски / Srpski', SV: 'sv - Svenska', TG: 'tg - Тоҷикӣ', TK: 'tk - Türkmençe', TL: 'tl - Tagalog', TR: 'tr - Türkçe', UK: 'uk - Українська', UZ: 'uz - O\'zbek', VI: 'vi - Tiếng Việt', YI: 'yi - ייִדיש', ZH: 'zh - 中文', ZU: 'zu - isiZulu', XX: 'Other' }

language_dropdown = [];

for (var i in languages) { language_dropdown += '' + languages[i] + ' '; }

$("#language").html('Show open  completed  translation requests  from  to  ' + language_dropdown + ' Search ');

function generateRequests {

to_language = "To+" + $("#language select#request-language").val; from_language = $("#language select#request-language").val; if($("#language #direction").val === "from") { language = from_language; } else if ($("#language #direction").val === "to") { language = to_language; }	status = $("#language select#status").val; if(status === "open") { status_url = "New"; } else if (status === "completed") { status_url = "Completed"; }	$.getJSON("http://wlb.wikia.com/api.php?action=query&list=categoryintersection&limit=10&categories=Category:" + status_url + "+translations|Category:" + language + "&format=json") .done(function(data, i) {

list_of_requests = []; list_of_requests_li = [];

var i;		for (i = 0; i < data.query.categoryintersection.length; ++i) {

list_of_requests_li[i] = '' + data.query.categoryintersection[i].title + ''; list_of_requests[i] = data.query.categoryintersection[i].title;

}	});	setTimeout(function { $("#request-table").html(list_of_requests_li); setTimeout(function {			$("li.request-item").each(function  { id = $(this).find("a").attr("id"); title = $(this).find("a").text; /* $(this).append('  '); $(this).find(".request-preview div").load("http://wlb.wikia.com/wiki/" + encodeURIComponent(title) + "?&action=render"); preview = $(".request-preview div #mw-content-text").find("p:nth-child(2)").text; $(this).find(".request-preview").prepend(preview); */			});		}, 1000);	}, 1000); }

$("body").append(" " + "#request-table li {" + "list-style: none; margin: 0; padding: 5px; border-bottom: 1px solid #999;" + "}" + "#request-table li:last-child {" + "border-bottom: 0;" + "}" + "#request-table {" + "margin-top: 1em; padding: 0 10px;" + "background: #efefef;" + "}" + " ");

}