Jump to content

User:ZLEA/EditRequestLinks.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.
// EditRequestLinks v1.1
// Install with:
// <code><nowiki>		{{subst:Iusc|User:ZLEA/EditRequestLinks.js}}																	</nowiki></code>
// or with
// <code><nowiki>		importScript( 'User:ZLEA/EditRequestLinks.js' ); // Backlink: [[User:ZLEA/EditRequestLinks.js]] 			</nowiki></code> 
//
// This script is based on [[User:DannyS712/New pages feed.js]] by [[User:DannyS712]] and [[User:Danski454/ReviewWarn.js]] by [[User:Danski454]]
mw.loader.using( 'mediawiki.util' ).done( function() {
	mw.util.addPortletLink('p-tb', mw.config.get( 'wgServer' ) + '/wiki/User:AnomieBOT/EDITREQTable', 'COI edit requests', 'n-coier', 'Conflict of Interest edit requests');
	$( '#n-specialpages' ).parent().append( $( '#n-coier' ) );
	
	if( mw.config.get( 'wgUserGroups' ) !== null &&
	( mw.config.get( 'wgUserGroups' ).indexOf('confirmed') !== -1 || mw.config.get( 'wgUserGroups' ).indexOf('autoconfirmed') !== -1 || mw.config.get( 'wgUserGroups' ).indexOf('sysop') !== -1)){
	mw.util.addPortletLink('p-tb', mw.config.get( 'wgServer' ) + '/wiki/User:AnomieBOT/SPERTable', 'SP edit requests', 'n-sper', 'Semi-protected edit requests');
	$( '#n-coier' ).parent().append( $( '#n-sper' ) )}
	
	if( mw.config.get( 'wgUserGroups' ) !== null &&
	( mw.config.get( 'wgUserGroups' ).indexOf('extendedconfirmed') !== -1 || mw.config.get( 'wgUserGroups' ).indexOf('sysop') !== -1)){
	mw.util.addPortletLink('p-tb', mw.config.get( 'wgServer' ) + '/wiki/User:AnomieBOT/EPERTable', 'ECP edit requests', 'n-ecper', 'Extended-confirmed-protected edit requests');
	$( '#n-sper' ).parent().append( $( '#n-ecper' ) )}
	
	if( mw.config.get( 'wgUserGroups' ) !== null &&
	( mw.config.get( 'wgUserGroups' ).indexOf('templateeditor') !== -1 || mw.config.get( 'wgUserGroups' ).indexOf('sysop') !== -1)){
	mw.util.addPortletLink('p-tb', mw.config.get( 'wgServer' ) + '/wiki/User:AnomieBOT/TPERTable', 'TP edit requests', 'n-tper', 'Template-protected edit requests');
	$( '#n-ecper' ).parent().append( $( '#n-tper' ) )}
	
	if( mw.config.get( 'wgUserGroups' ) !== null &&
	( mw.config.get( 'wgUserGroups' ).indexOf('sysop') !== -1)){
	mw.util.addPortletLink('p-tb', mw.config.get( 'wgServer' ) + '/wiki/User:AnomieBOT/PERTable', 'FP edit requests', 'n-fper', 'Fully-protected edit requests');
	$( '#n-tper' ).parent().append( $( '#n-fper' ) )}
	
	if( mw.config.get( 'wgUserGroups' ) !== null &&
	( mw.config.get( 'wgUserGroups' ).indexOf('interface-admin') !== -1)){
	mw.util.addPortletLink('p-tb', mw.config.get( 'wgServer' ) + '/wiki/User:AnomieBOT/IPERTable', 'IFP edit requests', 'n-ifper', 'Interface-protected edit requests');
	$( '#n-fper' ).parent().append( $( '#n-ifper' ) )}
	});