User:Meanos/monobooks.js
Appearance
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// Add an [edit top] link to pages
$(function () {
// if this is preview page or generated page, stop
if(document.getElementById("wikiPreview") || window.location.href.indexOf("/wiki/Special:") != -1) return;
// get the page title
var pageTitle = document.title.split(" - ")[0].replace(" ", "_");
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="editsection" style="float:right;margin-left:5px;margin-right:15px;margin-top:3px;">[<a href="/w/index.php?title='+pageTitle+'&action=edit§ion=0" title="'+document.title.split(" - ")[0]+'">edit top</a>]</div>';
// insert divContainer into the DOM before the h1
if(window.location.href.indexOf("&action=edit") == -1)
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
if(window.location.href.indexOf("&action=edit§ion=0") != -1)
document.getElementById("wpSummary").value = "/* Intro */ ";
});
mw.loader.load('https://fr.wikipedia.org/w/index.php?title=Utilisateur:GôTô/objects.js'
+ '&action=raw&ctype=text/javascript');
mw.loader.load('https://fr.wikipedia.org/w/index.php?title=Utilisateur:GôTô/ufunctions.js'
+ '&action=raw&ctype=text/javascript');
mw.loader.load('https://fr.wikipedia.org/w/index.php?title=Utilisateur:Dake/monobook.js/deluxehistory.js'
+ '&action=raw&ctype=text/javascript');
// ----------------------------------------
function addLoadEvent(func) {
if (window.addEventListener) {
window.addEventListener("load", func, false);
} else if (window.attachEvent) {
window.attachEvent("onload", func);
}
}
// ----------------------------------------
function perso() {
var l = document.getElementById("column-one");
if (l) {
l.innerHTML = l.innerHTML
+ '<div class="portlet" id="p-nbx">'
+ ' <h5>Boîte perso</h5>'
+ ' <div class="pBody">'
+ ' <ul>'
+ ' <li><a href="http://meta.wikimedia.org/wiki/Meta:Babel">Babel</a></li>'
+ ' </ul>'
+ ' </div>'
+ '</div> ';
}
}
addLoadEvent(perso);
// ----------------------------------------
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( "Catégories" ) ;
h5_cats.appendChild( text ) ;
var div_cats = document.createElement( "div" );
div_cats.setAttribute( "class", "pBody" );
var ul = document.createElement( "ul" );
var a_debut = 1 ;
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 () {
// if this is preview page or generated page, stop
if(document.getElementById("wikiPreview") || window.location.href.indexOf("/wiki/Special:") != -1) return;
// get the page title
var pageTitle = document.title.split(" - ")[0].replace(" ", "_");
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="editsection" style="float:right;margin-left:5px;margin-right:15px;margin-top:3px;">[<a href="/w/index.php?title='+pageTitle+'&action=edit§ion=0" title="'+document.title.split(" - ")[0]+'">edit top</a>]</div>';
// insert divContainer into the DOM before the h1
if(window.location.href.indexOf("&action=edit") == -1)
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
if(window.location.href.indexOf("&action=edit§ion=0") != -1)
document.getElementById("wpSummary").value = "/* Intro */ ";
});