User:JAn Dudík/common.js

From Wikimedia Commons, the free media repository
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.
//catALot///////////////////////////////////////
////////// Cat-A-Lot user preferences //////////
window.catALotPrefs = {"watchlist":"preferences","minor":false,"editpages":true,"docleanup":false};
////////////////////////////////////catALotEnd//
importScript('User:Jheald/wdcat.js');
if (mw.config.get('wgNamespaceNumber') === 14) {
	$(function () {
		// upload in cat
		mw.util.addPortletLink('p-cactions', '//commons.wikimedia.org/w/index.php?title=Special:UploadWizard&categories=' + encodeURIComponent(mw.config.get('wgTitle')), 'Upload to this category', 'UW');
		$("#contentSub").prepend(
			'<a href="//commons.wikimedia.org/w/index.php?title=Special:UploadWizard&amp;categories=' + encodeURIComponent(mw.config.get('wgTitle')) +
			'" title="Upload to this category">' +
			'<img alt="Upload to this category" src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Camera-photo_Upload.svg/30px-Camera-photo_Upload.svg.png"' +
			' style="vertical-align:sub" height="30" width="30">' +
			'</a>');
	});
}