User:Jean-Frédéric/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 is at User:Jean-Frédéric/monobook.css. |
importScript('User:Dapete/ImageMapEdit.js');
/*
* Catégories à Gauche
*
* Met les catégories dans un panneau de navigation
*
* Auteur : Jmfayard
* Dernière révision : 3 novembre 2006
*/
function CategoriesAGauche() {
var catlinks = document.getElementById("catlinks");
if (!catlinks) { return; }
var categories = catlinks.getElementsByTagName("a") ;
var h5_cats = document.createElement( "h5" );
var text = document.createTextNode( "Catégories" ) ;
h5_cats.appendChild( text ) ;
var div_cats = document.createElement( "div" );
div_cats.setAttribute( "class", "pBody" );
var ul = document.createElement( "ul" );
var a_debut = 1 ; // evitons le lien Categories:
for (var i = a_debut ; i < categories.length ; i++ ) {
var a = categories[i] ;
var li = document.createElement( "li" ) ;
li.appendChild( a.cloneNode(1) ) ;
ul.appendChild( li );
}
div_cats.appendChild( ul ) ;
var portlet = document.createElement( "div" ) ;
portlet.setAttribute( "class", "portlet" );
portlet.setAttribute( "id", "p-cat" ) ;
portlet.appendChild( h5_cats ) ;
portlet.appendChild( div_cats ) ;
//document.getElementById("column-one").insertBefore( document.getElementById("p-search"), portlet ) ;
//document.getElementById("column-one").appendChild( portlet ) ;
div_ptb = document.getElementById( "p-tb" );
document.getElementById("column-one").insertBefore( portlet, div_ptb)
}
addOnloadHook( CategoriesAGauche ) ;
/*----------------------------------------------------------------------------
* Ajoute des commentaires de modification prédéfinis
*
* Auteur : Dake
* Contributions : Pabix, Tieno
* Date de dernière révision : 12 novembre 2006
*/
//////////////////////ZONE PERSONNALISABLE//////////////////////
var resumedeluxeTitles = new Array();
with (resumedeluxeTitles) {
push("Interwiki fr");
push("- orthograph");
push("- wikification");
push("- DefaultSort");
push("- CommonsCat");
}
var resumedeluxeInputs= new Array();
with (resumedeluxeInputs) {
push("Adding [[fr:]]");
push("Orthograph");
push("Wikification");
push("DefaultSort");
push("Adding [[Commons:Category:]]");
}
/////////////////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 ++) {
str += "<a href=\"javascript:addToSummary('" +resumedeluxeInputs[cpt] + "')\""
+ " class=\"sumLink\" title=\"Ajouter '" +resumedeluxeInputs[cpt] +"' dans la boîte de résumé\">"
+ resumedeluxeTitles[cpt]
+ "</a> ";
}
sumLbl.innerHTML = str + "<br />" + sumLbl.innerHTML;
}
}
addOnloadHook(DeluxeSummary);
//
function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) {
mwCustomEditButtons[mwCustomEditButtons.length] =
{"imageId": imageId,
"imageFile": imageFile,
"speedTip": speedTip,
"tagOpen": tagOpen,
"tagClose": tagClose,
"sampleText": sampleText};
}
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/f/f8/Button_Tool_commons.png',
'Commons Cat',
'{{Commonscat|',
'}}',
getArticleName(),
'Commons');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/8/82/Button_l_fr.png',
'Interwiki Fr',
'[[fr:',
']]',
getArticleName(),
'Fr');
function getArticleName(){
var name = mw.config.get('wgPageName').replace(/_/g, " ");
return name;
}