Utilisateur:Plyd/monobook.js
Un article de Wikipédia, l'encyclopédie libre.
Note : Après avoir sauvegardé, vous devez forcer le rechargement de la page pour voir les changements : Mozilla / Konqueror / Firefox : Shift-Ctrl-R, IE / Opera : Ctrl-F5, Safari : Cmd-R.
/* {| border="0" cellpadding="10" cellspacing="0" style="clear: right; margin: 0 0 1em 1em; border: 1px solid #999; border-right: 2px solid #ccc; border-bottom: 2px solid #ccc; background-color: #f3fff3" |- | [[Image:Nuvola apps important.svg|left|100px]] | Attention ! Si vous désirez copier des fonctionalités de ce monobook.js, prenez garde à certains passages qui sont destinés à mes pages et sous-pages.<br/> N'hésitez pas à me contacter sur ma [[Discussion Utilisateur:Plyd|page de discussion]] en cas de doute :)<br/><br/> Cette page liste l'ensemble des scripts que j'ai pu voler à droite à gauche :) N'hésitez pas à me piller également, et à me faire part de vos améliorations :D |} <pre><nowiki> */ // import volé à GôTô puis modifié function importWikiPage(page, lng, raw) { langue = (lng ? lng : 'fr'); actionraw = (raw ? '&ctype=text/javascript&dontcountme=s' : '&action=raw&ctype=text/javascript&dontcountme=s'); document.write('<script type="text/javascript" src="' + 'http://' + langue + '.wikipedia.org/w/index.php?title=' + page + actionraw + '"></script>'); } importWikiPage('Utilisateur:Plyd/monobook.js/fusion.js'); //////////////////////////////////////////////////////////////////////////////// function morelinks() { var tabs = document.getElementById('p-cactions').cloneNode(true); tabs.id = 'mytabs'; var listitems = tabs.getElementsByTagName('LI'); for (i=0;i<listitems.length;i++) { if(listitems[i].id) listitems[i].id = 'mytabs-' + listitems[i].id; } document.getElementById('column-content').appendChild(tabs); } if (window.addEventListener) window.addEventListener("load",morelinks,false); else if (window.attachEvent) window.attachEvent("onload",morelinks); // ----------------------------------------------------------------------------- // Fonction ImageUse – Merci Anakin // ----------------------------------------------------------------------------- function ImageUse() { try { var imagename = document.getElementById('ca-nstab-image').firstChild.href; imagename = imagename.substring(imagename.indexOf("Image:") + 6); if(imagename) { var li = document.createElement('li'); li.id = 'ca-imageuse'; var a = document.createElement('a'); a.appendChild(document.createTextNode("Voir l'utilisation")); a.href = 'http://www.juelich.de/avatar/check-usage/check-usage.php?filename=' + imagename + '&template'; li.appendChild(a); document.getElementById('ca-watch').parentNode.appendChild(li); } } catch (e) { /* not existing ca-nstab-image tag ? */ } } if (window.addEventListener) window.addEventListener('load', ImageUse, false); else if (window.attachEvent) window.attachEvent ('onload', ImageUse); // Released into the public domain by [[User:Func]] // function NUPatrol() { if ( window.location.href.indexOf( 'Special:Log/newusers') < 0 && window.location.href.indexOf( '&type=newusers' ) < 0 ) return; var items, item, i, links, user, name, talk, contribs, insertLoc, link; items = document.getElementById( 'bodyContent' ).getElementsByTagName( 'ul' )[ 0 ].getElementsByTagName( 'li' ); function NewLink( txt, url, plainlinks, linkColor ) { var a = document.createElement( 'a' ); a.appendChild( document.createTextNode( txt ) ); a.href = url; if ( plainlinks ) a.className = 'plainlinks'; if ( linkColor ) { if ( typeof linkColor == "string" ) a.style.color = linkColor; else a.style.color = '#FF0000'; // old default behavior } return a; } for ( i = 0; i < items.length; i++ ) { item = items[ i ]; links = item.getElementsByTagName( 'a' ); user = links[ 0 ]; name = user.firstChild.nodeValue; talk = links[ 2 ]; talk.firstChild.nodeValue = 'discussion'; // lowercase 'Talk' for consistency contribs = links[ 3 ]; insertLoc = user.nextSibling; // ' newusers ' item.insertBefore( document.createTextNode( ' ( ' ), insertLoc ); item.insertBefore( talk, insertLoc ); item.insertBefore( document.createTextNode( ', ' ), insertLoc ); item.insertBefore( contribs, insertLoc ); item.insertBefore( document.createTextNode( ', ' ), insertLoc ); item.insertBefore( NewLink( 'actions', '/w/index.php?title=Special%3ALog&user=' + name, true, '#000088' ), insertLoc ); item.insertBefore( document.createTextNode( ', ' ), insertLoc ); item.insertBefore( NewLink( 'blocages', '/w/index.php?title=Special%3ALog&type=block&page=User%3A' + name, true, '#008800' ), insertLoc ); item.insertBefore( document.createTextNode( ', ' ), insertLoc ); item.insertBefore( NewLink( 'est bloqué ?', '/wiki/Special:Ipblocklist?action=search&ip=' + name, true, '#888800' ), insertLoc ); item.insertBefore( document.createTextNode( ', ' ), insertLoc ); item.insertBefore( NewLink( 'bloquer', '/w/index.php?title=Special:Blockip&ip=' + name, true, '#880000' ), insertLoc ); item.insertBefore( document.createTextNode( ' )' ), insertLoc ); item.removeChild( insertLoc.nextSibling ); // should remove the span item.removeChild( insertLoc ); // should remove ' newusers ' text } } if ( window.addEventListener ) window.addEventListener( 'load', NUPatrol, false ); else if ( window.attachEvent ) window.attachEvent( 'onload', NUPatrol ); /* ~~~~ <-- test */ function OptimizedSuivi() { if (document.title=="Supprimée de la liste de suivi - Ne plus suivre - Wikipédia") { history.go(-1) } // remplacement de la watchlist "normal" par une version avec ses modifs masquées + 1 jour var watch = document.getElementById("pt-watchlist"); if (!watch) return; watch.childNodes[0].setAttribute("href", "http://fr.wikipedia.org/w/index.php?title=Special:Watchlist&days=1&hideOwn=1") if (document.URL.indexOf("http://fr.wikipedia.org/wiki/Special:Watchlist")==0 || document.URL.indexOf("http://fr.wikipedia.org/w/index.php?title=Special:Watchlist")==0 ){ var allDays = document.getElementsByTagName("ul"); for (i=0; i<allDays.length; i++) { if (allDays[i].getAttribute("class") == "special") { var artList = allDays[i].getElementsByTagName("li"); for (j=0; j<artList.length; j++) { var elem = artList[j]; var aTag = elem.getElementsByTagName("a"); var articleName = aTag[0].getAttribute("title"); var stopWatch = "/w/index.php?title=" + articleName + "&action=unwatch" var newElement = document.createElement("a"); newElement.setAttribute("href",stopWatch); var newText = document.createTextNode("stop"); newElement.appendChild(newText); var newPar = document.createTextNode(") (") // séparation des cas (nouvel article, ou déjà existant) if (aTag[0].childNodes[0].data == "diff") { insertAfter(elem, newPar, aTag[1]); } else { insertAfter(elem, newPar, aTag[0]); } insertAfter(elem, newElement, newPar); } } } } } addLoadEvent(OptimizedSuivi); function nouvelOnglet() { var a = document.getElementById("p-cactions"); if (a) { b = a.getElementsByTagName("ul"); if(b.length > 0) { b[0].innerHTML = b[0].innerHTML + '<li id="ca-nstab-user">' + '<a href="/wiki/Special:Shortpages">' + 'shortpages</a></li>'; } } } addLoadEvent(nouvelOnglet); /* </nowiki></pre> */