Jump to content

User:DannyS712 test/cv.js

From Wikipedia, the free encyclopedia
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.
//<nowiki>
$(function (){
var Copy_vio_config = {
	name: '[[User:DannyS712/CV|CV.js]]',
	version: 1.2,
	debug: true
};

mw.loader.using( 'mediawiki.util', function () {
    $(document).ready( function () {
    	var newDiff = mw.config.get( 'wgDiffNewId' );
    	var oldid = mw.util.getParamValue( 'oldid' );
    	var linkOldid;
    	
    	if ( newDiff ) {
    		linkOldid = newDiff;
    	} else if ( oldid ) {
    		linkOldid = oldid;
    	} else {
    		linkOldid = mw.config.get( 'wgCurRevisionId' );
    	}
    	var link = '//tools.wmflabs.org/copyvios/?lang=en&project=wikipedia&title=&oldid=' + linkOldid + '&action=search&use_engine=1&use_links=1&turnitin=0';
    	mw.util.addPortletLink ( 'p-cactions', link, 'CV', 'ca-copyVioLink', 'Assess copyrights');
    } );
} );
});
//</nowiki>