MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

// User tags window.UserTagsJS = { tags: { bureaucrat: { link: 'Project:Bureaucrats' },			admin: { link: 'Project:Sysops' },			'content-moderator': { link: 'Project:Content moderator' },			rollback: { link: 'Project:Rollback' },			'autoconfirmed-user': { link: 'Project:Autoconfirmed users' },			inactive: { title: 'The user hasn\'t edited for last 30 days' }		},		modules: { stopblocked: false, inactive: 30, mwGroups: ['bureaucrat', 'rollback', 'sysop', 'content-moderator', 'autoconfirmed-user', 'bot', 'bot-global'], autoconfirmed: true, newuser: { namespace: 0, // [Optional] Edits must be made to articles to count computation: function(days, edits) { return days < 10 && edits < 30 }           },            metafilter: { sysop: ['bureaucrat'], bot: ['bot-global'] },       }	};    importScriptPage('MediaWiki:UserTags/code.js', 'dev');

// Configure AjaxRC importScriptPage('AjaxRC/code.js', 'dev'); (window.ajaxPages = (window.ajaxPages || [])).push(		"Special:RecentChanges",		"Special:Watchlist",		"Special:Log",		"Special:Contributions",		"Special:NewFiles",		"Special:NewPages",		"Special:ListFiles",		"Special:WikiActivity",		"Special:Images"	); window.AjaxRCRefreshText = 'Auto-Refresh'; window.AjaxRCRefreshHoverText = 'Automatically refresh every 60secs'; window.ajaxCallAgain = ($.isArray(window.ajaxCallAgain) && window.ajaxCallAgain) || []; scriptList.push('u:dev:AjaxRC/code.js');

/*Custom Collapsive box */ importScriptPage('MediaWiki:ShowHide/code.js', 'dev');

/*More Widget Info */ importScriptPage('MediaWiki:InfoWidgets/code.js', 'dev');

// Custom edit buttons if (mw.toolbar) { mw.toolbar.addButton(			'https://vignette2.wikia.nocookie.net/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e/images/c/c8/Button_redirect.png',			'Redirect',			'#REDIRECT ',			'',			'Insert text',			'mw-editbutton-redirect'		); mw.toolbar.addButton(			'https://vignette3.wikia.nocookie.net/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e/images/e/e1/O_Accent_Button.png',			'Add the ō character',			'ō',			,			,			'mw-editbutton-macron-o'		); mw.toolbar.addButton(			'https://vignette2.wikia.nocookie.net/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e/images/d/db/U_Accent_Button.png',			'Add the ū character',			'ū',			,			,			'mw-editbutton-macron-u'		); mw.toolbar.addButton(			'https://vignette3.wikia.nocookie.net/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e/images/7/79/Button_reflink.png',			'Add a Reference',			' ',			'\'\'Yōkoso Jitsuryoku Shijō Shugi no Kyōshitsu e\'\' Vol. 0, Ch. 0, p. 0',			'mw-editbutton-ref'		); }

// Custom Special:[Multiple]Upload UI	if (({Upload: 1, MultipleUpload: 1})[mw.config.get('wgCanonicalSpecialPageName')] === 1) { pageScriptList.push(			'MediaWiki:Common.js/FairUseUpload.js'		); }					/* Small scripts which donot need a seperate page (Snippets) */ // Remove red-links (deleted pages) from Recent Changes // [They stay red, they just don't link to ?action=edit] if (({ Recentchanges: 1, Log: 1 })[mw.config.get('wgCanonicalSpecialPageName')] === 1) { var deNewRC = function { $('a.new').each(function {				this.href = this.href.replace(/\?[^?]*$/, '');			}); };		$(deNewRC); window.ajaxCallAgain.push(deNewRC); }	// Add custom class for styling long list of refs if ($('.references li').length > 9) $('.references').addClass('compactreferences'); // SMW default popup is broken in wikia // Use custom modal $('.ultisup-image-popup a').click(function(ev) {       ev.preventDefault;        $.showCustomModal(this.title, '', { width: 1000 });       $("#ultisup-load").parent.load(this.href + " #gallery-0"); }); // Oasis-only scripts if (mw.config.get('skin') === 'oasis') { // Detach the AJAX feature from Page/Image Creation/Upload // because the pop-up form does not obey the preloads and such. $(window).load(function {			$('a.createpage').off('click').attr('href', '/wiki/Special:Forms');		}); // Template adder on file pages if (mw.config.get('wgCanonicalNamespace') === 'File') $(function {           if ($.inArray("autoconfirmed", mw.config.get("wgUserGroups")) === -1)                return;            var Options = {                    : 'Unlicensed image',                    : 'No Fairuse info',                    : 'Unused image',                    : 'Poor name'                },                tempOptStr = '';            for (var i in Options) {                tempOptStr += '' + Options[i] + ' ';            }            var html = '' + tempOptStr + ' Add template';            $('.comments').after(html);            $('#templateSubmit').click(function { $(this).html(''); new mw.Api.post({                       format: 'json',                        action: 'edit',                        title: mw.config.get('wgPageName'),                        token: mw.user.tokens.get('editToken'),                        summary: 'Adding template: ' + $('#FileTemplateAdder').val,                        minor: true,                        prependtext: $('#FileTemplateAdder').val + "\n"                    }) .done(function {                       $('#templateSubmit').text('Add this Template too!');                        new BannerNotification('Template: ' + $('#FileTemplateAdder').val + ' Added Successfully', 'confirm').show;                    }) .fail(function {                       new BannerNotification('Template addition failed!', 'error').show;                    }); });       });	}