User:Sreejithk2000/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.
// Twinkle script.
/*
var twinkleConfigExists = false;
importScript('User:Kanonkas/twinkle.js');
importScript('User:Kanonkas/twinklebatchdelete.js'); // Only for deleting pages, not files. See below for the file deleting script.
importScript('User:Kanonkas/twinklebatchdeletefiles.js'); // Only for deleting files.
*/

// <nowiki>
if (mw.config.get('wgNamespaceNumber') === 6) {

	// Magog's Cleanup script. The following hack adds link to the toolbar.
	importScript('User:Magog the Ogre/cleanup.js');

	// Adds a Mark as Duplicate link in the duplicate links section on File pages.
	if (mw.config.get('wgAction') === 'view') {
		$('.mw-imagepage-duplicates li')
			.each(function () {
				var link = $(this).find('a').html().replace(/"/g, '\"');
				link = 'javascript:AjaxQuickDelete.insertTagOnPage("\{\{duplicate|1=' + link + '}}", "Tagging as duplicate of [[' + link + ']]")';
				this.appendChild($('<a>', { href: link, text: '(Mark as Duplicate)' })[0]);
			});
	}

	if (/SVG$/i.test(mw.config.get('wgTitle')))
		importScript('User:Rillke/SVGedit.js');	// To Edit SVG files

}

// Always watch pages that I delete.
$('#wpWatch').prop('checked', true);

// The default length of 60 for deletion reason is too small. Increasing it to 150.
$('#wpReason').attr('size', 150);

window.AjaxDeleteWatchFile = true;
window.AjaxDeleteExtraButtons = [{
	'label': 'Uncategorized',
	'tag': '{\{subst:unc}}',
	'img_summary': 'Tagging as uncategorized'
}, {
	'label': 'Should be SVG',
	'tag': '{\{SVG|%PARAMETER%}}',
	'img_summary': 'This file will be better as SVG',
	'prompt_text': 'Which category does this file fall in?'
}, {
	'label': 'SVG available',
	'tag': '{\{SVG available|%PARAMETER%}}',
	'img_summary': 'SVG available as [[%PARAMETER%]]',
	'prompt_text': 'Which file is the SVG version of this file ?'
}, {
	'label': 'Mark as Dupe',
	'tag': '{\{duplicate|1=%PARAMETER%|user=%USER%}}',
	'img_summary': 'Tagging as duplicate of [[%PARAMETER%]]',
	'prompt_text': 'Which file is a duplicate of this file ?'
}, {
	'label': 'Custom template',
	'tag': '{\{%PARAMETER%}\}',
	'prompt_text': 'Please input a custom template',
	'img_summary': 'Tagging with {\{%PARAMETER%}\}'
}];

var unwatchLinksOnLoad = true; //add (x) links on page load
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Js/watchlist.js&action=raw&ctype=text/javascript');

importScript('User:Sreejithk2000/MoveDelPagetoFilePage.js');
importScript('User:Sreejithk2000/pixlr.js');
importScript('User:Sreejithk2000/Cosmetics.js');
importScript('User:Sreejithk2000/CommonSense.js');
importScript('User:Sreejithk2000/OpenCatFilesInNewWindow.js');
importScript('User:Sreejithk2000/duplicateFiles.js');
importScript('User:Sreejithk2000/SplitFileHistory.js');
importScript('User:Sreejithk2000/MergeFiles.js');
importScript('User:Sreejithk2000/JustReplace.js');
importScript('User:Sreejithk2000/deleteorphans.js');

importScript('User:Majora/LicenseReview.js');
importScript('User:Rillke/bigChunkedUpload.js');
importScript('User:Perhelion/fixconverttosvg.js');
importScript('User:Perhelion/simpleSVGcheck.js');
importScript('User:Magog the Ogre/cleanup.js');

// </nowiki>