Utilisateur:Grondin/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.
//<pre><nowiki> ////////////////////////////////////WATCH LIST/////////////////////////// var suiviManagerAllPages = new Array(); function SuiviManagerRegexp(regexp) { var match = new RegExp(regexp); for (var i=0;i<suiviManagerAllPages.length;i++) { var pageName = suiviManagerAllPages[i].childNodes[0].getAttribute("value"); if (match.test(pageName)) { suiviManagerAllPages[i].childNodes[0].checked=true; } } } function SuiviManagerLiensRouges() { for (var i=0;i<suiviManagerAllPages.length;i++) { var pageClass = suiviManagerAllPages[i].childNodes[1].getAttribute("class"); if (pageClass && pageClass=="new") { suiviManagerAllPages[i].childNodes[0].checked=true; } } } function SuiviManagerDeselect() { for (var i=0;i<suiviManagerAllPages.length;i++) { suiviManagerAllPages[i].childNodes[0].checked=false; } } function SuiviManager() { if (document.URL.indexOf("http://fr.wikipedia.org/wiki/Special:Watchlist/edit")!=0) return; var a=0; var b=0; var interfaceMsg = new Array(); var regexpList = new Array(); ////////////////////////////////////////////////// // Expressions régulières et liens de l'interface // // besoin d'aide pour les regexp ? // http://www.commentcamarche.net/javascript/jsregexp.php3 ////////////////////////////////////////////////// interfaceMsg[a++] = "<b>Tout cocher</b>"; regexpList[b++] = "^.*"; interfaceMsg[a++] = "Utilisateurs"; regexpList[b++] = "^Utilisateur:"; interfaceMsg[a++] = "Wikipédia:*"; regexpList[b++] = "^Wikipédia:"; interfaceMsg[a++] = "Sous-pages de PàS"; regexpList[b++] = "^Wikipédia:Pages à supprimer\/"; interfaceMsg[a++] = "Sous-pages de PàV"; regexpList[b++] = "^Wikipédia:Pages à vérifier\/"; interfaceMsg[a++] = "Pages du bistro"; regexpList[b++] = "^Wikipédia:Le Bistro\/"; interfaceMsg[a++] = "Images"; regexpList[b++] = "^Image:"; interfaceMsg[a++] = "Modèles"; regexpList[b++] = "^Modèle:"; interfaceMsg[a++] = "Aide"; regexpList[b++] = "^Aide:"; interfaceMsg[a++] = "Catégories"; regexpList[b++] = "^Catégorie:"; interfaceMsg[a++] = "Portails"; regexpList[b++] = "^Portail:"; ////////////////////////////////////////////////// var topTag = document.getElementById("contentSub") // récupère toutes les pages var watchlist = document.getElementsByTagName("ul"); for (u=0;u<watchlist.length;u++) { var entries = watchlist[u].getElementsByTagName("li"); for (i=0;i<entries.length;i++) { suiviManagerAllPages.push(entries[i]); } } // prépare la mini-interface var str = "<div style=\"background-color:#8ecfe4;font-size:1px;height:8px;border:1px solid #AAAAAA;-moz-border-radius-topright:0.5em;-moz-border-radius-topleft:0.5em;\"></div>" + "<div style=\"border:1px solid #6ac1de;border-top:0px solid white;padding:5px 5px 0 5px;margin-bottom:3ex;\"><p>" + "<div style=\"float: left; text-align: left; white-space: nowrap;\"></div>" for (var cpt = 0; cpt < interfaceMsg.length; cpt ++) { str += "<a href=\"javascript:SuiviManagerRegexp('" + regexpList[cpt] + "')\">" + interfaceMsg[cpt] + " ·</a> " } str += "<a href=\"javascript:SuiviManagerLiensRouges()\">" + "Retirer les liens rouges" + " ·</a> " str += "<a href=\"javascript:SuiviManagerDeselect()\">" + "<b>Enlever toutes les coches</b>" + " ·</a> " topTag.innerHTML = topTag.innerHTML + "<br clear=all />" + str + "<p></div>" } addLoadEvent(SuiviManager); ///////////////////////ajouts///////////////////////// function addToSummary(str) { document.editform.wpSummary.value += " " + str } function DeluxeSummary() { var sumLbl = document.getElementById("wpSummaryLabel") if (sumLbl) { //élargissement boite de résumé var sumInput = document.getElementById("wpSummary") sumInput.style.width = "90%" var titles = new Array() titles.push("ébauche") titles.push("cat") titles.push("image") titles.push("wikif") titles.push("sup") titles.push("portail") titles.push("image") titles.push("interwiki") titles.push("int") titles.push("ext") titles.push("corr interwiki") titles.push("corr int") titles.push("corr ext") titles.push("ext -> int") titles.push("int -> interwiki") titles.push("ext -> interwiki") titles.push("MeP") titles.push("fusion") titles.push("redir") titles.push("db-redir") titles.push("ortho/gram") titles.push("retouches") titles.push("ajInfo") titles.push("création") titles.push("Vote") titles.push("Motivation") titles.push("Réponse") titles.push("rv") titles.push("vandale") titles.push("copyvio") titles.push("spam") titles.push("bac à sable") titles.push("autopromo") titles.push("no-régul") titles.push("délais") titles.push("sup copyvio") titles.push("date") titles.push("rv-motif") titles.push("blocage") var inputs = new Array() inputs.push("- bandeau ébauche") inputs.push("- catégorie") inputs.push("- image") inputs.push("- wikification de la page ") inputs.push("supprimé ") inputs.push("- portail") inputs.push("- image manquante") inputs.push("- liens interwiki") inputs.push("- lien interne") inputs.push("- lien externe") inputs.push("correction liens interwiki ") inputs.push("correction lien interne") inputs.push("correction lien externe") inputs.push("conversion lien externe en lien interne") inputs.push("conversion lien interne en lien interwiki") inputs.push("conversion lien externe en lien interwiki") inputs.push("mise en page") inputs.push("fusion effectuée") inputs.push("Redirect") inputs.push("Correction double redirection") inputs.push("correction orthographe/grammaire") inputs.push("diverses retouches") inputs.push("ajout infos") inputs.push("Initialisation de la page") inputs.push("A voté") inputs.push("Ma motivation") inputs.push("Réponse") inputs.push("Revert : ") inputs.push("Revert : vandalisme") inputs.push("Revert : copyvio ") inputs.push("Revert : spam") inputs.push("Revert : bac à sable") inputs.push("Revert : auto-promotion") inputs.push("- non régularisé") inputs.push("- délais non respectés") inputs.push("- suppression passage en copyvio du site : ") inputs.push("- "+ TodayDate()) inputs.push("revert de la dernière contribution. Indiquez les motifs des modifications dans boîte de résumé ou en indiquer le renvoi en page de discussion") inputs.push("Avis de blocage ") var str = "" for (var cpt = 0; cpt < titles.length; cpt ++) { str += "<a href=\"javascript:addToSummary('" + inputs[cpt] + "')\"" + " class=\"sumLink\" title=\"Ajouter '" + inputs[cpt] +"' dans la boîte de résumé\">" + titles[cpt] + " ·</a> " } sumLbl.innerHTML = str + "<br />" + sumLbl.innerHTML } } addLoadEvent(DeluxeSummary) /* Lien Editcount */ var tabAction = "p-cactions"; function addECButton() { if ( window.location.href.indexOf('Contributions') < 0) return; var c = document.getElementById('contentSub'); var a = c.getElementsByTagName('a'); if (a.length == 3) { name = a[0].innerHTML; } else { name = c.innerHTML.replace(/ \(.*/, '').replace(/.* /, ''); } 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='http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user="+"&dbname=frwiki_p'>"+ "<div id='EditCount' style='display:inline;'>" + "Editcount" + "</div></a></li>"; l.innerHTML = before + pitem + after ; } addLoadEvent(addECButton); //////////BARRE EDITION BOUTON////////////////////////////////// function DeluxeBar() { if (document.createTextNode) { var toolbar = document.getElementById("toolbar"); if (!toolbar) return; var messages = new Array() var images = new Array() var commentaires = new Array() var a=-1; //Le décompte commence à -1 avec une incrementation sur le premier message, pour éviter tout probleme en cas d'inversion ou suppression du premier message // le texte a été splitté sinon Mediawiki casse tout... messages[++a] = "{{subst:" + "Bienvenue" + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/e/eb/Button_accueilB.png"; commentaires[a] = "Bienvenue !" messages[++a] = "{{subst:" + "Merci IP |~~~~" + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/a/a9/Button_tournesol.png"; commentaires[a] = "Merci pour ta contribution" messages[++a] = "{{subst:"+ "bienvenue IP" + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/3/39/Button_IP.png"; commentaires[a] = "Bienvenue !" messages[++a] = "{{subst:" + "motivation modif" +"|page=" + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/7/74/Button_oeil.png"; commentaires[a] = "Modification de page sans motif" messages[++a] = "{{"+ "subst:bienvenue débutant" + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/2/28/Button_info.png"; commentaires[a] = "Bienvenue débutant !" messages[++a] = "{{subst:" + "Bienvenue vandale" + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/0/00/Button_vandale.png"; commentaires[a] = "Avertissement vandalisme" messages[++a] = "{{subst:" + "Vandalisme| " + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/a/ad/Button_vandale2.png"; commentaires[a] = "Avertissement vandalisme" + " de niveau 1 " messages[++a] = "{{subst:" + "test 2" + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/1/1c/Button_flamme.png"; commentaires[a] = "Avertissement vandalisme" + " de niveau 2 " messages[++a] = "{{subst:" + "test 3" + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/3/3b/Button_crocs.png"; commentaires[a] = "Avertissement vandalisme" + " de niveau 3 " messages[++a] = "{{subst:" + "Bienvenue spammeur" + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/f/fb/Button_spam2.png"; commentaires[a] = "Avertissement spam " messages[++a] = "{{subst:" + "Spam| " + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/f/fb/Button_spam2.png"; commentaires[a] = "Avertissement spam " messages[++a] = "== Avis de blocage du ~~" + "~~" + "~ ==\\n{{subst:" + "Vandale bloqué| | " + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/b0/Button_blocage.png"; commentaires[a] = "Avis de blocage" messages[++a] = "== Avis de blocage du ~~" + "~~" + "~ ==\\n{{subst:" + "Vandale bloqué sans avertissement| " + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/b0/Button_blocage.png"; commentaires[a] = "Avis de blocage" messages[++a] = "{{subst:" + "Utilisateur:Grondin/modèle en travaux/Ets scolaire| " + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/6/66/Button_mort.png"; commentaires[a] = "Avis de saisine d'office du rectorat" messages[++a] = "{{subst:" + "Utilisateur:Dake/Traité||" + "--" + "~~" + "~~" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/d/d9/Button_trait%C3%A9.png"; commentaires[a] = "Traité" messages[++a] = "{{subst:" + "TraitéConserver||" + "--" + "~~" + "~~" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/a/ae/Button_trait%C3%A9conserver.png"; commentaires[a] = "Traité : article conservé" messages[++a] = "{{subst:" + "TraitéSupprimer||" + "--" + "~~" + "~~" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/9/96/Button_trait%C3%A9supprimer.png"; commentaires[a] = "Traité : article supprimé" messages[++a] = "{{" + "suppression à revoir" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/2/22/Button_radio_activite.png"; commentaires[a] = "Article sensiblement modifié" messages[++a] = "{{" + "copie de site|URL|Titre" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/e/e5/Button_copyvio.png"; commentaires[a] = "Violation de copyright" messages[++a] = "{{" + "avis blanchi copyvio\\n|1=\\n|2=\\n|3=\\n|4=\\n" + "}}"+ "--" + "~~" + "~~" ; images[a] = "http://upload.wikimedia.org/wikipedia/fr/e/e5/Button_copyvio.png"; commentaires[a] = "Violation de copyright"; messages[++a] = "{{" + "Bienvenue copyvio"+"| " + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/e/e5/Button_copyvio.png"; commentaires[a] = "Violation de copyright" messages[++a] = "{{" + "suppression" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/f/f8/Button_suppr.png"; commentaires[a] = "Proposé à la suppression" messages[++a] = "{{" + "page supprimée" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/fr/9/96/Button_trait%C3%A9supprimer.png"; commentaires[a] = "Page supprimée" messages[++a] = "#{{supprimer" + "}} " + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/f/fc/Button_supp.png"; commentaires[a] = "/*Supprimer*/Avis rendu !"; messages[++a] = "#{{conserver" + "}} " + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/ba/Button_conserver.png"; commentaires[a] = "/*Conserver*/Avis rendu !" messages[++a] = "#{{neutre" + "}} " + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/4/4e/Button_neutre.png"; commentaires[a] = "/*neutre*/Avis réservé !" messages[++a] = "#{{VoteFusionner" + "}} " + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/7/70/Button_fusion.png"; commentaires[a] = "/*neutre*/Avis pour fusionner !" messages[++a] = "#{{Rediriger" + "}} " + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/5/5f/Button_rediriger.png"; commentaires[a] = "/*neutre*/Avis pour rediriger !" messages[++a] = "#{{VoteTranswiki" + "}} " + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/d/d0/Button_transwiki.png"; commentaires[a] = "/*neutre*/Avis pour transwiki !" messages[++a] = "#{{pour" + "}} " + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/ba/Button_conserver.png"; commentaires[a] = "/*Pour*/A voté !" messages[++a] = "#{{contre" + "}} " + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/f/fc/Button_supp.png"; commentaires[a] = "/*Contre*/A voté !" messages[++a] = "{{" + "recherche IP" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/bd/Button_recherche_ip.png"; commentaires[a] = "Bandeau recherche IP" messages[++a] = "{{" + "IP partagée" + "| " + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/7/7a/Button_ip_partag%C3%A9e.png"; commentaires[a] = "Bandeau IP partagée" messages[++a] = ":"+ "{{" + "fait" + "}}" + " --" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/9/9d/Button_fait.png"; commentaires[a] = "traité " messages[++a] = "{{" + "Article sans source" + "| " + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/3/33/Button_exclamation.png"; commentaires[a] = "Apposition bandeau article sans source " messages[++a] = "{{" + "sourcer" + "| " + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/6/6d/Button_exclamation_1.png"; commentaires[a] = "Avis d'article non sourcé " messages[++a] = "{{" + "sources" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/6/6a/Button_exclamation_2.png"; commentaires[a] = "Apposition bandeau sources " messages[++a] = "{{" + "Pour Wikisource" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_wikisource.png"; commentaires[a] = "Apposition bandeau pour wikisource " messages[++a] = "{{" + "Wikisource" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_wikisource.png"; commentaires[a] = "Lien sur wikisource " messages[++a] = "{{" + "Wikisourcetexte" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_wikisource.png"; commentaires[a] = "Lien vers le texte wikisource " messages[++a] = "{{" + "Redirect Wikisource" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_wikisource.png"; commentaires[a] = "Redirect vers wikisource " messages[++a] = "{{" + "Pour Wiktionnaire" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/f/f6/Button_wikt_new.png"; commentaires[a] = "Apposition du bandeau pour Wiktionnaire " messages[++a] = "{{" + "Wiktionnaire" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/f/f6/Button_wikt_new.png"; commentaires[a] = "Lien vers Wiktionnaire " messages[++a] = "{{" + "Redirect Wiktionnaire" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/f/f6/Button_wikt_new.png"; commentaires[a] = "Redirect vers Wiktionnaire " messages[++a] = "{{" + "Pour Wikilivres" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/6/61/Button_wikibooks.png"; commentaires[a] = "Apposition du bandeau pour Wikilivres " messages[++a] = "{{" + "Wikilivres" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/6/61/Button_wikibooks.png"; commentaires[a] = "Lien vers Wikilivres " messages[++a] = "{{" + "Redirect Wikilivres" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/6/61/Button_wikibooks.png"; commentaires[a] = "Redirect vers Wikilivres " messages[++a] = "{{" + "Pour Wikinews" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/3/30/Button_wn.png"; commentaires[a] = "Apposition du bandeau pour Wikinews " messages[++a] = "{{" + "Wikinews | " + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/3/30/Button_wn.png"; commentaires[a] = "Lien vers Wikinews " messages[++a] = "{{" + "Redirect Wikinews| " + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/3/30/Button_wn.png"; commentaires[a] = "Redirect vers Wikinews " messages[++a] = "{{" + "Pour Wikiversité" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/b5/Button_wikiversity.png"; commentaires[a] = "Apposition du bandeau pour Wikiversité " messages[++a] = "{{" + "Wikiversité| " + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/b5/Button_wikiversity.png"; commentaires[a] = "Lien vers Wikiversité " messages[++a] = "{{" + "Redirect Wikiversité| " + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/b/b5/Button_wikiversity.png"; commentaires[a] = "Redirect vers Wikiversité " messages[++a] = "{{" + "Pour Wikiquote" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/c/c1/Button_wikiquote.png"; commentaires[a] = "Apposition du bandeau pour Wikiquote " messages[++a] = "{{" + "Wikiquote| " + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/c/c1/Button_wikiquote.png"; commentaires[a] = "Lien vers Wikiquote " messages[++a] = "{{" + "Redirect Wikiquote| " + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/c/c1/Button_wikiquote.png"; commentaires[a] = "Redirect vers Wikiquote " messages[++a] = "{{" + "Désormais sur Commons" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/f/f8/Button_Tool_commons.png"; commentaires[a] = "Image transférée sur Commons" messages[++a] = "{{subst:" + "Licence inconnue datée" + "}}"+ "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/9/9d/Button_halt.png"; commentaires[a] = "Image sans licence " messages[++a] = "{{subst:" + "Avertissement licence inconnue| " + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/7/72/Button_croix_bleue.png"; commentaires[a] = "Image sans licence " messages[++a] = "{{" + "Vers Interwiki\\n|1=\\n|2=\\n|3=" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/d/d0/Button_transwiki.png"; commentaires[a] = "Historique transféré sur le projet cible" messages[++a] = "{{subst:" + "autoCC\\n|1=\\n|option=\\n" + "}}"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/1/12/Button_find.png"; commentaires[a] = "Création de la page d'autorisaton de transfert de licence vers CC-BY-SA 2.5 " messages[++a] = "{{subst:" + "Demande auto CC\\n|1=\\n|option=\\n" + "}}" + "--" + "~~" + "~~"; images[a] = "http://upload.wikimedia.org/wikipedia/commons/6/67/Button_BY.png"; commentaires[a] = "" //////////////////////////////// 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; } addLoadEvent(DeluxeBar); //////////////////////AJOUT DE L'HISTORIQUE - PAGES LIÉES - sur les Special:Shortpages/////////////// function OptimizedShortPages() { if (document.URL.indexOf("http://fr.wikipedia.org/wiki/Special:Shortpages")!=0) return; var mainNode = document.getElementsByTagName("ol"); var allArticles = mainNode[0].getElementsByTagName("li"); for (i=0; i<allArticles.length; i++) { var articleName = allArticles[i].childNodes[0].getAttribute("title"); var historyElement = document.createElement("a"); var histUrl = "/w/index.php?title=" + articleName + "&action=history" historyElement.setAttribute("href", histUrl); var historyText = document.createTextNode("? (hist) "); historyElement.appendChild(historyText); insertAfter(allArticles[i], historyElement, allArticles[i].childNodes[1]); var relatedElement = document.createElement("a"); var relatedUrl = "/wiki/Special:Whatlinkshere/" + articleName relatedElement.setAttribute("href", relatedUrl); var relatedText = document.createTextNode(" (liens) "); relatedElement.appendChild(relatedText); var diffElement = document.createElement("a"); var diffUrl = "/w/index.php?title=" + articleName + "&diff=0" diffElement.setAttribute("href", diffUrl); var diffText = document.createTextNode(" (diff) "); diffElement.appendChild(diffText); insertAfter(allArticles[i], relatedElement, historyElement); insertAfter(allArticles[i], diffElement, relatedElement); insertAfter(allArticles[i], document.createTextNode(allArticles[i].childNodes[1].data), diffElement); allArticles[i].removeChild(allArticles[i].childNodes[1]); } } addLoadEvent(OptimizedShortPages); ///////////////////////MEILLEUR SUIVI/////////////////////// function insertAfter(parent, node, referenceNode) { parent.insertBefore(node, referenceNode.nextSibling); } function OptimizedSuivi() { 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); ////////////////Ajout de liens internes (bistro, PàS, etc.) dans la boîte de navigation à gauche///////////////////// function OptimizedNavig() { 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] = 'Wikipédia:Le Bistro' urls[1] = 'Wikipédia:Pages à supprimer' urls[2] = 'Wikipédia:Proposition articles de qualité' urls[3] = 'Projet:Maintenance' urls[4] = 'Wikipédia:Bulletin des administrateurs' urls[5] = 'Special:Newpages' urls[6] = 'Special:Blockip' urls[7] = 'Special:Log/delete' urls[8] = 'Special:Unusedcategories' urls[9] = 'Special:Export' urls[10] = 'Special:Import' urls[11] = 'wikt:Special:Import' urls[12] = 's:Special:Import' urls[13] = 'b:Special:Import' urls[14] = 'n:Special:Import' urls[15] = 'v:Special:Import' urls[16] = 'q:Special:Import' urls[17] = 'Mediawiki:Edittools' var labels = new Array() labels[0] = 'Bistro' labels[1] = 'PàS' labels[2] = 'pAdQ' labels[3] = 'Maintenance' labels[4] = 'Bulletin admin' labels[5] = 'nPage' labels[6] = 'Bloquer' labels[7] = 'Log/Del' labels[8] = 'unCat' labels[9] = 'Export' labels[10] = 'Import' labels[11] = 'wikt:Import' labels[12] = 's:Import' labels[13] = 'b:Import' labels[14] = 'n:Import' labels[15] = 'v:Import' labels[16] = 'q:Import' labels[17] = 'Edittools' for (var i=0;i<urls.length;i+=2) { tableHTML = '<table valign="top" cellspacing="0" cellpadding="0">' tableHTML += '<tr>' tableHTML += '<li><td><a href="' + startUrl + urls[i] + endUrl + '">' + labels[i] + ' | </a></td>' tableHTML += '<td><a href="' + startUrl + urls[i+1] + endUrl + '">' + labels[i+1] + '</a></td></li>' tableHTML += '</tr>' tableHTML += '</table>' b[0].innerHTML = b[0].innerHTML + tableHTML } } } } addLoadEvent(OptimizedNavig); ////FONCTION TODAYDATE/// 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) } //////////////////////////////////////////////////////////////////// // 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 addLoadEvent(OngletPurge); //OPTIMISE LE SUIVI //Auteur : ? //Version/Date : ? function OptimizedSuivi() { 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); } } } } } /********************************************************* * OUTILS À DESTINATION DES ADMINISTRATEURS *********************************************************/ /* * SuppressionDeluxe : Rajout de boutons de motif de suppression */ function SuppressionDeluxe() { if (document.title.indexOf("Confirmer la suppression - Wikipédia")!=0) return; var mainNode = document.getElementsByTagName("form"); var firstForm = mainNode[0]; var messages = new Array(); var ca = 0; messages[ca++] = "Image avec une pseudo-licence"; messages[ca++] = "Image sans licence"; messages[ca++] = "Licence non valide"; messages[ca++] = "Violation de copyright"; messages[ca++] = "Publicité ou autopromotion"; messages[ca++] = "Vandalisme"; messages[ca++] = "Babil de débutant"; messages[ca++] = "Redirection vers une page inexistante"; messages[ca++] = "Supprimé à la demande de son auteur"; messages[ca++] = "Traduction automatique"; messages[ca++] = "Contrevient aux règles de nommage"; messages[ca++] = "Suite à décision prise sur [[WP:PàS]]"; messages[ca++] = "Propos blessants, insultes ou grossièretés"; messages[ca++] = "Spam"; messages[ca++] = "Pris pour un bac à sable"; messages[ca++] = "Ne respecte pas les critères d'admissibilité"; messages[ca++] = "Fusion des historiques" messages[ca++] = "Purge de l'historique" messages[ca++] = "Transwiki terminé" var table = document.createElement("table"); var tr = document.createElement("tr"); table.appendChild(tr); if (firstForm.getAttribute("id")=="deleteconfirm") { actionDelete = firstForm.getAttribute("action"); var inputs = firstForm.getElementsByTagName("input"); var token = inputs[2].getAttribute("value"); for (var i=0;i<messages.length;i++) { if (i%3==0) { tr = document.createElement("tr"); table.appendChild(tr); } var formElement = document.createElement("form"); formElement.setAttribute("id", "deleteconfirm"); formElement.setAttribute("method", "post"); formElement.setAttribute("action", actionDelete); var inputReason = document.createElement("input"); inputReason.setAttribute("name", "wpReason"); inputReason.setAttribute("value", messages[i]); inputReason.setAttribute("type", "hidden"); var inputConfirm = document.createElement("input"); inputConfirm.setAttribute("name", "wpConfirmB"); inputConfirm.setAttribute("value", messages[i]); inputConfirm.setAttribute("type", "submit"); var inputToken = document.createElement("input"); inputToken.setAttribute("name", "wpEditToken"); inputToken.setAttribute("value", token); inputToken.setAttribute("type", "hidden"); formElement.appendChild(inputReason); formElement.appendChild(inputConfirm); formElement.appendChild(inputToken); var td = document.createElement("td"); td.appendChild(formElement); tr.appendChild(td); } var separation = document.createElement("p"); separation.appendChild(document.createElement("hr")); insertAfter(firstForm.parentNode, separation, firstForm); insertAfter(firstForm.parentNode, table, separation); } } addLoadEvent(SuppressionDeluxe) /* * BlocageDeluxe : Rajout de boutons prédéfinis pour justifier un blocage */ function BlocageDeluxe() { if (document.title.indexOf("Bloquer une adresse IP ou un utilisateur")!=0) return; var mainNode = document.getElementsByTagName("form"); var firstForm = mainNode[0]; var ca = 0; var messages = new Array(); var duree = new Array(); messages[ca] = "Vandale non averti mais voulant nuire"; duree[ca++] = "30 minutes"; messages[ca] = "Vandale non averti mais voulant manifestement nuire"; duree[ca++] = "1 hour"; messages[ca] = "Vandale non averti commettant de gros vandalismes"; duree[ca++] = "2 hours"; messages[ca] = "Grossièretés, insultes, injures."; duree[ca++] = "6 hours"; messages[ca] = "Vandale averti"; duree[ca++] = "1 day"; messages[ca] = "Vandale averti plusieurs fois"; duree[ca++] = "3 days"; messages[ca] = "Vandale déjà averti"; duree[ca++] = "1 week"; messages[ca] = "Récidiviste"; duree[ca++] = "2 weeks"; messages[ca] = "Identifiant à caractère injurieux"; duree[ca++] = "infinite"; messages[ca] = "Robot fou"; duree[ca++] = "infinite"; messages[ca] = "Spammeur"; duree[ca++] = "infinite"; messages[ca] = "Compte créé uniquement pour vandaliser"; duree[ca++] = "infinite"; var table = document.createElement("table"); var tr = document.createElement("tr"); table.appendChild(tr); if (firstForm.getAttribute("id")=="blockip") { actionBlock = firstForm.getAttribute("action"); var inputs = firstForm.getElementsByTagName("input"); var token = inputs[4].getAttribute("value"); var lePauvre = inputs[0].getAttribute("value"); for (var i=0;i<messages.length;i++) { // if (i%3==0) { tr = document.createElement("tr"); table.appendChild(tr); // } var formElement = document.createElement("form"); formElement.setAttribute("id", "blockip"); formElement.setAttribute("method", "post"); formElement.setAttribute("action", actionBlock); var inputReason = document.createElement("input"); inputReason.setAttribute("name", "wpBlockReason"); inputReason.setAttribute("value", messages[i]); inputReason.setAttribute("type", "hidden"); var dureeC = document.createElement("input"); dureeC.setAttribute("name", "wpBlockExpiry"); dureeC.setAttribute("value", "other"); dureeC.setAttribute("type", "hidden"); var dureeC2 = document.createElement("input"); dureeC2.setAttribute("name", "wpBlockOther"); dureeC2.setAttribute("value", duree[i]); dureeC2.setAttribute("type", "text"); var inputConfirm = document.createElement("input"); inputConfirm.setAttribute("name", "wpBlock"); inputConfirm.setAttribute("value", messages[i]); inputConfirm.setAttribute("type", "submit"); var ident = document.createElement("input"); ident.setAttribute("name", "wpBlockAddress"); ident.setAttribute("value", lePauvre); ident.setAttribute("type", "hidden"); var inputToken = document.createElement("input"); inputToken.setAttribute("name", "wpEditToken"); inputToken.setAttribute("value", token); inputToken.setAttribute("type", "hidden"); formElement.appendChild(inputReason); formElement.appendChild(dureeC); formElement.appendChild(dureeC2); formElement.appendChild(inputConfirm); formElement.appendChild(inputToken); formElement.appendChild(ident); var td = document.createElement("td"); td.appendChild(formElement); tr.appendChild(td); } var separation = document.createElement("p"); separation.appendChild(document.createElement("hr")); insertAfter(firstForm.parentNode, separation, firstForm); insertAfter(firstForm.parentNode, table, separation); } } addLoadEvent(BlocageDeluxe); /* * UndeleteSelectAll : Tout sélectionner ou déselectionner pour la restauration d'une page */ function UndeleteSelectAll() { if (document.title.indexOf("Voir et restaurer la page effacée - Wikipédia")!=0) return; var title2 = document.getElementsByTagName("h2"); var all = document.createElement("input"); all.setAttribute("type", "checkbox"); all.setAttribute("onchange", "selectAll(this.checked)"); all.setAttribute("title", "Sélectionner/Désélectionner tous"); if (title2.length > 1) title2[1].appendChild(all); else title2[0].appendChild(all); all.click(); } function selectAll(bool) { var inputs = document.getElementsByTagName("input"); for (var cpt = 0 ; cpt < inputs.length ; cpt++) { inputs[cpt].checked = bool; } } addLoadEvent(UndeleteSelectAll); /************************* * Navigation Pop-ups * *************************/ document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); document.write('<script type="text/javascript" src="' + 'http://fr.wikipedia.org/w/index.php?title=User:Leag/popups-strings-fr.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); simplePopups=true; popupStructure='menus'; popupDelay=0; popupAdminLinks=true; popupImages=false; popupMaxWidth=false; popupOnlyArticleLinks=false; popupMaxWidth=false; /* * plagiarismsearch : détection de plagiats */ function plagiarismsearch(){ var formElement = document.createElement('form'); formElement.setAttribute('method', 'post'); formElement.setAttribute('id', 'copyscapequery'); formElement.setAttribute('name', 'copyscapequery'); formElement.setAttribute('action', 'http://www.copyscape.com/?results'); var queryInput = document.createElement('input'); queryInput.setAttribute('name', 'q'); queryInput.setAttribute('type', 'hidden'); queryInput.setAttribute('value', document.URL); formElement.appendChild(queryInput); var queryGO = document.createElement('a'); queryGO.setAttribute('href', 'javascript:document.forms.copyscapequery.submit();'); var queryText = document.createTextNode('copyscape'); queryGO.appendChild(queryText); var link = document.createElement('li'); link.setAttribute ('id', 'ca-copyscape'); link.appendChild(queryGO); link.appendChild(formElement); var panelControl = document.getElementById('p-cactions'); if (panelControl) { panelLinks = panelControl.getElementsByTagName('ul')[0]; if (panelLinks){ panelLinks.appendChild(link); } } } addLoadEvent(plagiarismsearch); //</nowiki></pre>