From 3ef9fbcaf3d7b261792476f2486dc4b4a002bead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Sat, 6 Jul 2024 18:09:07 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8DRegExp?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E8=A2=AB=E8=A6=86=E7=9B=96=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#293=20#289?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 18 +++++++++--------- package.json | 2 +- src/pkg/utils/lodash.ts | 8 ++++++++ src/runtime/content/exec_script.test.ts | 8 ++++++++ src/runtime/content/utils.ts | 2 +- 5 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 src/pkg/utils/lodash.ts diff --git a/package-lock.json b/package-lock.json index 7c27b10d..d47529c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "scriptcat", - "version": "0.16.1", + "version": "0.16.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "scriptcat", - "version": "0.16.1", + "version": "0.16.3", "license": "GPLv3", "dependencies": { "@arco-design/web-react": "^2.51.1", @@ -51,7 +51,7 @@ "@types/crypto-js": "^4.1.1", "@types/eslint": "^8.4.10", "@types/jest": "^28.1.6", - "@types/lodash": "^4.14.194", + "@types/lodash": "^4.17.6", "@types/pako": "^2.0.0", "@types/react": "^18.0.15", "@types/react-dom": "^18.0.6", @@ -4431,9 +4431,9 @@ "peer": true }, "node_modules/@types/lodash": { - "version": "4.14.194", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.194.tgz", - "integrity": "sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==", + "version": "4.17.6", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.6.tgz", + "integrity": "sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==", "dev": true }, "node_modules/@types/luxon": { @@ -20819,9 +20819,9 @@ "peer": true }, "@types/lodash": { - "version": "4.14.194", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.194.tgz", - "integrity": "sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==", + "version": "4.17.6", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.6.tgz", + "integrity": "sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==", "dev": true }, "@types/luxon": { diff --git a/package.json b/package.json index 864ecae3..22872b3f 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@types/crypto-js": "^4.1.1", "@types/eslint": "^8.4.10", "@types/jest": "^28.1.6", - "@types/lodash": "^4.14.194", + "@types/lodash": "^4.17.6", "@types/pako": "^2.0.0", "@types/react": "^18.0.15", "@types/react-dom": "^18.0.6", diff --git a/src/pkg/utils/lodash.ts b/src/pkg/utils/lodash.ts new file mode 100644 index 00000000..c0ba0b29 --- /dev/null +++ b/src/pkg/utils/lodash.ts @@ -0,0 +1,8 @@ +/* eslint-disable import/prefer-default-export */ + +// 因为这个包出过好几次问题, 从原仓库单独剥离出来使用 +// copyright: https://github.com/lodash/lodash + +export function has(object: any, key: any) { + return object != null && Object.prototype.hasOwnProperty.call(object, key); +} diff --git a/src/runtime/content/exec_script.test.ts b/src/runtime/content/exec_script.test.ts index d3120e87..fb12346c 100644 --- a/src/runtime/content/exec_script.test.ts +++ b/src/runtime/content/exec_script.test.ts @@ -109,4 +109,12 @@ describe("sandbox", () => { const ret = await sandboxExec.exec(); expect(ret).toEqual(2); }); + + // RegExp.$x 内容被覆盖 https://github.com/scriptscat/scriptcat/issues/293 + it("RegExp", async () => { + scriptRes2.code = `let ok = /12(3)/.test('123');return RegExp.$1;`; + sandboxExec.scriptFunc = compileScript(compileScriptCode(scriptRes2)); + const ret = await sandboxExec.exec(); + expect(ret).toEqual("3"); + }); }); diff --git a/src/runtime/content/utils.ts b/src/runtime/content/utils.ts index bfa74460..b28a7c84 100644 --- a/src/runtime/content/utils.ts +++ b/src/runtime/content/utils.ts @@ -1,7 +1,7 @@ import { MessageManager } from "@App/app/message/message"; import { ScriptRunResouce } from "@App/app/repo/scripts"; import { v4 as uuidv4 } from "uuid"; -import has from "lodash/has"; +import { has } from "@App/pkg/utils/lodash"; import GMApi, { ApiValue, GMContext } from "./gm_api"; // 构建脚本运行代码 From f6f0a80d10ccc0597fb7128fdf125bbd16aa1c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Sun, 7 Jul 2024 16:58:56 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=90=9B=20=E5=A4=84=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=9B=9E=E9=80=80=20#277?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/options/routes/script/ScriptEditor.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/pages/options/routes/script/ScriptEditor.tsx b/src/pages/options/routes/script/ScriptEditor.tsx index e98504e2..fc83889d 100644 --- a/src/pages/options/routes/script/ScriptEditor.tsx +++ b/src/pages/options/routes/script/ScriptEditor.tsx @@ -149,6 +149,17 @@ const emptyScript = async (template: string, hotKeys: any, target?: string) => { type visibleItem = "scriptStorage" | "scriptSetting" | "scriptResource"; +const popstate = () => { + // eslint-disable-next-line no-restricted-globals + if (confirm("脚本已修改, 离开后会丢失修改, 是否继续?")) { + window.history.back(); + window.removeEventListener("popstate", popstate); + } else { + window.history.pushState(null, "", window.location.href); + } + return false; +}; + function ScriptEditor() { const scriptDAO = new ScriptDAO(); const scriptCtrl = IoC.instance(ScriptController) as ScriptController; @@ -426,6 +437,10 @@ function ScriptEditor() { return true; }; window.onbeforeunload = beforeunload; + window.history.pushState(null, "", window.location.href); + window.addEventListener("popstate", popstate); + } else { + window.removeEventListener("popstate", popstate); } return () => { From 8a05f00c2922c2382bae9c46a3d49a08223b4de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Sun, 7 Jul 2024 17:09:27 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E5=90=8E=E7=82=B9=E5=87=BB=E9=94=99=E4=B9=B1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#283?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/options/routes/ScriptList.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pages/options/routes/ScriptList.tsx b/src/pages/options/routes/ScriptList.tsx index 0dcf6a53..08268625 100644 --- a/src/pages/options/routes/ScriptList.tsx +++ b/src/pages/options/routes/ScriptList.tsx @@ -155,7 +155,7 @@ function ScriptList() { }, ], onFilter: (value, row) => row.status === value, - render: (col, item: ListType, index) => { + render: (col, item: ListType) => { return ( { setScriptList((list) => { - list[index].loading = true; - return [...list]; + return list.map((script) => { + if (script.id === item.id) { + script.loading = true; + } + return script; + }); }); setScriptList((list) => { + const index = list.findIndex((script) => script.id === item.id); let p: Promise; if (checked) { p = scriptCtrl.enable(item.id).then(() => { From faeb30c2803db8873cc186a28008c5cc9c6b5393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Mon, 8 Jul 2024 10:18:21 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E2=9C=A8=20=E6=96=B0=E5=BB=BA=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E6=94=AF=E6=8C=81=E5=AF=BC=E5=85=A5=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=20#294?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 14 +++---- package.json | 2 +- src/locales/zh-CN/translation.json | 5 ++- src/pages/components/layout/MainLayout.tsx | 45 ++++++++++++++++++++++ 4 files changed, 57 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index d47529c4..afc7413f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-i18next": "^13.1.0", - "react-icons": "^4.4.0", + "react-icons": "^5.2.1", "react-joyride": "^2.5.5", "react-router-dom": "^6.3.0", "semver": "^7.3.8", @@ -14976,9 +14976,9 @@ } }, "node_modules/react-icons": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.4.0.tgz", - "integrity": "sha512-fSbvHeVYo/B5/L4VhB7sBA1i2tS8MkT0Hb9t2H1AVPkwGfVHLJCqyr2Py9dKMxsyM63Eng1GkdZfbWj+Fmv8Rg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.2.1.tgz", + "integrity": "sha512-zdbW5GstTzXaVKvGSyTaBalt7HSfuK5ovrzlpyiWHAFXndXTdd/1hdDHI4xBM1Mn7YriT6aqESucFl9kEXzrdw==", "peerDependencies": { "react": "*" } @@ -28773,9 +28773,9 @@ } }, "react-icons": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.4.0.tgz", - "integrity": "sha512-fSbvHeVYo/B5/L4VhB7sBA1i2tS8MkT0Hb9t2H1AVPkwGfVHLJCqyr2Py9dKMxsyM63Eng1GkdZfbWj+Fmv8Rg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.2.1.tgz", + "integrity": "sha512-zdbW5GstTzXaVKvGSyTaBalt7HSfuK5ovrzlpyiWHAFXndXTdd/1hdDHI4xBM1Mn7YriT6aqESucFl9kEXzrdw==", "requires": {} }, "react-is": { diff --git a/package.json b/package.json index 22872b3f..adbd0b45 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-i18next": "^13.1.0", - "react-icons": "^4.4.0", + "react-icons": "^5.2.1", "react-joyride": "^2.5.5", "react-router-dom": "^6.3.0", "semver": "^7.3.8", diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json index 0b6a883d..386aeae7 100644 --- a/src/locales/zh-CN/translation.json +++ b/src/locales/zh-CN/translation.json @@ -4,6 +4,9 @@ "create_user_script": "新建普通脚本", "create_background_script": "新建后台脚本", "create_scheduled_script": "新建定时脚本", + "import_by_local": "本地导入", + "import_local_failure": "本地导入失败", + "import_local_success": "本地导入成功", "create_script": "新建脚本", "user_guide": "使用指南", "api_docs": "API文档", @@ -354,4 +357,4 @@ "resize_column_width": "调整列宽", "collapse": "收起", "expand": "展开" -} +} \ No newline at end of file diff --git a/src/pages/components/layout/MainLayout.tsx b/src/pages/components/layout/MainLayout.tsx index f3db767e..becf4234 100644 --- a/src/pages/components/layout/MainLayout.tsx +++ b/src/pages/components/layout/MainLayout.tsx @@ -28,6 +28,7 @@ import { RiTerminalBoxLine, RiTimerLine, RiPlayListAddLine, + RiImportLine, } from "react-icons/ri"; import "./index.css"; import { useTranslation } from "react-i18next"; @@ -131,6 +132,50 @@ const MainLayout: React.FC<{ {t("create_scheduled_script")} + { + const el = document.getElementById("import-local"); + el!.onchange = (e: Event) => { + const scriptCtl = IoC.instance( + ScriptController + ) as ScriptController; + try { + // 获取文件 + // @ts-ignore + const file = e.target.files[0]; + // 实例化 FileReader对象 + const reader = new FileReader(); + reader.onload = async (processEvent) => { + // 创建blob url + const blob = new Blob( + // @ts-ignore + [processEvent.target!.result], + { + type: "application/javascript", + } + ); + const url = URL.createObjectURL(blob); + await scriptCtl.importByUrl(url); + Message.success(t("import_local_success")); + }; + // 调用readerAsText方法读取文本 + reader.readAsText(file); + } catch (error) { + Message.error(`${t("import_local_failure")}: ${e}`); + } + }; + el!.click(); + }} + > + + {t("import_by_local")} + { From 013a4f614e62beeab6e0696fd09c11dcea9e0607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Mon, 8 Jul 2024 15:42:23 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8Dfirefox?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8BGM=5FaddElement=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#291?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/message/content.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/app/message/content.ts b/src/app/message/content.ts index 1ce767de..5ebd95f3 100644 --- a/src/app/message/content.ts +++ b/src/app/message/content.ts @@ -1,3 +1,4 @@ +import LoggerCore from "../logger/core"; import { Channel } from "./channel"; import { ChannelManager, @@ -107,15 +108,6 @@ export default class MessageContent nativeSend(data: any): void { let detail = data; - if (typeof cloneInto !== "undefined") { - try { - // eslint-disable-next-line no-undef - detail = cloneInto(detail, document.defaultView); - } catch (e) { - // eslint-disable-next-line no-console - console.log(e); - } - } // 特殊处理relatedTarget if (detail.data && typeof detail.data.relatedTarget === "object") { @@ -135,6 +127,18 @@ export default class MessageContent document.dispatchEvent(ev); } + if (typeof cloneInto !== "undefined") { + try { + LoggerCore.getLogger().info("nativeSend"); + // eslint-disable-next-line no-undef + detail = cloneInto(detail, document.defaultView); + } catch (e) { + // eslint-disable-next-line no-console + console.log(e); + LoggerCore.getLogger().info("error data"); + } + } + const ev = new CustomEvent((this.isContent ? "fd" : "ct") + this.eventId, { detail, }); From dd3b1b4f9012eecd52f5f27d8f6f4fb24c9888c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Mon, 8 Jul 2024 15:55:19 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E5=88=A0?= =?UTF-8?q?=E9=99=A4Userconfig=E5=90=8E=E4=B8=BB=E9=A1=B5=E8=BF=98?= =?UTF-8?q?=E6=98=AF=E4=BC=9A=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20#285?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/service/script/event.ts | 4 ++++ src/pages/options/routes/script/ScriptEditor.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/service/script/event.ts b/src/app/service/script/event.ts index 86b386aa..923e5d38 100644 --- a/src/app/service/script/event.ts +++ b/src/app/service/script/event.ts @@ -68,6 +68,10 @@ export default class ScriptEventListener { script.selfMetadata = oldScript.selfMetadata; } } + // 判断一些undefined的字段 + if (!script.config) { + script.config = undefined; + } return new Promise((resolve, reject) => { this.dao.save(script).then( () => { diff --git a/src/pages/options/routes/script/ScriptEditor.tsx b/src/pages/options/routes/script/ScriptEditor.tsx index fc83889d..8ff1a984 100644 --- a/src/pages/options/routes/script/ScriptEditor.tsx +++ b/src/pages/options/routes/script/ScriptEditor.tsx @@ -150,7 +150,7 @@ const emptyScript = async (template: string, hotKeys: any, target?: string) => { type visibleItem = "scriptStorage" | "scriptSetting" | "scriptResource"; const popstate = () => { - // eslint-disable-next-line no-restricted-globals + // eslint-disable-next-line no-restricted-globals, no-alert if (confirm("脚本已修改, 离开后会丢失修改, 是否继续?")) { window.history.back(); window.removeEventListener("popstate", popstate); From fcfb3ac0e3378b9607ee29593000e660edc4b955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Tue, 9 Jul 2024 11:36:00 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8DEnglish?= =?UTF-8?q?=E4=B8=8B=E5=88=97=E5=AE=BD=E9=97=AE=E9=A2=98=20#297?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/locales/ach-UG/translation.json | 14 ++++++++++++-- src/locales/en/translation.json | 18 ++++++++++++++---- src/locales/zh-CN/translation.json | 4 +++- src/locales/zh-TW/translation.json | 14 ++++++++++++-- src/manifest.json | 2 +- src/pages/options/routes/ScriptList.tsx | 4 ---- src/pages/options/routes/Setting.tsx | 4 ++-- 8 files changed, 45 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index adbd0b45..ba1fe6e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scriptcat", - "version": "0.16.3", + "version": "0.16.4", "description": "脚本猫,一个可以执行用户脚本的浏览器扩展,万物皆可脚本化,让你的浏览器可以做更多的事情!", "author": "CodFrm", "license": "GPLv3", diff --git a/src/locales/ach-UG/translation.json b/src/locales/ach-UG/translation.json index 2b1ded9f..a0d7ecda 100644 --- a/src/locales/ach-UG/translation.json +++ b/src/locales/ach-UG/translation.json @@ -4,6 +4,9 @@ "create_user_script": "crwdns5824:0crwdne5824:0", "create_background_script": "crwdns5826:0crwdne5826:0", "create_scheduled_script": "crwdns5828:0crwdne5828:0", + "import_by_local": "crwdns6892:0crwdne6892:0", + "import_local_failure": "crwdns6894:0crwdne6894:0", + "import_local_success": "crwdns6896:0crwdne6896:0", "create_script": "crwdns5830:0crwdne5830:0", "user_guide": "crwdns5832:0crwdne5832:0", "api_docs": "crwdns5834:0crwdne5834:0", @@ -348,5 +351,12 @@ "guide_setting_title": "crwdns6498:0crwdne6498:0", "guide_setting_content": "crwdns6500:0crwdne6500:0", "guide_setting_sync_title": "crwdns6502:0crwdne6502:0", - "guide_setting_sync_content": "crwdns6504:0crwdne6504:0" -} + "guide_setting_sync_content": "crwdns6900:0crwdne6900:0", + "auto": "crwdns6902:0crwdne6902:0", + "hide": "crwdns6904:0crwdne6904:0", + "resize_column_width": "crwdns6906:0crwdne6906:0", + "collapse": "crwdns6908:0crwdne6908:0", + "expand": "crwdns6910:0crwdne6910:0", + "menu_expand_num_before": "crwdns6912:0crwdne6912:0", + "menu_expand_num_after": "crwdns6914:0crwdne6914:0" +} \ No newline at end of file diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 3bca2cb5..d8abe5db 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -4,6 +4,9 @@ "create_user_script": "Create User Script", "create_background_script": "Create Background Script", "create_scheduled_script": "Create Scheduled Script", + "import_by_local": "Local Imported", + "import_local_failure": "Local import failed", + "import_local_success": "Local import success", "create_script": "Create Script", "user_guide": "User Guide", "api_docs": "API Docs", @@ -106,8 +109,8 @@ }, "enable": "Enable", "script_list_enable_width": 120, - "script_list_last_updated_width": 0, - "script_list_apply_to_run_status_width": 0, + "script_list_last_updated_width": 140, + "script_list_apply_to_run_status_width": 160, "subscribe_list_enable_width": 120, "disable": "Disable", "name": "Name", @@ -348,5 +351,12 @@ "guide_setting_title": "Settings", "guide_setting_content": "The settings mainly include language, script synchronization, update frequency, and other common options.", "guide_setting_sync_title": "Update and Sync", - "guide_setting_sync_content": "The script synchronization feature allows you to easily sync the script content of this device to the cloud. If you select the option to sync deletions, when a script is deleted on this device, it will also be deleted from the cloud. You can also update the script version here to get more powerful features." -} + "guide_setting_sync_content": "The script synchronization feature allows you to easily sync the script content of this device to the cloud. If you select the option to sync deletions, when a script is deleted on this device, it will also be deleted from the cloud. You can also update the script version here to get more powerful features.", + "auto": "Auto", + "hide": "Hide", + "resize_column_width": "Resize Column", + "collapse": "Collapse", + "expand": "Expand", + "menu_expand_num_before": "Menu item more than", + "menu_expand_num_after": "Auto-hide." +} \ No newline at end of file diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json index 386aeae7..cd32cbfb 100644 --- a/src/locales/zh-CN/translation.json +++ b/src/locales/zh-CN/translation.json @@ -356,5 +356,7 @@ "hide": "隐藏", "resize_column_width": "调整列宽", "collapse": "收起", - "expand": "展开" + "expand": "展开", + "menu_expand_num_before": "菜单项超过", + "menu_expand_num_after": "个时,自动隐藏" } \ No newline at end of file diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json index 61f035d5..aa54fa24 100644 --- a/src/locales/zh-TW/translation.json +++ b/src/locales/zh-TW/translation.json @@ -4,6 +4,9 @@ "create_user_script": "新建普通腳本", "create_background_script": "新建後台腳本", "create_scheduled_script": "新建定時腳本", + "import_by_local": "本地导入", + "import_local_failure": "本地导入失败", + "import_local_success": "本地导入成功", "create_script": "新建腳本", "user_guide": "使用指南", "api_docs": "API文檔", @@ -348,5 +351,12 @@ "guide_setting_title": "設置", "guide_setting_content": "設置中主要包含了語言、腳本同步、更新頻率等常用設置項", "guide_setting_sync_title": "更新與同步", - "guide_setting_sync_content": "腳本同步功能可以方便的將本設備的腳本內容同步至雲端,如果勾選同步刪除選項,則當本設備腳本刪除時,也會從刪除雲端對應的腳本。你也可以在此更新腳本的版本獲得更加強大的功能。" -} + "guide_setting_sync_content": "脚本同步功能可以方便的将本设备的脚本内容同步至云端,如果有多台设备请勾选同步删除选项,当本设备脚本删除时,会从云端删除对应的脚本,也会将其它设备的脚本删除。", + "auto": "自动", + "hide": "隐藏", + "resize_column_width": "调整列宽", + "collapse": "收起", + "expand": "展开", + "menu_expand_num_before": "菜单项超过", + "menu_expand_num_after": "个时,自动隐藏" +} \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index f9b3afbf..97fbb96e 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "__MSG_scriptcat__", - "version": "0.16.3", + "version": "0.16.4", "author": "CodFrm", "description": "__MSG_scriptcat_description__", "options_ui": { diff --git a/src/pages/options/routes/ScriptList.tsx b/src/pages/options/routes/ScriptList.tsx index 08268625..e43b4012 100644 --- a/src/pages/options/routes/ScriptList.tsx +++ b/src/pages/options/routes/ScriptList.tsx @@ -694,10 +694,6 @@ function ScriptList() { newColumns.forEach((item) => { switch (item.width) { - case 0: - item.width = 0; - dealColumns.push(item); - break; case -1: break; default: diff --git a/src/pages/options/routes/Setting.tsx b/src/pages/options/routes/Setting.tsx index 5b8ef4d7..22d48812 100644 --- a/src/pages/options/routes/Setting.tsx +++ b/src/pages/options/routes/Setting.tsx @@ -96,7 +96,7 @@ function Setting() { - 菜单项超过 + {t("menu_expand_num_before")}: - 个时,自动隐藏 + {t("menu_expand_num_after")}