User:Minesweeper.007/extraeditbuttons.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. |
![]() | Documentation for this user script can be added at User:Minesweeper.007/extraeditbuttons. |
//<pre>
//fills the variable mwCustomEditButtons (s. function in /wikibits.js), with buttons for the Toolbar
function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText){
mwCustomEditButtons.push({
"imageFile": imageFile,
"speedTip": speedTip,
"tagOpen": tagOpen,
"tagClose": tagClose,
"sampleText": sampleText});
}
if (typeof usersignature == 'undefined') var usersignature = '-- \~\~\~\~';
var Isrc='/media/wikipedia/commons/';
// English Wikipedia creates 11 extra buttons which are stored in mwCustomEditButtons
// rather than mwEditButtons. However, there is no guarantee it will always be 11
// so we count them here.
var enExtraButtons=mwCustomEditButtons.length;
var BDict={
'A':['f/f0/Bouton_Vandale0.png','Reverted edit','{{subst:revert|','}} ~~~~','Insert article here'],
'B':['1/1d/Bouton_Vandale1.png','Vandal 1','{{subst:uw-vandal1|','}} ~~~~','Insert article here'],
'C':['c/cc/Bouton_Vandale2.png','Vandal 2','{{subst:uw-vandal2|','}} ~~~~','Insert article here'],
'D':['e/e4/Bouton_Vandale3.png','Vandal 3','{{subst:uw-vandal3|','}} ~~~~','Insert article here'],
'E':['7/7e/Bouton_Vandale4.png','Vandal 4','{{subst:uw-vandal4|','}} ~~~~','Insert article here'],
'F':['9/9d/Media_icon.png','Welcome' ,'{{subst:w-link|heading=true}} ~~~~],
};
var XEBOrder2=[];
if (typeof XEBOrder!='string') // can be modified
XEBOrder2="A,B,C,D,E".split(",");
else if (XEBOrder.toLowerCase()=='all')
for (b in BDict) XEBOrder2.push(b);
else XEBOrder2=XEBOrder.toUpperCase().split(",");
addOnloadHook(initButtons);
if(!wgIsArticle)
//</pre>