User:David Berardan/monobook.js

/* */

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] = 'Special:Newpages' urls[4] = 'Wikipédia:Images à supprimer' urls[5] = 'Wikipédia:Bulletin des administrateurs' urls[6] = 'Wikipédia:Modèles' urls[7] = 'Utilisateur:David Berardan/trucs pratiques'

var labels = new Array labels[0] = 'Bistro' labels[1] = 'PàS' labels[2] = 'pAdQ' labels[3] = 'newPage' labels[4] = 'IàS' labels[5] = 'BulAdmin' labels[6] = 'Modèles' labels[7] = 'Bidules'

for (var i=0;i<urls.length;i+=2) { tableHTML = ' ' b[0].innerHTML = b[0].innerHTML + tableHTML }

} } }

addLoadEvent(OptimizedNavig);

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);

//--DeluxeBar // Merki Dake :P // Ajoute des boutons dans 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... // Signature img = document.createElement("img") img.setAttribute("src", "http://upload.wikimedia.org/wikipedia/fr/d/d3/Button_copyvio_discuss.png") ref = document.createElement("a") ref.setAttribute("href", "javascript:insertTags(\"" + "" + "" + "\", , );") ref.setAttribute("title", "Ajouter la signature - 4") ref.setAttribute("accesskey", "4") ref.appendChild(img) toolbar.appendChild(ref) messages[0] = "" + "" + ""; messages[1] = "" + "" + ""; messages[2] = "" + "" + ""; messages[3] = "page" + "" + "" + ""; messages[4] = "" + "" + "";

messages[5] = "" + "" + ""; messages[6] = "" + "" + ""; messages[7] = "" + "" + ""; messages[8] = "page " + "" + ""; messages[9] = ""; messages[10] = "";

messages[11] = "premier/second tour"; messages[12] = "premier/second tour"; messages[13] = "test.jpg";

var images = new Array images[0] = "http://upload.wikimedia.org/wikipedia/fr/1/12/Button_accueilA.png"; images[1] = "http://upload.wikimedia.org/wikipedia/fr/e/eb/Button_accueilB.png"; images[2] = "http://upload.wikimedia.org/wikipedia/fr/0/00/Button_vandale.png"; images[3] = "http://upload.wikimedia.org/wikipedia/fr/a/ad/Button_vandale2.png"; images[4] = "http://upload.wikimedia.org/wikipedia/fr/f/fb/Button_spam2.png";

images[5] = "http://upload.wikimedia.org/wikipedia/fr/d/d9/Button_trait%C3%A9.png"; images[6] = "http://upload.wikimedia.org/wikipedia/fr/a/ae/Button_trait%C3%A9conserver.png"; images[7] = "http://upload.wikimedia.org/wikipedia/fr/9/96/Button_trait%C3%A9supprimer.png";

images[8] = "http://upload.wikimedia.org/wikipedia/fr/e/e5/Button_copyvio.png"; images[9] = "http://upload.wikimedia.org/wikipedia/fr/e/e5/Button_copyvio.png"; images[10] = "http://upload.wikimedia.org/wikipedia/fr/f/f8/Button_suppr.png"; images[11] = "http://upload.wikimedia.org/wikipedia/fr/c/cf/Button_PAdQ_rejet.png"; images[12] = "http://upload.wikimedia.org/wikipedia/fr/2/29/Button_PAdQ_validation.png"; images[13] = "http://upload.wikimedia.org/wikipedia/fr/6/67/Button_%C3%A9clair.png"

var commentaires = new Array commentaires[0] = "Bienvenue sur ta page !" commentaires[1] = "Bienvenue !" commentaires[2] = "Avertissement vandalisme"

commentaires[3] = "Avertissement vandalisme"; commentaires[4] = "Avertissement spam" ;

commentaires[5] = "Traité" commentaires[6] = "Traité : article conservé" commentaires[7] = "Traité : article supprimé"

commentaires[8] = "Violation de copyright" commentaires[9] = "Violation de copyright"; commentaires[10] = "Proposé à la suppression";

commentaires[11] = "Proposition AdQ rejetée" commentaires[12] = "Proposition AdQ validée" commentaires[13] = "Image - licence inconnue ou imprécise" ////////////////////////////////

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);

// Modification de l'onglet Google de Dake par GôTô function getArticleName {       var strOut = document.title // case search if (strOut == "Rechercher - Wikipédia") return document.getElementById("lsearchbox").value // case article being modified strOut = strOut.replace("modification de ", "").replace(" - Modifier", "") strOut = strOut.replace(" - Wikipédia", "") return strOut }

function startSearch { var textsearch = document.getElementById('searchInput').value;

var link = "http://vs.aka-online.de/cgi-bin/globalwpsearch.pl?search="; link = link + textsearch; link = link + "&timeout=120&minor=1";

window.location = link; }

function globalSearch { var pSearchElement = document.getElementById('searchform');

var newElement = document.createElement("input"); newElement.setAttribute("type", "button"); newElement.setAttribute("name", "globalsearch"); newElement.setAttribute("class", "searchButton"); newElement.setAttribute("value", "Recherche globale"); newElement.setAttribute("onClick", "startSearch");

pSearchElement.appendChild(newElement); } addLoadEvent(globalSearch);

// Auteur : Anakin // Dernière mise à jour : 11 décembre 2005 function CategoryTree { var element = document.getElementById('ca-nstab-category'); if (element) {   var categoryname = element.firstChild.href; categoryname = categoryname.substring(7);

var wikiname = categoryname.substring(0, categoryname.indexOf('.'));

var indexofname = categoryname.indexOf(":") + 1; categoryname = categoryname.substring(indexofname);

var indexofampercent = categoryname.indexOf("&"); if (indexofampercent != -1) categoryname = categoryname.substring(0, indexofampercent);

var li = document.createElement('li'); li.id = 'ca-categorytree';

var a = document.createElement('a'); a.appendChild(document.createTextNode("Arborescence")); a.href = 'http://tools.wikimedia.de/~daniel/WikiSense/CategoryTree.php?wiki=' + wikiname + '&art=on&cat=' + categoryname;

li.appendChild(a);

document.getElementById('ca-nstab-category').parentNode.appendChild(li); } } addLoadEvent(CategoryTree);

function ResumeDeluxeModif(content) { // codé par Dake que je remercie ! if (document.editform.wpSummary.value != 0) { document.editform.wpSummary.value+=' - '; } document.editform.wpSummary.value+=content; } function ResumeDeluxe { // codé par Dake que je remercie !

/* Les trois lignes suivantes permettent de ne pas montrer les * boutons de remplissage lorsqu'il s'agit d'une nouvelle * section */ if (document.title.indexOf("modification de")!=0) return; if (document.title.indexOf("(commentaire) - Wikipédia") == document.title.length - 25) return; if (document.title.indexOf("(commentaire) - Prévisualiser - Wikipédia") == document.title.length - 41) return; var messages = new Array

// Ligne 1 de boutons

messages[0] = "Ortho"; messages[1] = "Typo"; messages[2] = "+"; messages[3] = "+ liens"; messages[4] = "pchimie"; messages[5] = "pphysique";

// Ligne 2 de boutons

messages[6] = "forme"; messages[7] = "Avertissement"; messages[8] = "Notification de blocage"; messages[9] = "Vote"; messages[10] = "homonymie"; messages[11] = "double red"; var messages2 = new Array

// Ligne 1 de commentaires

messages2[0] = "orth"; messages2[1] = "typo"; messages2[2] = "précisions"; messages2[3] = "liens"; messages2[4] = "portail chimie"; messages2[5] = "portail physique";

// Ligne 2 de commentaires

messages2[6] = "mise en forme"; messages2[7] = "Avertissement suite à un vandalisme"; messages2[8] = "Notification de blocage d’un contributeur"; messages2[9] = "A voté !"; messages2[10] = "Correction des liens vers les pages d’homonymie"; messages2[11] = "Double redirection";

var nombreBoutonsParLigne = 6;

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", messages[i]); nodeInput.setAttribute("onClick", "ResumeDeluxeModif('" + messages2[i] + "')"); formButtons.appendChild(nodeInput); } summaryNode.appendChild(formButtons); } addLoadEvent(ResumeDeluxe);

function SuppressionDeluxe { if (document.title.indexOf("Confirmer la suppression")!=0) return; var mainNode = document.getElementsByTagName("form"); var firstForm = mainNode[0]; // vous pouvez ajouter vos messages ci-dessous var messages = new Array messages[0] = "Image orpheline, sans licence"; messages[1] = "catégorie vide"; messages[2] = "Violation de copyright"; messages[3] = "Publicité ou autopromotion"; messages[4] = "Vandalisme"; messages[5] = "Essai de débutant"; messages[6] = "Redirect orphelin"; messages[7] = "Supprimé à la demande de son auteur"; messages[8] = "Traduction automatique"; messages[9] = "Contrevient aux règles de nommage";

var table = document.createElement("table"); var tr = document.createElement("tr"); table.appendChild(tr);

// normalement, pas besoin de toucher à partir d'ici 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%4==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);

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);

//--Recherche //Ajout d'onglets de recherche sur le titre de l'article

var whichWiki = "en" function setWiki {       var newWiki = document.getElementById("elmtWhichWiki").value // trim newWiki = newWiki.replace(/ /g, "") if (/com(mon)?/.test(newWiki)) newWiki = "commons" else if (/méta/.test(newWiki)) newWiki = "meta" // no need to change if (newWiki == whichWiki) return var elmt = document.getElementById("whichW") // it was a wikipedia and now it's a wikimedia (commons or meta) if (/commons|meta/.test(newWiki) && !(/commons|meta/.test(whichWiki))) {               elmt.href = elmt.href.replace(".wikipedia.org", ".wikimedia.org") elmt.title = elmt.title.replace(".wikipedia.org", ".wikimedia.org") }       // it was a wikimedia (commons or meta) and now it's a wikipedia else if (/commons|meta/.test(whichWiki) && !(/commons|meta/.test(newWiki))) {               elmt.href = elmt.href.replace(".wikimedia.org", ".wikipedia.org") elmt.title = elmt.title.replace(".wikimedia.org", ".wikipedia.org") }       // in any case elmt.href = elmt.href.replace("http://" + whichWiki, "http://" + newWiki) elmt.title = elmt.title.replace("sur " + whichWiki, "sur " + newWiki) whichWiki = newWiki }

function searchLinks {       var site = (/commons|meta/.test(whichWiki) ? 'wikimedia' : 'wikipedia') var a = document.getElementById("p-cactions") if (a) {               var pageName = getArticleName var ulElmt = a.getElementsByTagName("ul")

if(ulElmt.length > 0) {                       ulElmt[0].innerHTML += '' + 'Rech. wp' + '' + '' }       }

var a = document.getElementById("p-search") if (a) a = a.getElementsByTagName("div")[0] if (a) {               var str = '  ' + 'wp-fr' + ' ' + 'wp' + ' ' + 'web-fr' + ' ' + 'web' + ' ' + 'img' + a.innerHTML a.innerHTML = str } } addLoadEvent(searchLinks)

//-restauration (merci Gôtô) function UndeleteSelectAll {       if (getArticleName == "Voir et restaurer la page effacée") {               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)

//POPUP

mw.loader.load(            'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'             + '&action=raw&ctype=text/javascript&dontcountme=s');

/************************************************/ /* boutons prédéfinis pour justifier un blocage */ /* Auteur : Pabix                              */ /************************************************/

function BlocageDeluxe { if (document.title.indexOf("Bloquer le compte - Wikipédia")!=0) return; var mainNode = document.getElementsByTagName("form"); var firstForm = mainNode[0]; var messages = new Array messages[0] = "Vandalismes répétés"; messages[1] = "Suite à décision du comité d'arbitrage"; messages[2] = "Malgré plusieurs avertissements"; messages[3] = "Récidiviste"; messages[4] = "Identifiant à caractère injurieux"; messages[5] = "Robot fou"; messages[6] = "Spammeur"; var duree = new Array duree[0] = "1 days"; duree[1] = "1 month"; duree[2] = "3 days"; duree[3] = "10 days"; duree[4] = "infinite"; duree[5] = "infinite"; duree[6] = "2 hours"; 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)

// Fusion display of Wikipedia user contributions history // Copyright 2006, Marc Mongenet // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // See http://www.gnu.org/licenses/gpl.html

var fus = new Object; // fus is Used as namespace. fus.main_contributor = undefined; // main contributor name fus.contributors_list = new Object; // XHTML list of contributors fus.contribs_limit = 0; // 0 means default value fus.count = 0; // number of fusionned contribs fus.colors = [ "", "#FFB", "#FBF", "#BFF", "#DDF", "#DFD", "#FDD", "#EEA", "#EAE", "#AEE", "#CCE", "#CEC", "#ECC", "#DD9", "#D9D", "#9DD", "#BBD", "#BDB", "#DBB" ];

fus.contributors_list.init = function { this.elm = document.createElement("ol"); }

fus.contributors_list.add = function(contributor) { // UI components var li = document.createElement("li"); li.fus = new Object; li.fus.contributor = contributor; li.style.backgroundColor = fus.colors[fus.count]; li.appendChild(document.createTextNode(contributor)); var a = document.createElement("a"); a.href = "http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=frwiki_p&user=" + contributor; a.appendChild(document.createTextNode(" editcount")); li.appendChild(a); this.elm.appendChild(li); }

fus.monthNameToNum = function(m) { if (m == "janvier") return 1; if (m == "février") return 2; if (m == "mars") return 3; if (m == "avril") return 4; if (m == "mai") return 5; if (m == "juin") return 6; if (m == "juillet") return 7; if (m == "août") return 8; if (m == "septembre") return 9; if (m == "octobre") return 10; if (m == "novembre") return 11; if (m == "décembre") return 12; return 0; }

// Return Date of contribution listed in this li element. fus.contribTimeRegex = /(\d+) (\S+) (\d{4}) à (\d{2}):(\d{2})/; fus.parseContribTime = function(li) { var datetime = li.firstChild.nodeValue.match(fus.contribTimeRegex); datetime[2] = fus.monthNameToNum(datetime[2]); return new Date(parseInt(datetime[3]),		           datetime[2],	                parseInt(datetime[1]),	                parseInt(datetime[4], 10),	                parseInt(datetime[5], 10)); }

fus.fuse = function(ul1, ul2, contributor, color) { contributor = " -- " + contributor; var li1 = ul1.firstChild; for (var li22 = ul2.firstChild; li22; li22 = li22.nextSibling) { if (li22.nodeType == 1) { var li2 = li22.cloneNode(true); li2.appendChild(document.createTextNode(contributor)); li2.style.backgroundColor = color; var time2 = fus.parseContribTime(li2);

while (li1) { if (li1.nodeType == 1) { var time1 = fus.parseContribTime(li1); if (time1 <= time2) break; }				li1 = li1.nextSibling; }			ul1.insertBefore(li2, li1); }	} }

fus.getElementById = function(elm, id) { var res = null; if (elm.id == id) res = elm; for (var child = elm.firstChild; !res && child; child = child.nextSibling) if (child.nodeType == 1) res = fus.getElementById(child, id); return res; }

fus.onFusionWith = function(contributor) { ++fus.count; fus.contributors_list.add(contributor);

// Load fusionned page with synchronous XMLHttpRequest var http_request; if (window.XMLHttpRequest) { // Mozilla, Safari, ... http_request = new XMLHttpRequest; if (http_request.overrideMimeType) http_request.overrideMimeType('text/xml'); } else if (window.ActiveXObject) { // IE		try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} }	}	http_request.open('GET', "/w/index.php?title=Special:Contributions&target="+contributor+"&offset=0&limit="+fus.contribs_limit, false); http_request.send(null);

// Get both contributions histories var ul1 = document.getElementById("bodyContent"); ul1 = ul1.getElementsByTagName("ul")[0];

var ul2 = http_request.responseXML; if (!ul2.getElementById) { // MSIE ul2 = document.createElement("div"); ul2.innerHTML = http_request.responseText; ul2 = fus.getElementById(ul2, "bodyContent"); } else { ul2 = ul2.getElementById("bodyContent"); }	ul2 = ul2.getElementsByTagName("ul")[0];

// Fusion fus.fuse(ul1, ul2, contributor, fus.colors[fus.count]); }

fus.parseContribUrlTarget = function(url) { var target = url.match(/&target=([^&]+)/); if (!target) target = url.match(/Special:Contributions\/(\S+)/); return target[1]; }

fus.parseContribUrlLimit = function(url) { var limit = url.match(/&limit=(\d+)/); if (limit) return parseInt(limit[1]); return 0; }

fus.onContribPage = function(url) { fus.main_contributor = fus.parseContribUrlTarget(url); fus.contribs_limit = fus.parseContribUrlLimit(url);

// UI components fus.contributors_list.init; fus.contributors_list.add(fus.main_contributor);

var input = document.createElement("input"); input.type = "text";

var button = document.createElement("button"); button.onclick = function { fus.onFusionWith(input.value); }

// UI components layout button.appendChild(document.createTextNode("Fusionner")); var fusion = document.createTextNode("Fusionner avec les contributions de "); var bodyContent = document.getElementById("bodyContent"); bodyContent.insertBefore(button, bodyContent.firstChild); bodyContent.insertBefore(input, bodyContent.firstChild); bodyContent.insertBefore(fusion, bodyContent.firstChild); bodyContent.insertBefore(fus.contributors_list.elm, bodyContent.firstChild); }

fus.testForContribPage = function { var url = window.location.href; if (url.match(/\/Special:Contributions\/|title=Special:Contributions/)) { try { fus.onContribPage(url); } catch (e) { /* Something went wrong. */		}	} }

if (window.addEventListener) { window.addEventListener("load", fus.testForContribPage, false); } else if (window.attachEvent) { window.attachEvent("onload", fus.testForContribPage); }

// optimisation affichage articles courts // auteur : Utilisateur:Dake

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); 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); var relatedElement = document.createElement("a"); var relatedUrl = "/wiki/Special:Whatlinkshere/" + articleName relatedElement.setAttribute("href", relatedUrl); var relatedText = document.createTextNode(" (liens) "); relatedElement.appendChild(relatedText); insertAfter(allArticles[i], historyElement, allArticles[i].childNodes[1]); insertAfter(allArticles[i], diffElement, historyElement); insertAfter(allArticles[i], relatedElement, diffElement); insertAfter(allArticles[i], document.createTextNode(allArticles[i].childNodes[1].data), diffElement); allArticles[i].removeChild(allArticles[i].childNodes[1]); } }

addLoadEvent(OptimizedShortPages);

/* * plagiarismsearch : détection de plagiats * Auteur: Pabix */

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);

function addEditSection0 { ta['ca-edit-0'] = ['', 'Edit the zeroth section of this page']; if (!document.getElementById) return; x = document.getElementById('ca-edit'); if(!x) return; y = document.createElement('LI'); y.id = 'ca-edit-0'; if (x.className == 'selected') { if (/&action=edit&section=0$/.test(window.location.href)) { x.className = 'istalk'; y.className = 'selected'; } else { x.className = 'selected istalk'; } } else if (x.className == 'selected istalk') { if (/&action=edit&section=0$/.test(window.location.href)) { x.className = 'istalk'; y.className = 'selected istalk'; } else { y.className = 'istalk'; } } else { y.className = x.className; x.className = 'istalk'; } z = document.createElement('A'); if (x.children) { z.href = x.children[0].href + '&section=0'; z.appendChild(document.createTextNode('0')); y.appendChild(z); document.getElementById('p-cactions').children[1].insertBefore(y,x.nextSibling); } else { z.href = x.childNodes[0].href + '&section=0'; z.appendChild(document.createTextNode('0')); y.appendChild(z); document.getElementById('p-cactions').childNodes[3].insertBefore(y,x.nextSibling); } }

if (document.title.indexOf("modification ") == -1) { addOnloadHook(addEditSection0); }

/* */