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

Content deleted Content added
looking good, just cleaning up now
perf monitoring, layout changes, refactoring
Line 17:
 
async execute() {
}
console.time("get usernames")
await this.getUsernames();
console.timeEnd("get usernames")
if ( !this.window.userHighlighterSimpleNoColors ) {
this.setCss();
this.addCSS('user-role-indicator', 'font-size: smaller; display: inline; background: gainsboro#e7e9ff; padding: 0.1em; border-radius: 5px; border: 1px black solid; margin-left: 3px;')
}
 
const $links = this.$( '#article a, #bodyContent a, #mw_contentholder a' );
 
console.time("linkloop")
$links.each( ( index, element ) => {
this.$link = this.$( element );
Line 39 ⟶ 44:
}
} );
console.timeEnd("linkloop")
}
 
Line 266 ⟶ 272:
this.addHoverIcon("🐣", "Less than 500 edits");
}
}
 
setCss() {
// this.addCSS('user-role-indicator-container', 'position: relative !important; display: inline;')
this.addCSS('user-role-indicator', 'font-size: smaller; display: inline; background: gainsboro; padding: 0.1em; border-radius: 5px; border: 1px black solid; margin-left: 3px;')
}
}