Utilisateur:Raymond SÉNÈQUE/Exemple de page : Différence entre versions
m |
m |
||
Ligne 1 : | Ligne 1 : | ||
− | + | /* Any JavaScript here will be loaded for users using the Vector skin */ | |
+ | /**************** | ||
+ | * Insertion de nouveaux boutons dans la barre d'outil | ||
+ | */ | ||
− | + | addOnloadHook(addCustomButton); | |
− | {{ | + | /* |
+ | |||
+ | function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) { | ||
+ | mwCustomEditButtons[mwCustomEditButtons.length] = | ||
+ | {"imageId": imageId, | ||
+ | "imageFile": imageFile, | ||
+ | "speedTip": speedTip, | ||
+ | "tagOpen": tagOpen, | ||
+ | "tagClose": tagClose, | ||
+ | "sampleText": sampleText}; | ||
+ | } | ||
+ | |||
+ | addCustomButton('images/9/93/Button_wgw.png', | ||
+ | 'Sigle WGW', | ||
+ | ' {{wgw}} ', | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-wgw'); | ||
+ | |||
+ | |||
+ | addCustomButton('images/f/fd/Button_underline.png', | ||
+ | 'Souligner', | ||
+ | '<u>', | ||
+ | '</u>', | ||
+ | 'Texte souligné', | ||
+ | 'mw-editbutton-underline'); | ||
+ | |||
+ | addCustomButton('images/8/80/Button_upper_letter.png', | ||
+ | 'Exposant', | ||
+ | '<sup>', | ||
+ | '</sup>', | ||
+ | 'X', | ||
+ | 'mw-editbutton-upper'); | ||
+ | |||
+ | addCustomButton('images/7/70/Button_lower_letter.png', | ||
+ | 'Indice', | ||
+ | '<sub>', | ||
+ | '</sub>', | ||
+ | 'X', | ||
+ | 'mw-editbutton-lower'); | ||
+ | |||
+ | addCustomButton('images/b/bb/Button_barrer.png', | ||
+ | 'Rayer', | ||
+ | '<s>', | ||
+ | '</s>', | ||
+ | 'texte barré', | ||
+ | 'mw-editbutton-strike'); | ||
+ | |||
+ | addCustomButton('images/2/26/Button_latinas.png', | ||
+ | 'Guillemets-Italiques', | ||
+ | '\'\'« ', | ||
+ | ' »\'\'', | ||
+ | 'Citation', | ||
+ | 'mw-editbutton-Guillemet'); | ||
+ | |||
+ | addCustomButton('images/b/bb/Button_color.png', | ||
+ | 'Texte surligné', | ||
+ | '{{Surligné|white|red|', | ||
+ | '}}', | ||
+ | 'texte à surligner blanc sur rouge', | ||
+ | 'mw-editbutton-CadreCouleur'); | ||
+ | |||
+ | addCustomButton('images/e/ea/Button_align_left.png', | ||
+ | 'Alignement à gauche', | ||
+ | '<div style="text-align:left">', | ||
+ | '</div>', | ||
+ | 'Texte aligné à gauche', | ||
+ | 'mw-editbutton-left'); | ||
+ | |||
+ | addCustomButton('images/5/5f/Button_center.png', | ||
+ | 'Centrer', | ||
+ | '<center>', | ||
+ | '</center>', | ||
+ | 'Texte centré', | ||
+ | 'mw-editbutton-Center'); | ||
+ | |||
+ | addCustomButton('images/a/a5/Button_align_right.png', | ||
+ | 'Alignement à droite', | ||
+ | '<div style="text-align:right">', | ||
+ | '</div>', | ||
+ | 'Texte aligné à droite', | ||
+ | 'mw-editbutton-right'); | ||
+ | |||
+ | addCustomButton('images/2/29/Button_justify.png', | ||
+ | 'Texte justifié', | ||
+ | '<div style="text-align:justify">', | ||
+ | '</div>', | ||
+ | 'Texte justifié', | ||
+ | 'mw-editbutton-justify'); | ||
+ | |||
+ | addCustomButton('images/8/88/Btn_toolbar_enum.png', | ||
+ | 'Énumération', | ||
+ | '\n# élément 1\n# élément 2\n# élément 3', | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-enum'); | ||
+ | |||
+ | addCustomButton('images/1/11/Btn_toolbar_liste.png', | ||
+ | 'Liste', | ||
+ | '\n* élément A\n* élément B\n* élément C', | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-liste'); | ||
+ | |||
+ | addCustomButton('images/4/4f/Button_head_A3.png', | ||
+ | 'Sous-titre niveau 3', | ||
+ | '\n=== ', | ||
+ | ' ===\n', | ||
+ | 'Sous-titre n° 3', | ||
+ | 'mw-editbutton-title3'); | ||
+ | |||
+ | addCustomButton('images/1/14/Button_head_A4.png', | ||
+ | 'Sous-titre niveau 4', | ||
+ | '\n==== ', | ||
+ | ' ====\n', | ||
+ | 'Sous-titre n° 4', | ||
+ | 'mw-editbutton-title4'); | ||
+ | |||
+ | addCustomButton('images/8/8c/Button_head_A5.png', | ||
+ | 'Sous-titre niveau 5', | ||
+ | '\n===== ', | ||
+ | ' =====\n', | ||
+ | 'Sous-titre n° 5', | ||
+ | 'mw-editbutton-title5'); | ||
+ | |||
+ | addCustomButton('images/9/9e/Btn_toolbar_gallery.png', | ||
+ | 'Galerie d\'images', | ||
+ | '\n<center><gallery widths=60px perrow=10 caption="Galerie WikiGenWeb">\nFichier:wiki.png|\nFichier:wiki.png|\n</gallery>\n<small>Cliquez sur une vignette pour l\'agrandir</small>\n</center>', | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-gallery'); | ||
+ | |||
+ | addCustomButton('images/0/04/Button_array.png', | ||
+ | 'Tableau minimum', | ||
+ | '{|class="wikitable-left" \n!colspan="2"|Entête du tableau\n|-\n!Entête col 1\n!Entête col 2\n|-\n|A\n|B\n|}', | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-array'); | ||
+ | |||
+ | addCustomButton('images/b/b4/Button_category03.png', | ||
+ | 'Catégorie', | ||
+ | '[[Catégorie:', | ||
+ | '|{{PAGENAME}}]]', | ||
+ | 'nom de la catégorie', | ||
+ | 'mw-editbutton-category'); | ||
+ | |||
+ | addCustomButton('images/8/87/Button_Clear.png', | ||
+ | 'Clear', | ||
+ | '{{Clear}}', | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-Clear'); | ||
+ | |||
+ | addCustomButton('images/1/13/Button_enter.png', | ||
+ | 'Saut de ligne', | ||
+ | '<br />', | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-Enter'); | ||
+ | |||
+ | addCustomButton('images/c/c4/Button_ref.png', | ||
+ | 'Référence', | ||
+ | '<ref>', | ||
+ | '</ref>', | ||
+ | 'référence, citation ou lien', | ||
+ | 'mw-editbutton-ref'); | ||
+ | |||
+ | addCustomButton('images/6/64/Buttonrefvs8.png', | ||
+ | 'Index des références', | ||
+ | '== Notes et références ==\n<references />', | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-references'); | ||
+ | |||
+ | addCustomButton('images/3/3b/Button_template_alt.png', | ||
+ | 'Modèle', | ||
+ | '{{', | ||
+ | '}}', | ||
+ | 'modèle à inclure', | ||
+ | 'mw-editbutton-template'); | ||
+ | |||
+ | addCustomButton('images/4/47/Button_redir.png', | ||
+ | 'Redirection', | ||
+ | '#REDIRECT [[', | ||
+ | ']]', | ||
+ | 'nom de la destination', | ||
+ | 'mw-editbutton-redir'); | ||
+ | |||
+ | addCustomButton('images/a/a6/Button_Wikipedia.png', | ||
+ | 'Lien Interwiki Wikipedia', | ||
+ | '[[wikipedia.fr:', | ||
+ | '|]]', | ||
+ | 'Page Wikipedia', | ||
+ | 'mw-editbutton-Wikipedia'); | ||
+ | |||
+ | var voirAussi = '\n' | ||
+ | + '== Voir aussi ==\n' | ||
+ | + '=== Articles connexes ===\n' | ||
+ | + '* [[Indiquer ici votre article]]\n' | ||
+ | + '*\n' | ||
+ | + '=== Liens et documents externes ===\n' | ||
+ | + '*\n'; | ||
+ | addCustomButton('images/b/bb/Seealso.png', | ||
+ | 'Section Voir aussi', | ||
+ | voirAussi, | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-voiraussi'); | ||
+ | |||
+ | addCustomButton('images/2/23/Button_code.png', | ||
+ | 'Code', | ||
+ | '<code>', | ||
+ | '</code>', | ||
+ | 'Texte du code', | ||
+ | 'mw-editbutton-code'); | ||
+ | |||
+ | addCustomButton('images/d/d4/Button_div.png', | ||
+ | 'Div', | ||
+ | '<div>', | ||
+ | '</div>', | ||
+ | 'Balises entre div', | ||
+ | 'mw-editbutton-div'); | ||
+ | |||
+ | addCustomButton('images/7/72/Button_span_2.png', | ||
+ | 'Span', | ||
+ | '<span>', | ||
+ | '</span>', | ||
+ | 'Balises entre span', | ||
+ | 'mw-editbutton-span'); | ||
+ | |||
+ | addCustomButton('images/3/3c/Button_pre.png', | ||
+ | 'Pre', | ||
+ | '\n<pre>', | ||
+ | '</pre>\n', | ||
+ | 'Balise pre', | ||
+ | 'mw-editbutton-pre'); | ||
+ | |||
+ | addCustomButton('images/5/55/Button_nbsp_1.png', | ||
+ | 'Espace générique', | ||
+ | ' ', | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-nbsp'); | ||
+ | |||
+ | addCustomButton('images/a/ae/Button_fr.png', | ||
+ | 'Modèle fr', | ||
+ | '{{fr', | ||
+ | '}}', | ||
+ | '', | ||
+ | 'mw-editbutton-fr'); | ||
+ | |||
+ | var boite = '{{boîte déroulante/début\n' | ||
+ | +'<!-- Boîte -->\n' | ||
+ | +'|arrondi=0.6em\n' | ||
+ | +'|alignB=left\n' | ||
+ | +'|hauteur=1.6em\n' | ||
+ | +'|margeHaut=0em\n' | ||
+ | +'|margeBas=0em\n' | ||
+ | +'|largeur=100%\n' | ||
+ | +'|couleurBordure=#AAAAAA\n' | ||
+ | +'|couleurFondB=#FFFFFF\n' | ||
+ | +'<!-- Titre -->\n' | ||
+ | +'|image=\n' | ||
+ | +'|style=\n' | ||
+ | +'|titre=Titre de la boîte\n' | ||
+ | +'|alignT=center\n' | ||
+ | +'|label=\n' | ||
+ | +'|couleurFondT=#CCCCFF\n' | ||
+ | +'|couleurTexteT=black\n' | ||
+ | +'|thinning=no\n' | ||
+ | +'<!-- Contenu-->\n' | ||
+ | +'|marge=0px\n' | ||
+ | +'|couleurFond=white\n' | ||
+ | +'|align=left\n' | ||
+ | +'|taille=100%\n' | ||
+ | +'}}\n' | ||
+ | +'\n' | ||
+ | +'<-- ici le contenu -->\n' | ||
+ | +'\n' | ||
+ | +'{{Boîte déroulante/fin}}\n'; | ||
+ | |||
+ | addCustomButton('images/f/f9/Button_box.png', | ||
+ | 'Boîte déroulante', | ||
+ | boite, | ||
+ | '', | ||
+ | '', | ||
+ | 'mw-editbutton-boite'); | ||
+ | |||
+ | */ |
Version du 12 mars 2011 à 14:48
/* Any JavaScript here will be loaded for users using the Vector skin */ /****************
* Insertion de nouveaux boutons dans la barre d'outil */
addOnloadHook(addCustomButton);
/*
function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) {
mwCustomEditButtons[mwCustomEditButtons.length] = {"imageId": imageId, "imageFile": imageFile, "speedTip": speedTip, "tagOpen": tagOpen, "tagClose": tagClose, "sampleText": sampleText};
}
addCustomButton('images/9/93/Button_wgw.png',
'Sigle WGW', ' WikiGenWeb ', , , 'mw-editbutton-wgw');
addCustomButton('images/f/fd/Button_underline.png',
'Souligner', '', '', 'Texte souligné', 'mw-editbutton-underline');
addCustomButton('images/8/80/Button_upper_letter.png',
'Exposant', '', '', 'X', 'mw-editbutton-upper');
addCustomButton('images/7/70/Button_lower_letter.png',
'Indice', '', '', 'X', 'mw-editbutton-lower');
addCustomButton('images/b/bb/Button_barrer.png',
'Rayer', '', '', 'texte barré', 'mw-editbutton-strike');
addCustomButton('images/2/26/Button_latinas.png',
'Guillemets-Italiques', '\'\'« ', ' »\'\, 'Citation', 'mw-editbutton-Guillemet');
addCustomButton('images/b/bb/Button_color.png',
'Texte surligné',
'',
'',
'texte à surligner blanc sur rouge',
'mw-editbutton-CadreCouleur');
addCustomButton('images/e/ea/Button_align_left.png',
'Alignement à gauche','
'Texte aligné à gauche', 'mw-editbutton-left');
addCustomButton('images/5/5f/Button_center.png',
'Centrer','
'Texte centré', 'mw-editbutton-Center');
addCustomButton('images/a/a5/Button_align_right.png',
'Alignement à droite','
'Texte aligné à droite', 'mw-editbutton-right');
addCustomButton('images/2/29/Button_justify.png',
'Texte justifié','
'Texte justifié', 'mw-editbutton-justify');
addCustomButton('images/8/88/Btn_toolbar_enum.png', 'Énumération', '\n# élément 1\n# élément 2\n# élément 3', , , 'mw-editbutton-enum');
addCustomButton('images/1/11/Btn_toolbar_liste.png',
'Liste', '\n* élément A\n* élément B\n* élément C', , , 'mw-editbutton-liste');
addCustomButton('images/4/4f/Button_head_A3.png',
'Sous-titre niveau 3', '\n=== ', ' ===\n', 'Sous-titre n° 3', 'mw-editbutton-title3');
addCustomButton('images/1/14/Button_head_A4.png',
'Sous-titre niveau 4', '\n==== ', ' ====\n', 'Sous-titre n° 4', 'mw-editbutton-title4');
addCustomButton('images/8/8c/Button_head_A5.png',
'Sous-titre niveau 5', '\n===== ', ' =====\n', 'Sous-titre n° 5', 'mw-editbutton-title5');
addCustomButton('images/9/9e/Btn_toolbar_gallery.png',
'Galerie d\'images','\n
- \nFichier:wiki.png
\n
, , 'mw-editbutton-gallery');
addCustomButton('images/0/04/Button_array.png',
'Tableau minimum', '{|class="wikitable-left" \n!colspan="2"|Entête du tableau\n|-\n!Entête col 1\n!Entête col 2\n|-\n|A\n|B\n|}', , , 'mw-editbutton-array');
addCustomButton('images/b/b4/Button_category03.png',
'Catégorie', '[[Catégorie:', '|Raymond SÉNÈQUE/Exemple de page]]', 'nom de la catégorie', 'mw-editbutton-category');
addCustomButton('images/8/87/Button_Clear.png',
'Clear','',
, , 'mw-editbutton-Clear');
addCustomButton('images/1/13/Button_enter.png',
'Saut de ligne', '
', , , 'mw-editbutton-Enter');
addCustomButton('images/c/c4/Button_ref.png',
'Référence', '[1]', 'référence, citation ou lien', 'mw-editbutton-ref');
addCustomButton('images/6/64/Buttonrefvs8.png',
'Index des références','== Notes et références ==\n
- ↑ ', '
, , 'mw-editbutton-references');
addCustomButton('images/3/3b/Button_template_alt.png',
'Modèle', '{{', '}}', 'modèle à inclure', 'mw-editbutton-template');
addCustomButton('images/4/47/Button_redir.png',
'Redirection', '#REDIRECT [[', ']]', 'nom de la destination', 'mw-editbutton-redir');
addCustomButton('images/a/a6/Button_Wikipedia.png',
'Lien Interwiki Wikipedia', '[[wikipedia.fr:', '|]]', 'Page Wikipedia', 'mw-editbutton-Wikipedia');
var voirAussi = '\n'
+ '== Voir aussi ==\n' + '=== Articles connexes ===\n' + '* Indiquer ici votre article\n' + '*\n' + '=== Liens et documents externes ===\n' + '*\n';
addCustomButton('images/b/bb/Seealso.png',
'Section Voir aussi', voirAussi, , , 'mw-editbutton-voiraussi');
addCustomButton('images/2/23/Button_code.png',
'Code',
'',
'
',
'Texte du code',
'mw-editbutton-code');
addCustomButton('images/d/d4/Button_div.png',
'Div','
'Balises entre div', 'mw-editbutton-div');
addCustomButton('images/7/72/Button_span_2.png',
'Span',
'',
'',
'Balises entre span',
'mw-editbutton-span');
addCustomButton('images/3/3c/Button_pre.png',
'Pre','\n
', '\n',
'Balise pre', 'mw-editbutton-pre');
addCustomButton('images/5/55/Button_nbsp_1.png',
'Espace générique', ' ', , , 'mw-editbutton-nbsp');
addCustomButton('images/a/ae/Button_fr.png',
'Modèle fr', '{{fr', '}}', , 'mw-editbutton-fr');
var boite = '{{boîte déroulante/début\n' +'\n' +'|arrondi=0.6em\n' +'|alignB=left\n' +'|hauteur=1.6em\n' +'|margeHaut=0em\n' +'|margeBas=0em\n' +'|largeur=100%\n' +'|couleurBordure=#AAAAAA\n' +'|couleurFondB=#FFFFFF\n' +'\n' +'|image=\n' +'|style=\n' +'|titre=Titre de la boîte\n' +'|alignT=center\n' +'|label=\n' +'|couleurFondT=#CCCCFF\n' +'|couleurTexteT=black\n' +'|thinning=no\n' +'\n' +'|marge=0px\n' +'|couleurFond=white\n' +'|align=left\n' +'|taille=100%\n' +'}}\n' +'\n' +'<-- ici le contenu -->\n' +'\n' +'</div>
</div></div>\n';
addCustomButton('images/f/f9/Button_box.png',
'Boîte déroulante', boite, , , 'mw-editbutton-boite');
- /