diff --git a/Custom.md b/Custom.md index 936ce6eb..48291c33 100644 --- a/Custom.md +++ b/Custom.md @@ -6,6 +6,8 @@ 以下均以外置手册`Java`为例 +该外置下载地址 [百度网盘](https://pan.baidu.com/s/188sFN_oktGulGTdvnCQPqw) 提取码: `yfh7` + ## 配置格式 增加外置手册需要填写的参数如下图所示 diff --git a/README.md b/README.md index 2f8faa80..000bd023 100644 --- a/README.md +++ b/README.md @@ -169,11 +169,9 @@ ![Snipaste_2019-04-08_21-29-49.png](https://i.loli.net/2019/04/08/5cab4d354abe7.png) ![Snipaste_2019-04-08_21-31-23.png](https://i.loli.net/2019/04/08/5cab4d4b93e34.png) +## 安装 - -## 下载 - -[百度网盘](https://pan.baidu.com/s/188sFN_oktGulGTdvnCQPqw) 提取码: `yfh7` +请直接在插件中心进行安装即可,或将本项目打包成`upx`安装 [项目地址](https://github.com/fofolee/uTools-Manuals) @@ -181,9 +179,7 @@ [外置手册教程](https://yuanliao.info/d/356/27) -## 安装方法 - -将`upx`文件拖入`uTools`输入框中安装即可,安装前最好先卸载旧版本的插件,如果安装过程较久,请耐心等待 +## 关键字 ## 关键字 @@ -199,6 +195,7 @@ - 切换列表和手册视图 `tab` `🖱右键` - 发送选中的内容至上一个活动窗口 `⇪ + ⏎` `🖱中键` - 搜索下一个关键词 `⏎` + - 选中文本后翻译 `T` - 退出插件 `esc` ## 手册一览 diff --git a/assets/index.js b/assets/index.js index 1f0a4fb6..c8b4131e 100644 --- a/assets/index.js +++ b/assets/index.js @@ -46,6 +46,27 @@ showList = (text, index, listnum) => { window.mouseLockTime = new Date().getTime(); } +// 列表界面子输入框 +mainlistSubInput = () => { + utools.removeSubInput(); + utools.setSubInput(({ text }) => { + // 列表搜索 + showList(text.toUpperCase(), index, 300); + // 高亮结果 + text.split(' ').forEach(keyword => { + keyword && $(".name,.description").highlight(keyword, 'listFounds'); + }); + }, '空格→多关键词搜索;鼠标中键→发送选中条目到活动窗口'); +} + +// 手册界面子输入框 +manualSubInput = () => { + utools.removeSubInput(); + utools.setSubInput(({ text }) => { + highlightManual("#manual", text); + }, '空格→多关键词;选中文本→中键发送 T翻译 S收藏;Tab→切换界面'); +} + // 显示手册 showManual = path => { @@ -77,7 +98,7 @@ showManual = path => { $("#manual").html(`
${data}
`).fadeIn(); Prism.highlightAll(); location.href = e ? id : '#manualBody'; - utools.setSubInputValue(''); + manualSubInput(); }); request.fail(function (xhr, err) { $(".load").html('404').fadeOut(); @@ -118,11 +139,13 @@ toggleView = () => { $("#manual").fadeIn(); $("#mainlist").fadeOut(); utools.setExpendHeight(550); + manualSubInput(); } else if ($("#manual").is(":visible") && $("#mainlist").is(":hidden")) { $("#manual").fadeOut(); $("#mainlist").fadeIn(); let num = $(".info").length utools.setExpendHeight(num > 11 ? 550 : 50 * num); + mainlistSubInput(); } } @@ -194,14 +217,14 @@ utools.onPluginEnter( async ({ code, type, payload }) => { // 读取目录文件 try { if (window.dirs.idxFile) { - var index = await readFile(window.dirs.idxFile); + index = await readFile(window.dirs.idxFile); if (window.dirs.idxFile.includes('payload.json')) { index = JSON.parse(rc4(index, 'uTools')) } else { index = JSON.parse(index); } } else { - var index = utools.db.get(code).data; + index = utools.db.get(code).data; } if (type == 'over') { showList(payload, index, 300) @@ -209,19 +232,11 @@ utools.onPluginEnter( async ({ code, type, payload }) => { showList('', index, 300) } // 子输入框 - utools.setSubInput(({ text }) => { - // 列表搜索 - if ($('#manual').is(':hidden')) { - showList(text.toUpperCase(), index, 300); - // 高亮结果 - text.split(' ').forEach(keyword => { - keyword && $(".name,.description").highlight(keyword, 'listFounds'); - }); - // 手册搜索 - } else { - highlightManual("#manual", text); - } - }, '输入名称或功能进行查询'); + if ($('#manual').is(':hidden')) { + mainlistSubInput(); + } else { + manualSubInput(); + } if (type == 'window') { utools.hideMainWindow(); copy();