User:Bugghost/Scripts/UserRoleIndicator.js: Difference between revisions

Content deleted Content added
better layout, greybox
looking good, just cleaning up now
Line 19:
await this.getUsernames();
if ( !this.window.userHighlighterSimpleNoColors ) {
this.setHighlightColorssetCss();
}
const $links = this.$( '#article a, #bodyContent a, #mw_contentholder a' );
Line 239:
if ( !title || title.startsWith( 'User:' ) ) {
this.$link.attr( 'title', descriptionForHover );
this.$link.append($("<div class='user-role-indicator-container'><div class='user-role-indicator-inner'>"+icon+"</div></div>"))
}
 
Line 262:
this.checkForPermission( this.extendedConfirmed, '✍', 'Extended confirmed' );
 
// If they have no perms, justthen drawthey aare box around their usernamenon-EC, to make itso more<500 visible.edits
if ( !this.hasAdvancedPermissions ) {
this.addHoverIcon("🐣", "Less than 500 edits");
Line 268:
}
 
setHighlightColorssetCss() {
// this.addCSS('user-role-indicator-container', 'position: relative !important; display: inline;')
// 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('user-role-indicator-inner', 'font-size: smaller; display: inline; background: gainsboro; padding: 0.1em; border-radius: 5px; border: 1px black solid; margin-left: 3px;')
// 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', 'font-size: smaller; display: inline; background: gainsboro; padding: 0.1em; border-radius: 5px; border: 1px black solid; margin-left: 3px;')
 
// 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;' );
}
}