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) } } }