Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 56c70f2
Author: alistair3149 <[email protected]>
Date:   Sun Apr 30 20:05:06 2023 -0400

    chore(release): 🚀 2.5.0

commit 1f5f72e
Author: github-actions <[email protected]>
Date:   Sun Apr 30 23:55:44 2023 +0000

    ci: 👷 lint code to MediaWiki standards

    Check commit and GitHub actions for more details

commit e45af9b
Author: alistair3149 <[email protected]>
Date:   Sun Apr 30 19:54:31 2023 -0400

    feat(core): ✨ add scroll affordance to tables

commit ce99634
Author: alistair3149 <[email protected]>
Date:   Sun Apr 30 18:01:53 2023 -0400

    refactor(core): ♻️ load content scripts using wikipage.content hook

commit 1945988
Author: github-actions <[email protected]>
Date:   Sun Apr 30 21:02:42 2023 +0000

    ci: 👷 lint code to MediaWiki standards

    Check commit and GitHub actions for more details

commit 8c888a7
Author: alistair3149 <[email protected]>
Date:   Sun Apr 30 17:01:29 2023 -0400

    feat(core): ✨ make tables responsive without breaking table layout

    Instead of a CSS solution used previously, switch to a JS solution to wrap tables.
    This should ensure the table renders correctly and also scrollable.
    This lays the groundwork for making table more user-friendly in the future.

commit 1b80496
Author: github-actions <[email protected]>
Date:   Fri Apr 28 16:15:13 2023 +0000

    ci: 👷 lint code to MediaWiki standards

    Check commit and GitHub actions for more details

commit 567fc81
Author: alistair3149 <[email protected]>
Date:   Fri Apr 28 12:14:04 2023 -0400

    fix(RelatedArticles): 🐛 larger min-height to trigger lazyload

    RA needs a larger min-height to trigger the script to load the cards

commit d762606
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Apr 25 12:48:30 2023 -0400

    chore(deps-dev): update mediawiki/mediawiki-phan-config requirement (#614)

    Updates the requirements on [mediawiki/mediawiki-phan-config](https://github.com/wikimedia/mediawiki-tools-phan) to permit the latest version.
    - [Release notes](https://github.com/wikimedia/mediawiki-tools-phan/releases)
    - [Changelog](https://github.com/wikimedia/mediawiki-tools-phan/blob/master/HISTORY.md)
    - [Commits](wikimedia/mediawiki-tools-phan@0.12.0...0.12.1)

    ---
    updated-dependencies:
    - dependency-name: mediawiki/mediawiki-phan-config
      dependency-type: direct:development
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 560b999
Author: translatewiki.net <[email protected]>
Date:   Mon Apr 24 13:13:58 2023 +0200

    Localisation updates from https://translatewiki.net.

commit cc4d9cf
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Apr 17 02:49:12 2023 -0400

    chore(deps-dev): bump @commitlint/cli from 17.6.0 to 17.6.1 (#613)

    Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 17.6.0 to 17.6.1.
    - [Release notes](https://github.com/conventional-changelog/commitlint/releases)
    - [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md)
    - [Commits](https://github.com/conventional-changelog/commitlint/commits/v17.6.1/@commitlint/cli)

    ---
    updated-dependencies:
    - dependency-name: "@commitlint/cli"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit c24d4af
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 14 13:50:52 2023 -0400

    chore(deps-dev): bump @commitlint/config-conventional (#612)

    Bumps [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-conventional) from 17.4.4 to 17.6.1.
    - [Release notes](https://github.com/conventional-changelog/commitlint/releases)
    - [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-conventional/CHANGELOG.md)
    - [Commits](https://github.com/conventional-changelog/commitlint/commits/v17.6.1/@commitlint/config-conventional)

    ---
    updated-dependencies:
    - dependency-name: "@commitlint/config-conventional"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 217f5ae
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 14 13:48:02 2023 -0400

    chore(deps-dev): bump @commitlint/cli from 17.5.1 to 17.6.0 (#610)

    Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 17.5.1 to 17.6.0.
    - [Release notes](https://github.com/conventional-changelog/commitlint/releases)
    - [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md)
    - [Commits](https://github.com/conventional-changelog/commitlint/commits/v17.6.0/@commitlint/cli)

    ---
    updated-dependencies:
    - dependency-name: "@commitlint/cli"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 3ad4d62
Author: github-actions <[email protected]>
Date:   Fri Apr 14 17:30:33 2023 +0000

    ci: 👷 lint code to MediaWiki standards

    Check commit and GitHub actions for more details

commit 612382f
Author: alistair3149 <[email protected]>
Date:   Fri Apr 14 13:29:15 2023 -0400

    fix(core): 🐛 avoid double spacing between notice and content

commit 350041c
Author: github-actions <[email protected]>
Date:   Wed Apr 5 17:51:09 2023 +0000

    ci: 👷 lint code to MediaWiki standards

    Check commit and GitHub actions for more details

commit fe4f4a9
Author: alistair3149 <[email protected]>
Date:   Wed Apr 5 13:50:14 2023 -0400

    feat(core): ✨ only apply title transform to content namespaces

commit a04e178
Author: alistair3149 <[email protected]>
Date:   Mon Apr 3 12:55:08 2023 -0400

    chore(release): 🚀 2.4.4

commit aaa82d0
Author: alistair3149 <[email protected]>
Date:   Mon Apr 3 12:48:10 2023 -0400

    feat(search): ✨ trigger typeahead update when character is composed

    Only trigger an update when the character is fully composed.
    Examples include various CJK IMEs

    Closes: #608

commit 84246c5
Author: alistair3149 <[email protected]>
Date:   Mon Apr 3 11:52:38 2023 -0400

    refactor(search): ♻️ do not pass messages var around

commit 5988847
Author: translatewiki.net <[email protected]>
Date:   Mon Apr 3 13:18:23 2023 +0200

    Localisation updates from https://translatewiki.net.

commit c0b1de9
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Mar 28 21:22:46 2023 -0400

    chore(deps-dev): bump @commitlint/cli from 17.5.0 to 17.5.1 (#607)

    Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 17.5.0 to 17.5.1.
    - [Release notes](https://github.com/conventional-changelog/commitlint/releases)
    - [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md)
    - [Commits](https://github.com/conventional-changelog/commitlint/commits/v17.5.1/@commitlint/cli)

    ---
    updated-dependencies:
    - dependency-name: "@commitlint/cli"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 2b1445a
Author: github-actions <[email protected]>
Date:   Wed Mar 29 00:43:03 2023 +0000

    ci: 👷 lint code to MediaWiki standards

    Check commit and GitHub actions for more details

commit 6b8ff22
Author: Roan Kattouw <[email protected]>
Date:   Tue Mar 28 17:41:55 2023 -0700

    fix(codex): update button classes for type->weight change (#606)

    * fix(codex): Update button classes for type->weight change

    In Codex v0.7.0, the CSS class used for primary buttons changed from
    cdx-button--type-primary to cdx-button--weight-primary, type-normal
    changed weight-normal, and type-quiet changed to weight-quiet. Update
    codex.styles.less accordingly.

    See https://phabricator.wikimedia.org/T312987 for more details.

    * fix(codex): keep --type for 1.39 compatibility

    ---------

    Co-authored-by: alistair3149 <[email protected]>

commit 497f2e6
Author: alistair3149 <[email protected]>
Date:   Mon Mar 27 14:45:08 2023 -0400

    refactor(core): ♻️ deprecate wfExpandUrl in favor of UrlUtils

    Related: T319340

commit 90890de
Author: alistair3149 <[email protected]>
Date:   Mon Mar 27 14:08:38 2023 -0400

    feat(core): ✨ add config flag to disable preferences menu

commit b47f265
Author: alistair3149 <[email protected]>
Date:   Mon Mar 27 13:48:29 2023 -0400

    fix(core): 🐛 remove redundant override for image height

    There is no need for important for image height.
    This should also fix the issue where inline height are being overriden.
    Fix: #605

commit daf5b3d
Author: alistair3149 <[email protected]>
Date:   Mon Mar 27 13:41:23 2023 -0400

    fix(RelatedArticles): enforce min-height for RA to render

    RA needs a min-height to trigger the JS to render the cards

commit 791df17
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Mar 23 21:48:05 2023 -0400

    chore(deps-dev): bump @commitlint/cli from 17.4.4 to 17.5.0 (#604)

    Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 17.4.4 to 17.5.0.
    - [Release notes](https://github.com/conventional-changelog/commitlint/releases)
    - [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md)
    - [Commits](https://github.com/conventional-changelog/commitlint/commits/v17.5.0/@commitlint/cli)

    ---
    updated-dependencies:
    - dependency-name: "@commitlint/cli"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 918cb7f
Author: alistair3149 <[email protected]>
Date:   Mon Mar 20 12:22:10 2023 -0400

    chore(release): 🚀 2.4.3

commit 015b1e1
Author: alistair3149 <[email protected]>
Date:   Mon Mar 20 12:21:46 2023 -0400

    fix(core): 🐛 respect config flag for default theme

    This should fix the issue where CitizenThemeDefault is not working

commit 1bc6590
Author: translatewiki.net <[email protected]>
Date:   Mon Mar 20 13:15:36 2023 +0100

    Localisation updates from https://translatewiki.net.

commit 787ecc3
Author: alistair3149 <[email protected]>
Date:   Sat Mar 18 22:45:32 2023 -0400

    fix(CodeMirror): use same font as edit font

    This should fix the alignment issue with the syntax highlight overlay
  • Loading branch information
WaitSpringQW committed Sep 29, 2024
1 parent a978198 commit 18a7493
Show file tree
Hide file tree
Showing 37 changed files with 8,164 additions and 1,230 deletions.
753 changes: 400 additions & 353 deletions CHANGELOG.md

Large diffs are not rendered by default.

36 changes: 35 additions & 1 deletion i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,44 @@
"authors": [
"Alistair3149",
"Fitoschido",
"Galahad",
"MarleneR329"
]
},
"citizen-skin-desc": "Un skin hermoso, usable y respondido para MediaWiki que hace que las extensiones formen parte de la experiencia cohesiva. Creada inicialmente para [https://starcitizen.tools/ Star Citizen Wiki].",
"citizen-prefs-talkpage": "[[mw:Skin_talk:Citizen|Discusión]]",
"citizen-languages-toggle": "Más idiomas",
"citizen-actions-more-toggle": "Más acciones",
"citizen-sitestats-articles-label": "artículos",
"citizen-sitestats-images-label": "archivos",
"citizen-sitestats-users-label": "usuarios",
"citizen-sitestats-edits-label": "ediciones",
"citizen-page-info-copyright": "Derechos de autor",
"citizen-page-info-credits": "Créditos",
"citizen-page-info-lastmod": "Última modificación",
"citizen-footer-desc": "Edita este texto en [[MediaWiki:Citizen-footer-desc]]",
"citizen-footer-tagline": "Edita este texto en [[MediaWiki:Citizen-footer-tagline]]",
"citizen-action-addsection": "Añadir tema",
"citizen-jumptotop": "Volver al inicio"
"citizen-jumptotop": "Volver al inicio",
"citizen-search-fulltext": "Buscar en las páginas que contengan $1",
"citizen-search-fulltext-empty": "Buscar el texto en estas páginas",
"citizen-search-mediasearch": "Buscar multimedia relacionada a $1",
"citizen-search-mediasearch-empty": "Buscar multimedia",
"citizen-search-empty-desc": "Escribe para empezar a buscar",
"citizen-search-noresults-title": "¡Uh, oh! No hay resultados para $1",
"citizen-search-noresults-desc": "¿Quizá probar con las otras opciones?",
"citizen-tagline-ns-talk": "Página de discusión de {{SUBJECTPAGENAME}}",
"citizen-tagline-ns-project": "Información sobre {{SITENAME}}",
"citizen-tagline-ns-file": "Archivo de {{SITENAME}}",
"citizen-tagline-ns-mediawiki": "Página de la interfaz de MediaWiki",
"citizen-tagline-ns-template": "Página de plantilla",
"citizen-tagline-ns-help": "Página de ayuda",
"citizen-tagline-ns-category": "Página de categoría",
"prefs-citizen-theme-label": "Tema",
"prefs-citizen-theme-option-auto": "Automático",
"prefs-citizen-theme-option-light": "Claro",
"prefs-citizen-theme-option-dark": "Oscuro",
"prefs-citizen-fontsize-label": "Tamaño del texto",
"prefs-citizen-pagewidth-label": "Anchura de la imagen",
"prefs-citizen-resetbutton-label": "Reiniciar por defecto"
}
26 changes: 21 additions & 5 deletions i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,34 @@
"Joquliina",
"MITO",
"Moj",
"Nike"
"Nike",
"Pyscowicz"
]
},
"skinname-citizen": "Citizen",
"citizen-skin-desc": "Star Citizen Wikiä varten kehitetty responsiivinen ulkoasu",
"citizen-skin-desc": "Kaunis, käyttökelpoinen, responsiivinen MediaWiki-teema, joka tekee laajennuksista osan yhtenäistä kokemusta. Alun perin luotu [https://starcitizen.tools/ Star Citizen Wikille].",
"citizen.js": "/* Tämän sivun JavaScript-koodi liitetään Citizen-ulkoasuun */",
"citizen-languages-toggle": "Lisää kieliä",
"citizen-actions-more-toggle": "Lisää toimintoja",
"citizen-sitestats-articles-label": "artikkelit",
"citizen-sitestats-images-label": "tiedostot",
"citizen-sitestats-users-label": "käyttäjät",
"citizen-sitestats-edits-label": "muokkaukset",
"citizen-page-info-credits": "Tekijät",
"citizen-page-info-lastmod": "Viimeksi muokattu",
"citizen-action-addsection": "Lisää aihe",
"citizen-jumptotop": "Takaisin sivun alkuun",
"citizen-search-fulltext": "Etsi sivuja joissa on",
"citizen-search-fulltext": "Etsi sivuja, jotka sisältävät $1",
"citizen-search-empty-desc": "Kirjoita aloittaaksesi haun",
"citizen-tagline-ns-project": "Tietoja {{GRAMMAR:inessive|{{SITENAME}}}}",
"citizen-tagline-ns-file": "Tiedosto {{GRAMMAR:inessive|{{SITENAME}}}}",
"citizen-tagline-ns-mediawiki": "MediaWiki-käyttöliittymäsivu",
"citizen-tagline-ns-template": "Mallinesivu",
"citizen-tagline-ns-help": "Ohjesivu",
"citizen-tagline-ns-category": "Luokkasivu"
"citizen-tagline-ns-category": "Luokkasivu",
"prefs-citizen-theme-label": "Teema",
"prefs-citizen-theme-option-light": "Vaalea",
"prefs-citizen-theme-option-dark": "Tumma",
"prefs-citizen-fontsize-label": "Fonttikoko",
"prefs-citizen-pagewidth-label": "Sivun leveys",
"prefs-citizen-resetbutton-label": "Palauta oletusarvo"
}
49 changes: 49 additions & 0 deletions i18n/ia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"@metadata": {
"authors": [
"McDutchie"
]
},
"citizen-skin-desc": "Un apparentia de MediaWiki belle, usabile e responsive que face extensiones parte del experientia cohesive. Initialmente create pro le [https://starcitizen.tools/ wiki Star Citizen].",
"citizen-prefs-talkpage": "[[mw:Skin_talk:Citizen|Discussion]]",
"citizen.css": "/* Le codice CSS placiate essera cargate pro le usatores del apparentia Citizen */",
"citizen.js": "/* Le codice JavaScript placiate hic essera cargate pro le usatores del apparentia Citizen */",
"citizen-drawer-toggle": "Alternar menu",
"citizen-usermenu-toggle": "Alternar menu personal",
"citizen-search-toggle": "Alternar recerca",
"citizen-languages-toggle": "Plus linguas",
"citizen-actions-more-toggle": "Plus actiones",
"citizen-sitestats-articles-label": "articulos",
"citizen-sitestats-images-label": "files",
"citizen-sitestats-users-label": "usatores",
"citizen-sitestats-edits-label": "modificationes",
"citizen-page-info-copyright": "Derectos de autor",
"citizen-page-info-credits": "Creditos",
"citizen-page-info-lastmod": "Ultime modification",
"citizen-footer-desc": "Modificar iste texto sur [[MediaWiki:Citizen-footer-desc]]",
"citizen-footer-tagline": "Modificar iste texto sur [[MediaWiki:Citizen-footer-tagline]]",
"citizen-action-addsection": "Adder topico",
"citizen-jumptotop": "Retro al initio",
"citizen-search-fulltext": "Cercar paginas que contine $1",
"citizen-search-fulltext-empty": "Cercar texto in paginas",
"citizen-search-mediasearch": "Cercar multimedia concernente $1",
"citizen-search-mediasearch-empty": "Cercar multimedia",
"citizen-search-empty-desc": "Digita pro comenciar a cercar",
"citizen-search-noresults-title": "Oh oh! Necun resultato pro $1",
"citizen-search-noresults-desc": "Essayar forsan le optiones hic infra?",
"citizen-tagline-ns-talk": "Pagina de discussion de {{SUBJECTPAGENAME}}",
"citizen-tagline-ns-project": "Informationes sur {{SITENAME}}",
"citizen-tagline-ns-file": "File sur {{SITENAME}}",
"citizen-tagline-ns-mediawiki": "Pagina de interfacie MediaWiki",
"citizen-tagline-ns-template": "Pagina de patrono",
"citizen-tagline-ns-help": "Pagina de adjuta",
"citizen-tagline-ns-category": "Pagina de categoria",
"prefs-citizen-theme-label": "Thema",
"prefs-citizen-theme-option-auto": "Automatic",
"prefs-citizen-theme-option-light": "Clar",
"prefs-citizen-theme-option-dark": "Obscur",
"prefs-citizen-fontsize-label": "Dimension del litteras",
"prefs-citizen-pagewidth-label": "Latitude del pagina",
"prefs-citizen-lineheight-label": "Altitude de lineas",
"prefs-citizen-resetbutton-label": "Reinitialisar al predefinition"
}
43 changes: 43 additions & 0 deletions i18n/lt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"@metadata": {
"authors": [
"Nokeoo"
]
},
"citizen-prefs-talkpage": "[[mw:Skin_talk:Citizen|Diskusija]]",
"citizen-languages-toggle": "Daugiau kalbų",
"citizen-actions-more-toggle": "Daugiau veiksmų",
"citizen-sitestats-articles-label": "straipsniai",
"citizen-sitestats-images-label": "failai",
"citizen-sitestats-users-label": "naudotojai",
"citizen-sitestats-edits-label": "keitimai",
"citizen-page-info-copyright": "Autorinės teisės",
"citizen-page-info-credits": "Kreditai",
"citizen-page-info-lastmod": "Paskutinis pakeitimas",
"citizen-footer-desc": "Redaguoti šį tekstą [[MediaWiki:Citizen-footer-desc]]",
"citizen-footer-tagline": "Redaguoti šį tekstą [[MediaWiki:Citizen-footer-tagline]]",
"citizen-action-addsection": "Pridėti temą",
"citizen-jumptotop": "Grįžti į viršų",
"citizen-search-fulltext": "Ieškoti puslapių, turinčių $1",
"citizen-search-fulltext-empty": "Ieškoti teksto puslapiuose",
"citizen-search-mediasearch": "Ieškoti medijos, susijusios su $1",
"citizen-search-mediasearch-empty": "Ieškoti medijos",
"citizen-search-empty-desc": "Rašykite norėdami pradėti ieškoti",
"citizen-search-noresults-title": "Oi! Nėra $1 rezultatų",
"citizen-search-noresults-desc": "Galbūt išbandykite toliau pateiktas parinktis?",
"citizen-tagline-ns-talk": "{{SUBJECTPAGENAME}} diskusijų puslapis",
"citizen-tagline-ns-project": "Informacija apie {{SITENAME}}",
"citizen-tagline-ns-file": "Failas {{SITENAME}}",
"citizen-tagline-ns-mediawiki": "MediaWiki sąsajos puslapis",
"citizen-tagline-ns-template": "Šablono puslapis",
"citizen-tagline-ns-help": "Pagalbos puslapis",
"citizen-tagline-ns-category": "Kategorijos puslapis",
"prefs-citizen-theme-label": "Tema",
"prefs-citizen-theme-option-auto": "Automatiškai",
"prefs-citizen-theme-option-light": "Šviesus",
"prefs-citizen-theme-option-dark": "Tamsus",
"prefs-citizen-fontsize-label": "Šrifto dydis",
"prefs-citizen-pagewidth-label": "Puslapio plotis",
"prefs-citizen-lineheight-label": "Eilutės aukštis",
"prefs-citizen-resetbutton-label": "Atstatyti į numatytuosius"
}
59 changes: 59 additions & 0 deletions includes/Partials/PageTitle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
/**
* Citizen - A responsive skin developed for the Star Citizen Wiki
*
* This file is part of Citizen.
*
* Citizen is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Citizen is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Citizen. If not, see <https://www.gnu.org/licenses/>.
*
* @file
* @ingroup Skins
*/

declare( strict_types=1 );

namespace MediaWiki\Skins\Citizen\Partials;

use MediaWiki\MediaWikiServices;

/**
* Title partial of Skin Citizen
*/
final class PageTitle extends Partial {
/**
* Wrap text within parenthesis with a span tag
*
* @param string $html title of the page
* @return string html
*/
public function decorateTitle( $data ) {
if ( $this->shouldAddParenthesis() ) {
$pattern = '/(\(.+\))/';
$replacement = '<span class="mw-page-title-parenthesis">$1</span>';
return preg_replace( $pattern, $replacement, $data );
}
return $data;
}

/**
* Check if the current page is in the content namespace
*
* @return bool
*/
private function shouldAddParenthesis(): bool {
$ns = $this->title->getNamespace();
$contentNs = MediaWikiServices::getInstance()->getNamespaceInfo()->getContentNamespaces();
return in_array( $ns, $contentNs );
}
}
98 changes: 0 additions & 98 deletions includes/Partials/Title.php

This file was deleted.

4 changes: 2 additions & 2 deletions includes/SkinCitizen.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
use MediaWiki\Skins\Citizen\Partials\Drawer;
use MediaWiki\Skins\Citizen\Partials\Footer;
use MediaWiki\Skins\Citizen\Partials\Header;
use MediaWiki\Skins\Citizen\Partials\PageTitle;
use MediaWiki\Skins\Citizen\Partials\PageTools;
use MediaWiki\Skins\Citizen\Partials\Tagline;
use MediaWiki\Skins\Citizen\Partials\Theme;
use MediaWiki\Skins\Citizen\Partials\Title;
use SkinMustache;

/**
Expand Down Expand Up @@ -61,7 +61,7 @@ public function getTemplateData(): array {

$header = new Header( $this );
$drawer = new Drawer( $this );
$pageTitle = new Title( $this );
$pageTitle = new PageTitle( $this );
$tagline = new Tagline( $this );
$bodycontent = new BodyContent( $this );
$footer = new Footer( $this );
Expand Down
Loading

0 comments on commit 18a7493

Please sign in to comment.