User:BethNaught/ECD.js

/** * Attribution: a cut-down and modified version User:Ahecht/Scripts/CVD.js, * itself based on User:Technical 13/Scripts/CVD.js. */

/** global mw, $ */

mw.loader.using('mediawiki.util', function {   $(document).ready( function { mw.util.addPortletLink(			'p-tb',			'#',			'Earwig\'s CV Detector',			'p-cv-detector',			'Scan for copyright violations using Earwig\'s Copyvio Detector tool. (This will open in a new tab/window)'		).addEventListener('click', function(e) {			e.preventDefault;			var siteName = mw.config.get('wgSiteName').toLowerCase;			if(!/mediawiki|wikibooks|wikidata|wikimedia|wikinews|wikipedia|wikiquote|wikisource|wikiversity|wikivoyage|wiktionary/.test(siteName)) { siteName = 'wikipedia'; }			window.open('https://tools.wmflabs.org/copyvios?lang=' + mw.config.get('wgContentLanguage') + '&project=' + siteName + '&title=' + encodeURIComponent(mw.config.get('wgPageName')), '_blank');		}); }); });