User:Sj/Monobook.js

// ============================================================ // BEGIN Enable multiple onload functions // setup onload functions this way: // aOnloadFunctions[aOnloadFunctions.length] = function_name; // without brackets!

if (!window.aOnloadFunctions) { var aOnloadFunctions = new Array; } window.onload = function { if (window.aOnloadFunctions) { for (var _i=0; _i<aOnloadFunctions.length; _i++) { aOnloadFunctions[_i]; } } }

// END Enable multiple onload functions // ============================================================

function addLoadEvent(func) { if (window.addEventListener) window.addEventListener("load", func, false); else if (window.attachEvent) window.attachEvent("onload", func); } function interwikiExtra { // iterate over all -elements for(var i=0; a = document.getElementsByTagName("span")[i]; i++) { // if found a linkInfo span if(a.className == "interwiki-info") { // iterate over all -elements var count=0; for(var j=0; b = document.getElementsByTagName("li")[j]; j++) { if(b.className == "interwiki-" + a.id) { b.innerHTML = b.innerHTML + " "+a.title; if(a.title == "(vo)") { b.title = "Texte original"; } }    else if(b.className == "interwiki-" + a.id.substr(0,a.id.length-1)) { count = count+1; if(a.id.charAt(a.id.length-1) == count) { b.innerHTML = b.innerHTML + " "+a.title; } }   }   }  } } addLoadEvent(interwikiExtra);

function dotabs { //first tab var a = document.getElementById("ca-nstab-main"); var s = a.innerHTML; var i = s.indexOf('Article'); if(a){ if( document.getElementById("Author") ) { a.innerHTML = s.substring(0,i)+"Author"+s.substring(i+7,s.length-1); }  q = document.getElementById("textquality") if( q ) { var image = ""; if( q.className == "0%") { image = " "; } if( q.className == "25%") { image = " "; } if( q.className == "50%") { image = " "; } if( q.className == "75%") { image = " "; } if( q.className == "100%") { image = " "; } a.innerHTML = s.substring(0,i+7)+image+s.substring(i+7,s.length-1); } }  //2nd tab if( document.getElementById("infoedit") ) { var b = document.getElementById("ca-talk"); if(b){ var s = b.innerHTML; var i = s.indexOf('Discussion'); b.innerHTML = s.substring(0,i)+"Source"+s.substring(i+10,s.length-1); } } } addLoadEvent(dotabs);

function BilingualLink { if( document.body.className != "ns-0" ) return; var doc_url = document.URL; var url = ''; // iterate over all -elements for(var j=0; b = document.getElementsByTagName("li")[j]; j++) { if(b.className.substring(0,10) == "interwiki-" ) { var lang = b.className.substring(10,b.className.length); if( doc_url.indexOf('?title=') != -1 ) { var qm = doc_url.indexOf('&match='); if( qm != -1 ) url = doc_url.substring(0,qm)+"&match="+lang; else url = doc_url+"&match="+lang; }   else { var qm = doc_url.indexOf('?'); if( qm != -1 ) url = doc_url.substring(0,qm)+"?match="+lang; else url = doc_url+"?match="+lang; }   b.innerHTML = b.innerHTML+ " &hArr;"; } } } addLoadEvent(BilingualLink);

/* */

importScript('User:Ioeth/friendly.js');