diff --git a/README.md b/README.md
index 35e2f21..858706d 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
### translate.js
-![translate](translate/translate.png)
+![translate.jpg](translate/translate.jpg)
特色:
* 划词翻译调用“金山词霸、有道词典(有道翻译)、Google Translate(谷歌翻译)、沪江小D、搜狗翻译、必应词典(必应翻译)、Microsoft Translator(必应在线翻译)、海词词典、百度翻译、Oxford Learner's Dictionaries、Oxford Dictionaries、Merriam-Webster、汉典”网页翻译
@@ -15,24 +15,22 @@
### translate-dictionary.js
-![translate-dictionary.png](translate/translate-dictionary.png)
+![translate-dictionary.jpg](translate/translate-dictionary.jpg)
特色:
-* 金山词霸查询
-* 有道词典查询
-* 谷歌翻译查询
+* 划词翻译调用“有道词典(有道翻译)、金山词霸、Bing 词典(必应词典)、沪江小D、谷歌翻译”
* 支持发音
* 支持显示当前翻译引擎
* 支持面板拖动
### translate.js *and* translate-dictionary.js
-![translate-bundle.png](translate/translate-bundle.png)
+![translate-bundle.jpg](translate/translate-bundle.jpg)
同时安装:
-① 划词翻译:有道词典,金山词霸,谷歌翻译
-https://greasyfork.org/zh-CN/scripts/376313-%E5%88%92%E8%AF%8D%E7%BF%BB%E8%AF%91-%E6%9C%89%E9%81%93%E8%AF%8D%E5%85%B8-%E9%87%91%E5%B1%B1%E8%AF%8D%E9%9C%B8-%E8%B0%B7%E6%AD%8C%E7%BF%BB%E8%AF%91
+① 划词翻译:多词典查询
+https://greasyfork.org/zh-CN/scripts/376313-%E5%88%92%E8%AF%8D%E7%BF%BB%E8%AF%91-%E5%A4%9A%E8%AF%8D%E5%85%B8%E6%9F%A5%E8%AF%A2
② Translate
https://greasyfork.org/zh-CN/scripts/34921-translate
@@ -54,5 +52,5 @@ Tampermonkey 是一款免费的浏览器扩展和最为流行的用户脚本管
脚本名 | 用途
-|-
-translate.js|划词翻译调用“金山词霸、有道词典(有道翻译)、Google Translate(谷歌翻译)、搜狗翻译、必应词典(必应翻译)、Microsoft Translator(必应在线翻译)、海词词典、百度翻译、Oxford Learner's Dictionaries、Oxford Dictionaries、Merriam-Webster”网页翻译
-translate-dictionary.js|划词翻译调用“有道词典(有道翻译)、金山词霸、谷歌翻译”
+translate.js|划词翻译调用“金山词霸、有道词典(有道翻译)、Google Translate(谷歌翻译)、沪江小D、搜狗翻译、必应词典(必应翻译)、Microsoft Translator(必应在线翻译)、海词词典、百度翻译、Oxford Learner's Dictionaries、Oxford Dictionaries、Merriam-Webster、汉典”网页翻译
+translate-dictionary.js|划词翻译调用“有道词典(有道翻译)、金山词霸、Bing 词典(必应词典)、沪江小D、谷歌翻译”
diff --git a/translate/deprecated-translate-v1.4.js b/translate/deprecated-translate-v1.4.js
deleted file mode 100644
index b71656f..0000000
--- a/translate/deprecated-translate-v1.4.js
+++ /dev/null
@@ -1,297 +0,0 @@
-// ==UserScript==
-// @name Translate
-// @namespace http://tampermonkey.net/
-// @version 1.4
-// @description 划词翻译调用“必应翻译(必应词典)、谷歌翻译、有道词典(有道翻译)、百度翻译”网页翻译
-// @author barrer
-// @match http://*/*
-// @include https://*/*
-// @include file:///*
-// @run-at document-end
-// @connect dict.youdao.com
-// @connect cn.bing.com
-// @connect translate.googleapis.com
-// @connect fanyi.baidu.com
-// @grant GM_xmlhttpRequest
-// ==/UserScript==
-
-(function () {
- 'use strict';
-
- // Your code here...
- /**日志输出*/
- function log() {
- var debug = false;
- if (!debug)
- return;
- if (arguments) {
- for (var i = 0; i < arguments.length; i++) {
- console.log(arguments[i]);
- }
- }
- }
-
- log('url:' + window.location.href);
- // 翻译图标
- var icon = document.createElement('div'), style = '' +
- 'font-family:Arial,sans-serif!important;' +
- 'font-weight:normal!important;' +
- 'background:#f60!important;' +
- 'color:#fff!important;' +
- 'border-radius:3px!important;' +
- 'font-size:13px!important;' +
- 'line-height:100%!important;' +
- 'padding:2px 4px!important;' +
- 'margin:0 4px!important;' +
- 'display:inline-block!important;' +
- 'text-decoration:none!important;' +
- '';
- icon.innerHTML = '' +
- '必应' +
- '谷歌' +
- '有道' +
- '百度' +
- '';
- icon.setAttribute('style', '' +
- 'display:none!important;' +
- 'position:absolute!important;' +
- 'font-size:13px!important;' +
- 'text-align:left!important;' +
- 'z-index:2147483647!important;' +
- '');
- // 添加翻译图标到 DOM
- document.documentElement.appendChild(icon);
- // 鼠标事件:防止选中的文本消失
- document.addEventListener('mousedown', function (e) {
- if (e.target == icon || (e.target.parentNode && e.target.parentNode == icon)) {// 点击了翻译图标
- e.preventDefault();
- }
- });
- // 选中变化事件:当点击已经选中的文本的时候,隐藏翻译图标和翻译面板(此时浏览器动作是:选中的文本已经取消选中了)
- document.addEventListener("selectionchange", function () {
- log('selectionchange:' + window.getSelection().toString());
- if (!window.getSelection().toString().trim()) {
- icon.style.display = 'none';
- server.containerDestroy();
- }
- });
- // 鼠标事件:防止选中的文本消失;显示、隐藏翻译图标
- document.addEventListener('mouseup', function (e) {
- if (e.target == icon || (e.target.parentNode && e.target.parentNode == icon)) {// 点击了翻译图标
- e.preventDefault();
- return;
- }
- for (var i = 0; i < server.rendered.length; i++) {// 点击了翻译内容面板
- if (e.target == server.rendered[i])
- return;// 不再创建翻译图标
- }
- var text = window.getSelection().toString().trim();
- log('text:' + text);
- if (text && icon.style.display == 'none') {
- log('show icon');
- log(text + '|' + e.pageX + '|' + e.pageY);
- icon.style.top = e.pageY + 10 + 'px';
- icon.style.left = e.pageX + 10 + 'px';
- icon.style.display = 'block';
- } else if (!text) {
- log('hide icon');
- icon.style.display = 'none';
- server.containerDestroy();// 销毁翻译内容面板
- }
- });
- // 翻译图标点击事件
- icon.addEventListener('click', function (e) {
- var text = window.getSelection().toString().trim();
- if (text) {
- log('click:' + text);
- server.containerDestroy();// 销毁翻译内容面板
- // 新建翻译内容面板
- var container = server.container();
- container.style.top = e.pageY + 16 + 'px';
- if (e.pageX + 250 + 16 <= document.body.clientWidth)// container 面板css最大宽度为250px
- container.style.left = e.pageX + 16 + 'px';
- else
- container.style.left = document.body.clientWidth - 250 + 'px';
- document.body.appendChild(container);
- server.rendered.push(container);
- // 判断用户选择的翻译引擎
- var engine = e.target.hasAttribute('type') ? e.target.getAttribute('type') : '';
- log('engine:' + engine);
- switch (engine) {
- case 'bing':
- server.bing(text, container);
- break;
- case 'google':
- server.google(text, container);
- break;
- case 'baidu_translator':
- server.baidu_translator(text, container);
- break;
- default:
- server.youdao(text, container);
- }
- }
- });
- // 翻译server
- var server = {
- // 存放已经生成的翻译内容面板(销毁的时候用)
- rendered: [],
- // 有道翻译 引擎
- youdao: function (text, element) {
- this.ajax('http://dict.youdao.com/w/eng/' + encodeURIComponent(text), function (rst, ele) {
- var parser = new DOMParser(), doc = parser.parseFromString(rst, 'text/html'), html = '';
- var word = doc.querySelector('#phrsListTab .wordbook-js .keyword'),
- pronounce = doc.querySelector('#phrsListTab .wordbook-js .baav'),
- trans = doc.querySelector('#phrsListTab .trans-container'),
- webTrans = doc.querySelectorAll('#tWebTrans .wt-container .title');
- if (!!!pronounce) // 中文拼音
- pronounce = doc.querySelector('#phrsListTab .wordbook-js .phonetic');
- // 排版
- var pos = trans && trans.querySelectorAll('ul li,ul .wordGroup');
- for (var i = 0; pos && i < pos.length; i++) {
- pos[i].innerHTML = pos[i].innerHTML + '▓';
- }
- html += word ? word.innerText.trim() : '';
- html += pronounce ? ' ' + pronounce.innerText.replace(/(\s)+/g, ' ').trim() : '';
- html += trans && trans.querySelector('ul') ? '\n' +
- trans.querySelector('ul').innerText
- .replace(/(\s)+/g, ' ')
- .replace(/(▓)+/g, '\n').trim()
- : '';
- html += trans && trans.querySelector('.additional') ?
- '\n' + trans.querySelector('.additional').innerText.trim().replace(/\n/g, '') : '';
- if (!!webTrans.length) {
- html += '\n网络释义:\n';
- for (var j = 0; j < webTrans.length; j++) {
- if (j !== 0)
- html += ';';
- html += webTrans[j].innerText.replace(/\n/g, '').trim();
- }
- }
- ele.innerText = html;
- ele.style.display = 'block';// 显示结果
- }, function (rst, ele) {
- ele.innerText = '有道翻译 无法连接!';
- ele.style.display = 'block';// 显示结果
- }, element);
- },
- // Bing词典 引擎
- bing: function (text, element) {
- this.ajax('http://cn.bing.com/dict/search?q=' + encodeURIComponent(text), function (rst, ele) {
- var parser = new DOMParser(), doc = parser.parseFromString(rst, 'text/html'), html = '';
- var word = doc.querySelector('.hd_area'),
- trans = doc.querySelector('.qdef ul'),
- forms = doc.querySelector('.qdef .hd_if');
- // 排版
- var headword = doc.querySelector('#headword');
- if (headword)
- headword.innerHTML = headword.innerHTML + '
';
- var pos = doc.querySelectorAll('.qdef ul li .pos');
- for (var i = 0; i < pos.length; i++) {
- pos[i].innerText = '\n【' + pos[i].innerText + '】';
- }
- html += word ? word.innerText.replace(/\n/g, ' ').trim() : '';
- html += trans ? '\n' + trans.innerText.trim() : '';
- html += forms ? '\n' + forms.innerText.trim() : '';
- ele.innerText = html;
- ele.style.display = 'block';// 显示结果
- }, function (rst, ele) {
- ele.innerText = 'Bing词典 无法连接!';
- ele.style.display = 'block';// 显示结果
- }, element);
- },
- // 谷歌翻译 引擎
- google: function (text, element) {
- var apiUrl = 'https://translate.googleapis.com/translate_a/single?client=gtx&dt=t&dt=bd&dj=1&source=input&sl=en&tl=zh-CN&hl=en&q=';
- this.ajax(apiUrl + encodeURIComponent(text), function (rst, ele) {
- var json = JSON.parse(rst), html = '';
- for (var i = 0; i < json.sentences.length; i++) {
- html += json.sentences[i].orig + '\n';
- html += json.sentences[i].trans + '\n';
- }
- ele.innerText = html;
- ele.style.display = 'block';// 显示结果
- }, function (rst, ele) {
- ele.innerText = '谷歌翻译 无法连接!';
- ele.style.display = 'block';// 显示结果
- }, element);
- },
- // 百度翻译 引擎
- baidu_translator: function (text, element) {
- var data = new FormData();
- data.set('from', 'en');
- data.set('to', 'zh');
- data.set('query', text);
- this.ajax('http://fanyi.baidu.com/v2transapi', function (rst, ele) {
- var json = JSON.parse(rst), html = '';
- for (var i = 0; i < json.trans_result.data.length; i++) {
- html += json.trans_result.data[i].src + '\n';
- html += json.trans_result.data[i].dst + '\n';
- }
- ele.innerText = html;
- ele.style.display = 'block';// 显示结果
- }, function (rst, ele) {
- ele.innerText = '百度翻译 无法连接!';
- ele.style.display = 'block';// 显示结果
- },
- element,
- 'POST',
- data
- );
- },
- // ajax 跨域访问公共方法
- ajax: function (url, success, error, element, method, data, headers) {
- if (!!!method)
- method = 'GET';
- // >>>因为Tampermonkey跨域访问(a.com)时会自动携带对应域名(a.com)的对应cookie
- // 不会携带当前域名的cookie
- // 所以,GM_xmlhttpRequest【不存在】cookie跨域访问安全性问题
- // 以下设置默认headers不起作用<<<
- if (!!!headers)
- headers = {'cookie': ''};
- GM_xmlhttpRequest({
- method: method,
- url: url,
- headers: headers,
- data: data,
- onload: function (res) {
- success(res.responseText, element);
- },
- onerror: function (res) {
- error(res.responseText, element);
- }
- });
- },
- // 销毁已经生成的翻译内容面板
- containerDestroy: function () {
- for (var i = this.rendered.length - 1; i >= 0; i--) {
- if (this.rendered[i] && this.rendered[i].parentNode) {
- this.rendered[i].parentNode.removeChild(this.rendered[i]);
- }
- }
- },
- // 生成翻译结果面板 DOM (此时还未添加到页面)
- container: function () {
- var div = document.createElement('div');
- div.setAttribute('style', '' +
- 'display:none!important;' +
- 'position:absolute!important;' +
- 'font-size:13px!important;' +
- 'overflow:auto!important;' +
- 'background:#fefee6!important;' +
- 'font-family:Arial,sans-serif!important;' +
- 'font-weight:normal!important;' +
- 'text-align:left!important;' +
- 'color:#000!important;' +
- 'padding:0.5em 1em!important;' +
- 'line-height:1.5em!important;' +
- 'border-radius:5px!important;' +
- 'border:1px solid #ccc!important;' +
- 'max-width:250px!important;' +
- 'max-height:150px!important;' +
- 'z-index:2147483647!important;' +
- '');
- return div;
- }
- };// 翻译server结束
-})();
\ No newline at end of file
diff --git a/translate/icon.psd b/translate/icon.psd
deleted file mode 100755
index ee860cf..0000000
Binary files a/translate/icon.psd and /dev/null differ
diff --git a/translate/translate-bundle.jpg b/translate/translate-bundle.jpg
new file mode 100644
index 0000000..0da6515
Binary files /dev/null and b/translate/translate-bundle.jpg differ
diff --git a/translate/translate-bundle.png b/translate/translate-bundle.png
deleted file mode 100755
index 8bc4990..0000000
Binary files a/translate/translate-bundle.png and /dev/null differ
diff --git a/translate/translate-dictionary.jpg b/translate/translate-dictionary.jpg
new file mode 100644
index 0000000..f6e824e
Binary files /dev/null and b/translate/translate-dictionary.jpg differ
diff --git a/translate/translate-dictionary.js b/translate/translate-dictionary.js
index a21228a..95d18a8 100644
--- a/translate/translate-dictionary.js
+++ b/translate/translate-dictionary.js
@@ -1,8 +1,8 @@
// ==UserScript==
-// @name 划词翻译:有道词典,金山词霸,谷歌翻译
+// @name 划词翻译:多词典查询
// @namespace http://tampermonkey.net/
-// @version 1.5
-// @description 划词翻译调用“有道词典(有道翻译)、金山词霸、谷歌翻译”
+// @version 1.6
+// @description 划词翻译调用“有道词典(有道翻译)、金山词霸、Bing 词典(必应词典)、沪江小D、谷歌翻译”
// @author https://github.com/barrer
// @match http://*/*
// @include https://*/*
@@ -11,6 +11,10 @@
// @connect dict.youdao.com
// @connect open.iciba.com
// @connect translate.google.cn
+// @connect hjenglish.com
+// @connect hjapi.com
+// @connect hjfile.cn
+// @connect cn.bing.com
// @grant GM_xmlhttpRequest
// ==/UserScript==
@@ -25,6 +29,16 @@
word-wrap: break-word !important
}
+ a {
+ color: #36f;
+ text-decoration: none;
+ cursor: pointer;
+ }
+
+ a:hover {
+ text-decoration: underline;
+ }
+
img {
cursor: pointer;
display: inline-block;
@@ -52,8 +66,8 @@
img[activate] {
border: 1px solid transparent;
- -webkit-box-shadow: 0px 0px 0px 1px #fc6;
- box-shadow: 0px 0px 0px 1px #fc6;
+ -webkit-box-shadow: 0px 0px 0px 1px #f90;
+ box-shadow: 0px 0px 0px 1px #f90;
}
tr-icon {
@@ -107,6 +121,34 @@
line-height: 18px;
}
+ a.audio-button{
+ color: #36f;
+ text-decoration: none;
+ cursor: pointer;
+ margin-right: 10px;
+ }
+
+ a.audio-button:last-of-type {
+ margin-right: auto;
+ }
+
+ a.audio-button:hover {
+ text-decoration: underline;
+ }
+
+ .br {
+ border-top: 1px dashed #777;
+ margin: .5em auto .3em auto;
+ }
+
+ .list-title~.list-title {
+ margin-top: 1em;
+ }
+
+ .list-title {
+ color: #00c;
+ }
+
.google .sentences,
.google .trans,
.google .orig,
@@ -192,6 +234,141 @@
.none {
display: none;
}
+
+ .hjenglish dl,
+ .hjenglish dt,
+ .hjenglish dd,
+ .hjenglish p,
+ .hjenglish ul,
+ .hjenglish li,
+ .hjenglish h3 {
+ margin: 0;
+ padding: 0;
+ margin-block-start: 0px;
+ margin-block-end: 0px;
+ margin-inline-start: 0px;
+ margin-inline-end: 0px;
+ }
+
+ .hjenglish h3 {
+ font-size: 1em;
+ font-weight: normal;
+ }
+
+ .hjenglish .detail-pron,
+ .hjenglish .pronounces {
+ color: #777;
+ }
+
+ .hjenglish ul {
+ margin-left: 2em;
+ }
+
+ /*例句*/
+ .hjenglish .def-sentence-from,
+ .hjenglish .def-sentence-to {
+ display: none;
+ }
+
+ .hjenglish .detail-groups dd h3:before {
+ counter-increment: eq;
+ content: counter(eq) ".";
+ display: block;
+ width: 22px;
+ float: left;
+ }
+
+ .hjenglish .detail-groups dl {
+ counter-reset: eq;
+ margin-bottom: .5em;
+ clear: both;
+ }
+
+ .hjenglish ol,
+ .hjenglish ul {
+ list-style: none;
+ }
+
+ .bing h1,
+ .bing strong {
+ font-size: 1em;
+ font-weight: normal;
+ margin: 0;
+ padding: 0;
+ }
+
+ .bing .concise ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ }
+
+ .bing .concise .pos {
+ margin-right: .2em;
+ }
+
+ .bing .concise .web {
+ margin-right: auto;
+ }
+
+ .bing .concise .web:after {
+ content: ":"
+ }
+
+ .bing .oald {
+ margin-top: .4em;
+ }
+
+ .bing .hd_tf_lh div {
+ display: inline;
+ color: #777;
+ }
+
+ .bing #authid td:first-child {
+ width: 22px;
+ margin: 0;
+ padding: 0;
+ }
+
+ .bing .def_row {
+ vertical-align: top;
+ }
+
+ .bing .bil_dis,
+ .bing .val_dis {
+ padding-right: .25em;
+ }
+
+ /*例句*/
+ .bing .li_exs {
+ display: none;
+ }
+
+ .bing .li_id {
+ border: 1px solid #ebebeb;
+ padding: .2em;
+ }
+
+ .bing .infor,
+ .bing .sen_com,
+ .bing .com_sep,
+ .bing .bil,
+ .bing .gra {
+ padding-right: .25em;
+ }
+
+ .bing .infor,
+ .bing .label {
+ padding-left: .25em;
+ }
+
+ .bing .each_seg+.each_seg {
+ margin-top: .5em;
+ }
+
+ .bing .de_co div {
+ display: inline;
+ }
`;
var link = document.createElement('link');
link.rel = 'stylesheet';
@@ -199,61 +376,122 @@
link.href = URL.createObjectURL(new Blob([style.textContent], {
type: 'text/css;charset=UTF-8'
}));
+ // 翻译图标、内容面板、当前选中文本、当前翻译引擎
+ var icon = document.createElement('tr-icon'),
+ content = document.createElement('tr-content'),
+ selected,
+ engineId;
+ // 发音引擎
+ var audioEngines = []; // [{name: 'abc', url: 'http://*.mp3', ...}, ...]
+ // 翻译引擎结果集
+ var engineResult = {}; // id: DOM
+ // ID 类别
+ var ids = {
+ ICIBA: 'iciba',
+ ICIBA_LOWER_CASE: 'icibaLowerCase',
+ YOUDAO: 'youdao',
+ YOUDAO_LOWER_CASE: 'youdaoLowerCase',
+ BING: 'bing',
+ BING_LOWER_CASE: 'bingLowerCase',
+ HJENGLISH: 'hjenglish',
+ GOOGLE: 'google'
+ };
+ var idsExtension = {
+ LIST_DICT: [ids.ICIBA, ids.YOUDAO, ids.BING, ids.HJENGLISH],
+ LIST_DICT_LOWER_CASE: [ids.ICIBA, ids.ICIBA_LOWER_CASE, ids.YOUDAO, ids.YOUDAO_LOWER_CASE, ids.BING, ids.BING_LOWER_CASE, ids.HJENGLISH],
+ LIST_GOOGLE: [ids.GOOGLE],
+ lowerCaseMap: (function () {
+ var obj = {};
+ obj[ids.ICIBA_LOWER_CASE] = ids.ICIBA;
+ obj[ids.YOUDAO_LOWER_CASE] = ids.YOUDAO;
+ obj[ids.BING_LOWER_CASE] = ids.BING;
+ return obj;
+ })(),
+ names: (function () {
+ var obj = {};
+ obj[ids.ICIBA] = '《金山词霸》';
+ obj[ids.ICIBA_LOWER_CASE] = '';
+ obj[ids.YOUDAO] = '《有道词典》';
+ obj[ids.YOUDAO_LOWER_CASE] = '';
+ obj[ids.BING] = '《Bing 词典》';
+ obj[ids.BING_LOWER_CASE] = '';
+ obj[ids.HJENGLISH] = '《沪江小D》';
+ obj[ids.GOOGLE] = '';
+ return obj;
+ })()
+ }
+ // 绑定图标拖动事件
+ var iconDrag = new Drag(icon);
// 图标数组
var iconArray = [{
- name: '金山词霸',
- id: 'iciba',
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAABgFBMVEX////1AUv2DlT1A0z5ZpP2EVb/+fv2JGT1DFP+7/T//f7+4uv/9vn2HV/+6/H+5u32Gl3//P34ToH1CVH3LGn91eH8q8T4VYb2FVn6hqr/+/z5Y5D8p8H3Pnb4RHr4QXj3MW3+6e/5aZT1B0/3PXX6fqP5c5v7o776g6f4TID7n7v3KWf6iaz7lrX7jK78rMT9ztz2GFv9yNj1BE3+8fX4V4j3NG/4Rnz1BU7/8/f9w9X/+vv5a5b/9/n5Xo3+2+b8rsb8tsv8ssn9ytr8qcL+7fL90t/5W4v2HF79wtT3Kmj9xtf4UIP8vdD/9fj+2uX92OP8qsP+3+j/+Pr+4er+7vP2IWL+8vb+3ef5cJn8v9L7krL4WIj3OXL5bpj7nbr5bJf3L2v6gKX7mLb7k7P4SX78uM34U4X8t8z2ImL8u8/3N3H2IGH9wNP6dp76eJ/5cZr2H2D6iKv+5Oz/9Pf5apX6f6T+5+790+D91+P6eqD8tMr7j7D7m7j9zNv5Yo8kSjR+AAAAAXRSTlMAQObYZgAAA+lJREFUeF7t2mXP6koYheG1iru/7u7u7m7b3f24u/z1k+wEAnSGaUuB82GuP/DcaQaeoQGOaZo2SbGTbdTF1yuNnX+7pbHzD8cbOz860Nj5qTTF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p7rj6ETQGW+f5XOLWaZZHMxDrUAVh/28JixhGc2/axYPS21V2wOhhkgWcX1djLH8STJjvbMOGdzwc8gV2i1/WeRws27wO/X/CzDVQrTXLpHwd3wrVnJN+lYBHr7bEO0AE6QAfoAB2gA/C/oGnaf/DSo5D7etMMAAAAAElFTkSuQmCC',
+ name: '多词典查询',
+ id: 'icon-dict',
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAwFBMVEX////9+/zc4eSwusOZprF1h5VpfIu5w8rk6Or3+PljeIjy8/X////M09h+kJ2ns7zr7vCMm6dccoNWbX7S2N3GztTAyc/X3OD+9fb95ub6xMX5t7j2qqv0iInydXbxcHH8bW2adH72m5vzfn/xbW7xa2zNcXXibnHxbm/xaGnwZGXwYGHwX2D70dLwXV75vr7z+/7o9/3S7/vL7frc8/yw5fqg3vaL1vRry/HL8f1bxfBVwu9Twu9MwO9Gvu5BvO1OQbHPAAAAAXRSTlMAQObYZgAABjtJREFUeAHsltWChDAMAK9O00DbBPn/Lz0J524bXph1zdBZ4erk5OTk5OTk5DcY63yInxN8Gi41P7sA3yGkfJH5xcM3ib5cYr6L8F1i+v/5OAb4PtP4/wtQ4SfUfxdoHX7C/38K7ARvIb7j3QbzfwvMAd7AwS3rUiPBG8KiIuCLMWboRwkQJIOIxhEdI8DBGrxli0cJ+IJty9j6MQJSYKxNGhwhwJNFdNOGOIcjBKRA9pTuGjDpC0iBNrHP0kBfgKcBcY5ysQU+QGDfdI6LwdaJtAUI1n0w1TsRUBeQ78AYCe4bqAvIhlcikAalE+kKUFwRh84ARL6gScS6ArLwCzARcbB3DbQFasbsmW5hSBlLZ9IUoLgg5rW6W2odM5oErCggBV5ig65ANYgmP2BQGugJSIGS6gOzNFAUkALzw6IT9yYN1ASIqpH/AdrhuCEWz6QmEEfE1vnpf8FlxASsJcD9qYDw1EBH4K4AOqIngTDvDXQEpECRAm8baAhwb692REnuGiYdASKHJrt9/lMDY7J/qn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W3NewGmGFhbYb9AmSdO0bX34OC18AS4IjMsJhKchiLR56dd/QWDxEtAiy/aw/DbdZ3lRvgXxj5sQBBC3i+0C2PtvlOCyLrewCbo/CN4F4H3EgkH47DasvgVpCKG/IKTBeBdStt8G0eznwCSfGkRZUORPdsfgIon4p4D+dRY9N4rbcnc7uIp9BoImGJUz+mGBOL9DoE6j7wL+MPCz0D2egSgpbo5f5vE3AaiBYRt/HlpnHxaI2mp74/rzJAoEjJMjAgOurP2lAB/1nQJRkhd1ia9UH4bzfhMFAlCEWUwIGIVU8AOtlBTC2PsEQCHNqytkbRJ5jq/l3gA4MC4E52xCh+BaviihgM+BHHv0lUHOf6GA7wMtxuHDoR9G6cxfKAC4WUs+HqZpOoyMSy+1nsC5h+ezs0oqO8/wiTFrChykNsdo/XMHHj1DovniAoMwd6DGxQUQ1OBmtByiFVKg/s4EAJO80UArHq3CwJXWV6NrJcdoJfqRC6kuIwUbon8gL168ePHixYs/AQllYQQ4I2UrAAAAAElFTkSuQmCC',
trigger: function (text) {
- ajax('http://open.iciba.com/huaci_v3/dict.php?word=' + text, function (rst) {
- var html = parseIciba(rst);
- if (text.toLowerCase() != text) { // 再次翻译一遍小写的
- ajax('http://open.iciba.com/huaci_v3/dict.php?word=' + text.toLowerCase(), function (rst) {
- var reHtml = parseIciba(rst);
- if (html !== reHtml) {
- log(html, reHtml);
- html += '