MediaWiki:Citizen.js: Difference between revisions
MediaWiki interface page
More actions
Content deleted Content added
No edit summary |
Fix URL |
||
| Line 1: | Line 1: | ||
/* All JavaScript here will be loaded for users of the Citizen skin */ |
/* All JavaScript here will be loaded for users of the Citizen skin */ |
||
// Discord |
// Discord button in Citizen header |
||
$ |
$( function () { |
||
const $drawer = $( '.citizen-drawer' ); |
|||
$('.citizen-drawer').after($('<div class="citizen-discord citizen-header__item"><a href="https://discord.gg/FYN4ucQKvq"><div class="citizen-discord__button citizen-header__button"><div class="disc-icon"><label id="citizen-discord__buttonCheckbox" class="mw-checkbox-hack-button citizen-header__buttonCheckbox" for="citizen-discord__checkbox" title="Join us on Discord!" aria-hidden="true"><span>Join us on Discord!</span></label></div></div></a></div>')); |
|||
| ⚫ | |||
// Abort if header isn't present or button already exists |
|||
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', 'aria-hidden': 'true' } ), |
|||
$( '<span>', { class: 'citizen-discord__text', text: 'Discord' } ) |
|||
) |
|||
); |
|||
$drawer.after( $button ); |
|||
| ⚫ | |||
Revision as of 11:32, 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' );
// Abort if header isn't present or button already exists
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', 'aria-hidden': 'true' } ),
$( '<span>', { class: 'citizen-discord__text', text: 'Discord' } )
)
);
$drawer.after( $button );
} );