From b429e5f626c835e70388da8f851aea7f2755c3f3 Mon Sep 17 00:00:00 2001 From: CataeroGong Date: Wed, 28 Feb 2024 14:20:28 +0800 Subject: [PATCH] v3.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [+] 快捷键信息文字增加“内部超链”功能 --- keymap.html | 50 +++++++++++++++++++++++++++++++------------ release.cmd | 61 ++++++++++++++++------------------------------------- 2 files changed, 55 insertions(+), 56 deletions(-) diff --git a/keymap.html b/keymap.html index 9e1ae16..8959c9c 100644 --- a/keymap.html +++ b/keymap.html @@ -1101,6 +1101,13 @@ display: none; } +.ilink { + cursor: pointer; + /* color: blue; */ + text-decoration: dashed underline var(--c2); + text-underline-offset: 3px; +} + /* exe mode */ /* [data-launch-mode="exe"] :is(#btn_load_file, #btn_save_file, #btn_save_as_img) { display: none; @@ -1642,6 +1649,18 @@ * 启用修饰键颜色后,所有修饰键显示均会使用定义的背景颜色 对未设置颜色的修饰键,默认为透明背景 * 颜色和显示模式可以随意组合 + +【内部超链】 + 快捷键信息文字增加“内部超链”功能,可以跳转到键盘层或打开快捷键编辑窗口。 + 格式类似于 markdown 的超链:[文字](链接) + "[]" 中是内部超链的显示文字,可以为空,为空时显示层名+组合键 + "()" 中为链接,格式:"(L层号, 组合键)" + + 例: + [](L1) + [](L1, Ctrl+1) + [层2](L2) + [层2-键](L2, Alt+1) `; const KeymapHelp = { "#NAME": HELP_KEYMAP, @@ -1745,22 +1764,13 @@ "Ctrl+Shift+Q": "组1\n\n但不是主快捷键::g1", "RCtrl+Shift+Win+T": "组4\n::g4", "Ctrl+RShift+Win+T": "组5\n::g5", + "L": "内部超链\n\n[](L1)\n[](L1, Ctrl+1)\n[层2](L2)\n[层2-键](L2, Alt+1)", "#comment": HELP2 }, "#3": { "#name": "新增功能", - "Ctrl+1": "第1个键谱", - "Ctrl+2": "第2个键谱", - "Ctrl+3": "第3个键谱", - "Ctrl+4": "第4个键谱", - "Ctrl+5": "第5个键谱", - "Ctrl+6": "第6个键谱", - "Ctrl+7": "第7个键谱", - "Ctrl+8": "第8个键谱", - "Ctrl+9": "第9个键谱", - ",": "上一个键谱", - ".": "下一个键谱", - "#comment": `+<1~9> 快速切换键谱列表中的第 1~9 个键谱\n\n<,> 切换上一个键谱\n\n<.> 切换下一个键谱`, + "L": "内部超链\n\n[](L1)\n[](L1, Ctrl+1)\n[层2](L2)\n[层2-键](L2, Alt+1)", + "#comment": `【内部超链】\n 快捷键信息文字增加“内部超链”功能,可以跳转到键盘层或打开快捷键编辑窗口。\n 格式类似于 markdown 的超链:[文字](链接)\n "[]" 中是内部超链的显示文字,可以为空,为空时显示层名+组合键\n "()" 中为链接,格式:"(L层号, 组合键)"\n\n例:\n[](L1)\n[](L1, Ctrl+1)\n[层2](L2)\n[层2-键](L2, Alt+1)`, }, }; @@ -2078,6 +2088,20 @@ } } ret.digest = ret.digest.trim(); + // 处理内部超链宏 "[文字](Ln)", "[文字](Ln,A+B+C)" + function replacer(match, p1, p2, p3, p4, offset, string, groups) { + let ln = Keymap.getLayerName(parseInt(groups.layer)); + let txt = "L" + groups.layer + (ln ? ":" + ln : "") + (groups.combo ? "<" + groups.combo + ">" : ""); + let js = `UI.Keyboard.clearTips();UI.changeLayer(${groups.layer});UI.update();` + (groups.combo ? `setmapping_dlg('${groups.combo}');` : ""); + return `${groups.text || txt}` + } + re = /\[(?[^\]]*)\]\(L(?\d+)(\s*,\s*(?[^\)]+))?\)/g + ret.digest = ret.digest.replaceAll(re, replacer); + ret.body = ret.body.replaceAll(re, replacer); + // ret.body = mi.body.replaceAll(/\[(?.*)\]\(L(?\d+)\)/g, + // `$`); + // ret.body = mi.body.replaceAll(/\[(?.*)\]\(L(?\d+),\s*(?.+)\)/g, + // `$`); return ret; }, @@ -4343,7 +4367,7 @@

简易操作指南

window.on_webwin_loaded = webwin_init; var __appname__ = "键谱"; -var __version__ = "3.3.0"; +var __version__ = "3.4.0"; var __homepage__ = "https://github.com/cataerogong/keymap"; var __loader__ = ""; diff --git a/release.cmd b/release.cmd index f7e0797..15fd186 100644 --- a/release.cmd +++ b/release.cmd @@ -5,56 +5,31 @@ echo release version: %__version__% echo. pause -if not exist release mkdir release - -if "%~1" neq "" goto :%~1 - -call :html -call :clean -call :exe -call :tray - -exit /b - -:html -if exist release\keymap-%__version__%-html.zip del release\keymap-%__version__%-html.zip -zip release\keymap-%__version__%-html.zip keymap.html README.md MANUAL.md LICENSE js\* *.example.* keymaps\* -exit /b - -:clean pushd exe -call build clean +call build popd -if exist pack_tmp rmdir /s /q pack_tmp -exit /b -:exe -pushd exe -call build exe -popd -if not exist pack_tmp\data mkdir pack_tmp\data -::copy /y keymap.html pack_tmp\ -::copy /y README.md pack_tmp\ -::copy /y MANUAL.md pack_tmp\ +if exist pack_tmp rmdir /s /q pack_tmp +mkdir pack_tmp\data +copy /y keymap.html pack_tmp\ +copy /y README.md pack_tmp\ +copy /y MANUAL.md pack_tmp\ copy /y LICENSE pack_tmp\ +copy /y *.example.* pack_tmp\ +xcopy /y /s js\ pack_tmp\js\ +xcopy /y /s keymaps\ pack_tmp\keymaps\ copy /y exe\dist\keymap\keymap.exe pack_tmp\ xcopy /y /s exe\dist\keymap\_runtime\ pack_tmp\_runtime\ copy /y exe\README.md pack_tmp\README-keymap-exe.md -if exist release\keymap-%__version__%-exe-x64.zip del release\keymap-%__version__%-exe-x64.zip -cd pack_tmp -zip -r ..\release\keymap-%__version__%-exe-x64.zip keymap.* README-keymap-exe.md LICENSE _runtime\ data\ -cd .. -exit /b - -:tray -pushd exe -call build tray -popd -if not exist pack_tmp mkdir pack_tmp copy /y exe\dist\keymap\keymapTray.exe pack_tmp\ copy /y exe\dist\keymap\keymapTray.ini pack_tmp\ -if exist release\keymap-%__version__%-tray-x64.zip del release\keymap-%__version__%-tray-x64.zip -cd pack_tmp -zip -r ..\release\keymap-%__version__%-tray-x64.zip keymapTray.* LICENSE -cd .. + +if not exist release mkdir release +if exist release\keymap-%__version__%-all.zip del release\keymap-%__version__%-all.zip +if exist release\keymap-%__version__%-html.zip del release\keymap-%__version__%-html.zip +pushd pack_tmp +zip -r ..\release\keymap-%__version__%-html.zip keymap.html README.md MANUAL.md LICENSE *.example.* js\ keymaps\ +zip -r ..\release\keymap-%__version__%-all.zip * +popd + exit /b