Benutzer:Melancholie/monobook.js/addLinks

Us der alemannische Wikipedia, der freie Dialäkt-Enzyklopedy
// addLink (en:Wikipedia:WikiProject_User_scripts/Scripts)
function addLink(where, url, name, id, title, key, after){
 var na = document.createElement('a');
 na.href = url;
 na.appendChild(document.createTextNode(name));
 var li = document.createElement('li');
 if(id) li.id = id;
 li.appendChild(na);
 var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
 if(after) {
  tabs.insertBefore(li,document.getElementById(after));
 } else {
  tabs.appendChild(li);
 }
 if(id) {
  if(key && title) { ta[id] = [key, title]; }
  else if(key) { ta[id] = [key, ]; }
  else if(title) { ta[id] = [, title];}
 }
 akeytt();
 return li;
}
// Hilfreiche Links (en:Wikipedia:WikiProject_User_scripts/Scripts)
addOnloadHook(function () {
 var title; // UTF-8
 if (!(title = document.getElementById('t-whatlinkshere') )) return;
 if (!(title = title.getElementsByTagName('a')[0] )) return;
 if (!(title = title.href )) return;
 if (!(title = title.replace(/^.*\/wiki\/Spezial:Whatlinkshere\//, ) )) return;
 var iTitle = title; // ISO-8859-1
 if (!(iTitle = iTitle.replace(/%C3%84/, "%C4") )) return; // Ä
 if (!(iTitle = iTitle.replace(/%C3%A4/, "%E4") )) return; // ä
 if (!(iTitle = iTitle.replace(/%C3%96/, "%D6") )) return; // Ö
 if (!(iTitle = iTitle.replace(/%C3%B6/, "%F6") )) return; // ö
 if (!(iTitle = iTitle.replace(/%C3%9C/, "%DC") )) return; // Ü
 if (!(iTitle = iTitle.replace(/%C3%BC/, "%FC") )) return; // ü
 if (!(iTitle = iTitle.replace(/%C3%9F/, "%DF") )) return; // ß

 addLink('p-navigation', 'http://de.wikipedia.org/wiki/'+title,
         'de.Wikipedia', 't-dewp', 'de.WP-Suech', 'W', null);
 addLink('p-navigation', 'http://de.wiktionary.org/wiki/'+title,
         'de.Wiktionary', 't-dewikt', 'de.Wikt-Suech', 'T', null);
 addLink('p-navigation', 'http://vs.aka-online.de/cgi-bin/globalwpsearch.pl?search='+title+'&timeout=15',
         'glWPs (min)', 't-ilangmin', 'GlobalWPSearch 15s', 'G', null);
 addLink('p-navigation', 'http://vs.aka-online.de/cgi-bin/globalwpsearch.pl?search='+title+'&timeout=300&minor=1',
         'glWPs (max)', 't-ilangmax', 'GlobalWPSearch 300s', 'S', null);
 addLink('p-navigation', 'http://validator.w3.org/check?uri=http://als.wikipedia.org/wiki/'+title+'&doctype=XHTML+1.0+Strict',
         'W3C-Priefung', 't-w3c', 'XHTML-Uszoichnung priefe', 'V', null);
 addLink('p-navigation', '/wiki/'+title+'?action=raw&ctype=text/css',
         'Roher Tekscht', 't-quell', 'raw', 'Q', null);
 addLink('p-navigation', '/wiki/'+title+'?action=purge',
         'ZwSpoicherung leere', 't-purge', 'Cache purge', 'P', null);
});