User:Multichill/vector.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 can be added at User:Multichill/vector.css. |
//<source lang='javascript'>
/* Extra buttons in toolbar [[File:Krinkle_insertVectorButtons.js]] */
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Krinkle/insertVectorButtons.js&action=raw&ctype=text/javascript');
function kCustomMainInsertButton_config(){
// Copy to Commons :
if ( mw.config.get('wgNamespaceNumber') === 6 ) {
kCustomMainInsertButton(
'cwc', //imageId
'//upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Commons-logo-square.png/22px-Commons-logo-square.png', //imageFile
'Copy to Commons', //speedTip
'', //tagOpen
'{' + '{' + "Copy to Wikimedia Commons by BotMultichill}}\n", //tagClose
'', //sampleText
//callbackFunc:
function(){ $( '#wpSummary' ).val( 'This image is ready to be moved to Wikimedia Commons' ); }
);
}
// Commons cat :
if ( mw.config.get('wgNamespaceNumber') === 14 ) {
kCustomMainInsertButton(
'commonscat', //imageId
'//upload.wikimedia.org/wikipedia/commons/thumb/9/97/Commons_in_image_icon.svg/22px-Commons_in_image_icon.svg.png', //imageFile
'Commons cat', //speedTip
'{' + '{' + 'Commons cat' + '|', //tagOpen
"}}\n", //tagClose
'', //sampleText
//callbackFunc:
function(){ $( '#wpSummary' ).val( 'Adding link to Wikimedia Commons' ); }
);
}
}
//</source>