From 32fc367fd6318458e3c241309de077722905aae7 Mon Sep 17 00:00:00 2001 From: AwAjie <139576615+ajdgg@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:05:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=E5=92=8Cinfobox=E4=B8=ADtabber=E6=8B=93=E5=B1=95?= =?UTF-8?q?=E6=BA=A2=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ConsolePrintWordartLogo.ts | 18 ++++++++++++++++++ src/ConsolePrintWordartLogo/LICENSE | 5 +++++ src/ConsolePrintWordartLogo/definition.json | 9 +++++++++ src/SkinCitizen_CSS/SkinCitizen_CSS.less | 1 + .../infobox-tabber-overflow-repair.less | 18 ++++++++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 src/ConsolePrintWordartLogo/ConsolePrintWordartLogo.ts create mode 100644 src/ConsolePrintWordartLogo/LICENSE create mode 100644 src/ConsolePrintWordartLogo/definition.json create mode 100644 src/SkinCitizen_CSS/modules/infobox-tabber-overflow-repair.less diff --git a/src/ConsolePrintWordartLogo/ConsolePrintWordartLogo.ts b/src/ConsolePrintWordartLogo/ConsolePrintWordartLogo.ts new file mode 100644 index 00000000..d4bfbc9d --- /dev/null +++ b/src/ConsolePrintWordartLogo/ConsolePrintWordartLogo.ts @@ -0,0 +1,18 @@ +(async function () { + const consoleTUrl = `${mw.config.get('wgServer')}/api.php?action=query&meta=siteinfo&formatversion=2&format=json`; + const generatordata = await fetch(consoleTUrl); + const generatordataJson = (await generatordata.json()) as unknown; + const mediawikiVersions = (generatordataJson as {query: {general: {generator: string}}}).query.general.generator; + const ascii = ` +██╗ ██╗ ██████╗ ██╗ ██╗██╗ ██╗ +╚██╗ ██╔╝ ██╔═══██╗██║ ╚═╝██║ ╚═╝ + ╚██╗ ██╔╝██████╗ ██╗ ██╗██║ ╚═╝███████╗ ██████╗ ██╗ ██╗ ██╗ ██╗ ██╗██╗██║ ██╗██╗ + ╚████╔╝██╔═══██╗██║ ██║╚██████╗ ██╔═══██╗██╔═══██╗██║ ██║ ██║ ██║ ██║██║██║ ██╔╝██║ + ╚██╔╝ ██║ ██║██║ ██║ ╚════██║██║ ██║██║ ██║██║ ██║ ██║ ██║ ██║██║██████╔╝ ██║ + ██║ ██║ ██║██║ ██║██ ██║██║ ██║██║ ██║██║ ██║ ██║ ██║ ██║██║██╔══██╗ ██║ + ██║ ╚██████╔╝╚██████╔╝╚██████╔╝██║ ██║╚██████╔╝╚██████╔╝██╗╚█████ ████╔╝██║██║ ╚██╗██║ + ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╚═══╝ ╚═╝╚═╝ ╚═╝╚═╝ + ©2023-${new Date().getFullYear()} 有兽档案馆 ${mediawikiVersions} + `; + console.log(`%c${ascii}`, 'color:#159c5a'); +})(); diff --git a/src/ConsolePrintWordartLogo/LICENSE b/src/ConsolePrintWordartLogo/LICENSE new file mode 100644 index 00000000..e196e708 --- /dev/null +++ b/src/ConsolePrintWordartLogo/LICENSE @@ -0,0 +1,5 @@ +/** + * SPDX-License-Identifier: CC-BY-SA-4.0 + * _addText: '{{Gadget Header|license=CC-BY-SA-4.0|import=no}}' + * @author 顶呱呱的阿杰 + */ \ No newline at end of file diff --git a/src/ConsolePrintWordartLogo/definition.json b/src/ConsolePrintWordartLogo/definition.json new file mode 100644 index 00000000..02e90f44 --- /dev/null +++ b/src/ConsolePrintWordartLogo/definition.json @@ -0,0 +1,9 @@ +{ + "enable": true, + "description": "U NavbarAvatar 在导航栏显示用户头像。", + "section": "browser", + "default": true, + "dependencies": ["mediawiki.user"], + "hidden": true, + "rights": ["edit"] +} diff --git a/src/SkinCitizen_CSS/SkinCitizen_CSS.less b/src/SkinCitizen_CSS/SkinCitizen_CSS.less index 946f721e..958b52ad 100644 --- a/src/SkinCitizen_CSS/SkinCitizen_CSS.less +++ b/src/SkinCitizen_CSS/SkinCitizen_CSS.less @@ -9,6 +9,7 @@ @import './modules/fix-site-icon.less'; @import './modules/hide-sub.less'; @import './modules/HYYouShouYan.less'; +@import './modules/infobox-tabber-overflow-repair.less'; @import './modules/mobile-style.less'; @import './modules/pages-style-repair.less'; @import './modules/page-width.less'; diff --git a/src/SkinCitizen_CSS/modules/infobox-tabber-overflow-repair.less b/src/SkinCitizen_CSS/modules/infobox-tabber-overflow-repair.less new file mode 100644 index 00000000..dbec0865 --- /dev/null +++ b/src/SkinCitizen_CSS/modules/infobox-tabber-overflow-repair.less @@ -0,0 +1,18 @@ +// 修复tabber扩展在infobox中溢出的问题 by awajie +.infobox { + tbody { + > tr:nth-child(1) { + td { + display: flex; + flex-direction: column; + overflow-x: auto; + .tabber__header .tabber__header__prev::after, + .tabber__header .tabber__header__next::after { + display: block; + width: 100%; + height: 100%; + } + } + } + } +} From 3df422c146c0ad6a517b031119aaed28ba75c069 Mon Sep 17 00:00:00 2001 From: ZoruaFox <96456728+ZoruaFox@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:51:25 +0800 Subject: [PATCH 2/2] Update definition.json --- src/ConsolePrintWordartLogo/definition.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ConsolePrintWordartLogo/definition.json b/src/ConsolePrintWordartLogo/definition.json index 02e90f44..2f8b46fd 100644 --- a/src/ConsolePrintWordartLogo/definition.json +++ b/src/ConsolePrintWordartLogo/definition.json @@ -1,9 +1,7 @@ { "enable": true, - "description": "U NavbarAvatar 在导航栏显示用户头像。", + "description": "UConsolePrintWordartLogo", "section": "browser", "default": true, - "dependencies": ["mediawiki.user"], "hidden": true, - "rights": ["edit"] }