User:NguoiDungKhongDinhDanh/CopyvioChecker.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
This user script seems to have a documentation page at User:NguoiDungKhongDinhDanh/CopyvioChecker. |
/* This script adds CopyvioCheck tab to all pages, except for Special ones. Vector skin only.
Originally written by NguoiDungKhongDinhDanh.
Installing this script: Try using Enterprisey's ScriptInstaller, or paste the following line into your vector.js or common.js/global.js (not recommended for non-Vector user):
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:NguoiDungKhongDinhDanh/CopyvioChecker.js&action=raw&ctype=text/javascript');
Since I'm not very active and 'scripty', should the gadget have glitches, well, my apologise for being irresponsible. */
mw.loader.using( ['mediawiki.util', 'mediawiki.Uri'], function () {
"use strict";
var CvCkTabUrl;
function setDefault( option, val ) {
if ( window[option] === undefined ) {
window[option] = val;
}
}
setDefault( 'CvCkTabName', 'CopyvioCheck' );
setDefault( 'CvCkTab', true );
if ( mw.config.get( 'wgNamespaceNumber' ) == -1 ) {
return;
}
if ( window.CvCkTab ) {
CvCkTabUrl = new mw.Uri( '//copyvios.toolforge.org/' )
.extend( {
lang: mw.config.get( 'wgServer' ).replace(/\//g, '').split('.')[0],
project: mw.config.get( 'wgServer' ).replace(/\//g, '').split('.')[1],
oldid: (mw.config.get( 'wgRevisionId' )===0) ? (mw.config.get( 'wgCurRevisionId' )) : (mw.config.get( 'wgRevisionId' )),
action: 'search',
use_engine: '1',
use_links: '1',
turnitin: '1',
} )
.toString();
mw.util.addPortletLink(
'p-cactions',
CvCkTabUrl,
window.CvCkTabName,
'CopyvioCheck',
'Submit a query to copyvios.toolforge.org',
null,
null
);
}
} );