Utilisateur:Drekenn/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.
loadJs('User:EDUCA33E/LiveRC.js'); obtenir('CatsaGauche'); obtenir('CopyScape'); obtenir('LiensRouges'); obtenir('EvalProject'); /***********************************************************/ /* Liens persos (auteur: ????) */ /* Contribution : Drekenn */ /***********************************************************/ /* Ajout de liens dans la barre de navigation */ /* */ /* Date de dernière révision : 15 janvier 2008 */ /* [[Catégorie:MediaWiki:Fonction Monobook en JavaScript]] */ /* */ /***********************************************************/ function Bistro_Oracle() { var a = document.getElementById("p-navigation"); if (a) { b = a.getElementsByTagName("ul"); if(b.length > 0) { b[0].innerHTML = b[0].innerHTML + '<li><a style="display: inline" id="n-bistro" title="Wikipédia:Le Bistro" href="/w/index.php?title=Wikip%C3%A9dia:Le_Bistro&action=purge">Bistro</a></li><li><a style="display: inline" id="n-bistro" title="Oracle" href="/wiki/Wikipédia:Oracle">Oracle</a></li><li><a style="display: inline" id="n-bistro" title="LiveRC" href="/wiki/Utilisateur:EDUCA33E/LiveRC">LiveRC</a></li>' } } } addOnloadHook(Bistro_Oracle); /***********************************************************/ /***********************************************************/ /* Résumé Deluxe (auteur: Dake) */ /* Contributions : Pabix, Tieno, Drekenn */ /***********************************************************/ /* Ajoute des commentaires de modification prédéfinis */ /* */ /* Date de dernière révision : 15 janvier 2008 */ /* [[Catégorie:MediaWiki:Fonction Monobook en JavaScript]] */ /* */ /***********************************************************/ //////////////////////ZONE PERSONNALISABLE////////////////////// var resumedeluxeTitles = new Array(); with (resumedeluxeTitles) { push("personnel"); push("orthographe"); push("- typographie"); push("- catégorisation"); push("- interwiki"); push("- wikification"); push("- image"); push("- redirection"); push("- style"); push("- revert"); push("- réorganisation"); push("- réponse"); push("- maintenance"); push("- 1.0"); push("- homonymie"); push("- bandeau"); push("- infobox"); } var resumedeluxeInputs= new Array(); with (resumedeluxeInputs) { push("Modification de page personnelle"); push("orthographe"); push("typographie"); push("catégorisation"); push("interwiki"); push("wikification"); push("image"); push("redirection"); push("style"); push("revert"); push("réorganisation"); push("réponse"); push("maintenance"); push("évaluation Wikipédia 1.0"); push("création homonymie"); push("ajout de bandeau"); push("infobox"); } /////////////////FIN DE LA ZONE PERSONNALISABLE///////////////// function setSummary(str) { document.editform.wpSummary.value = str; } function addToSummary(str) { var resum = document.editform.wpSummary.value; if(resum != 0 && resum.indexOf("*/") < resum.length - 3) { document.editform.wpSummary.value += " - "; } document.editform.wpSummary.value += str; } function DeluxeSummary() { var sumLbl = document.getElementById("wpSummaryLabel"); if(sumLbl) { var sumInput = document.getElementById("wpSummary"); sumInput.style.width = "95%"; var str = "Messages prédéfinis : "; for(var cpt = 0; cpt < resumedeluxeTitles.length; cpt ++) { var tmp = resumedeluxeInputs[cpt]; str += "<a href=\"javascript:addToSummary('" + tmp.replace( /[']/g , "\\'") + "')\"" + " class=\"sumLink\" title=\"Ajouter dans la boîte de résumé\">" + resumedeluxeTitles[cpt] + "</a> "; } sumLbl.innerHTML = str + "<br />" + sumLbl.innerHTML; } } /***********************************************************/ /***********************************************************/ /* DeluxeBar (auteur: Dake) */ /* Contributions : Drekenn */ /***********************************************************/ /* Ajoute des icones à la toolbar d'édition */ /* */ /* Date de dernière révision : 15 janvier 2007 */ /* [[Catégorie:MediaWiki:Fonction Monobook en JavaScript]] */ /* */ /***********************************************************/ 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] = "{{subst:" + "Bienvenu" + "}}" + "~~" + "~~"; messages[1] = "{{subst:" + "Bienvenue" + "}}" + "~~" + "~~"; messages[2] = "{{Recherche IP}}\n{{subst:" + "Test 0" + "}}" + "~~" + "~~"; messages[3] = "{{Recherche IP}}\n{{subst:" + "Test 1" + "}}" + "~~" + "~~"; messages[4] = "{{Recherche IP}}\n{{subst:" + "Test 2" + "}}" + "~~" + "~~"; messages[5] = "{{Recherche IP}}\n{{subst:" + "Test 2-" + "}}" + "~~" + "~~"; messages[6] = "{{Recherche IP}}\n{{subst:" + "Test 2+" + "}}" + "~~" + "~~"; messages[7] = "{{Recherche IP}}\n{{subst:" + "Bienvenue spammeur" + "}}" + "~~" + "~~"; messages[8] = "{{Recherche IP}}\n{{subst:" + "Copieur|Article en question|site origine" + "}}" + "~~" + "~~"; messages[9] = "{{Recherche IP}}\n{{subst:" + "Faut sourcer" + "}}" + "~~" + "~~"; messages[10] = "{{Recherche IP}}\n{{subst:" + "Sourcer" + "}}" + "~~" + "~~"; var images = new Array() images[0] = "http://upload.wikimedia.org/wikipedia/commons/f/f7/Bouton_bienvenu.png"; images[1] = "http://upload.wikimedia.org/wikipedia/commons/1/1f/Button_bienvenue.png"; images[2] = "http://upload.wikimedia.org/wikipedia/commons/f/f0/Bouton_Vandale0.png"; images[3] = "http://upload.wikimedia.org/wikipedia/commons/1/1d/Bouton_Vandale1.png"; images[4] = "http://upload.wikimedia.org/wikipedia/commons/c/cc/Bouton_Vandale2.png"; images[5] = "http://upload.wikimedia.org/wikipedia/commons/b/bd/Bouton_Vandale2-.png"; images[6] = "http://upload.wikimedia.org/wikipedia/commons/9/96/Bouton_Vandale2%2B.png"; images[7] = "http://upload.wikimedia.org/wikipedia/commons/c/cd/Warncreate1.png"; images[8] = "http://upload.wikimedia.org/wikipedia/commons/e/e5/Button_copyvio.png"; images[9] = "http://upload.wikimedia.org/wikipedia/commons/b/b8/Bouton_Faut_sourcer.png"; images[10] = "http://upload.wikimedia.org/wikipedia/commons/e/ed/Bouton_sourcer.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 vandalisme" ; commentaires[5] = "Avertissement vandalisme"; commentaires[6] = "Avertissement vandalisme"; commentaires[7] = "Avertissement spam"; commentaires[8] = "Avertissement copie de site"; commentaires[9] = "Demande de sourcer"; commentaires[10] = "Avertissement manque total de source"; //////////////////////////////// for (var i=0;i<messages.length;i++) { var img = document.createElement("img"); img.setAttribute("src", images[i]); img.setAttribute("alt", commentaires[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); /***********************************************************/ //addLoadEvent(PaletteOutils);