MediaWiki:Gadget-MoreMenu.user.js

/* Original from metawikimedia:MediaWiki:Gadget-MoreMenu.user.js under the terms of CC-BY-SA-3.0 */

"use strict";

window.MoreMenu = window.MoreMenu || {};

window.MoreMenu.user = function (config) { return { user: { 'user-logs': { 'all-logs': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name          }), insertAfter: false },       'abusefilter-log': { url: mw.util.getUrl('Special:AbuseLog', {           wpSearchUser: config.targetUser.name          }) },       'block-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'block'          }), targetUserRights: ['block'] },       'checkuser-log': { url: mw.util.getUrl('Special:CheckUserLog', {           cuSearch: config.targetUser.name,            cuSearchType: 'initiator'          }), targetUserRights: ['checkuser-log'], currentUserRights: ['checkuser-log'] },       'deletion-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'delete'          }), targetUserRights: ['delete'] },       'global-account-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'globalauth'          }), targetUserRights: ['centralauth-lock'] },       'global-block-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'gblblock'          }), targetUserRights: ['globalblock'] },       'mass-message-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'massmessage'          }), targetUserRights: ['massmessage'] },       'move-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'move'          }), targetUserRights: ['move'] },       'pending-changes-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'stable'          }), targetUserRights: ['stablesettings'] },       'protection-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'protect'          }), targetUserRights: ['protect'] },       'rename-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'gblrename'          }), targetUserRights: ['centralauth-rename'] },       'review-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'review'          }), targetUserRights: ['review'] },       'spam-blacklist-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'spamblacklist'          }) },       'suppression-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'suppress'          }), targetUserRights: ['suppressrevision'], currentUserRights: ['suppressionlog'] },       'thanks-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'thanks'          }), targetUserGroups: ['user'] },       'upload-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'upload'          }), targetUserRights: ['upload'] },       'user-creation-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'newusers'          }), targetUserGroups: ['user'] // any user can create new accounts at Special:CreateAccount

},       'user-rights-log': { url: mw.util.getUrl('Special:Log', {           user: config.targetUser.name,            type: 'rights'          }), targetUserChangeGroups: true }     },      'blocks': { 'block-user': { url: mw.util.getUrl("Special:Block/".concat(config.targetUser.name)), currentUserRights: 'block', targetUserBlocked: false },       'block-globally': { url: "https://meta.miraheze.org/wiki/Special:GlobalBlock/".concat(config.targetUser.name), currentUserRights: 'globalblock', targetUserIp: true },       'change-block': { url: mw.util.getUrl("Special:Block/".concat(config.targetUser.name)), currentUserRights: 'block', targetUserBlocked: true },       'central-auth': { url: "https://meta.miraheze.org/wiki/Special:CentralAuth/".concat(config.targetUser.name), currentUserRights: 'centralauth-lock' },       'unblock-user': { url: mw.util.getUrl("Special:Unblock/".concat(config.targetUser.name)), targetUserBlocked: true, currentUserRights: 'block' },       'view-block': { url: mw.util.getUrl('Special:BlockList', {           wpTarget: config.targetUser.name          }), targetUserBlocked: true, style: 'color:#EE1111' },       'view-block-log': { url: mw.util.getUrl('Special:Log', {           page: config.targetUser.name,            type: 'block'          }) }     },      'sul': { url: mw.util.getUrl("Special:CentralAuth/".concat(config.targetUser.name)), targetUserGroups: ['user'] },     'ip-lookup': { 'spur': { url: "https://spur.us/app/context?q=".concat(config.targetUser.name), targetUserIp: true, targetUserIpRange: false, currentUserGroups: ['user'] },       'whois': { url: "https://whois-referral.toolforge.org/gateway.py?lookup=true&ip=".concat(config.targetUser.escapedName), targetUserIp: true, targetUserIpRange: true },       'proxy-check': { url: "https://ipcheck.toolforge.org/?ip=".concat(config.targetUser.escapedName), targetUserIp: true, currentUserRights: 'block' },       'rdns': { url: "https://www.robtex.com/ip/".concat(config.targetUser.escapedName, ".html"), targetUserIp: true, targetUserIpRange: true },       'geolocate': { url: "https://whatismyipaddress.com/ip/".concat(config.targetUser.escapedName), targetUserIp: true, targetUserIpRange: true }     },

/** Actions the current user can take on the target user. */     'change-rights': { url: mw.util.getUrl('Special:UserRights', {         user: "User:".concat(config.targetUser.name)        }), targetUserGroups: ['user'], currentUserChangeGroups: true },     'checkuser': { url: mw.util.getUrl("Special:CheckUser/".concat(config.targetUser.name)), currentUserRights: ['checkuser'] },     'contributions': { url: mw.util.getUrl("Special:Contributions/".concat(config.targetUser.name)) },     'deleted-contributions': { url: mw.util.getUrl("Special:DeletedContributions/".concat(config.targetUser.name)), currentUserRights: ['deletedhistory', 'deletedtext'], insertAfter: 'contributions' },     'suppressed-contribs': { url: mw.util.getUrl('Special:Log/suppress', {         offender: config.targetUser.name        }), currentUserRights: ['suppressionlog'], insertAfter: 'deleted-contributions' },     'email-user': { url: mw.util.getUrl("Special:EmailUser/".concat(config.targetUser.name)), targetUserGroups: ['user'], visible: undefined !== config.targetUser.emailable },     'uploads': { url: mw.util.getUrl('Special:ListFiles', {         user: config.targetUser.name,          ilshowall: '1'        }), targetUserGroups: ['user'] },     'user-groups': { url: mw.util.getUrl('Special:ListUsers', {         limit: 1,          username: config.targetUser.name        }), targetUserGroups: ['user'] },     'user-thanks-received': { url: mw.util.getUrl('Special:Log', {         user: '',          page: "User:".concat(config.targetUser.name),          type: 'thanks'        }), targetUserGroups: ['user'] }   }  }; };