Jump to content

User:Yethrosh/common.js

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Yethrosh (talk | contribs) at 10:26, 18 May 2023. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//mw.loader.load("//fa.wikipedia.org/w/index.php?title=MediaWiki:Tofawiki.js&action=raw&ctype=text/javascript");
mw.loader.load("//ur.wikipedia.org/w/index.php?title=MediaWiki:Tourwiki.js&action=raw&ctype=text/javascript");
mw.loader.load("//ur.wikipedia.org/w/index.php?title=User:Yethrosh/contentcounter.js&action=raw&ctype=text/javascript");
importScript('MediaWiki:Gadget-HotCat.js');
importScript('User:Lupin/recent2.js');
importScript('MediaWiki:Wdsearch.js');
importScript('User:Paranomia/simplevote.js');
importScript("User:Yethrosh/LinkTranslator.js");
importScript("User:Theopolisme/Scripts/adminhighlighter.js");
importScript("User:MarkS/extraeditbuttons.js");

//transfer to commons
$(function () {
	if ($(
		'#mw-imagepage-nofile, #ca-view-foreign, ' +
		'#catlinks a[href="/wiki/%D8%B1%D8%AF%D9%87:%D9%85%D8%AD%D8%AA%D9%88%DB%8C%D8%A7%D8%AA_%D8%BA%DB%8C%D8%B1%D8%A2%D8%B2%D8%A7%D8%AF"]' // Non-free
	).length !== 0 || mw.config.get('wgAction') !== 'view' || mw.config.get('wgNamespaceNumber') !== 6) {
		return;
	}
	$(mw.util.addPortletLink(
		'p-views',
		new mw.Uri('//tools.wmflabs.org/commonshelper/').extend({
			lang: mw.config.get('wgContentLanguage'),
			image: mw.config.get('wgTitle'),
			interface: mw.config.get('wgContentLanguage')
		}),
		'Transfer to commons'
	)).find('a').prop('target', '_blank').prepend($('<img>', {
		src: '//upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/14px-Commons-logo.svg.png'
	}), ' ');
});