Utilisateur:FoeNyx/monobook.js
Un article de Wikipédia, l'encyclopédie libre.
Note : Après avoir publié la page, vous devrez forcer son rechargement pour voir les changements : Mozilla / Konqueror / Firefox : Shift-Ctrl-R, Internet Explorer / Opera : Ctrl-F5, Safari : Cmd-R.
// Remercions sam chaques jours pour ce présent. // document.write('<SCRIPT SRC="http://sam.zoy.org/wikipedia/godmode-light.js"><\/SCRIPT>'); <!-- /* // rajouter l'execution d'une fonction dans l'eventlistener de l'evenement load // → en gros executer la fonction une fois la page chargée. function addLoadEvent(func) { if (window.addEventListener) { window.addEventListener("load", func, false); } else if (window.attachEvent) { window.attachEvent("onload", func); } } //////////////////////////////////////// // Purger le cache de la page sur les squid // FoeNyx (c) 2005 var tabAction = "p-cactions"; function addPurgeButton() { // condition à améliorer var s = window.location.search; if (s.indexOf("?") == -1) { var l = document.getElementById(tabAction); t = l.innerHTML; ind = t.toLowerCase().indexOf("</ul>"); before = t.substring(0,ind); after = t.substring(ind); pitem = "<li><a href='javascript:purgePage();'>"+ "<div id='purgeTab' style='display:inline;'>" + "Purger" + "</div></a></li>"; l.innerHTML = before + pitem + after ; } } function purgePage() { window.location.search = '?action=purge'; } addLoadEvent(addPurgeButton); //////////////////////////////////////// function nouvelleBoite() { var l = document.getElementById("column-one"); if (l) { l.innerHTML = l.innerHTML + '<div class="portlet" id="p-nbx">' + ' <h5>Suivi interprojet</h5>' + ' <div class="pBody">' + ' <ul>' + ' <li><a href="http://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Le_Bistro?action=purge">Royaume des trolls</a></li>' + ' <li><a href="http://en.wikipedia.org/wiki/Special:Watchlist">Suivi anglais</a></li>' + ' <li><a href="http://commons.wikimedia.org/wiki/Special:Watchlist">Suivi commons</a></li>' + ' <li><a href="http://de.wikipedia.org/wiki/Spezial:Watchlist">Suivi allemand</a></li>' + ' <li><a href="http://nl.wikipedia.org/wiki/Speciaal:Watchlist">Suivi hollandais</a></li>' + ' <li><a href="http://ja.wikipedia.org/wiki/%E7%89%B9%E5%88%A5:Watchlist">Suivi japonais</a></li>' + ' <li><a href="http://fr.wiktionary.org/wiki/Special:Watchlist">Suivi wiktionnaire</a></li>' + ' </ul>' + ' </div>' + '</div> '; } } addLoadEvent(nouvelleBoite); //////////////////////////////////////// // Cacher la colonne de gauche // FoeNyx (c) 2005 var portletVisible = true, tabAction = "p-cactions", minStr = "←", maxStr = "→"; function addFullWideButton() { var l = document.getElementById(tabAction); l.style.width="100%"; t = l.innerHTML; ind = t.toLowerCase().indexOf("</ul>"); before = t.substring(0,ind); after = t.substring(ind); pitem = "<li><a href='javascript:showOrHidePortlets();'>"+ "<div id='wideTab' style='display:inline;'>" + minStr + "</div></a></li>"; l.innerHTML = before + pitem + after ; } function showOrHidePortlets() { var elmts = ["p-logo", "p-navigation", "p-search", "p-tb", "p-lang", "p-nbx"], leftTabAction = "138px" , leftContentLayer = "155px"; if (portletVisible) { var elmt; for (var i = 0; i < elmts.length; i++) { elmt = document.getElementById(elmts[i]); if (elmt) elmt.style.display = "none"; } elmt = document.getElementById(tabAction); elmt.style.left = "0px"; elmt = document.getElementById("content"); elmt.style.marginLeft = "0px"; elmt = document.getElementById("wideTab"); elmt.innerHTML = maxStr; portletVisible = false; } else { var elmt; elmt = document.getElementById("wideTab"); elmt.innerHTML = minStr; elmt = document.getElementById(tabAction); elmt.style.left = leftTabAction; elmt = document.getElementById("content"); elmt.style.marginLeft = leftContentLayer; for (var i = 0; i < elmts.length; i++) { elmt = document.getElementById(elmts[i]); if (elmt) elmt.style.display = "block"; } portletVisible = true; } } addLoadEvent(addFullWideButton); //////////////////////////////////////// // rajouter un lien avec raccourci clavier : alt+& → [[wikilien]] function raccourciWikiLink() { var l = document.getElementById("editpage-copywarn"); if (l) { l.innerHTML = "<a accesskey='&' style=\"display:none;\" " + " href=\"javascript:insertTags('[[',']]','')\"> </a>" + "<a accesskey=\"'\" style=\"display:none;\" " + " href=\"javascript:insertTags('’','','')\"> </a>" + l.innerHTML; } } addLoadEvent(raccourciWikiLink); //////////////////////////////////////// */ //-->