From 0ba2e4e133400518f43e84ccdefcc00012beab5a Mon Sep 17 00:00:00 2001 From: littlefean <2028140990@qq.com> Date: Sat, 4 Jan 2025 18:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E5=85=B3=E9=97=AD=E5=9C=B0?= =?UTF-8?q?=E7=90=83=E4=BB=AA=E6=8C=89=E9=92=AE=E7=82=B9=E5=87=BB=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\350\277\233\347\250\213\345\233\276.json" | 2 +- src/pages/_toolbar.tsx | 45 ++++++++++--------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git "a/docs-pg/ProjectGraph\345\274\200\345\217\221\350\277\233\347\250\213\345\233\276.json" "b/docs-pg/ProjectGraph\345\274\200\345\217\221\350\277\233\347\250\213\345\233\276.json" index ec3d3825..5e1d6e64 100644 --- "a/docs-pg/ProjectGraph\345\274\200\345\217\221\350\277\233\347\250\213\345\233\276.json" +++ "b/docs-pg/ProjectGraph\345\274\200\345\217\221\350\277\233\347\250\213\345\233\276.json" @@ -1267,7 +1267,7 @@ "text": "可以自定义的颜色管理面板", "uuid": "eed8a19b-962b-4387-91b7-45390c214a0d", "details": "", - "color": [0, 0, 0, 0], + "color": [22, 163, 74, 1], "type": "core:text_node" }, { diff --git a/src/pages/_toolbar.tsx b/src/pages/_toolbar.tsx index 2593c839..59f20856 100644 --- a/src/pages/_toolbar.tsx +++ b/src/pages/_toolbar.tsx @@ -39,11 +39,11 @@ import { ViewFlashEffect } from "../core/effect/concrete/ViewFlashEffect"; import { Stage } from "../core/stage/Stage"; import { StageDumper } from "../core/stage/StageDumper"; import { StageDumperSvg } from "../core/stage/StageDumperSvg"; -import { StageSaveManager } from "../core/stage/StageSaveManager"; +// import { StageSaveManager } from "../core/stage/StageSaveManager"; import { Dialog } from "../utils/dialog"; -import { exists, writeTextFile } from "../utils/fs"; +import { writeTextFile } from "../utils/fs"; import { Popup } from "../utils/popup"; -import { PathString } from "../utils/pathString"; +// import { PathString } from "../utils/pathString"; import ColorManagerPanel from "./_color_manager_panel"; import { ColorManager } from "../core/ColorManager"; @@ -378,11 +378,11 @@ export default function Toolbar({ className = "" }: { className?: string }) { icon={} handleFunction={async () => { // 先保存一下 - if (!StageSaveManager.isSaved()) { - await StageSaveManager.saveHandleWithoutCurrentPath( - StageDumper.dump(), - ); - } + // if (!StageSaveManager.isSaved()) { + // await StageSaveManager.saveHandleWithoutCurrentPath( + // StageDumper.dump(), + // ); + // } // 打开文件或网页 openBrowserOrFile(); }} @@ -519,19 +519,22 @@ async function openBrowserOrFile() { // 去除前后的引号 nodeText = nodeText.slice(1, -1); } - if (PathString.isValidURL(nodeText)) { - // 是网址 - myOpen(nodeText); - } else { - const isExists = await exists(nodeText); - if (isExists) { - // 是文件 - myOpen(nodeText); - } else { - // 不是网址也不是文件,不做处理 - Stage.effects.push(new TextRiseEffect("非法文件路径: " + nodeText)); - } - } + myOpen(nodeText); + // 2025年1月4日——有自动备份功能了,好像不需要再加验证了 + + // if (PathString.isValidURL(nodeText)) { + // // 是网址 + // myOpen(nodeText); + // } else { + // const isExists = await exists(nodeText); + // if (isExists) { + // // 是文件 + // myOpen(nodeText); + // } else { + // // 不是网址也不是文件,不做处理 + // Stage.effects.push(new TextRiseEffect("非法文件路径: " + nodeText)); + // } + // } } } }