Content deleted Content added
better placement |
more icons |
||
Line 230:
checkForPermission( listOfUsernames, className, descriptionForHover ) {
if ( listOfUsernames[ this.user ] === 1 ) {
this.
}
}
const title = this.$link.attr( 'title' );
if ( !title || title.startsWith( 'User:' ) ) {
this.$link.attr( 'title', descriptionForHover );
this.$link.prepend($("<div class='user-role-indicator-container'><div class='user-role-indicator-inner'>
}
Line 249 โถ 248:
// 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.
}
// 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.checkForPermission( this.wmf, '
this.checkForPermission( this.stewards, '
this.checkForPermission( this.arbcom, '
this.checkForPermission( this.bureaucrats, '
this.checkForPermission( this.admins, '
this.checkForPermission( this.formeradmins, '
this.checkForPermission( this.newPageReviewers, '
this.checkForPermission( this.tenThousandEdits, '
this.checkForPermission( this.extendedConfirmed, '
// If they have no perms, just draw a box around their username, to make it more visible.
if ( !this.hasAdvancedPermissions ) {
▲ this.$link.attr( 'title', 'Less than 500 edits' );
}
}
Line 275 โถ 270:
setHighlightColors() {
// Highest specificity goes on bottom. So if you want an admin+steward to be highlighted steward, place the steward CSS below the admin CSS in this section.
// this.addCSS( 'UHS-override-signature-colors', `
// color: #0645ad !important;
// background-color: transparent !important;
// background: unset !important;
// ` );
this.addCSS('user-role-indicator-container', 'position: relative !important; display: inline;')
this.addCSS('user-role-indicator-inner', 'position: absolute; top: 1em; left: 0px; font-size: smaller; background-color: #1333 !important;')
// this.mw.util.addCSS( '.UHS-no-permissions { border: 1px solid black !important; }' );
// // 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.addCSS( 'UHS-500edits-bot-trustedIP', 'background-color: #0f0 !important;' );
// this.addCSS( 'UHS-10000edits', 'background-color: #9c9 !important;' );
// this.addCSS( 'UHS-new-page-reviewer', 'background-color: #99f !important;' );
// this.addCSS( 'UHS-former-administrator', 'background-color: #D3AC8B !important;' );
// this.addCSS( 'UHS-administrator', 'background-color: #9ff !important;' );
// this.addCSS( 'UHS-bureaucrat', 'background-color: orange !important; color: #0645ad !important;' );
// this.addCSS( 'UHS-arbitration-committee', 'background-color: #FF3F3F !important; color: white !important;' );
// this.addCSS( 'UHS-steward', 'background-color: #00FF00 !important;' );
// this.addCSS( 'UHS-wmf', 'background-color: hotpink !important; color: #0645ad !important;' );
}
}
|