From e9b8c66692439ed9fd6cff5352dd9b6bf9c0002d Mon Sep 17 00:00:00 2001 From: example Date: Sun, 5 May 2019 16:30:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=82=B9=E6=8C=89=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E4=BD=8D=E7=BD=AE=E8=BD=BB=E5=BE=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translate/translate-dictionary.js | 8 ++++---- translate/translate.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/translate/translate-dictionary.js b/translate/translate-dictionary.js index 3754f4d..63c8396 100644 --- a/translate/translate-dictionary.js +++ b/translate/translate-dictionary.js @@ -1,7 +1,7 @@ // ==UserScript== // @name 划词翻译:多词典查询 // @namespace http://tampermonkey.net/ -// @version 4.9 +// @version 5.0 // @description 划词翻译调用“有道词典(有道翻译)、金山词霸、Bing 词典(必应词典)、剑桥高阶、沪江小D、谷歌翻译” // @author https://github.com/barrer // @match http://*/* @@ -375,8 +375,8 @@ if (selected && icon.style.display == 'none') { // 显示翻译图标 log('show icon'); log(selected + ' | ' + e.pageX + ' | ' + e.pageY); - icon.style.top = e.pageY + 8 + 'px'; - icon.style.left = e.pageX + 4 + 'px'; + icon.style.top = e.pageY + 10 + 'px'; + icon.style.left = e.pageX + 10 + 'px'; icon.style.display = 'block'; // 兼容部分 Content Security Policy icon.style.position = 'absolute'; @@ -875,7 +875,7 @@ rst = /dict.innerHTML='(.*)'; \tdict.style.display = "block";/g.exec(rst)[1]; rst = rst .replace(/\\"/g, '"') - .replace(/\\'/g, '\'') + .replace(/\\'/g, '\'')// inner-city 这个词会多一个斜杠,金山词霸的数据有些许瑕疵 .replace(/onclick=/g, 'data-onclick='); rst = cleanAttr(rst, 'style'); // 标识符处理 diff --git a/translate/translate.js b/translate/translate.js index 4c786da..7a5a7f1 100644 --- a/translate/translate.js +++ b/translate/translate.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Translate // @namespace http://tampermonkey.net/ -// @version 5.6 +// @version 5.7 // @description 划词翻译调用“金山词霸、有道词典(有道翻译)、Google Translate(谷歌翻译)、沪江小D、搜狗翻译、必应词典(必应翻译)、Microsoft Translator(必应在线翻译)、海词词典、百度翻译、Oxford Learner's Dictionaries、Oxford Dictionaries、Merriam-Webster、汉典、PDF 划词翻译、Google Search、Bing Search(必应搜索)、百度搜索、Wikipedia Search(维基百科搜索)”网页翻译 // @author https://github.com/barrer // @match http://*/* @@ -443,8 +443,8 @@ if (text && icon.style.display == 'none') { log('show icon'); log(text + ' | ' + e.pageX + ' | ' + e.pageY); - icon.style.top = e.pageY + 8 + 'px'; - icon.style.left = e.pageX + 4 + 'px'; + icon.style.top = e.pageY + 10 + 'px'; + icon.style.left = e.pageX + 10 + 'px'; icon.style.display = 'block'; // 兼容部分 Content Security Policy icon.style.position = 'absolute';