User:The Earwig/copyvios.js

/*	Adds a toolbox link to do a copyvio check on the current page.

Install by adding: importScript('User:The Earwig/copyvios.js'); // User:The Earwig/copyvios.js to your Special:MyPage/common.js.

mw.loader.using('mediawiki.util', function {	if (mw.config.get('wgNamespaceNumber') < 0) {		return;	}	var url = 'https://copyvios.toolforge.org/?lang=' + mw.config.get('wgContentLanguage') +		'&project=' + mw.config.get('wgSiteName').toLowerCase +		'&title=' + encodeURIComponent(mw.config.get('wgPageName'));	if (mw.config.get('wgRevisionId') !== mw.config.get('wgCurRevisionId') || mw.util.getParamValue('oldid') !== null) {		url += '&oldid=' + encodeURIComponent(mw.config.get('wgRevisionId'));	}	mw.util.addPortletLink( 'p-tb', url, 'Copyvio check', 't-copyvio-check', 'Check this page for copyright violations' ); });