User:HeminKurdistan/commons.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
Documentation for this user script can be added at User:HeminKurdistan/commons. |
/////////////////////////////////////////////////
/**
* Extra buttons in toolbar
* @stats [[:File:Krinkle_InsertWikiEditorButton.js]]
* You can see Original script in [[:commons:User:Krinkle/common.js]]
*/
// <nowiki>
if (!mw.libs.getInsertWikiEditorButton) {
mw.libs.getInsertWikiEditorButton = $.ajax({ dataType: 'script', cache: true,
url: 'https://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript'
});
}
mw.libs.getInsertWikiEditorButton.then(function () {
// Wikidata Infobox
krInsertWikiEditorButton({
id: 'WikidataInfobox',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/7/71/Wikidata.svg/22px-Wikidata.svg.png',
label: 'Commons Cat',
insertBefore: '{{Wikidata Infobox}}\n',
insertAfter: '',
sampleText: '',
autoSummary: { summary: '+ Adding {{Wikidata Infobox}}', position: 'prepend', delimiter: '; ' }
});
// Taken on
krInsertWikiEditorButton({
id: 'TakenOn',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/14/Antu_applications-graphics.svg/25px-Antu_applications-graphics.svg.png',
label: 'TakenOn',
insertBefore: '{{Taken on|',
insertAfter: '|location=Iran}}',
sampleText: '',
autoSummary: { summary: '+ Adding {{Taken on}} in Summary', position: 'prepend', delimiter: '; ' }
});
});
// </nowiki>
/////////////////////////////////////////////////