User:Aaron Liu/Watchlyst Greybar Unsin.js#L-102

/* eslint-disable es-x/no-string-prototype-replaceall */

/* Watchlyst Greybar Unsin (User:Aaron Liu/Watchlyst Greybar Unsin.js)

3.4.5
*/

//

( function () {

// utility function that adds CSS so that user can easily override it

function addCss( style ) {

mw.loader.addStyleTag( style, document.head.children[ 0 ] );

}

// non-talk namespaces have an even number

if ( mw.config.get( 'wgNamespaceNumber' ) % 2 === 0 && mw.config.get( 'action' ) !== 'history' ) {

// non-talk, non-history and non-watchlist pages don't have this style for some reason

addCss( '.autocomment,.autocomment a,.autocomment a:visited{color:#72777d}' );

}

const watchlistLink = 'watchlist';

function getWatchlyst( data ) {

// Don't display if no new watchlist items or if you're on the watchlist page

if ( data.query.watchlist.length !== 0 && mw.config.get( 'wgPageName' ) !== 'Special:Watchlist' ) {

data = data.query.watchlist[ 0 ];

const $dismiss = $( '