User:Polletfa/monobook.js

/* Inspiré de :fr:Utilisateur:Jmfayard/monobook.js */

function addLoadEvent(func) {        if (window.addEventListener) window.addEventListener("load", func, false); else if (window.attachEvent) window.attachEvent("onload", func); }

function CategoriesAGauche {

var catlinks = document.getElementById("catlinks"); if (!catlinks) { return; } var categories = catlinks.getElementsByTagName("a") ;

var h5_cats = document.createElement( "h5" ); var text = document.createTextNode( "Categories" ) ; h5_cats.appendChild( text ) ;

var div_cats = document.createElement( "div" ); div_cats.setAttribute( "class", "pBody" );

var ul = document.createElement( "ul" );

var a_debut = 1 ; // evitons le lien Categories: for (var i = a_debut ; i < categories.length ; i++ ) { var a = categories[i] ; var li = document.createElement( "li" ) ; li.appendChild( a.cloneNode(1) ) ; ul.appendChild( li ); }

div_cats.appendChild( ul ) ;

var portlet = document.createElement( "div" ) ; portlet.setAttribute( "class", "portlet" ); portlet.setAttribute( "id", "p-cat" ) ;

portlet.appendChild( h5_cats ) ;

portlet.appendChild( div_cats ) ;

//document.getElementById("column-one").insertBefore( document.getElementById("p-search"), portlet ) ; //document.getElementById("column-one").appendChild( portlet ) ; div_ptb = document.getElementById( "p-tb" ); document.getElementById("column-one").insertBefore( portlet, div_ptb)

}

addLoadEvent( CategoriesAGauche ) ;

function Polletfa { var a = document.getElementById("p-cactions"); if (a) {   b = a.getElementsByTagName("ul"); if(b.length > 0) {     b[0].innerHTML = b[0].innerHTML + '' + '' + '(fr)' + '' + '(de)' + '' + '(en)' + '' + '(meta)' + '' + '(commons)' + '' + '(incubator)' + '' } } }

addLoadEvent(Polletfa);