From 3babfc331b7db31aea1eaf587e109ea408a865c7 Mon Sep 17 00:00:00 2001 From: ZiuChen <457353192@qq.com> Date: Sun, 18 Sep 2022 16:25:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=8B=A5=E5=B9=B2?= =?UTF-8?q?=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/data/setting.json | 37 +++++++++++++++++++++++++++++++++++++ src/hooks/useClipOperate.js | 4 +--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/data/setting.json b/src/data/setting.json index 8a715d3..b3a9b19 100644 --- a/src/data/setting.json +++ b/src/data/setting.json @@ -5,24 +5,61 @@ "operation.shown": ["copy", "view", "collect", "remove"], "operation.custom": [ { + "id": "custom", "title": "讯飞OCR识别", "icon": "⚡", "match": ["image", { "type": "file", "regex": ".(?:jpg|jpeg|png)$" }], "command": "redirect:讯飞ocr" }, { + "id": "custom", "title": "百度搜索", "icon": "🔍", "match": ["text"], "command": "redirect:百度一下" }, { + "id": "custom", + "title": "统计文本字数", + "icon": "🧮", + "match": ["text"], + "command": "redirect:统计文本次数" + }, + { + "id": "custom", + "title": "颜色管理", + "icon": "🎨", + "match": [ + { + "type": "text", + "regex": "^(?:#?[a-f0-9]{6}|(?:(?:25[0-5]|2[0-4]\\d|1?\\d{1,2}), ?){2}(?:25[0-5]|2[0-4]\\d|1?\\d{1,2})|rgba?\\((?:(?:25[0-5]|2[0-4]\\d|1?\\d{1,2}), ?){2}(?:25[0-5]|2[0-4]\\d|1?\\d{1,2})(?:, ?(?:1|0|0\\.\\d{1,2}))?\\)|hs[liv]a?\\((?:360|(?:(?:3[0-5]\\d|[1-2]\\d{2}|\\d{1,2})(?:\\.\\d{1,15})?))(?:deg)?(?:, |,| )(?:100|\\d{1,2}(?:\\.\\d{1,15})?)%?(?:, |,| )(?:100|\\d{1,2}(?:\\.\\d{1,15})?)%?(?:, ?(?:1|0|0\\.\\d{1,2}))?\\))$" + } + ], + "command": "redirect:统计文本次数" + }, + { + "id": "custom", + "title": "百度识图", + "icon": "🌄", + "match": ["image"], + "command": "redirect:百度识图" + }, + { + "id": "custom", + "title": "识别图片中二维码", + "icon": "📜", + "match": ["image"], + "command": "redirect:识别图片中二维码" + }, + { + "id": "custom", "title": "上传到图床", "icon": "🚀", "match": ["image", { "type": "file", "regex": ".(?:jpg|jpeg|png)$" }], "command": "redirect:上传到图床" }, { + "id": "custom", "title": "翻译", "icon": "🌎", "match": ["text"], diff --git a/src/hooks/useClipOperate.js b/src/hooks/useClipOperate.js index 3915374..d761e76 100644 --- a/src/hooks/useClipOperate.js +++ b/src/hooks/useClipOperate.js @@ -89,9 +89,7 @@ export default function useClipOperate({ emit }) { } } } else { - if (r.test(item.data)) { - return true - } + return r.test(item.data) } } }