Content deleted Content added
oops |
added the ability to do custom labels (hopefully) |
||
Line 17:
async execute() {
const defaultRoleInfoLookup = {
wmf: ['๐', 'Wikimedia Foundation (WMF)'],▼
stewards: ['๐ฉบ', 'Steward or Ombud'],▼
arbcom: ['โ๏ธ', 'Arbitration Committee member'],▼
bureaucrats: ['๐ผโ', 'Bureaucrat'],▼
admins: ['๐งน', 'Admin'],▼
formerAdmins: ['๐ฌ', 'Former Admin'],▼
newPageReviewers: ['๐งบ', 'New page reviewer'],▼
tenThousandEdits: ['๐ฅ', 'More than 10,000 edits'],▼
extendedConfirmed: ['๐', 'Extended confirmed'],▼
lessThan500: ['๐ฃ', 'Less than 500 edits'],▼
};▼
if(this.window.UserRoleIndicatorCustomLabels){
this.roleInfoLookup = { ...defaultRoleInfoLookup, ...window.UserRoleIndicatorCustomLabels };
}
// console.time("get usernames")
await this.getUsernames();
Line 247 โถ 264:
addRoleInfoIfNeeded() {
▲ wmf: ['๐', 'Wikimedia Foundation (WMF)'],
▲ stewards: ['๐ฉบ', 'Steward or Ombud'],
▲ arbcom: ['โ๏ธ', 'Arbitration Committee member'],
▲ bureaucrats: ['๐ผโ', 'Bureaucrat'],
▲ admins: ['๐งน', 'Admin'],
▲ formerAdmins: ['๐ฌ', 'Former Admin'],
▲ newPageReviewers: ['๐งบ', 'New page reviewer'],
▲ tenThousandEdits: ['๐ฅ', 'More than 10,000 edits'],
▲ extendedConfirmed: ['๐', 'Extended confirmed'],
▲ lessThan500: ['๐ฃ', 'Less than 500 edits'],
▲ };
// highlight anybody with "WMF" in their name, case insensitive. this should not generate false positives because "WMF" is on the username blacklist. see https://meta.wikimedia.org/wiki/Title_blacklist
Line 266 โถ 271:
// TODO: grab the order from an array, so I can keep checkForPermission and addCSS in the same order easily, lowering the risk of the HTML title="" being one thing, and the color being another
this.addRoleInfoIfAppropriate( this.wmf, this.roleInfoLookup.wmf[0], this.roleInfoLookup.wmf[1]);
this.addRoleInfoIfAppropriate( this.stewards, this.roleInfoLookup.stewards[0], this.roleInfoLookup.stewards[1]);
this.addRoleInfoIfAppropriate( this.arbcom, this.roleInfoLookup.arbcom[0], this.roleInfoLookup.arbcom[1]);
this.addRoleInfoIfAppropriate( this.bureaucrats, this.roleInfoLookup.bureaucrats[0], this.roleInfoLookup.bureaucrats[1]);
this.addRoleInfoIfAppropriate( this.admins, this.roleInfoLookup.admins[0], this.roleInfoLookup.admins[1]);
this.addRoleInfoIfAppropriate( this.formerAdmins, this.roleInfoLookup.formerAdmins[0], this.roleInfoLookup.formerAdmins[1]);
this.addRoleInfoIfAppropriate( this.newPageReviewers, this.roleInfoLookup.newPageReviewers[0], this.roleInfoLookup.newPageReviewers[1]);
this.addRoleInfoIfAppropriate( this.tenThousandEdits, this.roleInfoLookup.tenThousandEdits[0], this.roleInfoLookup.tenThousandEdits[1]);
this.addRoleInfoIfAppropriate( this.extendedConfirmed, this.roleInfoLookup.extendedConfirmed[0], this.roleInfoLookup.extendedConfirmed[1]);
// If they have no perms, then they are non-EC, so <500 edits
if ( !this.hasAdvancedPermissions ) {
this.addRoleIcon(this.roleInfoLookup.lessThan500[0], this.roleInfoLookup.lessThan500[1]);
}
}
|