Wikipedista:Miraceti/linkslangs.js
Poznámka: Po uložení musíte vyprázdnit mezipaměť vašeho prohlížeče, jinak změny neuvidíte.
$( document ).ready(function(){
if (typeof LINKSLANGSPOSITION == 'undefined')
LINKSLANGSPOSITION = 0;
if (LINKSLANGSPOSITION !=1)
$("li span[data-lang]").each(function() {
$this = $( this );
$parentLi = $this.closest("li");
switch (LINKSLANGSPOSITION){
case 0:
$parentLi.prepend(" ");
$this.remove().insertBefore($parentLi.contents().first());
$parentLi.prepend(" ");
break;
case 2:
$parentLi.append(" ");
$this.remove().insertAfter($parentLi.contents().last());
$parentLi.append(" ");
break;
}
});
});