From cee7d192ae1ad2e845b12f80ab8d12bc0c4be604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Thu, 11 Jul 2024 14:37:03 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E5=85=AC?= =?UTF-8?q?=E5=91=8A=E9=93=BE=E6=8E=A5=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E9=93=BE=E6=8E=A5=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/capabilities/SubWindow.json | 2 ++ src-tauri/gen/schemas/capabilities.json | 2 ++ src/assets/css/anno-parser.css | 13 +++++-------- src/web/utils/parseAnno.ts | 7 ++----- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src-tauri/capabilities/SubWindow.json b/src-tauri/capabilities/SubWindow.json index b7b7ef70..a120d0f1 100644 --- a/src-tauri/capabilities/SubWindow.json +++ b/src-tauri/capabilities/SubWindow.json @@ -16,6 +16,8 @@ "log:default", "path:allow-resolve-directory", "path:default", + "shell:allow-open", + "shell:default", "sql:allow-load", "sql:allow-execute", "sql:default", diff --git a/src-tauri/gen/schemas/capabilities.json b/src-tauri/gen/schemas/capabilities.json index e16efa5d..c66d4548 100644 --- a/src-tauri/gen/schemas/capabilities.json +++ b/src-tauri/gen/schemas/capabilities.json @@ -69,6 +69,8 @@ "log:default", "path:allow-resolve-directory", "path:default", + "shell:allow-open", + "shell:default", "sql:allow-load", "sql:allow-execute", "sql:default", diff --git a/src/assets/css/anno-parser.css b/src/assets/css/anno-parser.css index 0589b61b..85aab65d 100644 --- a/src/assets/css/anno-parser.css +++ b/src/assets/css/anno-parser.css @@ -1,7 +1,7 @@ /* * @file assets/css/post-parser.css * @description 游戏公告解析 css - * @since Beta v0.4.5 + * @since Beta v0.5.0 */ .anno-body { @@ -37,15 +37,12 @@ line-height: 2; } -.anno-link-icon { - width: 18px; - height: 18px; - color: #00c3ff; -} - .anno-content :deep(a) { color: #00c3ff; - text-decoration: none; + cursor: pointer; + text-decoration: underline solid #00c3ff; + text-underline-position: under; + transform: translateY(2px); } .anno-content :deep(p) { diff --git a/src/web/utils/parseAnno.ts b/src/web/utils/parseAnno.ts index 80f6b472..163fda29 100644 --- a/src/web/utils/parseAnno.ts +++ b/src/web/utils/parseAnno.ts @@ -1,7 +1,7 @@ /** * @file web/utils/parseAnno.ts * @description 解析游戏内公告数据 - * @since Beta v0.4.7 + * @since Beta v0.5.0 */ import { saveImgLocal } from "../../utils/TGShare.js"; @@ -11,14 +11,11 @@ import { decodeRegExp } from "./tools.js"; /** * @description 解析 a - * @since Beta v0.4.4 + * @since Beta v0.5.0 * @param {HTMLAnchorElement} a a 元素 * @returns {HTMLAnchorElement} 解析后的 a 元素 */ function parseAnnoA(a: HTMLAnchorElement): HTMLAnchorElement { - const span = document.createElement("i"); - span.classList.add("mdi", "mdi-link-variant", "anno-link-icon"); - a.prepend(span); const regex = /javascript:miHoYoGameJSSDK.openIn(Browser|Webview)\('(.+)'\);/; if (regex.test(a.getAttribute("href") ?? "")) { const href = a.getAttribute("href")?.match(regex);