Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Citizen.js: Difference between revisions

MediaWiki interface page
mNo edit summary
mNo edit summary
Line 17: Line 17:


var svg =
var svg =
  '<svg viewBox="-2 -1 28 26" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false" class="discord-icon" xmlns="http://www.w3.org/2000/svg">' +
  '<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false" class="discord-icon" xmlns="http://www.w3.org/2000/svg">' +
  '  <path fill-rule="evenodd" clip-rule="evenodd" d="M21.525 2.11C19.348.791 16.924.12 14.39.006A.076.076 0 0 0 14.312 0a.076.076 0 0 0-.076.076c-.19 2.488-.99 6.84-2.22 10.232C9.565 7.64 5.86 5.61 2.302 3.998a.076.076 0 0 0-.094.04C.802 6.3 0 9.07 0 11.95c0 6.32 4.02 11.69 9.38 12.03a.076.076 0 0 0 .084-.065c.34-1.63.79-3.2 1.3-4.66a.076.076 0 0 0-.05-.09c-.9-.28-1.75-.62-2.55-.99a.076.076 0 0 1-.01-.13c.12-.1.23-.2.35-.3A.076.076 0 0 1 8.6 17.6c3.4 1.58 7.2 1.58 10.6 0a.076.076 0 0 1 .07.02c.12.1.23.2.35.3a.076.076 0 0 1-.01.13c-.8.37-1.64.7-2.55.99a.076.076 0 0 0-.05.09c.5 1.47.95 3.03 1.3 4.66a.076.076 0 0 0 .08.06c5.37-.34 9.39-5.7 9.39-12.02 0-2.88-.8-5.65-2.2-7.92a.076.076 0 0 0-.09-.04c-3.56 1.6-7.26 3.63-9.7 6.23-1.23-3.4-2.03-7.75-2.22-10.23a.076.076 0 0 0-.07-.07Zm-4.63 11.41a1.71 1.71 0 0 1-1.71-1.71 1.71 1.71 0 0 1 1.7-1.71 1.71 1.71 0 0 1 1.72 1.7 1.71 1.71 0 0 1-1.72 1.72Zm4.63 0a1.71 1.71 0 0 1-1.71-1.71 1.71 1.71 0 0 1 1.7-1.71 1.71 1.71 0 0 1 1.72 1.7 1.71 1.71 0 0 1-1.72 1.72Z"/>' +
  '  <path d="M13.545 2.907a13.2 13.2 0 0 0-3.257-1.011.05.05 0 0 0-.052.025c-.141.25-.297.577-.406.833a12.2 12.2 0 0 0-3.658 0 8 8 0 0 0-.412-.833.05.05 0 0 0-.052-.025c-1.125.194-2.22.534-3.257 1.011a.04.04 0 0 0-.021.018C.356 6.024-.213 9.047.066 12.032q.003.022.021.037a13.3 13.3 0 0 0 3.995 2.02.05.05 0 0 0 .056-.019q.463-.63.818-1.329a.05.05 0 0 0-.01-.059l-.018-.011a9 9 0 0 1-1.248-.595.05.05 0 0 1-.02-.066l.015-.019q.127-.095.248-.195a.05.05 0 0 1 .051-.007c2.619 1.196 5.454 1.196 8.041 0a.05.05 0 0 1 .053.007q.121.1.248.195a.05.05 0 0 1-.004.085 8 8 0 0 1-1.249.594.05.05 0 0 0-.03.03.05.05 0 0 0 .003.041c.24.465.515.909.817 1.329a.05.05 0 0 0 .056.019 13.2 13.2 0 0 0 4.001-2.02.05.05 0 0 0 .021-.037c.334-3.451-.559-6.449-2.366-9.106a.03.03 0 0 0-.02-.019m-8.198 7.307c-.789 0-1.438-.724-1.438-1.612s.637-1.613 1.438-1.613c.807 0 1.45.73 1.438 1.613 0 .888-.637 1.612-1.438 1.612m5.316 0c-.788 0-1.438-.724-1.438-1.612s.637-1.613 1.438-1.613c.807 0 1.451.73 1.438 1.613 0 .888-.631 1.612-1.438 1.612"/>' +
  '</svg>';
  '</svg>';



Revision as of 03:02, 21 October 2025

/* All JavaScript here will be loaded for users of the Citizen skin */

mw.loader.using( 'mediawiki.util' ).then( function () {
  $( function () {
    var $start = $( '.citizen-header__start' );
    if ( !$start.length ) return;

    var $btn = $( '<a>', {
      id: 'discord-header-btn',
      class: 'citizen-header__button',
      href: 'https://discord.com/',
      title: 'Join our Discord',
      'aria-label': 'Join our Discord',
      target: '_blank',
      rel: 'noopener noreferrer'
    });

	var svg =
	  '<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false" class="discord-icon" xmlns="http://www.w3.org/2000/svg">' +
	  '  <path d="M13.545 2.907a13.2 13.2 0 0 0-3.257-1.011.05.05 0 0 0-.052.025c-.141.25-.297.577-.406.833a12.2 12.2 0 0 0-3.658 0 8 8 0 0 0-.412-.833.05.05 0 0 0-.052-.025c-1.125.194-2.22.534-3.257 1.011a.04.04 0 0 0-.021.018C.356 6.024-.213 9.047.066 12.032q.003.022.021.037a13.3 13.3 0 0 0 3.995 2.02.05.05 0 0 0 .056-.019q.463-.63.818-1.329a.05.05 0 0 0-.01-.059l-.018-.011a9 9 0 0 1-1.248-.595.05.05 0 0 1-.02-.066l.015-.019q.127-.095.248-.195a.05.05 0 0 1 .051-.007c2.619 1.196 5.454 1.196 8.041 0a.05.05 0 0 1 .053.007q.121.1.248.195a.05.05 0 0 1-.004.085 8 8 0 0 1-1.249.594.05.05 0 0 0-.03.03.05.05 0 0 0 .003.041c.24.465.515.909.817 1.329a.05.05 0 0 0 .056.019 13.2 13.2 0 0 0 4.001-2.02.05.05 0 0 0 .021-.037c.334-3.451-.559-6.449-2.366-9.106a.03.03 0 0 0-.02-.019m-8.198 7.307c-.789 0-1.438-.724-1.438-1.612s.637-1.613 1.438-1.613c.807 0 1.45.73 1.438 1.613 0 .888-.637 1.612-1.438 1.612m5.316 0c-.788 0-1.438-.724-1.438-1.612s.637-1.613 1.438-1.613c.807 0 1.451.73 1.438 1.613 0 .888-.631 1.612-1.438 1.612"/>' +
	  '</svg>';

    $btn.append( svg );

    var $hamburger = $start.find( 'button, a' ).first();
    ( $hamburger.length ? $btn.insertAfter( $hamburger ) : $start.prepend( $btn ) );
  } );
} );