Content deleted Content added
minor aesthetic changes |
hand writing icon wasn't displaying correctly in my version of firefox - ๐ seems to appear better. also swapping NPP to ๐งบ (rather than ๐งฝ) |
||
Line 1:
// <nowiki>
// Copied and edited from
class UserRoleIndicator {
Line 18 โถ 17:
async execute() {
// console.time("get usernames")
await this.getUsernames();
// console.timeEnd("get usernames")
this.addCSS('user-role-indicator', 'font-size: smaller; display: inline; background: #b7b9ff55; padding: 0.1em; border-radius: 5px; margin-left: 3px;')
Line 26 โถ 25:
const $links = this.$( '#article a, #bodyContent a, #mw_contentholder a' );
// console.time("linkloop")
$links.each( ( index, element ) => {
this.$link = this.$( element );
Line 39 โถ 38:
this.hasAdvancedPermissions = false;
this.addClassesAndHoverTextToLinkIfNeeded();
} );
// console.timeEnd("linkloop")
}
Line 236 โถ 231:
checkForPermission( listOfUsernames, className, descriptionForHover ) {
if ( listOfUsernames[ this.user ] === 1 ) {
this.
}
}
const title = this.$link.attr( 'title' );
Line 254 โถ 249:
// 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
if ( this.user.match( /^[^/]*WMF/i ) ) {
this.
}
Line 264 โถ 259:
this.checkForPermission( this.admins, '๐งน', 'Admin' );
this.checkForPermission( this.formeradmins, '๐ฌ', 'Former Admin' );
this.checkForPermission( this.newPageReviewers, '
this.checkForPermission( this.tenThousandEdits, '๐ฅ', 'More than 10,000 edits' );
this.checkForPermission( this.extendedConfirmed, '
// If they have no perms, then they are non-EC, so <500 edits
if ( !this.hasAdvancedPermissions ) {
this.
}
}
|