User:Revent/common.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// variable definitions stolen from User:Perhelion/common.js //
var ns = mw.config.get('wgNamespaceNumber'), //  global [[Bugzilla:33837]] <nowiki>
	ul = mw.config.get('wgUserLanguage'),
	pn = mw.config.get('wgPageName'),
	un = mw.config.get('wgUserName'),
	ac = mw.config.get('wgAction'),
	ti = mw.config.get('wgTitle'),
	cun = "", // (optional) CUSTOM username
	convertToSVGTypes = "geology, meteorology, road sign",
	GlobalReplaceDefaultReason = '',
	AjaxDeleteExtraButtons = [];

window.importScript('User:Rillke/LicenseReview.js');

// Also stolen from User:Perhilion/common.js //
if (ns === 6) { /** Files only **/
	var ext = ti.slice(-3).toUpperCase();

	mw.loader.load( '/w/index.php?title=User:Magog the Ogre/cleanup.js&action=raw&ctype=text/javascript' ); // File desc. cleanup
	mw.loader.load( '/w/index.php?title=User:Rillke/bigChunkedUpload.js&action=raw&ctype=text/javascript' ); // [[Help:Chunked upload]]
	
	if (ext.indexOf("SVG") === 0) {  /** SVG only **/

		// simple SVG edit (beta)
		mw.loader.load( '/w/index.php?title=User:Rillke/SVGedit.js&action=raw&ctype=text/javascript' );

		// W3C-Validator check-link for every SVG (by [[User: Perhelion]] fixed also now for admins); + detailed byte-size
		mw.loader.load( '/w/index.php?title=User:Perhelion/simpleSVGcheck.js&action=raw&ctype=text/javascript' );

		AjaxDeleteExtraButtons.push({
				'label' : 'PoorSVG', // TracedSVG
				'tag' : '{{PoorSVG|1=%PARAMETER%}}', // Raster file
				'img_summary' : 'This SVG contains poor traced elements, please revectorize',
				'talk_tag' : '{'+'{subst:TracedSVG/notify|1=%FILE%|2=%PARAMETER%}}',
				'talk_summary' : 'Poor SVG note',
				'prompt_text' : 'Which file is the original of?'
			}, {
				'label' : 'PoorSVG tag only', // TracedSVG
				'tag' : '{{PoorSVG|1=%PARAMETER%}}', // Raster file
				'img_summary' : 'This SVG contains poor traced elements, please revectorize',
				'prompt_text' : 'Which file is the original of?'
			}, {
				'label' : 'BadSVG',
				'tag' : '{{BadSVG}}',
				'img_summary' : 'This file contains raster graphics that should be removed',
				'talk_tag' : '{'+'{subst:BadSVG/notification|1=%FILE%}}',
				'talk_summary' : 'Bad SVG note',
				'prompt_text' : 'Please remove embedded raster graphics?'
			}, {
				'label' : 'BadSVG tag only',
				'tag' : '{{BadSVG}}',
				'img_summary' : 'This file contains raster graphics that should be removed',
				'prompt_text' : 'Please remove embedded raster graphics?'
			}, {
				'label' : 'SVGbug', // SVGbug
				'tag' : '{{SVGbug|1=%PARAMETER%}}', // Raster file
				'img_summary' : 'This SVG contains one or more libRSVG bugs',
				'prompt_text' : 'Description of the bug or a link?'
			}
		);
	} else {
		AjaxDeleteExtraButtons.push({
			'label' : 'ToSVG',
			'tag' : '{{Convert to SVG|1=%PARAMETER%}}',
			'img_summary' : 'This file should be better a SVG',
			'talk_tag' : '{'+'{subst:Please use SVG|1=%FILE%}}',
			'talk_summary' : 'Use SVG note',
			'prompt_text' : 'Please use SVG insteed of raster graphics. Which type?'
		}, {
			'label' : 'ToSVG tag only ',
			'tag' : '{{Convert to SVG|1=%PARAMETER%}}',
			'img_summary' : 'This file should be better a SVG',
			'prompt_text' : 'Please use SVG insteed of raster graphics. Which type?'
		});
		GlobalReplaceDefaultReason = ext + ' → SVG';
	}
	
		// [[Help:QuickDelete]]
	//To watch user talk pages, to which you add tags
	var AjaxDeleteWatchUserTalk = true;
	//To watch file pages, to which you add tags
	var AjaxDeleteWatchFile = true;
	// adding more buttons :
	AjaxDeleteExtraButtons.push({
			'label' : 'DW No Source',
			'tag' : '{{dw no source since|month=February|day=16|year=2016}}',
			'img_summary' : 'This is a [[COM:DW|derivative work]] and no source is provided',
			'talk_tag' : '{'+'{subst:dw-nsd}}',
			'talk_summary' : 'Original source is missing for %FILE%'
		}, { //notice talk_tag and talk_summary must be '' (void string) if uploader must not be notified
			'label' : 'Duplicate',
			'tag' : '{{duplicate|1=%PARAMETER%|user=%USER%}}',
			'img_summary' : 'Tagging as duplicate of [[File:%PARAMETER%]]', // FIXME!?: $.trim(%PARAMETER%).replace(/^(?:File|Image)\:/, '')
			'talk_tag' : '{'+'{subst:Speedynote|1=%FILE%|2={'+'{subst:int:File-exists-duplicate|}} [[:File:%PARAMETER%]].}}',
			'talk_summary' : 'Duplicate notification',
			'prompt_text' : 'Which file is this a duplicate of?'
		}, { //notice talk_tag and talk_summary must be '' (void string) if uploader must not be notified
			'label' : 'Dupe tag only ',
			'tag' : '{{duplicate|1=%PARAMETER%|user=%USER%}}',
			'img_summary' : 'Tagging as duplicate of [[File:%PARAMETER%]]', // FIXME!?: $.trim(%PARAMETER%).replace(/^(?:File|Image)\:/, '')
			'prompt_text' : 'Which file is this a duplicate of?'
		}, { //notice talk_tag and talk_summary must be '' (void string) if uploader must not be notified
			'label' : 'Speedy',
			'tag' : '{{Speedydelete|1=%PARAMETER%}}',
			'img_summary' : 'Tagging as speedy delete because: %PARAMETER%',
			'talk_tag' : '{'+'{subst:Speedynote|1=%FILE%|2=%PARAMETER%}}',
			'talk_summary' : 'Speedy notification',
			'prompt_text' : 'Speedy: why ? MUST PREVENT UPLOADER'
		}, {
			'label' : 'Wrong License',
			'tag' : '{{wl|1=%PARAMETER%}}',
			'img_summary' : 'Tagging as wrongly licensed because: %PARAMETER%',
			'talk_tag' : '{'+'{subst:Wrong license note|2=%PARAMETER%|1=%FILE%}}',
			'talk_summary' : 'Notification of possible wrong license',
			'prompt_text' : 'Incorrect license: reason?'
		}, {
			'label' : 'Thumbnail',
			'tag' : '{{Thumbnail}}',
			'img_summary' : 'Tagging as thumbnail',
			'talk_tag' : '{'+'{subst:Do not upload thumbnails|1=%FILE%}}',
			'talk_summary' : 'Thumb note',
			'prompt_text' : 'Please re-upload the full resolution version?'
		}, {
			'label' : 'Watermark',
			'tag' : '{{Watermark|1=}}',
			'img_summary' : 'This file contains a watermark that should be removed',
			'talk_tag' : '{'+'{subst:No watermarks|1=:%FILE%}}',
			'talk_summary' : 'Watermarks note',
			'prompt_text' : 'Please remove Watermarks?'
		}
	);

	mw.loader.load( '/w/index.php?title=User:Sreejithk2000/JustReplace.js&action=raw&ctype=text/javascript' );

	// make editing and adding descriptions easier
	mw.loader.load( '/w/index.php?title=User:MarkTraceur/editDescriptions.js&action=raw&ctype=text/javascript' );
}

mw.loader.load('//ru.wikipedia.org/w/index.php?title=MediaWiki:Gadget-markblocked.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:PleaseStand/userinfo.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Technical_13/Scripts/OneClickArchiver.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Dschwen/MegapixelDisplay.js&action=raw&ctype=text/javascript');

mw.loader.load( '/w/index.php?title=MediaWiki:ExCommons.js&action=raw&ctype=text/javascript' );

//<nowiki>

//vFCvFCCfg/////////////////////////////////////
/////// VISUAL FILE CHANGE CONFIGURATION ///////
///// DO NOT MODIFY BY HAND - FINGERS AWAY! ////
////////////////////////////////////////////////
window.vFCSettings = {"userNote":"Yours sincerely,","firstTest":0,"testEdits":0,"defaultAction":"c_replace","watchlistUserTalk":"preferences","watchlistFiles":"nochange","watchlistReplace":"nochange","watchlistOTRS":"nochange","loadBatchSize":20000,"maxSimultaneousReq":100,"summaryChacheLen":5,"loadThumbs":false,"loadWikitext":true};
//////////////////////////////////vFCvFCCfgEnd//
//</nowiki>