Zum Inhalt springen

„Benutzer:Isnow/vector.js“ – Versionsunterschied

aus Wikipedia, der freien Enzyklopädie
Inhalt gelöscht Inhalt hinzugefügt
if (document.getElementById
document.getElementById('p-lang').getElementsByClassName('body')[0]
Zeile 2: Zeile 2:


function morelangs() {
function morelangs() {
var langs = document.getElementById('p-lang').cloneNode(true);
var langs = document.getElementById('p-lang').getElementsByClassName('body')[0].cloneNode(true);
// don't use the same ids twice
// don't use the same ids twice
langs.id = 'mylangs';
langs.id = 'mylangs';

Version vom 23. Dezember 2012, 20:26 Uhr

//Reference: http://meta.wikimedia.org/wiki/User:Fristu/monobook.js

function morelangs() {
  var langs = document.getElementById('p-lang').getElementsByClassName('body')[0].cloneNode(true);
  // don't use the same ids twice
  langs.id = 'mylangs';

  var listitems = langs.getElementsByTagName('LI');
  for (i=0;i<listitems.length;i++) {
    switch (listitems[i].className) {
        case 'interwiki-de':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-en':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-fr':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-ja':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-ko':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-zh':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-de FA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-en FA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-fr FA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-ja FA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-ko FA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-zh FA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-de GA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-en GA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-fr GA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-ja GA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-ko GA':
          listitems[i].className = 'mylangs-show';
          break;
        case 'interwiki-zh GA':
          listitems[i].className = 'mylangs-show';
          break;
        default :
          listitems[i].className = 'mylangs-none';
    }
  }

  // drop them at the bottom of the content area
  if (document.getElementById('column-content') != null) {
    document.getElementById('column-content').appendChild(langs);
  } // current version
  if (document.getElementById('content') != null) {
    document.getElementById('content').appendChild(langs);
  } // beta version
}
if (window.addEventListener) window.addEventListener("load",morelangs,false);
else if (window.attachEvent) window.attachEvent("onload",morelangs);