diff --git a/README.md b/README.md index 3723924..35e2f21 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ![translate](translate/translate.png) 特色: -* 划词翻译调用“金山词霸、有道词典(有道翻译)、Google Translate(谷歌翻译)、搜狗翻译、必应词典(必应翻译)、Microsoft Translator(必应在线翻译)、海词词典、百度翻译、Oxford Learner's Dictionaries、Oxford Dictionaries、Merriam-Webster”网页翻译 +* 划词翻译调用“金山词霸、有道词典(有道翻译)、Google Translate(谷歌翻译)、沪江小D、搜狗翻译、必应词典(必应翻译)、Microsoft Translator(必应在线翻译)、海词词典、百度翻译、Oxford Learner's Dictionaries、Oxford Dictionaries、Merriam-Webster、汉典”网页翻译 * 支持顺序自定义 * 支持隐藏图标 * 支持显示更多图标 diff --git a/translate/icon.psd b/translate/icon.psd index 26be611..ee860cf 100755 Binary files a/translate/icon.psd and b/translate/icon.psd differ diff --git a/translate/translate.js b/translate/translate.js index 1f20158..efcf7c0 100644 --- a/translate/translate.js +++ b/translate/translate.js @@ -1,8 +1,8 @@ // ==UserScript== // @name Translate // @namespace http://tampermonkey.net/ -// @version 3.5 -// @description 划词翻译调用“金山词霸、有道词典(有道翻译)、Google Translate(谷歌翻译)、搜狗翻译、必应词典(必应翻译)、Microsoft Translator(必应在线翻译)、海词词典、百度翻译、Oxford Learner's Dictionaries、Oxford Dictionaries、Merriam-Webster”网页翻译 +// @version 3.6 +// @description 划词翻译调用“金山词霸、有道词典(有道翻译)、Google Translate(谷歌翻译)、沪江小D、搜狗翻译、必应词典(必应翻译)、Microsoft Translator(必应在线翻译)、海词词典、百度翻译、Oxford Learner's Dictionaries、Oxford Dictionaries、Merriam-Webster、汉典”网页翻译 // @author https://github.com/barrer // @match http://*/* // @include https://*/* @@ -177,6 +177,20 @@ tiggerEvent(source, 'keyup'); } }, + { + name: '沪江小D', + id: 'hjenglish', + image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAwFBMVEUzqfEhqvUTp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JGZcF4BpI3BnghRdnDZgQQJWKsiB4TIOMiwJEAYyAY9oAQAjrmBWSYl6cHBSw5DgzE6AQVIOA3GBM40wH8OiuVNVcI2CXIUqliRJxGx5+VopwBARl3fQmbrAjYlqwK5T0gA+5sx0MC1FrK/fsEgCt6XMBWLmPyLrhq7MMClloVSZS3gJepYNwZW90q0Hb8XPw9ZB2/LX2PSILI/YjRY5dp2w2BWN4CfLAUIMycvUWgXcRWTShvgTGAj/i1bqi9mjWBtvaCG4cfwsjVVdXeIlAt47IEt6dOCoESexKfN677XVldz7oAF+yKyQNAZJhAyHOnqhEPCiBup0eGEiGIo9Ypqj5VQIV4xZov4d2Pef6fqpumaT9RoPy/8WHNANkh8MMw5lnuXN2WdWmpvl2gXKKumiyLvrRDB5oTwzAcx/8PNP4gtvzatO//VpcUvZtYx53qkM+YtFP92uBR25Z2xZm+NQjIGbLf+QdKITUhgMFUccLqvbC7UyJwBmYEUCoVNMKc7cW//YF6CQyiNqjqwDDbQAT/6bS6ugLDAFVvAvowLSACRPXB39J2+2Bs8AHijotqAWWtBwREgKwVAREQAX/b8UHM4Xb64Le98XHnYQELREAErA9Ix1ovunSItirNRyIAAAAASUVORK5CYII=', + host: ['dict.hjenglish.com'], + popup: function (text) { + popupCenter('https://dict.hjenglish.com/notfound/w/' + encodeURIComponent(text), null, 1024, screen.height); + }, + custom: function (text) { + document.querySelectorAll('.word-details-button-expand').forEach(function (ele) { + ele.click(); + }); + } + }, { name: '搜狗翻译', id: 'sougou', @@ -306,6 +320,16 @@ document.querySelector('.s-frm').submit(); } }, + { + name: '汉典', + id: 'zdic', + image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACABAMAAAAxEHz4AAAAMFBMVEX////89fXvy8vz2tr+/f346enotrbhoqLai4vRcXHGUFC7MC+zGxupAQGuCQmwAAA775PrAAAAAXRSTlMAQObYZgAAD+hJREFUeF7NmU9QIumSwK0W7kUD09ceULFvKvjnCCLvDANlz7XxifpurW9E3Zs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II=', + host: ['www.zdic.net'], + popup: function (text) { + popupCenter('http://www.zdic.net/sousuo/?q=' + encodeURIComponent(text), null, 800, screen.height); + }, + custom: function (text) {} + }, { name: 'Settings', id: 'settings',