User:Svartkell/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin can be added at User:Svartkell/monobook.css. |
//<nowiki>
// auteur : Utilisateur:Dake
// Onglet Purge
function OngletPurge() {
var a = document.getElementById("p-cactions");
if (a)
{
var pageName = document.title.replace(" - Wikipédia", "");
b = a.getElementsByTagName("ul");
if(b.length > 0)
{
b[0].innerHTML = b[0].innerHTML
+ '<li id="ca-nstab-user">'
+ '<a href="/w/index.php?action=purge&title=' + pageName + '">purger</a>'
+ '</li>';
}
}
}
// Onglet Purge
$(OngletPurge);
// Ajout d'autres icônes à la barre d'édition
function DeluxeBar() {
if (document.createTextNode) {
var toolbar = document.getElementById("toolbar");
if (!toolbar) return;
///// zone personnalisable ////
var messages = new Array()
// le texte a été splitté sinon Mediawiki casse tout...
messages[0] = "{{" + "ébauche" + "}}";
messages[1] = "{{" + "Portail " + "}}";
messages[2] = "[[" + "Catégorie:" + "]]";
messages[3] = "[[" + "Catégorie:Naissance en " + "|" + "Catégorie:Naissance en " + "]]";
messages[4] = "[[" + "Catégorie:Décès en " + "|" + "Catégorie:Décès en " + "]]";
messages[5] = "{{subst:" + "Bienvenue sur ta page" + "}}" + "~~" + "~~";
messages[6] = "{{subst:" + "Bienvenue" + "}}" + "~~" + "~~";
messages[7] = "{{subst:" + "Bienvenue vandale" + "}}" + "~~" + "~~";
messages[8] = "{{subst:" + "Vandalisme|page" + "}}" + "~~" + "~~";
messages[9] = "{{subst:" + "Bienvenue spammeur" + "}}" + "~~" + "~~";
messages[10] = "{{subst:" + "suppression" + "}}";
var images = new Array()
images[0] = "http://upload.wikimedia.org/wikipedia/fr/b/bb/Button_%C3%A9bauche.png";
images[1] = "http://upload.wikimedia.org/wikipedia/fr/8/8b/Button_portail.png";
images[2] = "http://upload.wikimedia.org/wikipedia/fr/7/77/Button_cat%C3%A9gorie.png";
images[3] = "http://upload.wikimedia.org/wikipedia/fr/5/54/Button_naissance.png";
images[4] = "http://upload.wikimedia.org/wikipedia/fr/2/2f/Button_d%C3%A9c%C3%A8s.png";
images[5] = "http://upload.wikimedia.org/wikipedia/fr/1/12/Button_accueilA.png";
images[6] = "http://upload.wikimedia.org/wikipedia/fr/e/eb/Button_accueilB.png";
images[7] = "http://upload.wikimedia.org/wikipedia/fr/0/00/Button_vandale.png";
images[8] = "http://upload.wikimedia.org/wikipedia/fr/9/9c/Button_vandale-2.png";
images[9] = "http://upload.wikimedia.org/wikipedia/fr/f/fb/Button_spam2.png";
images[10] = "http://upload.wikimedia.org/wikipedia/fr/f/f8/Button_suppr.png";
var commentaires = new Array()
commentaires[0] = ""
commentaires[1] = ""
commentaires[2] = ""
commentaires[3] = ""
commentaires[4] = ""
commentaires[5] = "Bienvenue sur ta page !"
commentaires[6] = "Bienvenue !"
commentaires[7] = "Avertissement vandalisme"
commentaires[8] = "Avertissement vandalisme"
commentaires[9] = "Avertissement spam" ;
commentaires[10] = "Proposé à la suppression"
////////////////////////////////
for (var i=0;i<messages.length;i++) {
var img = document.createElement("img");
img.setAttribute("src", images[i]);
var ref = document.createElement("a");
ref.setAttribute("href", "javascript:insertTags('', \"" + messages[i] + "\", '');" +
"javascript:changeSummary(\"" + commentaires[i] + "\");" );
ref.appendChild(img);
toolbar.appendChild(ref);
}
}
}
function changeSummary(sampleText) {
document.editform.wpSummary.value = sampleText;
}
$(DeluxeBar);
// Résumé Deluxe
// Fonction ResumeDeluxeModif
// Code : Dake
function ResumeDeluxeModif(content) {
if (document.editform.wpSummary.value != 0) {
document.editform.wpSummary.value+=' - ';
}
document.editform.wpSummary.value+=content;
}
function ResumeDeluxe() {
// vous pouvez ajouter vos messages ci-dessous - attention aux apostrophes et aux
// guillemets qui peuvent casser le script
var messages = new Array()
messages[0] = "Orthographe / Typo";
messages[1] = "Catégories";
messages[2] = "Wikification";
messages[3] = "Lien Wiki";
messages[4] = "Interwiki";
messages[5] = "Ajout bandeau ébauche";
messages[6] = "Suppression bandeau ébauche";
messages[7] = "Ajout bandeau portail";
messages[8] = "Suppression signature(s)";
messages[9] = "Suppression lien image mort";
messages[10] = "Révocation vandalisme";
messages[11] = "Blanchi / contenait ";
// texte dans les boutons (pour éviter de prendre trop de place)
var labelBoutons = new Array()
labelBoutons[0] = "ortho";
labelBoutons[1] = "cat";
labelBoutons[2] = "wiki";
labelBoutons[3] = "lien";
labelBoutons[4] = "interwiki";
labelBoutons[5] = "+ ébauche";
labelBoutons[6] = "- ébauche";
labelBoutons[7] = "+ portail";
labelBoutons[8] = "sign";
labelBoutons[9] = "- image";
labelBoutons[10] = "revert";
labelBoutons[11] = "blanchi";
var nombreBoutonsParLigne = 12;
// ne rien toucher ci-dessous
var mainNode = document.getElementById("wpSummaryLabel");
if (!mainNode) {
return;
}
var summaryNode = mainNode;
var formButtons = document.createElement("form");
for (var i=0;i<messages.length;i++) {
if (i%nombreBoutonsParLigne==0) {
formButtons.appendChild(document.createElement("p"));
}
var nodeInput = document.createElement("input");
nodeInput.setAttribute("type", "button");
nodeInput.setAttribute("value", labelBoutons[i]);
nodeInput.setAttribute("onClick", "ResumeDeluxeModif('" + messages[i] + "')");
formButtons.appendChild(nodeInput);
}
summaryNode.appendChild(formButtons);
}
$(ResumeDeluxe);
function TodayDate()
{
var m = new Array("janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre")
var today = new Date()
var day = today.getDate()
var year = today.getYear()
if (year < 2000)
year += 1900
return (day + " " + m[today.getMonth()] + " " + year)
}
// Personalisation de la boite de navigation ainsi que de la boite utilisateur (haut de page)
function OptimizedNavig()
{
// nav box
var a = document.getElementById("p-navigation");
if (a)
{
b = a.getElementsByTagName("ul");
if(b.length > 0)
{
var startUrl = '/w/index.php?title='
// var endUrl = '&action=purge'
// liste des URLs
var urls = new Array()
urls[0] = 'Special:Lonelypages&limit=500&offset=0'
urls[1] = 'Special:Deadendpages&limit=500&offset=0'
urls[2] = 'Special:Newpages'
urls[3] = 'Wikipédia:Le Bistro/' + TodayDate()
urls[4] = 'Special:Uncategorizedpages&limit=500&offset=0'
urls[5] = 'Special:Statistics'
urls[6] = 'Wikipédia:Pages à supprimer'
var labels = new Array()
labels[0] = 'Pages orphelines'
labels[1] = 'Pages en impasse'
labels[2] = 'Nouvelles pages'
labels[3] = 'Bistro'
labels[4] = 'Pages sans catégories'
labels[5] = 'Statistiques'
labels[6] = 'Pages à supprimer'
for (var i=0;i<urls.length;i++) {
tableHTML = '<table valign="top" cellspacing="0" cellpadding="0">'
tableHTML += '<tr>'
tableHTML += '<li><td><a href="' + startUrl + urls[i] + '">' + labels[i] + '</a></td></li>'
tableHTML += '</tr>'
tableHTML += '</table>'
b[0].innerHTML = b[0].innerHTML + tableHTML
}
}
}
}
$(OptimizedNavig);
// -----------------------------------------------------------------------------
// God-like Monobook skin
// (c) 2005 Sam Hocevar <sam@zoy.org>
// $Id: godmode-light.js 1029 2006-01-09 11:05:19Z sam $
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Language support, taken from phase3/languages/*
// -----------------------------------------------------------------------------
var rollbacklink = 'rollback';
var cantrollback = 'Cannot revert edit; last contributor is only author of this page.';
var alreadyrolled = 'Cannot rollback last edit of [[$1]] by [[User:$2|$2]] ([[User talk:$2|Talk]]); someone else has edited or rolled back the page already. Last edit was by [[User:$3|$3]] ([[User talk:$3|Talk]]). ';
var revertpage = 'Reverted edits by [[Special:Contributions/$2|$2]] to last version by $1';
switch (document.getElementsByTagName('html')[0].lang) {
case 'fr':
rollbacklink = 'révoquer';
cantrollback = 'Impossible de révoquer: dernier auteur est le seul à avoir modifié cet article';
alreadyrolled = 'Impossible de révoquer la dernière modification de [[$1]] par [[User:$2|$2]] ([[User talk:$2|Talk]]); quelqu\'un d\'autre à déjà modifer ou révoquer l\'article. La dernière modificaion était de [[User:$3|$3]] ([[User talk:$3|Talk]]). '; // lol @ pathetic grammar
revertpage = "Révocation des modifications de [[Special:Contributions/$2|$2]] (retour à la précédente version de $1)";
break;
case 'de':
rollbacklink = 'Zurücksetzen';
cantrollback = 'Die Änderung kann nicht zurückgenommen werden; der letzte Autor ist der einzige.';
alreadyrolled = 'Die Zurücknahme des Artikels [[$1]] von [[Benutzer:$2|$2]] ([[Benutzer Diskussion:$2|Diskussion]]) ist nicht möglich, da eine andere Änderung oder Rücknahme erfolgt ist. Die letzte Änderung ist von [[Benutzer:$3|$3]] ([[Benutzer Diskussion:$3|Diskussion]])';
revertpage = 'Änderungen von [[Benutzer:$2]] rückgängig gemacht und letzte Version von [[Benutzer:$1]] wiederhergestellt';
break;
case 'es':
rollbacklink = 'Revertir';
cantrollback = 'No se pueden revertir las ediciones; el último colaborador es el único autor de este artículo.';
alreadyrolled = 'No se puede revertir la última edición de [[$1]] por [[Colaborador:$2|$2]] ([[Colaborador Discusión:$2|Discusión]]); alguien más ya ha editado o revertido esa página. La última edición fue hecha por [[Colaborador:$3|$3]] ([[Colaborador Discusión:$3|Discusión]]). ';
revertpage = 'Revertida a la última edición de $1';
break;
case 'it':
rollbacklink = 'rollback';
cantrollback = 'Impossibile tornare ad una versione precedente: l\'ultima modifica è stata apportata dall\'unico utente che abbia lavorato a questo articolo.';
//alreadyrolled = '';
revertpage = 'Riportata alla revisione precedente da $1';
break;
case 'pt':
rollbacklink = 'voltar';
cantrollback = 'Não foi possível reverter a edição; o último contribuidor é o único autor deste artigo.';
alreadyrolled = 'Não foi possível reverter as edições de [[$1]] por [[User:$2|$2]] ([[User talk:$2|Talk]]); alguém o editou ou já o reverteu. A última edição foi de [[User:$3|$3]] ([[User talk:$3|Conversar com ele]]). ';
revertpage = 'Revertidas edições por [[Special:Contributions/$2|$2]], para a última versão por $1';
break;
}
//</nowiki>