| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
function init() { |
| 6 |
if ( document.querySelectorAll( '#pt-notifications-alert a, #pt-notifications-notice a' ).length !== 2 ) { |
| 7 |
return; |
| 8 |
} |
| 9 |
|
| 10 |
mw.hook( 'ext.echo.NotificationBadgeWidget.onInitialize' ).add( ( badge ) => { |
| 11 |
const element = badge.$element[ 0 ]; |
| 12 |
element.classList.add( 'mw-list-item' ); |
| 13 |
const anchor = ( element.querySelector( 'a' ) ); |
| 14 |
anchor.classList.add( |
| 15 |
'cdx-button', |
| 16 |
'cdx-button--weight-quiet', |
| 17 |
'cdx-button--icon-only', |
| 18 |
'cdx-button--fake-button', |
| 19 |
'cdx-button--fake-button--enabled' |
| 20 |
); |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
if ( element.id === 'pt-notifications-alert' ) { |
| 26 |
anchor.classList.add( 'vector-icon' ); |
| 27 |
} |
| 28 |
if ( element.id === 'pt-notifications-notice' ) { |
| 29 |
anchor.classList.add( 'vector-icon' ); |
| 30 |
} |
| 31 |
|
| 32 |
anchor.classList.add( 'skin-invert' ); |
| 33 |
} ); |
| 34 |
} |
| 35 |
|
| 36 |
module.exports = init; |