MediaWiki:Citizen.js: Difference between revisions
MediaWiki interface page
More actions
Content deleted Content added
Fix URL |
m oop |
||
| Line 5: | Line 5: | ||
const $drawer = $( '.citizen-drawer' ); |
const $drawer = $( '.citizen-drawer' ); |
||
// Abort if header isn't present or button already exists |
|||
if ( !$drawer.length || $( '.citizen-discord' ).length ) { |
if ( !$drawer.length || $( '.citizen-discord' ).length ) { |
||
return; |
return; |
||
| Line 19: | Line 18: | ||
} ).append( |
} ).append( |
||
$( '<div>', { class: 'citizen-discord__button citizen-header__button' } ).append( |
$( '<div>', { class: 'citizen-discord__button citizen-header__button' } ).append( |
||
$( '<span>', { |
$( '<span>', { |
||
class: 'disc-icon citizen-header__buttonIcon', |
|||
'aria-hidden': 'true' |
|||
} ) |
|||
) |
) |
||
); |
); |
||
Latest revision as of 11:34, 3 April 2026
/* All JavaScript here will be loaded for users of the Citizen skin */
// Discord button in Citizen header
$( function () {
const $drawer = $( '.citizen-drawer' );
if ( !$drawer.length || $( '.citizen-discord' ).length ) {
return;
}
const $button = $( '<a>', {
class: 'citizen-discord citizen-header__item',
href: 'https://discord.gg/sarkic',
target: '_blank',
rel: 'noopener noreferrer',
title: 'Join us on Discord!',
'aria-label': 'Join us on Discord!'
} ).append(
$( '<div>', { class: 'citizen-discord__button citizen-header__button' } ).append(
$( '<span>', {
class: 'disc-icon citizen-header__buttonIcon',
'aria-hidden': 'true'
} )
)
);
$drawer.after( $button );
} );