From 80a35ea571f8d7ef864b332add827368bc9b0440 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 13 Dec 2022 15:01:54 -0500 Subject: [PATCH 01/35] =?UTF-8?q?fix(core):=20=F0=9F=90=9B=20do=20not=20ma?= =?UTF-8?q?ke=20search=20create=20and=20exist=20link=20into=20a=20card?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes it might only have a whitespace in it, which creates an empty card --- .../mediawiki.special.search.styles.less | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/skinStyles/mediawiki/special/mediawiki.special.search.styles.less b/skinStyles/mediawiki/special/mediawiki.special.search.styles.less index b46b87d5..ecf77c2e 100644 --- a/skinStyles/mediawiki/special/mediawiki.special.search.styles.less +++ b/skinStyles/mediawiki/special/mediawiki.special.search.styles.less @@ -16,12 +16,8 @@ display: none; } -// Sticky header .mw-search-form-wrapper { - padding-top: var( --space-md ); - margin-top: ~'calc( var( --space-md ) * -1 )'; // counteract padding - background-color: transparent; - .citizen-sticky-header; + border-bottom: 1px solid var( --border-color-base ); // Wrapper has a border bottom already .mw-search-profile-tabs:last-child { @@ -81,7 +77,7 @@ .results-info { color: var( --color-base--subtle ); - font-size: 0.8125rem; + font-size: 0.875rem; white-space: nowrap; } @@ -112,10 +108,12 @@ .mw-search-createlink, .mw-search-exists { - padding: var( --space-sm ) var( --space-md ); - border-radius: var( --border-radius--small ); + // These can generate a empty card when there are no text content + // FIXME: re-enable when this is addressed in core + // padding: var( --space-sm ) var( --space-md ); + // background: var( --color-surface-2 ); + // border-radius: var( --border-radius--small ); margin-top: 0 !important; - background: var( --color-surface-2 ); color: var( --color-base--emphasized ); } @@ -151,6 +149,11 @@ .searchmatch { color: var( --color-base--emphasized ); font-weight: var( --font-weight-semibold ); + + a & { + // If searchmatch is part of the link (usually title), use link color + color: inherit; + } } .searchresults { From 224c190a475e5079e5e0e8332442643c5e2b571f Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 13 Dec 2022 16:51:49 -0500 Subject: [PATCH 02/35] =?UTF-8?q?feat(core):=20=E2=9C=A8=20do=20not=20set?= =?UTF-8?q?=20fieldset=20font=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/skins.citizen.styles/skinning/elements.less | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/skins.citizen.styles/skinning/elements.less b/resources/skins.citizen.styles/skinning/elements.less index aab95d17..09d59625 100644 --- a/resources/skins.citizen.styles/skinning/elements.less +++ b/resources/skins.citizen.styles/skinning/elements.less @@ -175,7 +175,6 @@ fieldset { padding: var( --space-xs ) var( --space-md ); border: 1px solid var( --border-color-base ); margin: var( --space-md ) 0; - font-size: 0.875rem; } legend { From 88fca93c469f7e2918b3b68a6a0381f4a3e5e800 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 13 Dec 2022 17:39:50 -0500 Subject: [PATCH 03/35] =?UTF-8?q?feat(AdvancedSearch):=20=E2=9C=A8=20updat?= =?UTF-8?q?e=20AdvancedSearch=20styles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- .../ext.advancedSearch.initialstyles.less | 12 +- .../ext.advancedSearch.styles.less | 103 +++++++++++++++--- .../mediawiki.special.search.styles.less | 9 -- 4 files changed, 97 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index bb978a20..515fdc66 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ OOUI | A | 0.44.3 | 2022-11-30 ### Extensions Name | Grade | Version | Last updated :--- | :--- | :--- | :--- -[AdvancedSearch](https://www.mediawiki.org/wiki/Extension:AdvancedSearch) | B | REL1_35 `fae6250` | 2021-08-26 +[AdvancedSearch](https://www.mediawiki.org/wiki/Extension:AdvancedSearch) | B | REL1_39 `3a0eed7` | 2022-12-12 [AJAXPoll](https://www.mediawiki.org/wiki/Extension:AJAXPoll) | A | REL1_39 `8429d8d` | 2022-10-25 [ApprovedRevs](https://www.mediawiki.org/wiki/Extension:Approved_Revs) | B | N/A | N/A [Babel](https://www.mediawiki.org/wiki/Extension:Babel) | B | MLEB 2021.07 | 2021-07-29 diff --git a/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.initialstyles.less b/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.initialstyles.less index 7af98fc4..0603f4ec 100644 --- a/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.initialstyles.less +++ b/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.initialstyles.less @@ -3,13 +3,21 @@ * * SkinStyles for Extension:AdvancedSearch * Module: ext.advancedSearch.initialstyles - * Version: REL1_35 fae6250 + * Version: REL1_39 3a0eed7 * - * Date: 2021-08-26 + * Date: 2022-12-12 */ .client-js { + .mw-search-form-wrapper { + // min-height: 122.6px; + } + .mw-search-spinner { + top: 5em; + // Very hacky since it might be wrong because of font size + left: 23em; + &:before, &:after, & .mw-search-spinner-bounce { diff --git a/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.styles.less b/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.styles.less index a7b93e6d..3f430d99 100644 --- a/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.styles.less +++ b/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.styles.less @@ -3,54 +3,123 @@ * * SkinStyles for Extension:AdvancedSearch * Module: ext.advancedSearch.styles - * Version: REL1_35 fae6250 + * Version: REL1_39 3a0eed7 * - * Date: 2021-08-26 + * Date: 2022-12-12 */ +.mw-advancedSearch-container { + border-bottom: 1px solid var( --border-color-base ); + margin-top: var( --space-xs ); +} + +// Align with Citizen label styles +.mw-advancedSearch-searchPreview-label, +.advancedsearch-namespacesPreview-label { + margin-right: var( --space-xs ); + color: var( --color-base--subtle ); + font-size: 0.875rem; + font-weight: var( --font-weight-normal ); + letter-spacing: 0.05em; +} + .mw-advancedSearch-fieldContainer { - border-color: var( --border-color-base ); - background: transparent; + max-width: none; + border: 0; + border-radius: var( --border-radius--small ); + margin-top: 0; + background: var( --color-surface-2 ); fieldset { - border-color: var( --border-color-base ); + border-top-color: var( --border-color-base ); + margin-top: var( --space-md ); } .oo-ui-labelElement > .oo-ui-fieldsetLayout-header > .oo-ui-labelElement-label { - background: var( --color-surface-0 ); // the parent containers are transparent + background: var( --color-surface-2 ); color: var( --color-base--subtle ); + font-size: 0.875rem; + font-weight: var( --font-weight-normal ); + letter-spacing: 0.05em; } } +.mw-advancedSearch-expandablePane-options, +.mw-advancedSearch-expandablePane-namespaces { + max-width: none; + padding-top: 0; // padding handled through container +} + .mw-advancedSearch-expandablePane-button { &.oo-ui-widget-enabled.oo-ui-buttonWidget { - &.oo-ui-buttonElement-pressed > .oo-ui-buttonElement-button { - background-color: var( --color-surface-2 ); + > .oo-ui-buttonElement-button { + padding-left: 0; + border-color: transparent; + background-color: transparent; + + &:hover { + background-color: var( --background-color-quiet--hover ); + color: inherit; + } + + // Added active state + &:active { + background-color: var( --background-color-quiet--active ); + } + + // HACK: Flip indicator when expanded + .oo-ui-indicator-down { + transition: opacity 100ms, transform 250ms ease; + } + + &[ aria-expanded='true' ] { + .oo-ui-indicator-down { + transform: rotate3d( 1, 0, 0, 180deg ); + } + } } - > .oo-ui-buttonElement-button { - &:hover { - background-color: var( --color-surface-2--hover ); - color: var( --color-base ); - } + &.oo-ui-buttonElement-pressed > .oo-ui-buttonElement-button { + background-color: transparent; } } } +.mw-advancedSearch-namespace-selection-header { + > .mw-advancedSearch-namespace-search-in-label { + font-weight: var( --font-weight-semibold ); + } +} + .mw-advancedSearch-namespace-selection { - border-color: var( --border-color-base ); + max-width: none; + border: 0; + border-radius: var( --border-radius--small ); + margin-top: 0; background: var( --color-surface-2 ); } .mw-advancedSearch-namespace-border { - border-color: var( --border-color-base ); + border-top: 1px solid var( --border-color-base ); + border-bottom: 0; +} + +.mw-advancedSearch-namespaceFilter.oo-ui-tagMultiselectWidget { + max-width: none; +} + +.mw-advancedSearch-namespaceFilter .oo-ui-tagMultiselectWidget-handle { + border-radius: 0 0 var( --border-radius--small ) var( --border-radius--small ); +} + +.mw-advancedSearch-namespaceFilter .oo-ui-tagMultiselectWidget-input .oo-ui-inputWidget-input { + background-color: var( --color-surface-0 ); } -// that's how nested the background-color property of a tagWidget is .oo-ui-tagMultiselectWidget.oo-ui-widget-enabled.oo-ui-tagMultiselectWidget-outlined .oo-ui-tagItemWidget.oo-ui-widget-enabled { &.selected { border-color: var( --color-primary ); - background-color: var( --color-surface-3 ); + background-color: var( --background-color-primary--hover ); } } diff --git a/skinStyles/mediawiki/special/mediawiki.special.search.styles.less b/skinStyles/mediawiki/special/mediawiki.special.search.styles.less index ecf77c2e..39855fdf 100644 --- a/skinStyles/mediawiki/special/mediawiki.special.search.styles.less +++ b/skinStyles/mediawiki/special/mediawiki.special.search.styles.less @@ -16,15 +16,6 @@ display: none; } -.mw-search-form-wrapper { - border-bottom: 1px solid var( --border-color-base ); - - // Wrapper has a border bottom already - .mw-search-profile-tabs:last-child { - border-bottom: 0; - } -} - #mw-search-top-table { display: flex; justify-content: space-between; From 351745374155fe292dd487f0e6f3ea6dd3782765 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 13 Dec 2022 17:43:01 -0500 Subject: [PATCH 04/35] =?UTF-8?q?fix(AdvancedSearch):=20=F0=9F=90=9B=201px?= =?UTF-8?q?=20layout=20shift=20in=20preloader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdvancedSearch/ext.advancedSearch.initialstyles.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.initialstyles.less b/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.initialstyles.less index 0603f4ec..fad9485e 100644 --- a/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.initialstyles.less +++ b/skinStyles/extensions/AdvancedSearch/ext.advancedSearch.initialstyles.less @@ -10,7 +10,7 @@ .client-js { .mw-search-form-wrapper { - // min-height: 122.6px; + min-height: 121.56px; // This is quite hacky } .mw-search-spinner { From 529fe221de103bf68302f06cf5a3e941f2206e04 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 13 Dec 2022 18:04:28 -0500 Subject: [PATCH 05/35] =?UTF-8?q?feat(core):=20=E2=9C=A8=20tweak=20notific?= =?UTF-8?q?ation=20styles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mediawiki/mediawiki.notification.less | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/skinStyles/mediawiki/mediawiki.notification.less b/skinStyles/mediawiki/mediawiki.notification.less index 54c8d815..ae32aea5 100644 --- a/skinStyles/mediawiki/mediawiki.notification.less +++ b/skinStyles/mediawiki/mediawiki.notification.less @@ -1,12 +1,23 @@ -@import '../../resources/variables.less'; +/* + * Citizen + * + * SkinStyles for MediaWiki notifications + * Module: mediawiki.notification + * Version: 1.39.0 + * + * Date: 2022-12-13 +*/ + +.mw-notification-area { + padding: var( --space-xs ); +} .mw-notification { - border-color: var( --border-color-base ); + border-color: transparent; border-radius: var( --border-radius--medium ); background-color: var( --color-surface-1 ); box-shadow: var( --box-shadow-dialog ); color: var( --color-base ); - font-size: 0.875rem; &.mw-notification-type { &-warn { From 074df5272c2cc7739967ded992b48e5bf45da806 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 13 Dec 2022 18:25:14 -0500 Subject: [PATCH 06/35] =?UTF-8?q?fix(search):=20=F0=9F=90=9B=20incorrect?= =?UTF-8?q?=20full=20text=20search=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skins.citizen.search.less | 11 +++++------ resources/skins.citizen.search/typeahead.js | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/resources/skins.citizen.search/skins.citizen.search.less b/resources/skins.citizen.search/skins.citizen.search.less index 73024cdf..caa45f69 100644 --- a/resources/skins.citizen.search/skins.citizen.search.less +++ b/resources/skins.citizen.search/skins.citizen.search.less @@ -107,6 +107,11 @@ font-weight: var( --font-weight-medium ); } + &__query { + color: var( --color-base--emphasized ); + font-weight: var( --font-weight-semibold ); + } + &__label { display: flex; margin-left: var( --space-xs ); @@ -166,12 +171,6 @@ height: var( --size-icon ); background-color: transparent; } - - &__description { - strong { - color: var( --color-base--emphasized ); - } - } } } diff --git a/resources/skins.citizen.search/typeahead.js b/resources/skins.citizen.search/typeahead.js index 785dcfeb..b204c2b1 100644 --- a/resources/skins.citizen.search/typeahead.js +++ b/resources/skins.citizen.search/typeahead.js @@ -363,19 +363,27 @@ function updateTypeahead( messages ) { const fulltextEl = document.getElementById( FULLTEXT_ID ), - highlightedQuery = '' + htmlSafeSearchQuery + '', - fulltextText = mw.message( 'citizen-search-fulltext', highlightedQuery ); + query = '' + htmlSafeSearchQuery + '', + fulltextLink = config.wgScriptPath + '/index.php?title=Special:Search&fulltext=1&search=' + htmlSafeSearchQuery, + fulltextText = mw.message( 'citizen-search-fulltext', query ); const item = getMenuItem( { icon: 'articleSearch', id: FULLTEXT_ID, - link: config.wgScriptPath + '/index.php?title=Special:Search&fulltext=1&search=' + htmlSafeSearchQuery, + link: fulltextLink, description: fulltextText } ); // Update existing element instead of creating a new one if ( fulltextEl ) { - updateMenuItem( fulltextEl, { description: fulltextText } ); + // FIXME: Probably more efficient to just replace the query than the whole messaage? + updateMenuItem( + fulltextEl, + { + link: fulltextLink, + description: fulltextText + } + ); // FIXME: There is probably a more efficient way if ( hasQuery ) { fulltextEl.classList.remove( HIDDEN_CLASS ); From 0ef78751a7f3618703dd2168478b17d012c25940 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 13 Dec 2022 23:26:15 +0000 Subject: [PATCH 07/35] =?UTF-8?q?ci:=20=F0=9F=91=B7=20lint=20code=20to=20M?= =?UTF-8?q?ediaWiki=20standards?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check commit and GitHub actions for more details --- resources/skins.citizen.search/typeahead.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/skins.citizen.search/typeahead.js b/resources/skins.citizen.search/typeahead.js index b204c2b1..bca5e7fd 100644 --- a/resources/skins.citizen.search/typeahead.js +++ b/resources/skins.citizen.search/typeahead.js @@ -377,9 +377,9 @@ function updateTypeahead( messages ) { // Update existing element instead of creating a new one if ( fulltextEl ) { // FIXME: Probably more efficient to just replace the query than the whole messaage? - updateMenuItem( + updateMenuItem( fulltextEl, - { + { link: fulltextLink, description: fulltextText } From 4d1225b96f3d8847e901eda4e816ebe1181ab280 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 13 Dec 2022 23:52:54 -0500 Subject: [PATCH 08/35] =?UTF-8?q?refactor(search):=20=E2=99=BB=EF=B8=8F=20?= =?UTF-8?q?simplify=20typeahead=20item=20styles=20and=20classes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skins.citizen.search.less | 97 ++++++++++--------- .../templates/typeahead.mustache | 2 +- resources/skins.citizen.search/typeahead.js | 30 +++--- 3 files changed, 68 insertions(+), 61 deletions(-) diff --git a/resources/skins.citizen.search/skins.citizen.search.less b/resources/skins.citizen.search/skins.citizen.search.less index caa45f69..b05bd46f 100644 --- a/resources/skins.citizen.search/skins.citizen.search.less +++ b/resources/skins.citizen.search/skins.citizen.search.less @@ -15,40 +15,13 @@ // Well this won't be loaded before .citizen-animation-ready anyways .citizen-card-transition(); - &__placeholder { - .citizen-typeahead { - &__content { - flex-direction: column; - padding: var( --space-xl ) 0; - text-align: center; - } - - &__thumbnail { - margin-bottom: var( --space-sm ); - } - } - } - &__item { - &--active { - background-color: var( --background-color-primary--hover ); - } - .citizen-typeahead { &__thumbnail { margin-right: var( --space-sm ); - background-color: #eaecf0; - background-position: center; - background-size: cover; &.citizen-ui-icon { - width: 70px; - height: 60px; - background-color: var( --color-surface-3 ); - - &:before { - background-size: 20px; - } + width: 100%; // reset width } } @@ -56,13 +29,61 @@ white-space: nowrap; } } - } - &__placeholder, - &__item { + &--active { + background-color: var( --background-color-primary--hover ); + } + &--hidden { display: none; } + + &--placeholder { + .citizen-typeahead { + &__content { + flex-direction: column; + padding: var( --space-xl ) 0; + text-align: center; + } + + &__thumbnail { + margin-bottom: var( --space-sm ); + } + } + } + + &--page { + .citizen-typeahead { + &__thumbnail { + background-color: #eaecf0; + background-position: center; + background-size: cover; + + &.citizen-ui-icon { + height: 60px; + background-color: var( --color-surface-3 ); + + &:before { + background-size: 20px; + } + } + } + } + } + + &--tool { + .citizen-typeahead { + &__content { + padding: var( --space-md ) 0; + border-top: 1px solid var( --border-color-base ); + } + + &__thumbnail { + height: var( --size-icon ); + background-color: transparent; + } + } + } } &__content { @@ -160,20 +181,6 @@ } } -#citizen-typeahead-fulltext { - .citizen-typeahead { - &__content { - padding: var( --space-md ) 0; - border-top: 1px solid var( --border-color-base ); - } - - &__thumbnail { - height: var( --size-icon ); - background-color: transparent; - } - } -} - // HACK: This is as close as we can to detect whether there is a keyboard in CSS @media ( hover: hover ) and ( pointer: fine ) { .citizen-typeahead { diff --git a/resources/skins.citizen.search/templates/typeahead.mustache b/resources/skins.citizen.search/templates/typeahead.mustache index dfb6c2d5..2093cc01 100644 --- a/resources/skins.citizen.search/templates/typeahead.mustache +++ b/resources/skins.citizen.search/templates/typeahead.mustache @@ -5,7 +5,7 @@
    {{! Empty state }} -
  1. +
  2. diff --git a/resources/skins.citizen.search/typeahead.js b/resources/skins.citizen.search/typeahead.js index bca5e7fd..d3829760 100644 --- a/resources/skins.citizen.search/typeahead.js +++ b/resources/skins.citizen.search/typeahead.js @@ -209,6 +209,7 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { results.forEach( ( result, index ) => { const data = { id: PREFIX + '-suggestion-' + index, + type: 'page', link: suggestionLinkPrefix + encodeURIComponent( result.key ), title: highlightTitle( result.title ), // Just to be safe, not sure if the default API is HTML escaped @@ -226,7 +227,7 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { fragment.append( getMenuItem( data ) ); } ); // Hide placeholder - placeholder.classList.add( PREFIX + '__placeholder--hidden' ); + placeholder.classList.add( PREFIX + '__item--hidden' ); typeahead.prepend( fragment ); } else { // Update placeholder with no result content @@ -234,11 +235,12 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { placeholder, { icon: 'articleNotFound', - class: PREFIX + '__placeholder ' + PREFIX + '__placeholder--noResult', + type: 'placeholder', title: mw.message( 'citizen-search-noresults-title', htmlSafeSearchQuery ).text(), description: mw.message( 'citizen-search-noresults-desc' ).text() } ); + placeholder.classList.remove( PREFIX + '__item--hidden' ); } }; @@ -290,10 +292,8 @@ function updateMenuItem( item, data ) { if ( data.id ) { item.setAttribute( 'id', data.id ); } - if ( data.class ) { - // So that it can overwrite the original class - // We use that in placeholder - item.setAttribute( 'class', data.class ); + if ( data.type ) { + item.classList.add( PREFIX + '__item--' + data.type ); } if ( data.link ) { const link = item.querySelector( '.' + PREFIX + '__content' ); @@ -354,7 +354,7 @@ function updateTypeahead( messages ) { searchQuery = searchInput.value, htmlSafeSearchQuery = mw.html.escape( searchQuery ), hasQuery = searchQuery.length > 0, - placeholder = typeahead.querySelector( '.' + PREFIX + '__placeholder' ); + placeholder = typeahead.querySelector( '.' + PREFIX + '__item--placeholder' ); const updateFullTextSearchItem = () => { const @@ -367,13 +367,6 @@ function updateTypeahead( messages ) { fulltextLink = config.wgScriptPath + '/index.php?title=Special:Search&fulltext=1&search=' + htmlSafeSearchQuery, fulltextText = mw.message( 'citizen-search-fulltext', query ); - const item = getMenuItem( { - icon: 'articleSearch', - id: FULLTEXT_ID, - link: fulltextLink, - description: fulltextText - } ); - // Update existing element instead of creating a new one if ( fulltextEl ) { // FIXME: Probably more efficient to just replace the query than the whole messaage? @@ -391,6 +384,13 @@ function updateTypeahead( messages ) { fulltextEl.classList.add( HIDDEN_CLASS ); } } else { + const item = getMenuItem( { + icon: 'articleSearch', + id: FULLTEXT_ID, + type: 'tool', + link: fulltextLink, + description: fulltextText + } ); typeahead.append( item ); } }; @@ -406,11 +406,11 @@ function updateTypeahead( messages ) { placeholder, { icon: 'articlesSearch', - class: PREFIX + '__placeholder ' + PREFIX + '__placeholder--noQuery', title: messages.searchsuggestSearch, description: messages.fulltextEmpty } ); + placeholder.classList.remove( PREFIX + '__item--hidden' ); } } From 6aa587635d030fca4f5fbe09c8060143adf44b52 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 00:45:43 -0500 Subject: [PATCH 09/35] =?UTF-8?q?refactor(search):=20=E2=99=BB=EF=B8=8F=20?= =?UTF-8?q?clean=20up=20clearSuggestion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/skins.citizen.search/typeahead.js | 87 ++++++++++----------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/resources/skins.citizen.search/typeahead.js b/resources/skins.citizen.search/typeahead.js index d3829760..fe167900 100644 --- a/resources/skins.citizen.search/typeahead.js +++ b/resources/skins.citizen.search/typeahead.js @@ -1,7 +1,8 @@ const config = require( './config.json' ), PREFIX = 'citizen-typeahead', - SEARCH_LOADING_CLASS = 'citizen-loading'; + SEARCH_LOADING_CLASS = 'citizen-loading', + HIDDEN_CLASS = PREFIX + '__item--hidden'; const activeIndex = { index: -1, @@ -123,29 +124,22 @@ function bindMouseHoverEvent( element ) { * @return {void} */ function clearSuggestions() { - const typeaheadItems = typeahead.children, - nonSuggestionCount = 3; + const typeaheadItems = typeahead.children; - if ( typeaheadItems.length > nonSuggestionCount ) { - // Splice would be cleaner but it is slower (?) - const fragment = new DocumentFragment(), - nonSuggestionItems = [ ...typeaheadItems ].slice( - typeaheadItems.length - nonSuggestionCount, typeaheadItems.length - ); + if ( typeaheadItems.length > 0 ) { + // Do all the work in document fragment then replace the whole list + // It is more performant this way + const + fragment = new DocumentFragment(), + template = document.getElementById( PREFIX + '-template' ); - nonSuggestionItems.forEach( ( item ) => { - fragment.append( item ); - } ); - - // TODO: Just use replaceChildren when browser support is >90% - if ( typeof typeahead.replaceChildren !== 'undefined' ) { - typeahead.replaceChildren( fragment ); - } else { - while ( typeahead.hasChildNodes() ) { - typeahead.removeChild( typeahead.lastChild ); + [ ...typeaheadItems ].forEach( ( item ) => { + if ( !item.classList.contains( PREFIX + '__item--page' ) ) { + fragment.append( item ); } - typeahead.appendChild( fragment ); - } + } ); + fragment.append( template ); + typeahead.replaceChildren( fragment ); } // Remove loading animation @@ -227,7 +221,7 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { fragment.append( getMenuItem( data ) ); } ); // Hide placeholder - placeholder.classList.add( PREFIX + '__item--hidden' ); + placeholder.classList.add( HIDDEN_CLASS ); typeahead.prepend( fragment ); } else { // Update placeholder with no result content @@ -240,7 +234,7 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { description: mw.message( 'citizen-search-noresults-desc' ).text() } ); - placeholder.classList.remove( PREFIX + '__item--hidden' ); + placeholder.classList.remove( HIDDEN_CLASS ); } }; @@ -356,46 +350,51 @@ function updateTypeahead( messages ) { hasQuery = searchQuery.length > 0, placeholder = typeahead.querySelector( '.' + PREFIX + '__item--placeholder' ); - const updateFullTextSearchItem = () => { + const updateToolItem = ( data ) => { const - FULLTEXT_ID = PREFIX + '-fulltext', - HIDDEN_CLASS = PREFIX + '__item--hidden'; - - const - fulltextEl = document.getElementById( FULLTEXT_ID ), + itemId = PREFIX + '-' + data.id, query = '' + htmlSafeSearchQuery + '', - fulltextLink = config.wgScriptPath + '/index.php?title=Special:Search&fulltext=1&search=' + htmlSafeSearchQuery, - fulltextText = mw.message( 'citizen-search-fulltext', query ); + itemLink = data.link + htmlSafeSearchQuery, + /* eslint-disable-next-line mediawiki/msg-doc */ + itemDesc = mw.message( data.msg, query ); + + let item = document.getElementById( itemId ); // Update existing element instead of creating a new one - if ( fulltextEl ) { + if ( item ) { // FIXME: Probably more efficient to just replace the query than the whole messaage? updateMenuItem( - fulltextEl, + item, { - link: fulltextLink, - description: fulltextText + link: itemLink, + description: itemDesc } ); // FIXME: There is probably a more efficient way if ( hasQuery ) { - fulltextEl.classList.remove( HIDDEN_CLASS ); + item.classList.remove( HIDDEN_CLASS ); } else { - fulltextEl.classList.add( HIDDEN_CLASS ); + item.classList.add( HIDDEN_CLASS ); } } else { - const item = getMenuItem( { - icon: 'articleSearch', - id: FULLTEXT_ID, + item = getMenuItem( { + icon: data.icon, + id: itemId, type: 'tool', - link: fulltextLink, - description: fulltextText + link: itemLink, + description: itemDesc } ); typeahead.append( item ); } }; - updateFullTextSearchItem(); + // Fulltext search + updateToolItem( { + id: 'fulltext', + link: config.wgScriptPath + '/index.php?title=Special:Search&fulltext=1&search=', + icon: 'articleSearch', + msg: 'citizen-search-fulltext' + } ); if ( hasQuery ) { getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ); @@ -410,7 +409,7 @@ function updateTypeahead( messages ) { description: messages.fulltextEmpty } ); - placeholder.classList.remove( PREFIX + '__item--hidden' ); + placeholder.classList.remove( HIDDEN_CLASS ); } } From 203b0b42c3a388684a51f231d993788632b92ae8 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 10:28:45 -0500 Subject: [PATCH 10/35] =?UTF-8?q?feat(search):=20=E2=9C=A8=20add=20MediaSe?= =?UTF-8?q?arch=20to=20typeahead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/bn.json | 66 ++++++++--------- i18n/ckb.json | 2 +- i18n/de.json | 2 +- i18n/en.json | 3 +- i18n/fr.json | 2 +- i18n/kk-cyrl.json | 2 +- i18n/ko.json | 2 +- i18n/lb.json | 44 ++++++------ i18n/mk.json | 2 +- i18n/nl.json | 72 +++++++++---------- i18n/pl.json | 2 +- i18n/pt-br.json | 2 +- i18n/pt.json | 2 +- i18n/qqq.json | 3 +- i18n/roa-tara.json | 2 +- i18n/ru.json | 2 +- i18n/sl.json | 2 +- i18n/tr.json | 2 +- i18n/uk.json | 2 +- i18n/yue.json | 2 +- i18n/zh-hans.json | 2 +- i18n/zh-hant.json | 2 +- i18n/zh-hk.json | 2 +- includes/Hooks/ResourceLoaderHooks.php | 2 + .../skins.citizen.search.less | 12 +++- .../templates/typeahead.mustache | 2 +- resources/skins.citizen.search/typeahead.js | 49 +++++++------ skin.json | 3 +- 28 files changed, 153 insertions(+), 139 deletions(-) diff --git a/i18n/bn.json b/i18n/bn.json index aa174d47..3588e002 100644 --- a/i18n/bn.json +++ b/i18n/bn.json @@ -1,33 +1,33 @@ -{ - "@metadata": { - "authors": [ - "R4356th", - "আফতাবুজ্জামান" - ] - }, - "skinname-citizen": "সিটিজেন", - "citizen-prefs-talkpage": "[[mw:Skin_talk:Citizen|আলোচনা]]", - "citizen.js": "/* এখানের সকল জাভাস্ক্রিপ্ট সিটিজেন আবরণের ব্যবহারকারীদের জন্য লোড হবে */", - "citizen-sitestats-articles-label": "টি নিবন্ধ", - "citizen-sitestats-images-label": "টি ফাইল", - "citizen-sitestats-users-label": "জন ব্যবহারকারী", - "citizen-sitestats-edits-label": "টি সম্পাদনা", - "citizen-footer-desc": "[[MediaWiki:Citizen-footer-desc]]-এ এই লেখা সম্পাদনা করুন", - "citizen-footer-tagline": "[[MediaWiki:Citizen-footer-tagline]]-এ এই লেখা সম্পাদনা করুন", - "citizen-action-addsection": "আলোচনা যোগ করুন", - "citizen-jumptotop": "উপরে চলুন", - "citizen-search-fulltext": "এটি থাকা পাতাগুলিতে অনুসন্ধান করুন:", - "citizen-search-fulltext-empty": "অনুসন্ধান শুরু করতে কিছু লিখুন", - "citizen-tagline-ns-mediawiki": "মিডিয়াউইকি ইন্টারফেস পাতা", - "citizen-tagline-ns-template": "টেমপ্লেট পাতা", - "citizen-tagline-ns-help": "সাহায্য পাতা", - "citizen-tagline-ns-category": "বিষয়শ্রেণীর পাতা", - "prefs-citizen-theme-label": "থিম", - "prefs-citizen-theme-option-auto": "স্বয়ংক্রিয়", - "prefs-citizen-theme-option-light": "উজ্জ্বল", - "prefs-citizen-theme-option-dark": "কালো", - "prefs-citizen-fontsize-label": "ফন্টের আকার", - "prefs-citizen-pagewidth-label": "পাতার প্রস্থ", - "prefs-citizen-lineheight-label": "লাইনের উচ্চতা", - "prefs-citizen-resetbutton-label": "পূর্বনির্ধারিত অবস্থায় যান" -} +{ + "@metadata": { + "authors": [ + "R4356th", + "আফতাবুজ্জামান" + ] + }, + "skinname-citizen": "সিটিজেন", + "citizen-prefs-talkpage": "[[mw:Skin_talk:Citizen|আলোচনা]]", + "citizen.js": "/* এখানের সকল জাভাস্ক্রিপ্ট সিটিজেন আবরণের ব্যবহারকারীদের জন্য লোড হবে */", + "citizen-sitestats-articles-label": "টি নিবন্ধ", + "citizen-sitestats-images-label": "টি ফাইল", + "citizen-sitestats-users-label": "জন ব্যবহারকারী", + "citizen-sitestats-edits-label": "টি সম্পাদনা", + "citizen-footer-desc": "[[MediaWiki:Citizen-footer-desc]]-এ এই লেখা সম্পাদনা করুন", + "citizen-footer-tagline": "[[MediaWiki:Citizen-footer-tagline]]-এ এই লেখা সম্পাদনা করুন", + "citizen-action-addsection": "আলোচনা যোগ করুন", + "citizen-jumptotop": "উপরে চলুন", + "citizen-search-fulltext": "এটি থাকা পাতাগুলিতে অনুসন্ধান করুন:", + "citizen-search-empty-desc": "অনুসন্ধান শুরু করতে কিছু লিখুন", + "citizen-tagline-ns-mediawiki": "মিডিয়াউইকি ইন্টারফেস পাতা", + "citizen-tagline-ns-template": "টেমপ্লেট পাতা", + "citizen-tagline-ns-help": "সাহায্য পাতা", + "citizen-tagline-ns-category": "বিষয়শ্রেণীর পাতা", + "prefs-citizen-theme-label": "থিম", + "prefs-citizen-theme-option-auto": "স্বয়ংক্রিয়", + "prefs-citizen-theme-option-light": "উজ্জ্বল", + "prefs-citizen-theme-option-dark": "কালো", + "prefs-citizen-fontsize-label": "ফন্টের আকার", + "prefs-citizen-pagewidth-label": "পাতার প্রস্থ", + "prefs-citizen-lineheight-label": "লাইনের উচ্চতা", + "prefs-citizen-resetbutton-label": "পূর্বনির্ধারিত অবস্থায় যান" +} diff --git a/i18n/ckb.json b/i18n/ckb.json index e4aa3cca..12d04f8b 100644 --- a/i18n/ckb.json +++ b/i18n/ckb.json @@ -20,7 +20,7 @@ "citizen-action-addsection": "بابەت دابنێ", "citizen-jumptotop": "گەڕانەوە بۆ سەرەوە", "citizen-search-fulltext": "گەڕان لە ناوەڕۆکی لاپەڕەکان", - "citizen-search-fulltext-empty": "بنوسە بۆ گەڕان", + "citizen-search-empty-desc": "بنوسە بۆ گەڕان", "citizen-tagline-ns-talk": "لاپەڕەی گفتوگۆی {{SUBJECTPAGENAME}}", "citizen-tagline-ns-project": "زانیاری لەبارەی {{SITENAME}}", "citizen-tagline-ns-file": "پەڕگە لەسەر {{SITENAME}}", diff --git a/i18n/de.json b/i18n/de.json index 8fb51fa6..08dece79 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -32,7 +32,7 @@ "citizen-action-addsection": "Thema hinzufügen", "citizen-jumptotop": "Zurück nach oben", "citizen-search-fulltext": "Suche nach Seiten mit", - "citizen-search-fulltext-empty": "Tippe, um zu suchen zu beginnen", + "citizen-search-empty-desc": "Tippe, um zu suchen zu beginnen", "citizen-tagline-ns-talk": "Diskussionsseite von {{SUBJECTPAGENAME}}", "citizen-tagline-ns-project": "Informationen über {{SITENAME}}", "citizen-tagline-ns-file": "Datei auf {{SITENAME}}", diff --git a/i18n/en.json b/i18n/en.json index fa77d879..2bb6565d 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -27,7 +27,8 @@ "citizen-action-addsection": "Add topic", "citizen-jumptotop": "Back to top", "citizen-search-fulltext": "Search for pages containing $1", - "citizen-search-fulltext-empty": "Type to start searching", + "citizen-search-mediasearch": "Search for media related to $1", + "citizen-search-empty-desc": "Type to start searching", "citizen-search-noresults-title": "Uh oh! No results for $1", "citizen-search-noresults-desc": "Maybe try the options below?", "citizen-tagline-ns-talk": "Discussion page of {{SUBJECTPAGENAME}}", diff --git a/i18n/fr.json b/i18n/fr.json index 6d6d61c0..b4418744 100644 --- a/i18n/fr.json +++ b/i18n/fr.json @@ -29,7 +29,7 @@ "citizen-action-addsection": "Ajouter un sujet", "citizen-jumptotop": "Retour au début", "citizen-search-fulltext": "Rechercher les pages contenant $1", - "citizen-search-fulltext-empty": "Taper pour commencer la recherche", + "citizen-search-empty-desc": "Taper pour commencer la recherche", "citizen-search-noresults-title": "Oh oh ! Aucun résultat pour $1", "citizen-search-noresults-desc": "Essayer peut-être les options ci-dessous ?", "citizen-tagline-ns-talk": "Page de discussion de {{SUBJECTPAGENAME}}", diff --git a/i18n/kk-cyrl.json b/i18n/kk-cyrl.json index 53c24202..974d546e 100644 --- a/i18n/kk-cyrl.json +++ b/i18n/kk-cyrl.json @@ -27,7 +27,7 @@ "citizen-action-addsection": "Тақырып қосу", "citizen-jumptotop": "Жоғары қайту", "citizen-search-fulltext": "Осы сөз(дер) бар беттерді іздеу", - "citizen-search-fulltext-empty": "Іздей бастау үшін теріңіз", + "citizen-search-empty-desc": "Іздей бастау үшін теріңіз", "citizen-tagline-ns-talk": "{{SUBJECTPAGENAME}} дегеннің талқылау беті", "citizen-tagline-ns-project": "{{SITENAME}} туралы мәлімет", "citizen-tagline-ns-file": "{{SITENAME}} жобасындағы файл", diff --git a/i18n/ko.json b/i18n/ko.json index 9b57269d..c66f270e 100644 --- a/i18n/ko.json +++ b/i18n/ko.json @@ -17,7 +17,7 @@ "citizen-page-info-lastmod": "마지막 수정", "citizen-action-addsection": "주제 추가", "citizen-jumptotop": "맨 위로 돌아가기", - "citizen-search-fulltext-empty": "검색을 시작하려면 입력하세요", + "citizen-search-empty-desc": "검색을 시작하려면 입력하세요", "prefs-citizen-theme-label": "테마", "prefs-citizen-theme-option-auto": "자동", "prefs-citizen-theme-option-light": "밝음", diff --git a/i18n/lb.json b/i18n/lb.json index e0cc23d7..e2312a75 100644 --- a/i18n/lb.json +++ b/i18n/lb.json @@ -1,22 +1,22 @@ -{ - "@metadata": { - "authors": [ - "Robby" - ] - }, - "skinname-citizen": "Citizen", - "citizen-languages-toggle": "Méi Sproochen", - "citizen-actions-more-toggle": "Méi Aktiounen", - "citizen-sitestats-articles-label": "Artikelen", - "citizen-sitestats-images-label": "Fichieren", - "citizen-sitestats-users-label": "Benotzer", - "citizen-sitestats-edits-label": "Ännerungen", - "citizen-jumptotop": "Zréck no uewen", - "citizen-search-fulltext-empty": "Tippt fir unzefänke mat sichen", - "citizen-tagline-ns-help": "Hëllef-Säit", - "prefs-citizen-theme-option-light": "Hell", - "prefs-citizen-theme-option-dark": "Däischter", - "prefs-citizen-fontsize-label": "Schrëftgréisst", - "prefs-citizen-pagewidth-label": "Breet vun der Säit", - "prefs-citizen-resetbutton-label": "Op de Standard zrécksetzen" -} +{ + "@metadata": { + "authors": [ + "Robby" + ] + }, + "skinname-citizen": "Citizen", + "citizen-languages-toggle": "Méi Sproochen", + "citizen-actions-more-toggle": "Méi Aktiounen", + "citizen-sitestats-articles-label": "Artikelen", + "citizen-sitestats-images-label": "Fichieren", + "citizen-sitestats-users-label": "Benotzer", + "citizen-sitestats-edits-label": "Ännerungen", + "citizen-jumptotop": "Zréck no uewen", + "citizen-search-empty-desc": "Tippt fir unzefänke mat sichen", + "citizen-tagline-ns-help": "Hëllef-Säit", + "prefs-citizen-theme-option-light": "Hell", + "prefs-citizen-theme-option-dark": "Däischter", + "prefs-citizen-fontsize-label": "Schrëftgréisst", + "prefs-citizen-pagewidth-label": "Breet vun der Säit", + "prefs-citizen-resetbutton-label": "Op de Standard zrécksetzen" +} diff --git a/i18n/mk.json b/i18n/mk.json index 15362cc0..f177b3cc 100644 --- a/i18n/mk.json +++ b/i18n/mk.json @@ -26,7 +26,7 @@ "citizen-action-addsection": "Додај тема", "citizen-jumptotop": "Најгоре", "citizen-search-fulltext": "Пребарај страници што содржат $1", - "citizen-search-fulltext-empty": "Внесете текст за да почнете да пребарувате", + "citizen-search-empty-desc": "Внесете текст за да почнете да пребарувате", "citizen-search-noresults-title": "За жал, не најдов ништо за $1", "citizen-search-noresults-desc": "Да ги пробаме можностите подолу?", "citizen-tagline-ns-talk": "Разговорна страница на {{SUBJECTPAGENAME}}", diff --git a/i18n/nl.json b/i18n/nl.json index e6acc2a4..85dc3056 100644 --- a/i18n/nl.json +++ b/i18n/nl.json @@ -1,36 +1,36 @@ -{ - "@metadata": { - "authors": [ - "Mainframe98", - "McDutchie", - "Romaine" - ] - }, - "citizen.css": "/* CSS die hier wordt geplaatst heeft alleen invloed op het uiterlijk Citizen */", - "citizen.js": "/* JavaScript die hier wordt geplaatst heeft alleen invloed op gebruikers die het uiterlijk Citizen gebruiken */", - "citizen-sitestats-articles-label": "artikelen", - "citizen-sitestats-images-label": "bestanden", - "citizen-sitestats-users-label": "gebruikers", - "citizen-sitestats-edits-label": "bewerkingen", - "citizen-page-info-copyright": "Auteursrechten", - "citizen-page-info-credits": "Naamsvermeldingen", - "citizen-page-info-lastmod": "Laatste wijziging", - "citizen-footer-desc": "Bewerk deze tekst op [[MediaWiki:Citizen-footer-desc]]", - "citizen-footer-tagline": "Bewerk deze tekst op [[MediaWiki:Citizen-footer-tagline]]", - "citizen-action-addsection": "Onderwerp toevoegen", - "citizen-jumptotop": "Terug naar boven", - "citizen-search-fulltext-empty": "Type om te beginnen met zoeken", - "citizen-tagline-ns-talk": "Overlegpagina van {{SUBJECTPAGENAME}}", - "citizen-tagline-ns-project": "Informatie over {{SITENAME}}", - "citizen-tagline-ns-file": "Bestand op {{SITENAME}}", - "citizen-tagline-ns-template": "Sjabloonpagina", - "citizen-tagline-ns-help": "Hulppagina", - "citizen-tagline-ns-category": "Categoriepagina", - "prefs-citizen-theme-label": "Thema", - "prefs-citizen-theme-option-auto": "Automatisch", - "prefs-citizen-theme-option-light": "Licht", - "prefs-citizen-theme-option-dark": "Donker", - "prefs-citizen-fontsize-label": "Lettergrootte", - "prefs-citizen-pagewidth-label": "Paginabreedte", - "prefs-citizen-lineheight-label": "Lijnhoogte" -} +{ + "@metadata": { + "authors": [ + "Mainframe98", + "McDutchie", + "Romaine" + ] + }, + "citizen.css": "/* CSS die hier wordt geplaatst heeft alleen invloed op het uiterlijk Citizen */", + "citizen.js": "/* JavaScript die hier wordt geplaatst heeft alleen invloed op gebruikers die het uiterlijk Citizen gebruiken */", + "citizen-sitestats-articles-label": "artikelen", + "citizen-sitestats-images-label": "bestanden", + "citizen-sitestats-users-label": "gebruikers", + "citizen-sitestats-edits-label": "bewerkingen", + "citizen-page-info-copyright": "Auteursrechten", + "citizen-page-info-credits": "Naamsvermeldingen", + "citizen-page-info-lastmod": "Laatste wijziging", + "citizen-footer-desc": "Bewerk deze tekst op [[MediaWiki:Citizen-footer-desc]]", + "citizen-footer-tagline": "Bewerk deze tekst op [[MediaWiki:Citizen-footer-tagline]]", + "citizen-action-addsection": "Onderwerp toevoegen", + "citizen-jumptotop": "Terug naar boven", + "citizen-search-empty-desc": "Type om te beginnen met zoeken", + "citizen-tagline-ns-talk": "Overlegpagina van {{SUBJECTPAGENAME}}", + "citizen-tagline-ns-project": "Informatie over {{SITENAME}}", + "citizen-tagline-ns-file": "Bestand op {{SITENAME}}", + "citizen-tagline-ns-template": "Sjabloonpagina", + "citizen-tagline-ns-help": "Hulppagina", + "citizen-tagline-ns-category": "Categoriepagina", + "prefs-citizen-theme-label": "Thema", + "prefs-citizen-theme-option-auto": "Automatisch", + "prefs-citizen-theme-option-light": "Licht", + "prefs-citizen-theme-option-dark": "Donker", + "prefs-citizen-fontsize-label": "Lettergrootte", + "prefs-citizen-pagewidth-label": "Paginabreedte", + "prefs-citizen-lineheight-label": "Lijnhoogte" +} diff --git a/i18n/pl.json b/i18n/pl.json index cc0e5d90..f05558d2 100644 --- a/i18n/pl.json +++ b/i18n/pl.json @@ -26,7 +26,7 @@ "citizen-action-addsection": "Dodaj temat", "citizen-jumptotop": "Powrót do góry", "citizen-search-fulltext": "Szukaj stron zawierających tekst $1", - "citizen-search-fulltext-empty": "Zacznij pisać, aby wyszukiwać", + "citizen-search-empty-desc": "Zacznij pisać, aby wyszukiwać", "citizen-search-noresults-title": "O nie! Nie ma wyników dla $1", "citizen-search-noresults-desc": "Może wypróbuj poniższe opcje?", "citizen-tagline-ns-talk": "Strona dyskusji o „{{SUBJECTPAGENAME}}”", diff --git a/i18n/pt-br.json b/i18n/pt-br.json index 69fce1fe..7b8ffc4c 100644 --- a/i18n/pt-br.json +++ b/i18n/pt-br.json @@ -30,7 +30,7 @@ "citizen-action-addsection": "Adicionar tópico", "citizen-jumptotop": "Voltar ao topo", "citizen-search-fulltext": "Pesquisar por páginas que contenham", - "citizen-search-fulltext-empty": "Tipo para começar a pesquisar", + "citizen-search-empty-desc": "Tipo para começar a pesquisar", "citizen-search-noresults-title": "Uh oh! Nenhum resultado para $1", "citizen-search-noresults-desc": "Talvez tente as opções abaixo?", "citizen-tagline-ns-talk": "Página de discussão de {{SUBJECTPAGENAME}}", diff --git a/i18n/pt.json b/i18n/pt.json index 18071139..6354416f 100644 --- a/i18n/pt.json +++ b/i18n/pt.json @@ -26,7 +26,7 @@ "citizen-action-addsection": "Adicionar tópico", "citizen-jumptotop": "Voltar ao topo", "citizen-search-fulltext": "Procurar páginas que contenham $1", - "citizen-search-fulltext-empty": "Escrever para começar a procurar", + "citizen-search-empty-desc": "Escrever para começar a procurar", "citizen-search-noresults-title": "Não há resultados para $1", "citizen-search-noresults-desc": "Talvez queira tentar as opções abaixo?", "citizen-tagline-ns-talk": "Página de discussão de {{SUBJECTPAGENAME}}", diff --git a/i18n/qqq.json b/i18n/qqq.json index 247e0ea6..23f54e61 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -29,7 +29,8 @@ "citizen-action-addsection": "Used in the Citizen skin. See for example {{canonicalurl:Talk:Main_Page|useskin=vector}}\n{{Identical|Add topic}}. Same as vector-action-addsection in Vector skin.", "citizen-jumptotop": "Label for link to jump to top of page", "citizen-search-fulltext": "Fulltext search suggestion", - "citizen-search-fulltext-empty": "Helper text in the search suggestion when there are no search query", + "citizen-search-mediasearch": "MediaSearch suggestion", + "citizen-search-empty-desc": "Helper text in the search suggestion when there are no search query", "citizen-search-noresults-title": "Title in the search suggestion when there are no search results", "citizen-search-noresults-desc": "Description in the search suggestion when there are no search results", "citizen-tagline-ns-talk": "Tagline for pages in talk namespace", diff --git a/i18n/roa-tara.json b/i18n/roa-tara.json index 6125b78d..000b1833 100644 --- a/i18n/roa-tara.json +++ b/i18n/roa-tara.json @@ -20,7 +20,7 @@ "citizen-action-addsection": "Aggiunge 'n'argomende", "citizen-jumptotop": "Tuèrne sus", "citizen-search-fulltext": "Cirche le pàggene ca tènene", - "citizen-search-fulltext-empty": "Scrive pe accumenzà 'a recerche", + "citizen-search-empty-desc": "Scrive pe accumenzà 'a recerche", "citizen-tagline-ns-talk": "Pàgene de le 'ngazzaminde de {{SUBJECTPAGENAME}}", "citizen-tagline-ns-project": "'Mbormaizune sus a {{SITENAME}}", "citizen-tagline-ns-file": "Fail sus a {{SITENAME}}", diff --git a/i18n/ru.json b/i18n/ru.json index 12e79525..776e0f0c 100644 --- a/i18n/ru.json +++ b/i18n/ru.json @@ -27,7 +27,7 @@ "citizen-action-addsection": "Добавить тему", "citizen-jumptotop": "Вернуться наверх", "citizen-search-fulltext": "Поиск страниц, содержащих", - "citizen-search-fulltext-empty": "Введите текст", + "citizen-search-empty-desc": "Введите текст", "citizen-tagline-ns-talk": "Обсуждение страницы {{SUBJECTPAGENAME}}", "citizen-tagline-ns-project": "Информация о {{SITENAME}}", "citizen-tagline-ns-file": "Файл на {{SITENAME}}", diff --git a/i18n/sl.json b/i18n/sl.json index de4c2762..54f215be 100644 --- a/i18n/sl.json +++ b/i18n/sl.json @@ -26,7 +26,7 @@ "citizen-action-addsection": "Dodaj temo", "citizen-jumptotop": "Nazaj na vrh", "citizen-search-fulltext": "Poiščite strani, ki vsebujejo $1", - "citizen-search-fulltext-empty": "Vnesite za začetek iskanja", + "citizen-search-empty-desc": "Vnesite za začetek iskanja", "citizen-search-noresults-title": "Ojoj! Ni zadetkov za $1", "citizen-search-noresults-desc": "Morda poskusite s spodnjimi možnostmi?", "citizen-tagline-ns-talk": "Pogovorna stran {{SUBJECTPAGENAME}}", diff --git a/i18n/tr.json b/i18n/tr.json index 5560c1ff..d71299b3 100644 --- a/i18n/tr.json +++ b/i18n/tr.json @@ -29,7 +29,7 @@ "citizen-action-addsection": "Konu ekle", "citizen-jumptotop": "Başa dön", "citizen-search-fulltext": "İçeren sayfaları ara", - "citizen-search-fulltext-empty": "Aramaya başlamak için yazın", + "citizen-search-empty-desc": "Aramaya başlamak için yazın", "citizen-tagline-ns-talk": "{{SUBJECTPAGENAME}} tartışma sayfası", "citizen-tagline-ns-project": "{{SITENAME}} hakkında bilgi", "citizen-tagline-ns-file": "{{SITENAME}} sitesindeki dosya", diff --git a/i18n/uk.json b/i18n/uk.json index e1c19ae0..e5964b1f 100644 --- a/i18n/uk.json +++ b/i18n/uk.json @@ -22,7 +22,7 @@ "citizen-action-addsection": "Додати тему", "citizen-jumptotop": "Повернутись угору", "citizen-search-fulltext": "Пошук сторінок, що містять", - "citizen-search-fulltext-empty": "Введіть, щоб почати пошук", + "citizen-search-empty-desc": "Введіть, щоб почати пошук", "citizen-tagline-ns-talk": "Сторінка обговорення {{SUBJECTPAGENAME}}", "citizen-tagline-ns-project": "Інформація про {{SITENAME}}", "citizen-tagline-ns-file": "Файл на {{SITENAME}}", diff --git a/i18n/yue.json b/i18n/yue.json index 7b40d2dd..77ae0b52 100644 --- a/i18n/yue.json +++ b/i18n/yue.json @@ -27,7 +27,7 @@ "citizen-action-addsection": "加主題", "citizen-jumptotop": "返到上面", "citizen-search-fulltext": "喺每頁入面喥搵$1", - "citizen-search-fulltext-empty": "打字開始搵", + "citizen-search-empty-desc": "打字開始搵", "citizen-tagline-ns-talk": "{{SUBJECTPAGENAME}}嘅討論頁", "citizen-tagline-ns-project": "關於{{SITENAME}}嘅資料", "citizen-tagline-ns-file": "喺{{SITENAME}}嘅檔案", diff --git a/i18n/zh-hans.json b/i18n/zh-hans.json index eca28e99..59c9f1ac 100644 --- a/i18n/zh-hans.json +++ b/i18n/zh-hans.json @@ -34,7 +34,7 @@ "citizen-action-addsection": "添加话题", "citizen-jumptotop": "回到顶部", "citizen-search-fulltext": "搜索包含“$1”的页面", - "citizen-search-fulltext-empty": "键入以开始搜索", + "citizen-search-empty-desc": "键入以开始搜索", "citizen-search-noresults-title": "抱歉!没有找到“$1”的搜索结果", "citizen-search-noresults-desc": "也许可以试试下面的选项?", "citizen-tagline-ns-talk": "{{SUBJECTPAGENAME}}的讨论页", diff --git a/i18n/zh-hant.json b/i18n/zh-hant.json index a3b6ebe0..c852c41a 100644 --- a/i18n/zh-hant.json +++ b/i18n/zh-hant.json @@ -32,7 +32,7 @@ "citizen-action-addsection": "新增話題", "citizen-jumptotop": "返回頂端", "citizen-search-fulltext": "搜尋包含「$1」的頁面:", - "citizen-search-fulltext-empty": "輸入以開始搜尋", + "citizen-search-empty-desc": "輸入以開始搜尋", "citizen-search-noresults-title": "呃哦! $1沒有結果", "citizen-search-noresults-desc": "也許試試下面的選項?", "citizen-tagline-ns-talk": "{{SUBJECTPAGENAME}}的討論頁", diff --git a/i18n/zh-hk.json b/i18n/zh-hk.json index 2d60ce3f..806d48c3 100644 --- a/i18n/zh-hk.json +++ b/i18n/zh-hk.json @@ -27,7 +27,7 @@ "citizen-action-addsection": "新增話題", "citizen-jumptotop": "返回頂端", "citizen-search-fulltext": "搜尋包含", - "citizen-search-fulltext-empty": "輸入開始搜尋", + "citizen-search-empty-desc": "輸入開始搜尋", "citizen-tagline-ns-talk": "{{SUBJECTPAGENAME}}的討論頁面", "citizen-tagline-ns-project": "關於{{SITENAME}}的資訊", "citizen-tagline-ns-file": "{{SITENAME}}上的檔案", diff --git a/includes/Hooks/ResourceLoaderHooks.php b/includes/Hooks/ResourceLoaderHooks.php index 52212282..0c79abf8 100644 --- a/includes/Hooks/ResourceLoaderHooks.php +++ b/includes/Hooks/ResourceLoaderHooks.php @@ -26,6 +26,7 @@ declare( strict_types=1 ); namespace MediaWiki\Skins\Citizen\Hooks; use Config; +use ExtensionRegistry; use MediaWiki\ResourceLoader as RL; /** @@ -79,6 +80,7 @@ class ResourceLoaderHooks { 'wgCitizenMaxSearchResults' => $config->get( 'CitizenMaxSearchResults' ), 'wgScriptPath' => $config->get( 'ScriptPath' ), 'wgSearchSuggestCacheExpiry' => $config->get( 'SearchSuggestCacheExpiry' ), + 'isMediaSearchExtensionEnabled' => ExtensionRegistry::getInstance()->isLoaded( 'MediaSearch' ), ]; } } diff --git a/resources/skins.citizen.search/skins.citizen.search.less b/resources/skins.citizen.search/skins.citizen.search.less index b05bd46f..8d566ab3 100644 --- a/resources/skins.citizen.search/skins.citizen.search.less +++ b/resources/skins.citizen.search/skins.citizen.search.less @@ -74,7 +74,7 @@ &--tool { .citizen-typeahead { &__content { - padding: var( --space-md ) 0; + padding: var( --space-sm ) 0; border-top: 1px solid var( --border-color-base ); } @@ -82,6 +82,16 @@ height: var( --size-icon ); background-color: transparent; } + + &__description { + color: var( --color-base ); + } + } + + + .citizen-typeahead__item--tool { + .citizen-typeahead__content { + border-top: 0; + } } } } diff --git a/resources/skins.citizen.search/templates/typeahead.mustache b/resources/skins.citizen.search/templates/typeahead.mustache index 2093cc01..10d8968d 100644 --- a/resources/skins.citizen.search/templates/typeahead.mustache +++ b/resources/skins.citizen.search/templates/typeahead.mustache @@ -10,7 +10,7 @@
    {{msg-searchsuggest-search}}
    -
    {{msg-citizen-search-fulltext-empty}}
    +
    {{msg-citizen-search-empty-desc}}
  3. diff --git a/resources/skins.citizen.search/typeahead.js b/resources/skins.citizen.search/typeahead.js index fe167900..c82f9e9b 100644 --- a/resources/skins.citizen.search/typeahead.js +++ b/resources/skins.citizen.search/typeahead.js @@ -8,7 +8,7 @@ const activeIndex = { index: -1, max: config.wgCitizenMaxSearchResults + 1, setMax: function ( x ) { - this.max = x + 1; + this.max = x; }, increment: function ( i ) { this.index += i; @@ -91,18 +91,6 @@ function keyboardEvents( event ) { } } -/* - * Attach mouse eventlistener to all typeahead items - * - * @return {void} - */ -function attachMouseListener() { - const items = typeahead.querySelectorAll( '.' + PREFIX + '__item' ); - items.forEach( ( item ) => { - bindMouseHoverEvent( item ); - } ); -} - /* * Bind mouseenter and mouseleave event to reproduce mouse hover event * @@ -180,7 +168,10 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { cleanTitle = cleanup( title ), cleanMatchedTitle = cleanup( matchedTitle ); - return !( cleanTitle.includes( cleanMatchedTitle ) || cleanMatchedTitle.includes( cleanTitle ) ); + return !( + cleanTitle.includes( cleanMatchedTitle ) || + cleanMatchedTitle.includes( cleanTitle ) + ); }; let html = ''; @@ -260,9 +251,7 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { clearSuggestions(); if ( results !== null ) { renderSuggestions( results ); - attachMouseListener(); } - activeIndex.setMax( results.length ); } ).catch( ( error ) => { searchInput.removeEventListener( 'input', abortFetch ); searchInput.parentNode.classList.remove( SEARCH_LOADING_CLASS ); @@ -334,6 +323,7 @@ function getMenuItem( data ) { fragment = template.content.cloneNode( true ), item = fragment.querySelector( '.' + PREFIX + '__item' ); updateMenuItem( item, data ); + bindMouseHoverEvent( item ); return fragment; } @@ -396,6 +386,16 @@ function updateTypeahead( messages ) { msg: 'citizen-search-fulltext' } ); + // MediaSearch + if ( config.isMediaSearchExtensionEnabled ) { + updateToolItem( { + id: 'mediasearch', + link: config.wgScriptPath + '/index.php?title=Special:MediaSearch&search=', + icon: 'imageGallery', + msg: 'citizen-search-mediasearch' + } ); + } + if ( hasQuery ) { getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ); } else { @@ -405,12 +405,14 @@ function updateTypeahead( messages ) { placeholder, { icon: 'articlesSearch', - title: messages.searchsuggestSearch, - description: messages.fulltextEmpty + title: messages.emptyTitle, + description: messages.emptyDesc } ); placeholder.classList.remove( HIDDEN_CLASS ); } + // -1 as there is a template element + activeIndex.setMax( typeahead.children.length - 1 ); } /** @@ -423,16 +425,16 @@ function initTypeahead( searchForm, input ) { const messages = { - fulltextEmpty: mw.message( 'citizen-search-fulltext-empty' ).text(), - searchsuggestSearch: mw.message( 'searchsuggest-search' ).text() + emptyTitle: mw.message( 'searchsuggest-search' ).text(), + emptyDesc: mw.message( 'citizen-search-empty-desc' ).text() }, template = mw.template.get( 'skins.citizen.search', 'resources/skins.citizen.search/templates/typeahead.mustache' ), data = { - 'msg-citizen-search-fulltext-empty': messages.fulltextEmpty, - 'msg-searchsuggest-search': messages.searchsuggestSearch + 'msg-searchsuggest-search': messages.emptyTitle, + 'msg-citizen-search-empty-desc': messages.emptyDesc }; const onBlur = ( event ) => { @@ -467,9 +469,6 @@ function initTypeahead( searchForm, input ) { searchInput.setAttribute( 'aria-autocomplete', 'list' ); searchInput.setAttribute( 'aria-controls', 'searchform-suggestions' ); - // Attach mouse listener to inital typeahead items - attachMouseListener(); - // Since searchInput is focused before the event listener is set up onFocus(); searchInput.addEventListener( 'focus', onFocus ); diff --git a/skin.json b/skin.json index aa265446..942ea347 100644 --- a/skin.json +++ b/skin.json @@ -159,7 +159,8 @@ ], "messages": [ "citizen-search-fulltext", - "citizen-search-fulltext-empty", + "citizen-search-mediasearch", + "citizen-search-empty-desc", "citizen-search-noresults-title", "citizen-search-noresults-desc", "search-redirect", From c2da5c5ade34d0895932a0d120908f02fadb0a28 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 10:40:08 -0500 Subject: [PATCH 11/35] =?UTF-8?q?fix(search):=20=F0=9F=90=9B=20do=20not=20?= =?UTF-8?q?collapse=20whitespace=20in=20label=20text=20node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/skins.citizen.search/typeahead.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/skins.citizen.search/typeahead.js b/resources/skins.citizen.search/typeahead.js index c82f9e9b..37beb94a 100644 --- a/resources/skins.citizen.search/typeahead.js +++ b/resources/skins.citizen.search/typeahead.js @@ -183,7 +183,7 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { /* Article redirect icon */ '' + /* Since we are matching that redirect title, it should be highlighted */ - highlightTitle( matchedTitle ) + + '' + highlightTitle( matchedTitle ) + '' + ''; } From db79f26a66e0f65a179929cbf4db03bd38a08cf0 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 11:22:50 -0500 Subject: [PATCH 12/35] =?UTF-8?q?refactor(search):=20=E2=99=BB=EF=B8=8F=20?= =?UTF-8?q?use=20template=20literals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/skins.citizen.search/typeahead.js | 74 +++++++++++---------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/resources/skins.citizen.search/typeahead.js b/resources/skins.citizen.search/typeahead.js index 37beb94a..e615c2cc 100644 --- a/resources/skins.citizen.search/typeahead.js +++ b/resources/skins.citizen.search/typeahead.js @@ -1,8 +1,14 @@ const - config = require( './config.json' ), PREFIX = 'citizen-typeahead', SEARCH_LOADING_CLASS = 'citizen-loading', - HIDDEN_CLASS = PREFIX + '__item--hidden'; + ITEM_CLASS = `${PREFIX}__item`, + ACTIVE_CLASS = `${ITEM_CLASS}--active`, + HIDDEN_CLASS = `${ITEM_CLASS}--hidden`; + +/** + * Config object from getCitizenSearchResourceLoaderConfig() + */ +const config = require( './config.json' ); const activeIndex = { index: -1, @@ -38,8 +44,7 @@ let typeahead, searchInput; * @return {void} */ function toggleActive( element ) { - const ACTIVE_CLASS = PREFIX + '__item--active'; - const typeaheadItems = typeahead.querySelectorAll( '.' + PREFIX + '__item' ); + const typeaheadItems = typeahead.querySelectorAll( `.${ITEM_CLASS}` ); for ( let i = 0; i < typeaheadItems.length; i++ ) { if ( element !== typeaheadItems[ i ] ) { @@ -69,7 +74,7 @@ function keyboardEvents( event ) { } // Is children slower? - const typeaheadItems = typeahead.querySelectorAll( '.' + PREFIX + '__item' ); + const typeaheadItems = typeahead.querySelectorAll( `.${ITEM_CLASS}` ); if ( event.key === 'ArrowDown' || event.key === 'ArrowUp' ) { if ( event.key === 'ArrowDown' ) { @@ -83,7 +88,7 @@ function keyboardEvents( event ) { } if ( typeaheadItems[ activeIndex.index ] ) { - const link = typeaheadItems[ activeIndex.index ].querySelector( '.' + PREFIX + '__content' ); + const link = typeaheadItems[ activeIndex.index ].querySelector( `.${PREFIX}__content` ); if ( event.key === 'Enter' && link instanceof HTMLAnchorElement ) { event.preventDefault(); link.click(); @@ -119,10 +124,10 @@ function clearSuggestions() { // It is more performant this way const fragment = new DocumentFragment(), - template = document.getElementById( PREFIX + '-template' ); + template = document.getElementById( `${PREFIX}-template` ); [ ...typeaheadItems ].forEach( ( item ) => { - if ( !item.classList.contains( PREFIX + '__item--page' ) ) { + if ( !item.classList.contains( `${ITEM_CLASS}--page` ) ) { fragment.append( item ); } } ); @@ -149,11 +154,11 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { if ( results.length > 0 ) { const fragment = document.createDocumentFragment(), - suggestionLinkPrefix = config.wgScriptPath + '/index.php?title=Special:Search&search='; + suggestionLinkPrefix = `${config.wgScriptPath}/index.php?title=Special:Search&search=`; const highlightTitle = ( text ) => { const regex = new RegExp( mw.util.escapeRegExp( htmlSafeSearchQuery ), 'i' ); - return text.replace( regex, '$&' ); + return text.replace( regex, `$&` ); }; const getRedirectLabel = ( title, matchedTitle ) => { @@ -179,12 +184,10 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { // Result is a redirect // Show the redirect title and highlight it if ( matchedTitle && isRedirectUseful() ) { - html = '
    ' + - /* Article redirect icon */ - '' + - /* Since we are matching that redirect title, it should be highlighted */ - '' + highlightTitle( matchedTitle ) + '' + - '
    '; + html = `
    + + ${highlightTitle( matchedTitle )} +
    `; } return html; @@ -193,7 +196,7 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { // Create suggestion items results.forEach( ( result, index ) => { const data = { - id: PREFIX + '-suggestion-' + index, + id: `${PREFIX}-suggestion-${index}`, type: 'page', link: suggestionLinkPrefix + encodeURIComponent( result.key ), title: highlightTitle( result.title ), @@ -258,7 +261,7 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { // User can trigger the abort when the fetch event is pending // There is no need for an error if ( error.name !== 'AbortError' ) { - const message = 'Uh oh, a wild error appears! ' + error; + const message = `Uh oh, a wild error appears! ${error}`; throw new Error( message ); } } ); @@ -276,31 +279,34 @@ function updateMenuItem( item, data ) { item.setAttribute( 'id', data.id ); } if ( data.type ) { - item.classList.add( PREFIX + '__item--' + data.type ); + item.classList.add( `${ITEM_CLASS}--${data.type}` ); } if ( data.link ) { - const link = item.querySelector( '.' + PREFIX + '__content' ); + const link = item.querySelector( `.${PREFIX}__content` ); link.setAttribute( 'href', data.link ); } if ( data.icon || data.thumbnail ) { - const thumbnail = item.querySelector( '.' + PREFIX + '__thumbnail' ); + const thumbnail = item.querySelector( `.${PREFIX}__thumbnail` ); if ( data.thumbnail ) { - thumbnail.style.backgroundImage = 'url(' + data.thumbnail + ')'; + thumbnail.style.backgroundImage = `url('${data.thumbnail}')`; } else { - // FIXME: There is probably a cleaner way - thumbnail.setAttribute( 'class', PREFIX + '__thumbnail citizen-ui-icon mw-ui-icon-wikimedia-' + data.icon ); + thumbnail.classList.add( + `${PREFIX}__thumbnail`, + 'citizen-ui-icon', + `mw-ui-icon-wikimedia-${data.icon}` + ); } } if ( data.title ) { - const title = item.querySelector( '.' + PREFIX + '__title' ); + const title = item.querySelector( `.${PREFIX}__title` ); title.innerHTML = data.title; } if ( data.label ) { - const label = item.querySelector( '.' + PREFIX + '__label' ); + const label = item.querySelector( `.${PREFIX}__label` ); label.innerHTML = data.label; } if ( data.description ) { - const description = item.querySelector( '.' + PREFIX + '__description' ); + const description = item.querySelector( `.${PREFIX}__description` ); description.innerHTML = data.description; } } @@ -312,7 +318,7 @@ function updateMenuItem( item, data ) { * @return {HTMLElement|void} */ function getMenuItem( data ) { - const template = document.getElementById( PREFIX + '-template' ); + const template = document.getElementById( `${PREFIX}-template` ); // Shouldn't happen but just to be safe if ( !( template instanceof HTMLTemplateElement ) ) { @@ -321,7 +327,7 @@ function getMenuItem( data ) { const fragment = template.content.cloneNode( true ), - item = fragment.querySelector( '.' + PREFIX + '__item' ); + item = fragment.querySelector( `.${ITEM_CLASS}` ); updateMenuItem( item, data ); bindMouseHoverEvent( item ); return fragment; @@ -338,12 +344,12 @@ function updateTypeahead( messages ) { searchQuery = searchInput.value, htmlSafeSearchQuery = mw.html.escape( searchQuery ), hasQuery = searchQuery.length > 0, - placeholder = typeahead.querySelector( '.' + PREFIX + '__item--placeholder' ); + placeholder = typeahead.querySelector( `.${ITEM_CLASS}--placeholder` ); const updateToolItem = ( data ) => { const - itemId = PREFIX + '-' + data.id, - query = '' + htmlSafeSearchQuery + '', + itemId = `${PREFIX}-${data.id}`, + query = `${htmlSafeSearchQuery}`, itemLink = data.link + htmlSafeSearchQuery, /* eslint-disable-next-line mediawiki/msg-doc */ itemDesc = mw.message( data.msg, query ); @@ -381,7 +387,7 @@ function updateTypeahead( messages ) { // Fulltext search updateToolItem( { id: 'fulltext', - link: config.wgScriptPath + '/index.php?title=Special:Search&fulltext=1&search=', + link: `${config.wgScriptPath}/index.php?title=Special:Search&fulltext=1&search=`, icon: 'articleSearch', msg: 'citizen-search-fulltext' } ); @@ -390,7 +396,7 @@ function updateTypeahead( messages ) { if ( config.isMediaSearchExtensionEnabled ) { updateToolItem( { id: 'mediasearch', - link: config.wgScriptPath + '/index.php?title=Special:MediaSearch&search=', + link: `${config.wgScriptPath}/index.php?title=Special:MediaSearch&search=`, icon: 'imageGallery', msg: 'citizen-search-mediasearch' } ); From 0ca34a5c3fafe7e158ca8bae065bb53e293b5912 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 11:39:18 -0500 Subject: [PATCH 13/35] =?UTF-8?q?docs(search):=20=F0=9F=93=9A=EF=B8=8F=20d?= =?UTF-8?q?ocument=20functions=20and=20objects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/skins.citizen.search/typeahead.js | 62 ++++++++++++++------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/resources/skins.citizen.search/typeahead.js b/resources/skins.citizen.search/typeahead.js index e615c2cc..f2fed6cc 100644 --- a/resources/skins.citizen.search/typeahead.js +++ b/resources/skins.citizen.search/typeahead.js @@ -37,11 +37,25 @@ const activeIndex = { } }; -let typeahead, searchInput; +let /** @type {HTMLElement | undefined} */ typeahead; +let /** @type {HTMLElement | undefined} */ searchInput; -/* +/** + * @typedef {Object} MenuItemData + * @property {string} id + * @property {string} type + * @property {string} link + * @property {string} icon + * @property {string} thumbnail + * @property {string} title + * @property {string} label + * @property {string} description + */ + +/** + * Sets an 'ACTIVE_CLASS' on the element + * * @param {HTMLElement} element - * @return {void} */ function toggleActive( element ) { const typeaheadItems = typeahead.querySelectorAll( `.${ITEM_CLASS}` ); @@ -59,7 +73,6 @@ function toggleActive( element ) { } } } - /* eslint-enable mediawiki/class-doc */ } /** @@ -96,11 +109,10 @@ function keyboardEvents( event ) { } } -/* +/** * Bind mouseenter and mouseleave event to reproduce mouse hover event * * @param {HTMLElement} element - * @return {void} */ function bindMouseHoverEvent( element ) { element.addEventListener( 'mouseenter', ( event ) => { @@ -113,8 +125,6 @@ function bindMouseHoverEvent( element ) { /** * Remove all existing suggestions from typeahead - * - * @return {void} */ function clearSuggestions() { const typeaheadItems = typeahead.children; @@ -147,7 +157,6 @@ function clearSuggestions() { * @param {string} searchQuery * @param {string} htmlSafeSearchQuery * @param {HTMLElement} placeholder - * @return {void} */ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { const renderSuggestions = ( results ) => { @@ -155,15 +164,29 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { const fragment = document.createDocumentFragment(), suggestionLinkPrefix = `${config.wgScriptPath}/index.php?title=Special:Search&search=`; - + /** + * Return the redirect title with search query highlight + * + * @param {string} text + * @return {string} + */ const highlightTitle = ( text ) => { const regex = new RegExp( mw.util.escapeRegExp( htmlSafeSearchQuery ), 'i' ); return text.replace( regex, `$&` ); }; - + /** + * Return the HTML of the redirect label + * + * @param {string} title + * @param {string} matchedTitle + * @return {string} + */ const getRedirectLabel = ( title, matchedTitle ) => { - // Check if the redirect is useful - // See T303013 + /** + * Check if the redirect is useful (T303013) + * + * @return {boolean} + */ const isRedirectUseful = () => { // Change to lowercase then remove space and dashes const cleanup = ( text ) => { @@ -180,7 +203,6 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { }; let html = ''; - // Result is a redirect // Show the redirect title and highlight it if ( matchedTitle && isRedirectUseful() ) { @@ -271,8 +293,7 @@ function getSuggestions( searchQuery, htmlSafeSearchQuery, placeholder ) { * Update menu item element * * @param {HTMLElement} item - * @param {Object} data - * @return {void} + * @param {MenuItemData} data */ function updateMenuItem( item, data ) { if ( data.id ) { @@ -314,7 +335,7 @@ function updateMenuItem( item, data ) { /** * Generate menu item HTML using the existing template * - * @param {Object} data + * @param {MenuItemData} data * @return {HTMLElement|void} */ function getMenuItem( data ) { @@ -337,7 +358,6 @@ function getMenuItem( data ) { * Update the typeahead element * * @param {Object} messages - * @return {void} */ function updateTypeahead( messages ) { const @@ -346,6 +366,11 @@ function updateTypeahead( messages ) { hasQuery = searchQuery.length > 0, placeholder = typeahead.querySelector( `.${ITEM_CLASS}--placeholder` ); + /** + * Update a tool item or create it if it does not exist + * + * @param {Object} data + */ const updateToolItem = ( data ) => { const itemId = `${PREFIX}-${data.id}`, @@ -424,7 +449,6 @@ function updateTypeahead( messages ) { /** * @param {HTMLElement} searchForm * @param {HTMLInputElement} input - * @return {void} */ function initTypeahead( searchForm, input ) { const EXPANDED_CLASS = 'citizen-typeahead--expanded'; From b262f4740460afc93dcab4127f602f624fb12266 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 12:32:30 -0500 Subject: [PATCH 14/35] =?UTF-8?q?refactor(core):=20=E2=99=BB=EF=B8=8F=20re?= =?UTF-8?q?move=20unused=20table=20style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/skins.citizen.styles/skinning/content.tables.less | 6 ------ 1 file changed, 6 deletions(-) diff --git a/resources/skins.citizen.styles/skinning/content.tables.less b/resources/skins.citizen.styles/skinning/content.tables.less index e85c408b..c4fe994b 100644 --- a/resources/skins.citizen.styles/skinning/content.tables.less +++ b/resources/skins.citizen.styles/skinning/content.tables.less @@ -47,9 +47,3 @@ padding: var( --space-xs ) var( --space-sm ); } } - -@media ( max-width: @width-breakpoint-desktop-wide ) { - table.wikiatble { - white-space: nowrap; - } -} From 37cdf912571cd8b3b4c19cc45a09b123d0b83476 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 12:56:17 -0500 Subject: [PATCH 15/35] =?UTF-8?q?feat(core):=20=E2=9C=A8=20deprecate=20bac?= =?UTF-8?q?kground-color-framed=20and=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit background-color-framed can be replaced with color-surface-2 most of the time. input is not used. They are both deprecated in favor of the simpler color-surface system --- .../common/cssvariables.less | 8 ----- .../common/scrollbar.less | 2 +- resources/variables.less | 12 ------- .../UploadWizard/ext.uploadWizard.less | 10 +++--- .../ext.WSSearchFront.module.less | 32 +++++++++---------- .../jquery.ui/smoothness/jquery.ui.theme.less | 12 +++---- 6 files changed, 28 insertions(+), 48 deletions(-) diff --git a/resources/skins.citizen.styles/common/cssvariables.less b/resources/skins.citizen.styles/common/cssvariables.less index c8f99b6d..38242b3a 100644 --- a/resources/skins.citizen.styles/common/cssvariables.less +++ b/resources/skins.citizen.styles/common/cssvariables.less @@ -12,10 +12,6 @@ --background-color-overlay: @background-color-overlay; --background-color-overlay--lighter: @background-color-overlay--lighter; - --background-color-framed: @background-color-framed; - --background-color-framed--hover: @background-color-framed--hover; - --background-color-framed--active: @background-color-framed--active; - --background-color-input: @background-color-input; --background-color-icon: @background-color-icon; --background-color-icon--hover: @background-color-icon--hover; --background-color-icon--active: @background-color-icon--active; @@ -117,10 +113,6 @@ html { --background-color-overlay: @dark-background-color-overlay; --background-color-overlay--lighter: @dark-background-color-overlay--lighter; - --background-color-framed: @dark-background-color-framed; - --background-color-framed--hover: @dark-background-color-framed--hover; - --background-color-framed--active: @dark-background-color-framed--active; - --background-color-input: @dark-background-color-input; --background-color-icon: @dark-background-color-icon; --background-color-icon--hover: @dark-background-color-icon--hover; --background-color-icon--active: @dark-background-color-icon--active; diff --git a/resources/skins.citizen.styles/common/scrollbar.less b/resources/skins.citizen.styles/common/scrollbar.less index 09a8f6b2..1be591b4 100644 --- a/resources/skins.citizen.styles/common/scrollbar.less +++ b/resources/skins.citizen.styles/common/scrollbar.less @@ -15,7 +15,7 @@ transition: @transition-background; &:hover { - background: var( --background-color-framed ); + background: var( --background-color-quiet--hover ); } } diff --git a/resources/variables.less b/resources/variables.less index 98c5c88e..73f074b4 100644 --- a/resources/variables.less +++ b/resources/variables.less @@ -174,12 +174,6 @@ @background-color-overlay: rgba( 255, 255, 255, 0.95 ); //base100 95% opacity @background-color-overlay--lighter: rgba( 255, 255, 255, 0.6 ); -@background-color-framed: @color-base90; -@background-color-framed--hover: @color-base100; -@background-color-framed--active: @color-base70; - -@background-color-input: rgba( 255, 255, 255, 0.5 ); - @background-color-icon: rgba( 0, 0, 0, 0.6 ); @background-color-icon--hover: rgba( 0, 0, 0, 0.8 ); @background-color-icon--active: rgba( 0, 0, 0, 1 ); @@ -300,12 +294,6 @@ @dark-background-color-overlay: rgba( 19, 26, 33, 0.95 ); @dark-background-color-overlay--lighter: rgba( 19, 26, 33, 0.6 ); -@dark-background-color-framed: @dark-color-base10; -@dark-background-color-framed--hover: @dark-color-base30; -@dark-background-color-framed--active: @dark-color-base0; - -@dark-background-color-input: rgba( 0, 0, 0, 0.5 ); - @dark-background-color-icon: rgba( 255, 255, 255, 0.6 ); @dark-background-color-icon--hover: rgba( 255, 255, 255, 0.8 ); @dark-background-color-icon--active: rgba( 255, 255, 255, 0.4 ); diff --git a/skinStyles/extensions/UploadWizard/ext.uploadWizard.less b/skinStyles/extensions/UploadWizard/ext.uploadWizard.less index 5b511609..34323056 100644 --- a/skinStyles/extensions/UploadWizard/ext.uploadWizard.less +++ b/skinStyles/extensions/UploadWizard/ext.uploadWizard.less @@ -30,11 +30,11 @@ } .mwe-upwiz-file.odd .mwe-upwiz-visible-file { - background: var( --background-color-framed ); + background: var( --color-surface-2 ); } #mwe-upwiz-deeds-thumbnails { - background-color: var( --background-color-framed ); + background-color: var( --color-surface-2 ); } .mwe-upwiz-thumbnail-link canvas, @@ -44,7 +44,7 @@ .mwe-upwiz-singleLanguageInputWidget { border-color: var( --border-color-base ); - background-color: var( --background-color-framed ); + background-color: var( --color-surface-2 ); } .mwe-upwiz-copyMetadataWidget { @@ -64,7 +64,7 @@ } .arrowSteps li { - background-color: var( --background-color-framed ); + background-color: var( --color-surface-2 ); color: var( --color-base--subtle ); } @@ -74,7 +74,7 @@ } .arrowSteps li.arrow:after { - border-left-color: var( --background-color-framed ); + border-left-color: var( --color-surface-2 ); } .arrowSteps li.arrow:before { diff --git a/skinStyles/extensions/WSSearchFront/ext.WSSearchFront.module.less b/skinStyles/extensions/WSSearchFront/ext.WSSearchFront.module.less index a5d41ffe..3365ebf5 100644 --- a/skinStyles/extensions/WSSearchFront/ext.WSSearchFront.module.less +++ b/skinStyles/extensions/WSSearchFront/ext.WSSearchFront.module.less @@ -9,14 +9,14 @@ */ :root { - --tint-1: var( --background-color-framed ); - --border-1: 1px solid var( --background-color-framed--active ); + --tint-1: var( --color-surface-2 ); + --border-1: 1px solid var( --color-surface-2--active ); } .wssearch--filter-options-search, .wssearch--search-input { border: 1px solid var( --border-color-base ); - background-color: var( --background-color-framed ); + background-color: var( --color-surface-2 ); color: var( --color-base ); &:hover { @@ -41,7 +41,7 @@ &:focus { border-color: var( --color-base ); - box-shadow: inset 0 0 0 1px var( --base-color ), inset 0 0 0 2px var( --background-color-framed ); + box-shadow: inset 0 0 0 1px var( --base-color ), inset 0 0 0 2px var( --color-surface-2 ); } &:active { @@ -52,12 +52,12 @@ } .wssearch--selected-filter { - background-color: var( --background-color-framed ); + background-color: var( --color-surface-2 ); transition: background-color 0.1s, color 0.1s, border-color 0.1s, box-shadow 0.1s; &:hover { border-color: var( --base-color-lighter ); - background-color: var( --background-color-framed--hover ); + background-color: var( --color-surface-2--hover ); } &:after { @@ -80,7 +80,7 @@ &:focus { border-color: var( --color-base ); background-color: var( --color-base ); - box-shadow: inset 0 0 0 1px var( --base-color ), inset 0 0 0 2px var( --background-color-framed ); + box-shadow: inset 0 0 0 1px var( --base-color ), inset 0 0 0 2px var( --color-surface-2 ); } } @@ -119,7 +119,7 @@ &:active, &:focus { border-color: var( --color-base ); - box-shadow: inset 0 0 0 1px var( --base-color ), inset 0 0 0 2px var( --background-color-framed ); + box-shadow: inset 0 0 0 1px var( --base-color ), inset 0 0 0 2px var( --color-surface-2 ); } } @@ -146,13 +146,13 @@ .wssearch--order__option, .wssearch--size__option { - background-color: var( --background-color-framed ); + background-color: var( --color-surface-2 ); color: var( --color-base--emphasized ); } .wssearch-hit-prop-loading-bg { - background: linear-gradient( 135deg, var( --background-color-framed ) 25%, transparent 0, transparent 50%, var( --background-color-framed ) 0, var( --background-color-framed ) 75%, transparent 0, transparent ); - background-color: var( --background-color-framed--active ); + background: linear-gradient( 135deg, var( --color-surface-2 ) 25%, transparent 0, transparent 50%, var( --color-surface-2 ) 0, var( --color-surface-2 ) 75%, transparent 0, transparent ); + background-color: var( --color-surface-2--active ); } .wssearch--hit-pill { @@ -222,7 +222,7 @@ } .wssearch--checkbox { - background-color: var( --background-color-framed ); + background-color: var( --color-surface-2 ); color: var( --color-base--emphasized ); &:hover { @@ -235,11 +235,11 @@ } &.wssearch--checkbox-selected:hover { - background-color: var( --background-color-framed ); + background-color: var( --color-surface-2 ); } &:not( :last-child ) { - border-bottom: 1px solid var( --background-color-framed--active ); + border-bottom: 1px solid var( --color-surface-2--active ); } &-count { @@ -276,7 +276,7 @@ &:active, &:focus { border-color: var( --color-base ); - box-shadow: inset 0 0 0 1px var( --base-color ), inset 0 0 0 2px var( --background-color-framed ); + box-shadow: inset 0 0 0 1px var( --base-color ), inset 0 0 0 2px var( --color-surface-2 ); } } @@ -290,7 +290,7 @@ } &__header > * { - background-color: var( --background-color-framed--active ); + background-color: var( --color-surface-2--active ); } } diff --git a/skinStyles/jquery.ui/smoothness/jquery.ui.theme.less b/skinStyles/jquery.ui/smoothness/jquery.ui.theme.less index 397e9eed..233f65da 100644 --- a/skinStyles/jquery.ui/smoothness/jquery.ui.theme.less +++ b/skinStyles/jquery.ui/smoothness/jquery.ui.theme.less @@ -33,13 +33,13 @@ &-content { border-color: var( --border-color-base ); - background: var( --background-color-framed ); + background: var( --color-surface-2 ); color: var( --color-base ); } &-header { border-color: var( --border-color-base ); - background: var( --background-color-framed--hover ); + background: var( --color-surface-2--hover ); color: var( --color-base ); } } @@ -51,7 +51,7 @@ .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border-color: var( --border-color-base ); - background-color: var( --background-color-framed ); + background-color: var( --color-surface-2 ); color: var( --color-base ); } @@ -68,7 +68,7 @@ .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border-color: var( --border-color-base ); - background-color: var( --background-color-framed--hover ); + background-color: var( --color-surface-2--hover ); color: var( --color-base--emphasized ); } @@ -82,8 +82,8 @@ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { - border-color: var( --background-color-framed--active ); - background-color: var( --background-color-framed--active ); + border-color: var( --color-surface-2--active ); + background-color: var( --color-surface-2--active ); color: var( --color-base--subtle ); } From 867fd29b7c2092e0f407beb27a9a65193d06532f Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 12:59:38 -0500 Subject: [PATCH 16/35] =?UTF-8?q?refactor(core):=20=E2=99=BB=EF=B8=8F=20cl?= =?UTF-8?q?ean=20up=20unused=20LESS=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/variables.less | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/resources/variables.less b/resources/variables.less index 73f074b4..6f3db3d6 100644 --- a/resources/variables.less +++ b/resources/variables.less @@ -140,7 +140,7 @@ * referring to them as applied further below. */ -@color-base0: #000; // = HSB 0°, 0%, 0% +// @color-base0: #000; // = HSB 0°, 0%, 0% @color-base10: #202122; // = HSB 210°, 6%, 13% @color-base20: #54595d; // = HSB 207°, 10%, 36%; WCAG 2.0 level AAA 7.09:1 contrast ratio on `#fff` @color-base30: #72777d; // = HSB 210°, 9%, 49%; WCAG 2.0 level AA at 4.52:1 contrast ratio on `#fff` @@ -274,23 +274,6 @@ @box-shadow-card: 0 2.8px 2.2px -4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .03))', 0 6.7px 5.3px -4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .01))', 0 12.5px 10px -4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .02))', 0 22.3px 17.9px -4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .02))', 0 41.8px 33.4px -4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .03))', 0 100px 80px -4px ~'hsl(var(--surface-shadow) / var(--shadow-strength))'; @box-shadow-dialog: 0 2.8px 2.2px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .03))', 0 6.7px 5.3px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .01))', 0 12.5px 10px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .02))', 0 22.3px 17.9px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .02))', 0 41.8px 33.4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .03))', 0 100px 80px ~'hsl(var(--surface-shadow) / var(--shadow-strength))'; -/** - * Dark theme color palette - * Background color is used instead of shadow to show elevation - * and hierarchy in dark theme - * See https://material.io/design/color/dark-theme.html#properties - */ -@dark-color-base0: #131a21; // Surface color -@dark-color-base10: #1f262c; // 5% white overlay -@dark-color-base20: #242a31; // 7% white overlay -@dark-color-base30: #262c32; // 8% white overlay -@dark-color-base40: #282f35; // 9% white overlay -@dark-color-base50: #2d3339; // 11% white overlay -@dark-color-base60: #30363c; // 12% white overlay -@dark-color-base70: #343a40; // 14% white overlay -@dark-color-base80: #363c42; // 15% white overlay -@dark-color-base90: #393f45; // 16% white overlay - @dark-background-color-overlay: rgba( 19, 26, 33, 0.95 ); @dark-background-color-overlay--lighter: rgba( 19, 26, 33, 0.6 ); From 3414d5964375de829c129c39d680ef3c9e6b743b Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 14:06:06 -0500 Subject: [PATCH 17/35] =?UTF-8?q?feat(core):=20=E2=9C=A8=20dynamic=20dark?= =?UTF-8?q?=20theme=20color=20based=20on=20primary=20hue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skins.citizen.preferences.less | 4 ++-- .../skins.citizen.styles/ContentFooter.less | 2 +- .../common/cssvariables.less | 8 ------- .../skins.citizen.styles/common/theme.less | 23 ++++++++++++------- resources/variables.less | 23 +------------------ 5 files changed, 19 insertions(+), 41 deletions(-) diff --git a/resources/skins.citizen.preferences/skins.citizen.preferences.less b/resources/skins.citizen.preferences/skins.citizen.preferences.less index eae7b6a6..2dc57ad7 100644 --- a/resources/skins.citizen.preferences/skins.citizen.preferences.less +++ b/resources/skins.citizen.preferences/skins.citizen.preferences.less @@ -106,8 +106,8 @@ } &-dark { - background: @color-surface-0-dark; - color: @dark-color-base; + background: ~'hsl( var( --color-primary__h ) 20% 10% )'; + color: ~'hsl( var( --color-primary__h ) 10% 75% )'; } } diff --git a/resources/skins.citizen.styles/ContentFooter.less b/resources/skins.citizen.styles/ContentFooter.less index 967423a0..1677f70f 100644 --- a/resources/skins.citizen.styles/ContentFooter.less +++ b/resources/skins.citizen.styles/ContentFooter.less @@ -9,7 +9,6 @@ .page-info { display: flex; flex-wrap: wrap; - color: var( --color-base--subtle ); font-size: 0.8125rem; gap: var( --space-xl ); @@ -20,6 +19,7 @@ } &__label { + color: var( --color-base--subtle ); letter-spacing: 0.05em; } } diff --git a/resources/skins.citizen.styles/common/cssvariables.less b/resources/skins.citizen.styles/common/cssvariables.less index 38242b3a..af131e23 100644 --- a/resources/skins.citizen.styles/common/cssvariables.less +++ b/resources/skins.citizen.styles/common/cssvariables.less @@ -110,9 +110,6 @@ html { * Dark theme */ :root.skin-citizen-dark { - --background-color-overlay: @dark-background-color-overlay; - --background-color-overlay--lighter: @dark-background-color-overlay--lighter; - --background-color-icon: @dark-background-color-icon; --background-color-icon--hover: @dark-background-color-icon--hover; --background-color-icon--active: @dark-background-color-icon--active; @@ -123,11 +120,6 @@ html { --background-color-warning: @dark-background-color-warning; --background-color-success: @dark-background-color-success; - /* Foreground Colors */ - --color-base: @dark-color-base; - --color-base--emphasized: @dark-color-base--emphasized; - --color-base--subtle: @dark-color-base--subtle; - --color-link-new: @dark-color-link-new; --color-link-new--hover: @dark-color-link-new--hover; --color-link-new--active: @dark-color-link-new--active; diff --git a/resources/skins.citizen.styles/common/theme.less b/resources/skins.citizen.styles/common/theme.less index 4ded6d5c..317e1e79 100644 --- a/resources/skins.citizen.styles/common/theme.less +++ b/resources/skins.citizen.styles/common/theme.less @@ -40,19 +40,26 @@ a { * Dark theme */ :root.skin-citizen-dark { - --color-primary__l: @color-primary__l-dark; + --color-primary__l: 60%; - --color-surface-0: @color-surface-0-dark; - --color-surface-1: @color-surface-1-dark; - --color-surface-2: @color-surface-2-dark; - --color-surface-3: @color-surface-3-dark; - --color-surface-4: @color-surface-4-dark; + --color-surface-0: ~'hsl( var( --color-primary__h ) 20% 10% )'; + --color-surface-1: ~'hsl( var( --color-primary__h ) 25% 12% )'; + --color-surface-2: ~'hsl( var( --color-primary__h ) 25% 15% )'; + --color-surface-3: ~'hsl( var( --color-primary__h ) 15% 20% )'; + --color-surface-4: ~'hsl( var( --color-primary__h ) 15% 25% )'; + + --color-base--emphasized: ~'hsl( var( --color-primary__h ) 15% 95% )'; + --color-base: ~'hsl( var( --color-primary__h ) 10% 75% )'; + --color-base--subtle: ~'hsl( var( --color-primary__h ) 25% 65% )'; --background-color-primary--hover: ~'hsl( var( --color-primary__h ), var( --color-primary__s ), 15% )'; --background-color-primary--active: ~'hsl( var( --color-primary__h ), var( --color-primary__s ), 20% )'; - --color-surface-2--hover: @color-surface-2-dark--hover; - --color-surface-2--active: @color-surface-2-dark--active; + --background-color-overlay: ~'hsla( var( --color-primary__h ) 20% 10% / 95% )'; + --background-color-overlay--lighter: ~'hsl( var( --color-primary__h ) 20% 10% / 60% )'; + + --color-surface-2--hover: ~'hsl( var( --color-primary__h ) 30% 19% )'; + --color-surface-2--active: ~'hsl( var( --color-primary__h ) 30% 11% )'; --surface-shadow: var( --color-primary__h ) 50% 3%; --shadow-strength: 0.8; diff --git a/resources/variables.less b/resources/variables.less index 6f3db3d6..fe26d242 100644 --- a/resources/variables.less +++ b/resources/variables.less @@ -101,20 +101,6 @@ @color-syntax-violet: #945eb8; @color-syntax-grey: #90a4ae; -/* Dark theme */ -@diff-hoverstate-dark: 4; - -@color-primary__l-dark: 60%; - -@color-surface-0-dark: ~'hsl( 210, 27%, 10% )'; -@color-surface-1-dark: ~'hsl( 212, 15%, 17% )'; -@color-surface-2-dark: ~'hsl( 208, 14%, 18% )'; -@color-surface-3-dark: ~'hsl( 210, 11%, 21% )'; -@color-surface-4-dark: ~'hsl( 210, 10%, 24% )'; - -@color-surface-2-dark--hover: ~'hsl( 208, 14%, 'unit( 18 + @diff-hoverstate-dark, % )~' )'; -@color-surface-2-dark--active: ~'hsl( 208, 14%, 'unit( 18 - @diff-hoverstate-dark, % )~' )'; - /* * Syntax highlight colors * Based on Material Theme Palenight @@ -274,9 +260,6 @@ @box-shadow-card: 0 2.8px 2.2px -4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .03))', 0 6.7px 5.3px -4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .01))', 0 12.5px 10px -4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .02))', 0 22.3px 17.9px -4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .02))', 0 41.8px 33.4px -4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .03))', 0 100px 80px -4px ~'hsl(var(--surface-shadow) / var(--shadow-strength))'; @box-shadow-dialog: 0 2.8px 2.2px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .03))', 0 6.7px 5.3px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .01))', 0 12.5px 10px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .02))', 0 22.3px 17.9px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .02))', 0 41.8px 33.4px ~'hsl(var(--surface-shadow) / calc(var(--shadow-strength) + .03))', 0 100px 80px ~'hsl(var(--surface-shadow) / var(--shadow-strength))'; -@dark-background-color-overlay: rgba( 19, 26, 33, 0.95 ); -@dark-background-color-overlay--lighter: rgba( 19, 26, 33, 0.6 ); - @dark-background-color-icon: rgba( 255, 255, 255, 0.6 ); @dark-background-color-icon--hover: rgba( 255, 255, 255, 0.8 ); @dark-background-color-icon--active: rgba( 255, 255, 255, 0.4 ); @@ -292,10 +275,6 @@ @dark-background-color-success: @color-green30; /* Foreground colors */ -@dark-color-base: rgba( 255, 255, 255, 0.6 ); -@dark-color-base--emphasized: rgba( 255, 255, 255, 0.87 ); -@dark-color-base--subtle: rgba( 255, 255, 255, 0.38 ); - @dark-color-link: @color-accent50--lighten; @dark-color-link--hover: @color-accent90; @dark-color-link--active: @color-accent30; @@ -331,7 +310,7 @@ * After that we can remove all theses LESS variables. */ -// Dark mode colors +@dark-color-base: rgba( 255, 255, 255, 0.6 ); @dark-bg-10: #1d2129; @dark-bg-20: #22262d; @dark-bg-30: #24272f; From 52f8b3f1fada555274710ee0beee127f56abffae Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 14:10:10 -0500 Subject: [PATCH 18/35] =?UTF-8?q?chore(release):=20=F0=9F=9A=80=202.3.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 25 +++++++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- skin.json | 2 +- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af3131b1..761a1694 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,31 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.3.0](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/compare/v2.2.0...v2.3.0) (2022-12-14) + + +### Features + +* **AdvancedSearch:** ✨ update AdvancedSearch styles ([88fca93](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/88fca93c469f7e2918b3b68a6a0381f4a3e5e800)) +* **core:** ✨ align inconsistent search styles ([653ba19](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/653ba1913051ef11306de4fd8bda4cc56f44d37b)) +* **core:** ✨ deprecate background-color-framed and input ([37cdf91](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/37cdf912571cd8b3b4c19cc45a09b123d0b83476)) +* **core:** ✨ do not hardcode min-width for page tools menu ([0187478](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/0187478d1aa69bfa2f699fb4790cadc8491c98fd)) +* **core:** ✨ do not set fieldset font size ([224c190](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/224c190a475e5079e5e0e8332442643c5e2b571f)) +* **core:** ✨ dynamic dark theme color based on primary hue ([3414d59](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/3414d5964375de829c129c39d680ef3c9e6b743b)) +* **core:** ✨ tweak notification styles ([529fe22](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/529fe221de103bf68302f06cf5a3e941f2206e04)) +* **MediaSearch:** ✨ add grade A support for MediaSearch ([9b9916d](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/9b9916d61bea955f3208e2f1fdb728b63918c66b)) +* **search:** ✨ add MediaSearch to typeahead ([203b0b4](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/203b0b42c3a388684a51f231d993788632b92ae8)) + + +### Bug Fixes + +* **AdvancedSearch:** 🐛 1px layout shift in preloader ([3517453](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/351745374155fe292dd487f0e6f3ea6dd3782765)) +* **core:** 🐛 do not make search create and exist link into a card ([80a35ea](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/80a35ea571f8d7ef864b332add827368bc9b0440)) +* **core:** 🐛 do not use CSS containment for body content ([7a59e9c](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/7a59e9c2d720d99a4fe0aa31b2ff83b1c56922b9)) +* **core:** 🐛 incorrect z-index in changelist title ([c4bd384](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/c4bd3842358920752d8f0abf5a768846b1b2f03f)) +* **search:** 🐛 do not collapse whitespace in label text node ([c2da5c5](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/c2da5c5ade34d0895932a0d120908f02fadb0a28)) +* **search:** 🐛 incorrect full text search URL ([074df52](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/commit/074df5272c2cc7739967ded992b48e5bf45da806)) + ## [2.2.0](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/compare/v2.1.0...v2.2.0) (2022-12-08) diff --git a/package-lock.json b/package-lock.json index 39b796d5..f4976a8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "mediawiki-skins-Citizen", - "version": "2.2.0", + "version": "2.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "2.2.0", + "version": "2.3.0", "devDependencies": { "@commitlint/cli": "^17.3.0", "@commitlint/config-conventional": "^17.3.0", diff --git a/package.json b/package.json index 08da5114..60c6c84d 100644 --- a/package.json +++ b/package.json @@ -30,5 +30,5 @@ "stylelint-config-wikimedia": "0.13.1", "svgo": "3.0.2" }, - "version": "2.2.0" + "version": "2.3.0" } diff --git a/skin.json b/skin.json index 942ea347..7e65a1ff 100644 --- a/skin.json +++ b/skin.json @@ -1,6 +1,6 @@ { "name": "Citizen", - "version": "2.2.0", + "version": "2.3.0", "author": [ "[https://www.mediawiki.org/wiki/User:Alistair3149 Alistair3149]", "[https://www.mediawiki.org/wiki/User:Octfx Octfx]", From 8c8ab997ac306d74aa5f11e4cff8209061e893a5 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 14 Dec 2022 15:05:08 -0500 Subject: [PATCH 19/35] =?UTF-8?q?feat(core):=20=E2=9C=A8=20increase=20base?= =?UTF-8?q?=20layout=20width=20to=201080px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/variables.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/variables.less b/resources/variables.less index fe26d242..3fa600f4 100644 --- a/resources/variables.less +++ b/resources/variables.less @@ -213,7 +213,9 @@ @size-icon: 1.25rem; // Not in the header section it is also used outside of header @header-size: 3.5rem; -@width-layout: @width-breakpoint-desktop - 2 * @padding-page; +// 67.5rem at 16px font size +// We use px because it would be frustrating if max-width changes with font size +@width-layout: 1080px; // TODO: Revise this number, fixed value isn't great but we need it for b @width-toc: 240px; From 71a87e680d7747941221dc5e586012cff77190e5 Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Thu, 15 Dec 2022 13:10:48 +0100 Subject: [PATCH 20/35] Localisation updates from https://translatewiki.net. --- i18n/bn.json | 66 ++++++++++++++++++++++----------------------- i18n/fr.json | 1 + i18n/lb.json | 44 +++++++++++++++--------------- i18n/mk.json | 1 + i18n/nl.json | 72 ++++++++++++++++++++++++------------------------- i18n/pt.json | 1 + i18n/sl.json | 1 + i18n/sv.json | 4 ++- i18n/zh-hk.json | 5 ++-- 9 files changed, 101 insertions(+), 94 deletions(-) diff --git a/i18n/bn.json b/i18n/bn.json index 3588e002..499257d2 100644 --- a/i18n/bn.json +++ b/i18n/bn.json @@ -1,33 +1,33 @@ -{ - "@metadata": { - "authors": [ - "R4356th", - "আফতাবুজ্জামান" - ] - }, - "skinname-citizen": "সিটিজেন", - "citizen-prefs-talkpage": "[[mw:Skin_talk:Citizen|আলোচনা]]", - "citizen.js": "/* এখানের সকল জাভাস্ক্রিপ্ট সিটিজেন আবরণের ব্যবহারকারীদের জন্য লোড হবে */", - "citizen-sitestats-articles-label": "টি নিবন্ধ", - "citizen-sitestats-images-label": "টি ফাইল", - "citizen-sitestats-users-label": "জন ব্যবহারকারী", - "citizen-sitestats-edits-label": "টি সম্পাদনা", - "citizen-footer-desc": "[[MediaWiki:Citizen-footer-desc]]-এ এই লেখা সম্পাদনা করুন", - "citizen-footer-tagline": "[[MediaWiki:Citizen-footer-tagline]]-এ এই লেখা সম্পাদনা করুন", - "citizen-action-addsection": "আলোচনা যোগ করুন", - "citizen-jumptotop": "উপরে চলুন", - "citizen-search-fulltext": "এটি থাকা পাতাগুলিতে অনুসন্ধান করুন:", - "citizen-search-empty-desc": "অনুসন্ধান শুরু করতে কিছু লিখুন", - "citizen-tagline-ns-mediawiki": "মিডিয়াউইকি ইন্টারফেস পাতা", - "citizen-tagline-ns-template": "টেমপ্লেট পাতা", - "citizen-tagline-ns-help": "সাহায্য পাতা", - "citizen-tagline-ns-category": "বিষয়শ্রেণীর পাতা", - "prefs-citizen-theme-label": "থিম", - "prefs-citizen-theme-option-auto": "স্বয়ংক্রিয়", - "prefs-citizen-theme-option-light": "উজ্জ্বল", - "prefs-citizen-theme-option-dark": "কালো", - "prefs-citizen-fontsize-label": "ফন্টের আকার", - "prefs-citizen-pagewidth-label": "পাতার প্রস্থ", - "prefs-citizen-lineheight-label": "লাইনের উচ্চতা", - "prefs-citizen-resetbutton-label": "পূর্বনির্ধারিত অবস্থায় যান" -} +{ + "@metadata": { + "authors": [ + "R4356th", + "আফতাবুজ্জামান" + ] + }, + "skinname-citizen": "সিটিজেন", + "citizen-prefs-talkpage": "[[mw:Skin_talk:Citizen|আলোচনা]]", + "citizen.js": "/* এখানের সকল জাভাস্ক্রিপ্ট সিটিজেন আবরণের ব্যবহারকারীদের জন্য লোড হবে */", + "citizen-sitestats-articles-label": "টি নিবন্ধ", + "citizen-sitestats-images-label": "টি ফাইল", + "citizen-sitestats-users-label": "জন ব্যবহারকারী", + "citizen-sitestats-edits-label": "টি সম্পাদনা", + "citizen-footer-desc": "[[MediaWiki:Citizen-footer-desc]]-এ এই লেখা সম্পাদনা করুন", + "citizen-footer-tagline": "[[MediaWiki:Citizen-footer-tagline]]-এ এই লেখা সম্পাদনা করুন", + "citizen-action-addsection": "আলোচনা যোগ করুন", + "citizen-jumptotop": "উপরে চলুন", + "citizen-search-fulltext": "এটি থাকা পাতাগুলিতে অনুসন্ধান করুন:", + "citizen-search-empty-desc": "অনুসন্ধান শুরু করতে কিছু লিখুন", + "citizen-tagline-ns-mediawiki": "মিডিয়াউইকি ইন্টারফেস পাতা", + "citizen-tagline-ns-template": "টেমপ্লেট পাতা", + "citizen-tagline-ns-help": "সাহায্য পাতা", + "citizen-tagline-ns-category": "বিষয়শ্রেণীর পাতা", + "prefs-citizen-theme-label": "থিম", + "prefs-citizen-theme-option-auto": "স্বয়ংক্রিয়", + "prefs-citizen-theme-option-light": "উজ্জ্বল", + "prefs-citizen-theme-option-dark": "কালো", + "prefs-citizen-fontsize-label": "ফন্টের আকার", + "prefs-citizen-pagewidth-label": "পাতার প্রস্থ", + "prefs-citizen-lineheight-label": "লাইনের উচ্চতা", + "prefs-citizen-resetbutton-label": "পূর্বনির্ধারিত অবস্থায় যান" +} diff --git a/i18n/fr.json b/i18n/fr.json index b4418744..39e120cb 100644 --- a/i18n/fr.json +++ b/i18n/fr.json @@ -29,6 +29,7 @@ "citizen-action-addsection": "Ajouter un sujet", "citizen-jumptotop": "Retour au début", "citizen-search-fulltext": "Rechercher les pages contenant $1", + "citizen-search-mediasearch": "Rechercher les médias relatifs à $1", "citizen-search-empty-desc": "Taper pour commencer la recherche", "citizen-search-noresults-title": "Oh oh ! Aucun résultat pour $1", "citizen-search-noresults-desc": "Essayer peut-être les options ci-dessous ?", diff --git a/i18n/lb.json b/i18n/lb.json index e2312a75..5df31542 100644 --- a/i18n/lb.json +++ b/i18n/lb.json @@ -1,22 +1,22 @@ -{ - "@metadata": { - "authors": [ - "Robby" - ] - }, - "skinname-citizen": "Citizen", - "citizen-languages-toggle": "Méi Sproochen", - "citizen-actions-more-toggle": "Méi Aktiounen", - "citizen-sitestats-articles-label": "Artikelen", - "citizen-sitestats-images-label": "Fichieren", - "citizen-sitestats-users-label": "Benotzer", - "citizen-sitestats-edits-label": "Ännerungen", - "citizen-jumptotop": "Zréck no uewen", - "citizen-search-empty-desc": "Tippt fir unzefänke mat sichen", - "citizen-tagline-ns-help": "Hëllef-Säit", - "prefs-citizen-theme-option-light": "Hell", - "prefs-citizen-theme-option-dark": "Däischter", - "prefs-citizen-fontsize-label": "Schrëftgréisst", - "prefs-citizen-pagewidth-label": "Breet vun der Säit", - "prefs-citizen-resetbutton-label": "Op de Standard zrécksetzen" -} +{ + "@metadata": { + "authors": [ + "Robby" + ] + }, + "skinname-citizen": "Citizen", + "citizen-languages-toggle": "Méi Sproochen", + "citizen-actions-more-toggle": "Méi Aktiounen", + "citizen-sitestats-articles-label": "Artikelen", + "citizen-sitestats-images-label": "Fichieren", + "citizen-sitestats-users-label": "Benotzer", + "citizen-sitestats-edits-label": "Ännerungen", + "citizen-jumptotop": "Zréck no uewen", + "citizen-search-empty-desc": "Tippt fir unzefänke mat sichen", + "citizen-tagline-ns-help": "Hëllef-Säit", + "prefs-citizen-theme-option-light": "Hell", + "prefs-citizen-theme-option-dark": "Däischter", + "prefs-citizen-fontsize-label": "Schrëftgréisst", + "prefs-citizen-pagewidth-label": "Breet vun der Säit", + "prefs-citizen-resetbutton-label": "Op de Standard zrécksetzen" +} diff --git a/i18n/mk.json b/i18n/mk.json index f177b3cc..6dfe3811 100644 --- a/i18n/mk.json +++ b/i18n/mk.json @@ -26,6 +26,7 @@ "citizen-action-addsection": "Додај тема", "citizen-jumptotop": "Најгоре", "citizen-search-fulltext": "Пребарај страници што содржат $1", + "citizen-search-mediasearch": "Пребарајте податотеки поврзани со $1", "citizen-search-empty-desc": "Внесете текст за да почнете да пребарувате", "citizen-search-noresults-title": "За жал, не најдов ништо за $1", "citizen-search-noresults-desc": "Да ги пробаме можностите подолу?", diff --git a/i18n/nl.json b/i18n/nl.json index 85dc3056..e1e40d5e 100644 --- a/i18n/nl.json +++ b/i18n/nl.json @@ -1,36 +1,36 @@ -{ - "@metadata": { - "authors": [ - "Mainframe98", - "McDutchie", - "Romaine" - ] - }, - "citizen.css": "/* CSS die hier wordt geplaatst heeft alleen invloed op het uiterlijk Citizen */", - "citizen.js": "/* JavaScript die hier wordt geplaatst heeft alleen invloed op gebruikers die het uiterlijk Citizen gebruiken */", - "citizen-sitestats-articles-label": "artikelen", - "citizen-sitestats-images-label": "bestanden", - "citizen-sitestats-users-label": "gebruikers", - "citizen-sitestats-edits-label": "bewerkingen", - "citizen-page-info-copyright": "Auteursrechten", - "citizen-page-info-credits": "Naamsvermeldingen", - "citizen-page-info-lastmod": "Laatste wijziging", - "citizen-footer-desc": "Bewerk deze tekst op [[MediaWiki:Citizen-footer-desc]]", - "citizen-footer-tagline": "Bewerk deze tekst op [[MediaWiki:Citizen-footer-tagline]]", - "citizen-action-addsection": "Onderwerp toevoegen", - "citizen-jumptotop": "Terug naar boven", - "citizen-search-empty-desc": "Type om te beginnen met zoeken", - "citizen-tagline-ns-talk": "Overlegpagina van {{SUBJECTPAGENAME}}", - "citizen-tagline-ns-project": "Informatie over {{SITENAME}}", - "citizen-tagline-ns-file": "Bestand op {{SITENAME}}", - "citizen-tagline-ns-template": "Sjabloonpagina", - "citizen-tagline-ns-help": "Hulppagina", - "citizen-tagline-ns-category": "Categoriepagina", - "prefs-citizen-theme-label": "Thema", - "prefs-citizen-theme-option-auto": "Automatisch", - "prefs-citizen-theme-option-light": "Licht", - "prefs-citizen-theme-option-dark": "Donker", - "prefs-citizen-fontsize-label": "Lettergrootte", - "prefs-citizen-pagewidth-label": "Paginabreedte", - "prefs-citizen-lineheight-label": "Lijnhoogte" -} +{ + "@metadata": { + "authors": [ + "Mainframe98", + "McDutchie", + "Romaine" + ] + }, + "citizen.css": "/* CSS die hier wordt geplaatst heeft alleen invloed op het uiterlijk Citizen */", + "citizen.js": "/* JavaScript die hier wordt geplaatst heeft alleen invloed op gebruikers die het uiterlijk Citizen gebruiken */", + "citizen-sitestats-articles-label": "artikelen", + "citizen-sitestats-images-label": "bestanden", + "citizen-sitestats-users-label": "gebruikers", + "citizen-sitestats-edits-label": "bewerkingen", + "citizen-page-info-copyright": "Auteursrechten", + "citizen-page-info-credits": "Naamsvermeldingen", + "citizen-page-info-lastmod": "Laatste wijziging", + "citizen-footer-desc": "Bewerk deze tekst op [[MediaWiki:Citizen-footer-desc]]", + "citizen-footer-tagline": "Bewerk deze tekst op [[MediaWiki:Citizen-footer-tagline]]", + "citizen-action-addsection": "Onderwerp toevoegen", + "citizen-jumptotop": "Terug naar boven", + "citizen-search-empty-desc": "Type om te beginnen met zoeken", + "citizen-tagline-ns-talk": "Overlegpagina van {{SUBJECTPAGENAME}}", + "citizen-tagline-ns-project": "Informatie over {{SITENAME}}", + "citizen-tagline-ns-file": "Bestand op {{SITENAME}}", + "citizen-tagline-ns-template": "Sjabloonpagina", + "citizen-tagline-ns-help": "Hulppagina", + "citizen-tagline-ns-category": "Categoriepagina", + "prefs-citizen-theme-label": "Thema", + "prefs-citizen-theme-option-auto": "Automatisch", + "prefs-citizen-theme-option-light": "Licht", + "prefs-citizen-theme-option-dark": "Donker", + "prefs-citizen-fontsize-label": "Lettergrootte", + "prefs-citizen-pagewidth-label": "Paginabreedte", + "prefs-citizen-lineheight-label": "Lijnhoogte" +} diff --git a/i18n/pt.json b/i18n/pt.json index 6354416f..fabd0926 100644 --- a/i18n/pt.json +++ b/i18n/pt.json @@ -26,6 +26,7 @@ "citizen-action-addsection": "Adicionar tópico", "citizen-jumptotop": "Voltar ao topo", "citizen-search-fulltext": "Procurar páginas que contenham $1", + "citizen-search-mediasearch": "Procurar conteúdo multimédia relacionado com $1", "citizen-search-empty-desc": "Escrever para começar a procurar", "citizen-search-noresults-title": "Não há resultados para $1", "citizen-search-noresults-desc": "Talvez queira tentar as opções abaixo?", diff --git a/i18n/sl.json b/i18n/sl.json index 54f215be..db02b892 100644 --- a/i18n/sl.json +++ b/i18n/sl.json @@ -26,6 +26,7 @@ "citizen-action-addsection": "Dodaj temo", "citizen-jumptotop": "Nazaj na vrh", "citizen-search-fulltext": "Poiščite strani, ki vsebujejo $1", + "citizen-search-mediasearch": "Iskanje predstavnosti, povezanih z $1", "citizen-search-empty-desc": "Vnesite za začetek iskanja", "citizen-search-noresults-title": "Ojoj! Ni zadetkov za $1", "citizen-search-noresults-desc": "Morda poskusite s spodnjimi možnostmi?", diff --git a/i18n/sv.json b/i18n/sv.json index dfea4bdd..686c3dd1 100644 --- a/i18n/sv.json +++ b/i18n/sv.json @@ -17,7 +17,9 @@ "citizen-sitestats-edits-label": "redigeringar", "citizen-footer-desc": "Redigera den här texten på [[MediaWiki:Citizen-footer-desc/sv]]", "citizen-footer-tagline": "Redigera den här texten på [[MediaWiki:Citizen-footer-tagline/sv]]", - "citizen-search-fulltext": "Sökningar som innehåller", + "citizen-search-fulltext": "Sök efter sidor som innehåller $1", + "citizen-search-noresults-title": "Ånej! Inga resultat för $1", + "citizen-search-noresults-desc": "Kanske prova alternativen nedan?", "prefs-citizen-theme-label": "Tema", "prefs-citizen-theme-option-auto": "Automatisk", "prefs-citizen-theme-option-light": "Ljust", diff --git a/i18n/zh-hk.json b/i18n/zh-hk.json index 806d48c3..4d220bcd 100644 --- a/i18n/zh-hk.json +++ b/i18n/zh-hk.json @@ -5,7 +5,8 @@ "Diskdance", "LuciferianThomas", "Tranve", - "Winston Sung" + "Winston Sung", + "捍粵者" ] }, "skinname-citizen": "公民(Citizen)", @@ -19,7 +20,7 @@ "citizen-languages-toggle": "更多語言", "citizen-actions-more-toggle": "更多操作", "citizen-sitestats-articles-label": "篇條目", - "citizen-sitestats-images-label": "個檔案", + "citizen-sitestats-images-label": "份檔案", "citizen-sitestats-users-label": "位用家", "citizen-sitestats-edits-label": "次修改", "citizen-footer-desc": "在[[MediaWiki:Citizen-footer-desc]]編輯此文字", From a8d42da5350029187c67347265021feb1cf8bdce Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Thu, 15 Dec 2022 19:23:53 -0500 Subject: [PATCH 21/35] =?UTF-8?q?docs(readme):=20=F0=9F=93=9A=EF=B8=8F=20f?= =?UTF-8?q?ix=20Github=20action=20status=20badge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 515fdc66..5c7d486b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Citizen -[![](https://img.shields.io/github/contributors/StarCitizenTools/mediawiki-skins-Citizen?style=flat-square&logo=github)](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/graphs/contributors) ![](https://img.shields.io/github/workflow/status/StarCitizenTools/mediawiki-skins-Citizen/MediaWiki%20CI?label=MediaWiki%20CI&style=flat-square&logo=GithubActions) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg?style=flat-square&logo=GNU)](https://www.gnu.org/licenses/gpl-3.0) [![MediaWiki: >=1.39.0](https://img.shields.io/badge/MediaWiki-%3E%3D1.39.0-%2336c?style=flat-square&logo=Wikipedia)](https://www.mediawiki.org) [![](https://img.shields.io/badge/translations-translatewiki-%23013467?style=flat-square&logo=GoogleTranslate)](https://translatewiki.net/w/i.php?title=Special:Translate&group=mwgithub-star-citizen) +[![](https://img.shields.io/github/contributors/StarCitizenTools/mediawiki-skins-Citizen?style=flat-square&logo=github)](https://github.com/StarCitizenTools/mediawiki-skins-Citizen/graphs/contributors) ![](https://img.shields.io/github/actions/workflow/status/StarCitizenTools/mediawiki-skins-Citizen/mediawiki.yml?branch=main&label=MediaWiki%20CI&style=flat-square&logo=GithubActions) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg?style=flat-square&logo=GNU)](https://www.gnu.org/licenses/gpl-3.0) [![MediaWiki: >=1.39.0](https://img.shields.io/badge/MediaWiki-%3E%3D1.39.0-%2336c?style=flat-square&logo=Wikipedia)](https://www.mediawiki.org) [![](https://img.shields.io/badge/translations-translatewiki-%23013467?style=flat-square&logo=GoogleTranslate)](https://translatewiki.net/w/i.php?title=Special:Translate&group=mwgithub-star-citizen) Citizen is a beautiful, usable, responsive [MediaWiki](https://www.mediawiki.org) skin that makes [extensions](https://www.mediawiki.org/wiki/Manual:Extensions) part of the cohesive experience. It was initially created for the [Star Citizen Wiki](https://starcitizen.tools) but is flexible to run on various MediaWiki configurations. From 5946089cbbfd1ed040179e9e057067688d74ad61 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Thu, 15 Dec 2022 21:12:05 -0500 Subject: [PATCH 22/35] =?UTF-8?q?feat(CodeEditor):=20=E2=9C=A8=20add=20Cod?= =?UTF-8?q?eEditor=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + skin.json | 2 + .../CodeEditor/ext.codeEditor.ace.less | 52 +++++++++++++++++ .../CodeEditor/jquery.codeEditor.less | 56 +++++++++++++++++++ 4 files changed, 111 insertions(+) create mode 100644 skinStyles/extensions/CodeEditor/ext.codeEditor.ace.less create mode 100644 skinStyles/extensions/CodeEditor/jquery.codeEditor.less diff --git a/README.md b/README.md index 5c7d486b..0de78a6a 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Name | Grade | Version | Last updated [CentralNotice](https://www.mediawiki.org/wiki/Extension:CentralNotice) | B | REL1_35 `4aa2a8f` | 2022-06-16 [Cite](https://www.mediawiki.org/wiki/Extension:Cite) | A | N/A | N/A [CleanChanges](https://www.mediawiki.org/wiki/Extension:CleanChanges) | B | MLEB 2021.07 | 2021-07-29 +[CodeEditor](https://www.mediawiki.org/wiki/Extension:CodeEditor) | A | REL1_39 `67c012c` | 2022-12-15 [CodeMirror](https://www.mediawiki.org/wiki/Extension:CodeMirror) | A | REL1_35 `a326407` | 2021-08-25 [CookieWarning](https://www.mediawiki.org/wiki/Extension:CookieWarning) | A | REL1_35 `3c2ae6a` | 2022-04-29 [DiscussionTools](https://www.mediawiki.org/wiki/Extension:DiscussionTools) | A | REL1_35 `7aa0a9b` | 2022-05-06 diff --git a/skin.json b/skin.json index 7e65a1ff..13e6dab6 100644 --- a/skin.json +++ b/skin.json @@ -290,6 +290,8 @@ "+ext.centralNotice.display": "skinStyles/extensions/CentralNotice/ext.centralNotice.display.less", "+ext.cite.styles": "skinStyles/extensions/Cite/ext.cite.styles.less", "+ext.cleanchanges.uls": "skinStyles/extensions/CleanChanges/ext.cleanchanges.uls.less", + "+ext.codeEditor.ace": "skinStyles/extensions/CodeEditor/ext.codeEditor.ace.less", + "+jquery.codeEditor": "skinStyles/extensions/CodeEditor/jquery.codeEditor.less", "+ext.CodeMirror.lib": "skinStyles/extensions/CodeMirror/ext.CodeMirror.lib.less", "+ext.CodeMirror.mode.mediawiki": "skinStyles/extensions/CodeMirror/ext.CodeMirror.mode.mediawiki.less", "+ext.CodeMirror.visualEditor.init": "skinStyles/extensions/CodeMirror/ext.CodeMirror.visualEditor.init.less", diff --git a/skinStyles/extensions/CodeEditor/ext.codeEditor.ace.less b/skinStyles/extensions/CodeEditor/ext.codeEditor.ace.less new file mode 100644 index 00000000..08545f36 --- /dev/null +++ b/skinStyles/extensions/CodeEditor/ext.codeEditor.ace.less @@ -0,0 +1,52 @@ +/* + * Citizen + * + * SkinStyles for Extension:CodeEditor + * Module: ext.codeEditor.ace + * Version: REL1_39 67c012c + * + * Date: 2022-12-15 +*/ + +@import '../../../resources/variables.less'; + +// FIXME: Implemement same syntax higlight color as CodeMirror and SyntaxHighlight +.ace { + &-tm { + background-color: transparent; + color: var( --color-base--emphasized ); + + .ace { + &_gutter { + background-color: transparent; + color: var( --color-base--subtle ); + + &-active-line { + background-color: var( --background-color-quiet--hover ); + } + } + + &_marker-layer { + .ace { + &_active-line { + background-color: var( --background-color-quiet--hover ); + } + } + } + + &_print-margin { + background: var( --border-color-base ); + } + + &_cursor { + color: var( --color-base--emphasized ); + } + } + } + + &_gutter { + &-cell { + color: var( --color-base--subtle ); + } + } +} diff --git a/skinStyles/extensions/CodeEditor/jquery.codeEditor.less b/skinStyles/extensions/CodeEditor/jquery.codeEditor.less new file mode 100644 index 00000000..8785daee --- /dev/null +++ b/skinStyles/extensions/CodeEditor/jquery.codeEditor.less @@ -0,0 +1,56 @@ +/* + * Citizen + * + * SkinStyles for Extension:CodeEditor + * Module: jquery.codeEditor + * Version: REL1_39 67c012c + * + * Date: 2022-12-15 +*/ + +.wikiEditor-ui .ace_editor { + font-family: var( --font-family-monospace ); +} + +.codeEditor-status { + position: relative; + width: auto; // so it won't overflow + padding-top: 8px; // Make space for resize indicator + padding-right: var( --space-xs ); + padding-left: var( --space-xs ); + border-top-color: var( --border-color-base ); + background-color: var( --color-surface-2 ); + color: var( --color-base--subtle ); + line-height: var( --line-height-sm ); + + // HACK: Add resize indicator + &:after { + position: absolute; + top: 1px; // counter border top + right: 0; + left: 0; + width: 52px; + height: 4px; + border-radius: var( --border-radius--pill ); + margin: 2px auto; + background: var( --color-base--subtle ); + content: ''; + } + + &-worker, + &-line, + &-message { + padding: 0 var( --space-xs ); + } + + &-message { + border-color: var( --border-color-base ); + color: var( --color-base--emphasized ); + } +} + +// So that it connects with CodeEditor's status bar +.skin-citizen .mw-editform .editOptions { + border-top-left-radius: 0; + border-top-right-radius: 0; +} From 2e9dffb7f06470e25170407e619f9a5deb372d67 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Sat, 17 Dec 2022 22:44:36 -0500 Subject: [PATCH 23/35] =?UTF-8?q?fix(search):=20=F0=9F=90=9B=20correct=20U?= =?UTF-8?q?RL=20for=20MediaSearch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Somehow it has to have the type parameter or it'll just go directly to a page if exists --- resources/skins.citizen.search/typeahead.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/skins.citizen.search/typeahead.js b/resources/skins.citizen.search/typeahead.js index f2fed6cc..1f05bab9 100644 --- a/resources/skins.citizen.search/typeahead.js +++ b/resources/skins.citizen.search/typeahead.js @@ -421,7 +421,7 @@ function updateTypeahead( messages ) { if ( config.isMediaSearchExtensionEnabled ) { updateToolItem( { id: 'mediasearch', - link: `${config.wgScriptPath}/index.php?title=Special:MediaSearch&search=`, + link: `${config.wgScriptPath}/index.php?title=Special:MediaSearch&type=image&search=`, icon: 'imageGallery', msg: 'citizen-search-mediasearch' } ); From 60c12706a5adbb0bffb5802eb0979e1d7bd1a66c Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Sun, 18 Dec 2022 01:09:42 -0500 Subject: [PATCH 24/35] feat(search): contain the overscroll of search suggestion --- resources/skins.citizen.search/skins.citizen.search.less | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/skins.citizen.search/skins.citizen.search.less b/resources/skins.citizen.search/skins.citizen.search.less index 8d566ab3..0c27ebe7 100644 --- a/resources/skins.citizen.search/skins.citizen.search.less +++ b/resources/skins.citizen.search/skins.citizen.search.less @@ -9,6 +9,7 @@ box-sizing: border-box; padding: 0.75rem 0 0 0; margin: -0.75rem 0 0 0; // Reset
      styles + overscroll-behavior: contain; //border-radius: 0 0 var( --border-radius--medium ) var( --border-radius--medium ); .citizen-card; .citizen-card-hide( 50% 0, Y, false ); From 20417ef6c3f0b8dadd259f484156eda89b580fd3 Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Mon, 19 Dec 2022 13:10:03 +0100 Subject: [PATCH 25/35] Localisation updates from https://translatewiki.net. --- i18n/fr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr.json b/i18n/fr.json index 39e120cb..4e238820 100644 --- a/i18n/fr.json +++ b/i18n/fr.json @@ -29,7 +29,7 @@ "citizen-action-addsection": "Ajouter un sujet", "citizen-jumptotop": "Retour au début", "citizen-search-fulltext": "Rechercher les pages contenant $1", - "citizen-search-mediasearch": "Rechercher les médias relatifs à $1", + "citizen-search-mediasearch": "Rechercher des médias relatifs à $1", "citizen-search-empty-desc": "Taper pour commencer la recherche", "citizen-search-noresults-title": "Oh oh ! Aucun résultat pour $1", "citizen-search-noresults-desc": "Essayer peut-être les options ci-dessous ?", From 0051115ce069e039469dc8e463b3ae8789d51c89 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 20 Dec 2022 12:53:43 -0800 Subject: [PATCH 26/35] =?UTF-8?q?feat(core):=20=E2=9C=A8=20always=20trunca?= =?UTF-8?q?te=20sticky=20header=20first=20heading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That would keep the sticky first header to always be one line, also solves #559 --- resources/skins.citizen.styles/StickyHeader.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/skins.citizen.styles/StickyHeader.less b/resources/skins.citizen.styles/StickyHeader.less index ac0c8b71..d2f6e622 100644 --- a/resources/skins.citizen.styles/StickyHeader.less +++ b/resources/skins.citizen.styles/StickyHeader.less @@ -18,6 +18,7 @@ .citizen-body-header--sticky { .mw-body-header { padding-bottom: var( --space-md ); + flex-wrap: nowrap; .citizen-sticky-header; .mw-indicators { @@ -27,10 +28,13 @@ .page-heading { position: relative; + min-width: 0; } .firstHeading { font-size: var( --font-size-h3 ); + overflow: hidden; + text-overflow: ellipsis; } .citizen-jumptotop { From 6cfd8cb809401e689921e91cd741c593eca46d8e Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 20 Dec 2022 20:54:59 +0000 Subject: [PATCH 27/35] =?UTF-8?q?ci:=20=F0=9F=91=B7=20lint=20code=20to=20M?= =?UTF-8?q?ediaWiki=20standards?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check commit and GitHub actions for more details --- resources/skins.citizen.styles/StickyHeader.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/skins.citizen.styles/StickyHeader.less b/resources/skins.citizen.styles/StickyHeader.less index d2f6e622..c4dd8d55 100644 --- a/resources/skins.citizen.styles/StickyHeader.less +++ b/resources/skins.citizen.styles/StickyHeader.less @@ -17,8 +17,8 @@ .citizen-body-header--sticky { .mw-body-header { - padding-bottom: var( --space-md ); flex-wrap: nowrap; + padding-bottom: var( --space-md ); .citizen-sticky-header; .mw-indicators { @@ -32,9 +32,9 @@ } .firstHeading { - font-size: var( --font-size-h3 ); overflow: hidden; - text-overflow: ellipsis; + font-size: var( --font-size-h3 ); + text-overflow: ellipsis; } .citizen-jumptotop { From aa13b58194cd3cd4df9ce4b2154a9f8f5aed9b49 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 20 Dec 2022 13:34:59 -0800 Subject: [PATCH 28/35] fix(core): missing style for the previous commit --- resources/skins.citizen.styles/StickyHeader.less | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/skins.citizen.styles/StickyHeader.less b/resources/skins.citizen.styles/StickyHeader.less index c4dd8d55..ad43b8ca 100644 --- a/resources/skins.citizen.styles/StickyHeader.less +++ b/resources/skins.citizen.styles/StickyHeader.less @@ -18,6 +18,7 @@ .citizen-body-header--sticky { .mw-body-header { flex-wrap: nowrap; + white-space: nowrap; padding-bottom: var( --space-md ); .citizen-sticky-header; From 982407d454a24be32a57ebf47ecc06574fd3cf96 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 20 Dec 2022 21:36:13 +0000 Subject: [PATCH 29/35] =?UTF-8?q?ci:=20=F0=9F=91=B7=20lint=20code=20to=20M?= =?UTF-8?q?ediaWiki=20standards?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check commit and GitHub actions for more details --- resources/skins.citizen.styles/StickyHeader.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/skins.citizen.styles/StickyHeader.less b/resources/skins.citizen.styles/StickyHeader.less index ad43b8ca..1f1e4bee 100644 --- a/resources/skins.citizen.styles/StickyHeader.less +++ b/resources/skins.citizen.styles/StickyHeader.less @@ -18,8 +18,8 @@ .citizen-body-header--sticky { .mw-body-header { flex-wrap: nowrap; - white-space: nowrap; padding-bottom: var( --space-md ); + white-space: nowrap; .citizen-sticky-header; .mw-indicators { From a5747ad84b9af11d2134a82e3047b7c20bbe54ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Dec 2022 13:44:59 -0800 Subject: [PATCH 30/35] chore(deps): bump tj-actions/changed-files from 34 to 35 (#558) Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 34 to 35. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v34...v35) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/mediawiki.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mediawiki.yml b/.github/workflows/mediawiki.yml index 802dc662..08aa0d8f 100644 --- a/.github/workflows/mediawiki.yml +++ b/.github/workflows/mediawiki.yml @@ -40,7 +40,7 @@ jobs: # Check for changed files - name: Check for PHP changes id: changed-php - uses: tj-actions/changed-files@v34 + uses: tj-actions/changed-files@v35 with: since_last_remote_commit: "true" files: | @@ -48,7 +48,7 @@ jobs: - name: Check for script changes id: changed-script - uses: tj-actions/changed-files@v34 + uses: tj-actions/changed-files@v35 with: since_last_remote_commit: "true" files: | @@ -56,7 +56,7 @@ jobs: - name: Check for stylesheet changes id: changed-stylesheet - uses: tj-actions/changed-files@v34 + uses: tj-actions/changed-files@v35 with: since_last_remote_commit: "true" files: | @@ -67,7 +67,7 @@ jobs: - name: Check for i18n changes id: changed-i18n - uses: tj-actions/changed-files@v34 + uses: tj-actions/changed-files@v35 with: since_last_remote_commit: "true" files: | From 985ecb2aa10093a47b1aacfdc95839bbf588cfd6 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 20 Dec 2022 14:06:07 -0800 Subject: [PATCH 31/35] feat(core): tweak content sub spacing --- .../skinning/interface-subtitle.less | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/skins.citizen.styles/skinning/interface-subtitle.less b/resources/skins.citizen.styles/skinning/interface-subtitle.less index 7dbe4a76..23e03234 100644 --- a/resources/skins.citizen.styles/skinning/interface-subtitle.less +++ b/resources/skins.citizen.styles/skinning/interface-subtitle.less @@ -20,6 +20,16 @@ line-height: var( --line-height-xs ); } +#contentSub, +#contentSub2 { + margin-bottom: var( --space-md ); +} + +// Reduced spacing if both sub1 and 2 exists +#contentSub + #contentSub2 { + margin-top: ~'calc( var( --space-xs ) * -1 )'; +} + span.subpages { display: block; } From 023ee9427acbec2c019bee3a332df825e4853a45 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 20 Dec 2022 21:50:49 -0800 Subject: [PATCH 32/35] =?UTF-8?q?feat(core):=20=E2=9C=A8=20more=20colorful?= =?UTF-8?q?=20emphasized=20text=20color?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/skins.citizen.styles/common/theme.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/skins.citizen.styles/common/theme.less b/resources/skins.citizen.styles/common/theme.less index 317e1e79..7da765d8 100644 --- a/resources/skins.citizen.styles/common/theme.less +++ b/resources/skins.citizen.styles/common/theme.less @@ -48,7 +48,7 @@ a { --color-surface-3: ~'hsl( var( --color-primary__h ) 15% 20% )'; --color-surface-4: ~'hsl( var( --color-primary__h ) 15% 25% )'; - --color-base--emphasized: ~'hsl( var( --color-primary__h ) 15% 95% )'; + --color-base--emphasized: ~'hsl( var( --color-primary__h ) 80% 95% )'; --color-base: ~'hsl( var( --color-primary__h ) 10% 75% )'; --color-base--subtle: ~'hsl( var( --color-primary__h ) 25% 65% )'; From 084799f58ac4f4fe84ae19d08682d986303d0b04 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 21 Dec 2022 12:46:37 -0800 Subject: [PATCH 33/35] fix(core): add missing WMUI help icon (#560) --- skin.json | 1 + 1 file changed, 1 insertion(+) diff --git a/skin.json b/skin.json index 13e6dab6..10dcd6b0 100644 --- a/skin.json +++ b/skin.json @@ -237,6 +237,7 @@ "edit", "editLock", "ellipsis", + "help", "history", "home", "image", From 8d35bd164d480e010f252189d76152cd3eb0619c Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Thu, 22 Dec 2022 13:10:30 +0100 Subject: [PATCH 34/35] Localisation updates from https://translatewiki.net. --- i18n/lb.json | 1 + 1 file changed, 1 insertion(+) diff --git a/i18n/lb.json b/i18n/lb.json index 5df31542..bb06e8bd 100644 --- a/i18n/lb.json +++ b/i18n/lb.json @@ -13,6 +13,7 @@ "citizen-sitestats-edits-label": "Ännerungen", "citizen-jumptotop": "Zréck no uewen", "citizen-search-empty-desc": "Tippt fir unzefänke mat sichen", + "citizen-search-noresults-title": "O Neen! Näischt fonnt fir $1", "citizen-tagline-ns-help": "Hëllef-Säit", "prefs-citizen-theme-option-light": "Hell", "prefs-citizen-theme-option-dark": "Däischter", From 79b8836e5ae7dd9c550080238fdb24b04bffc44e Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Thu, 29 Dec 2022 13:14:24 +0100 Subject: [PATCH 35/35] Localisation updates from https://translatewiki.net. --- i18n/qqq.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i18n/qqq.json b/i18n/qqq.json index 23f54e61..ad62f4cd 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -3,11 +3,12 @@ "authors": [ "Abijeet Patro", "Alistair3149", + "Amire80", "[https://www.mediawiki.org/wiki/User:Alistair3149 Alistair3149]", "[https://www.mediawiki.org/wiki/User:Octfx Octfx]" ] }, - "skinname-citizen": "{{name}}", + "skinname-citizen": "{{name}}\n\n\"Citizen\" refers to the name of the video game [[:w:en:Star Citizen|Star Citizen]].", "citizen-skin-desc": "{{desc|what=skin|name=Citizen|url=https://github.com/StarCitizenTools/mediawiki-skins-Citizen}}", "citizen-prefs-talkpage": "Link to the Citizen talk page which is shown before the preview link in skin preferences. See T307113 for more information.", "citizen.css": "{{optional}}",