Greasy Fork is available in English.

Google select text translator

Translate any selected text into the language you wants with google translator

  1. // ==UserScript==
  2. // @id googletranslatorbytoprapid
  3. // @name Google select text translator
  4. // @name:zh-CN 谷歌点击划词翻译
  5. // @version 4.32
  6. // @namespace https://greasyfork.org/en/scripts/36842
  7. // @author Toprapid
  8. // @copyright 2017+,toprapid
  9. // @description Translate any selected text into the language you wants with google translator
  10. // @description:zh-cn 谷歌点击划词翻译综合插件
  11. // @match http://*/*
  12. // @match https://*/*
  13. // @grant GM_registerMenuCommand
  14. // @grant GM_addStyle
  15. // @grant GM_xmlhttpRequest
  16. // @grant GM_getValue
  17. // @grant GM_setValue
  18. // ==/UserScript==
  19.  
  20.  
  21. function googleTranslatorByToprapid_Main(){
  22. //版本
  23. var gtVer="4.32";
  24.  
  25. var sourceTranslateLanguageNameInStorage = "sourceTranslateLanguage";
  26. var targetTranslateLanguageNameInStorage = "targetTranslateLanguage";
  27. var translatorSettingLanguageInStorage="translatorSettingLanguage";
  28. var defaultSourceLanguage = "-1";
  29. var defaultTranslateLanguage = "0";
  30. var currentSourceLanguage = parseInt(GM_getValue(sourceTranslateLanguageNameInStorage, defaultSourceLanguage));
  31. var currentTranslateLanguage= parseInt(GM_getValue(targetTranslateLanguageNameInStorage, defaultTranslateLanguage));
  32. var translatorSettingLanguage = GM_getValue(translatorSettingLanguageInStorage, "0") === "0" ? 0 : 1;
  33. //国家与语言代码字符串
  34. //国家
  35. var uLanguageNames = [["中文", "中文", "中文", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "芬兰语", "英语", "丹麦语", "英语", "希伯来语", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "韩文", "日语", "荷兰语", "荷兰语", "葡萄牙语", "葡萄牙语", "法语", "法语", "法语", "法语", "法语", "西班牙语", "西班牙语", "西班牙语", "西班牙语", "西班牙语", "西班牙语", "西班牙语", "德语", "德语", "德语", "俄语","乌克兰语", "意大利语", "希腊语", "挪威语", "匈牙利语", "土耳其语", "捷克语", "斯洛文尼亚语", "波兰语", "瑞典语", "西班牙语"], ["Chinese", "Chinese", "Chinese", "English", "English", "English", "English", "English", "English", "English", "English", "Finnish", "English", "Danish", "English", "Hebrew", "English", "English", "English", "English", "English", "English", "English", "English", "English", "English", "Korean", "Japanese", "Dutch", "Dutch", "Portuguese", "Portuguese", "French", "French", "French", "French", "French", "Spanish", "Spanish", "Spanish", "Spanish", "Spanish", "Spanish", "Spanish", "German", "German", "German", "Russian","Ukrainian", "Italian", "Greek", "Norwegian", "Hungarian", "Turkish", "Czech", "Slovenian", "Polish", "Sweden Language", "Spanish"]];
  36. //国家所对应的地区
  37. var uRegionNames = [["简体", "繁体台湾", "繁体香港", "香港", "美国", "英国", "全球", "加拿大", "澳大利亚", "爱尔兰", "芬兰", "芬兰", "丹麦", "丹麦", "以色列", "以色列", "南非", "印度", "挪威", "新加坡", "新西兰", "印度尼西亚", "菲律宾", "泰国", "马来西亚", "阿拉伯", "韩国", "日本", "荷兰", "比利时", "葡萄牙", "巴西", "法国", "卢森堡", "瑞士", "比利时", "加拿大", "拉丁美洲", "西班牙", "阿根廷", "美国", "墨西哥", "哥伦比亚", "波多黎各", "德国", "奥地利", "瑞士", "俄罗斯", "乌克兰","意大利", "希腊", "挪威", "匈牙利", "土耳其", "捷克共和国", "斯洛文尼亚语", "波兰", "瑞典", "智利"],["Simplified", "Traditional Taiwan", "Traditional Hong Kong", "Hong Kong", "America", "United Kingdom", "Global", "Canada", "Australia", "Irish", "Finland", "Finland", "Denmark", "Denmark", "Israel", "Israel", "South Africa", "Indian", "Norway", "Singapore", "New Zealand", "Indonesia", "the Philippines", "Thai", "Malaysia", "Arab", "Korea", "Japan", "Dutch", "Belgium", "Portugal", "Brazil", "French", "Luxembourg", "Switzerland", "Belgium", "Canada", "Latin America", "Spain", "Argentina", "America", "Mexico", "Columbia", "Puerto Rico", "Germany", "Austria", "Switzerland", "Russia", "Ukraine","Italy", "Greece", "Norway", "Hungary", "Turkey", "Czech Republic", "Slovenian", "Poland", "Sweden", "Chile"]];
  38. //最终代码
  39. var uLanguageCode = ["zh-cn", "zh-tw", "zh-hk", "en-hk", "en-us", "en-gb", "en-ww", "en-ca", "en-au", "en-ie", "en-fi", "fi-fi", "en-dk", "da-dk", "en-il", "he-il", "en-za", "en-in", "en-no", "en-sg", "en-nz", "en-id", "en-ph", "en-th", "en-my", "en-xa", "ko-kr", "ja-jp", "nl-nl", "nl-be", "pt-pt", "pt-br", "fr-fr", "fr-lu", "fr-ch", "fr-be", "fr-ca", "es-la", "es-es", "es-ar", "es-us", "es-mx", "es-co", "es-pr", "de-de", "de-at", "de-ch", "ru-ru", "uk-uk","it-it", "el-gr", "no-no", "hu-hu", "tr-tr", "cs-cz", "sl-sl", "pl-pl", "sv-se", "es-cl"];
  40. //腾讯代码
  41. var tLanguageCode=["自动识别","中文", "中文", "中文", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "xxx", "英语", "xxx", "英语", "xxx", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "英语", "韩语", "日语", "xxx", "xxx", "葡萄牙语", "葡萄牙语", "法语", "法语", "法语", "法语", "法语", "西班牙语", "西班牙语", "西班牙语", "西班牙语", "西班牙语", "西班牙语", "西班牙语", "德语", "德语", "德语", "俄语","xxx", "意大利语", "xxx", "xxx", "xxx", "土耳其语", "xxx", "xxx", "xxx", "xxx", "西班牙语","泰语","越南语","印尼语","马来西亚语","阿拉伯语","印地语"];
  42. //google翻译api变量
  43. var UA = navigator.userAgent;
  44. var googleDomain = ["translate.google.cn", "translate.google.com"];
  45. var dictURL = "https://" + googleDomain[translatorSettingLanguage] + "/translate_a/single?client=gtx";
  46. var ttsURL = "http://" + googleDomain[translatorSettingLanguage] + "/translate_tts?client=gtx";
  47. var alURL="https://"+googleDomain[translatorSettingLanguage] +"/?op=translate";
  48. var audioContext= new AudioContext();
  49. var tokenNameInStorage=["google_value_tk_zh_cn","google_value_tk_en_us"];
  50. var isEnabled = true;
  51. var isTranslatorDisabledTemporarily=true;
  52. var oldText = "";
  53. var searchedTextCache=[];
  54. var searchedTextIndex=-1;
  55. var speakerIconBase64Data="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QEQDhUFQkzk7wAAAIpJREFUOMtj/P//PwNFgAQD3jMwMDRg6MVjwHw0/n4GBob/DAwM5xkYGAQIGTAfqhgdFEDF1+MzAKYZl9P6oXIO2AxA1owsAXc2lH7PwMCwHtmA/zgwPLygYYBi0f///xmYSIgwByT2QxiDiYFCQIoBB5DY8rgSEtmBSLVopEpCokpSJjozMVKanQFy4nkNOfntnwAAAABJRU5ErkJggg==";
  56. var settingIconBase64Data="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAAEEfUpiAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACQVJREFUeNpi/P//PwMyYAERra2tRxgZmaz///9XwABSsf/Awf8gevOWrf/BKpYsXpR34cLF/1cuX2QECCBGdDOYWVlZbzOzsE76+fNXw4zp09sZT50+83/liuUKPDw8DyIjoxiY//37266hqf2Wg5OLYf26tYwAAQQ3o6en53ZJSYnqp0+f/8+aNXMrUCgLiB/BFezavef/zx/fGU6dOqXgHxD44O/fvwxbNm9iZAJJ5uTkbH/29DmDkJAwAyMj44N7d+8x3Lxxi+H9+/cqGM5csXLV/61bNgsAmR9BfIAAwlCADlhgDKDd/w8dOgTSJWBsbPz/7NmzjEBHMzBBA++qINB+Ti4ufnkFxf+8fHwMioqKYKPBClRUVbXevn3L8OL58/RLFy8cuHHjJsOFCxe6wG4oLi7+7+LqxsDCwsLg4uzECBLcsnXbf14eHobNmzcJgB25YcOm/8LCwgwPH95nUFZWZmBj42A4efI4Q1ZWFiPcF9Omz/z/588fBiZGRoa3b18zPH78WGPOnDk34b44fuzIRCC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g844oiS+3WYQtav2P1essbG9e2T/l3xteRS9iQRCksih4eVpAWwP9t9Y7yV65s3WGuEDp//rwQiYTfsziUBrX3Jbf886VLl4yncM8Poc/7OJN7BC3/48WLF82nOQ3+054dFAEAACAM8uwf2iCyCHxnj18FAAAAAAAAAAAAAAAAAAAAABh6fiXP0juK5QAAAABJRU5ErkJggg==";
  58. var copyIconBase64Data="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAB/UlEQVR4Xq2VMWvCUBDHLzFFsYiKOqi4iMZBUBMoFId+gWDpJnR0KDhKh36MrrWrLTgLguAiTi2hODuIH8DBRQU1mt4VHsRgYlLyh4MLgfu9/93jHqfrOpA4VLfbfaIUTDocDrDdbvVGo/EOADpcENVkEliiKMptvV5/AwttNhvIZrOPkUjkoVKpLMGheMMpebsTkYtisXi3Wq2+JpNJ1ClAMBThWH48Hun7BLDf72E+n4MkSSICvqbT6W2hUFg6BhhA1G8KKnjSIp7nQVVViMVi4mKxcAQRrFoym81AlmUaPpwRORLH43EH03sybTcDqwKgaRpYidpYLpcVhKjoJGoPcC8CMJcytYsgngJYK4PBIOC1FQmCM4t4BvD5fJBKpWA4HMJoNIJEIiGiiw/PAIIgQCgUgnw+D7lcjm4YxONxhX7ZAsg2CztRwXA4DMlkEjKZDKTTaSiVSrQRbiyvKQ2O9g4L1EVIIBAwH5CzdMBWAgXlXoi3ckC5FzI78B5gM4Oz324lYLAHR0cRhA2QrXHjUCn+BxgMBt/tdvsZt+gVgrj1en1VrVZfEHhteDNoR7kGMGmtVuuVPZm1Wq2Brna48BBgLzfrWqdgLWND9wxghmFxzS2ADuYI0Ov1PjudjoTbMuMU4Pf7t/1+/8epg12z2XzGxAfORXZPbsEvSLk9F+qUJXIAAAAASUVORK5CYII=";
  59. var pinIconBase64Data="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGjElEQVR4XsVWa0xU6Rl+zpkrMwwzDMIg3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UQBcvAAAAAElFTkSuQmCC";
  61. var previousIconBase64Data="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4wgSCwEjIU24iwAABttJREFUaN7tWW9oFOkZ/73zzszubHY3MS67hkiqkYjgxT9QrUa0VjgjSM8cwlE4WLh+8LyCilAxUBVFEUpbep5BKKm20utFlH7wy4K0QVH0gxVDgkJYN03WmLhLokl2s2R3dt53+mmms5OZTS7mdKF54GH+MPPO7/f8nud5330XWLIl+/828j4/1traWlsoFD4D8OLevXvdizGm+D6Ab9++XaGUfp3L5b7YtWuXNDAwkAZQB0B/17GFHxp8S0vLRgA9jLFDzc3NUigUAmMssljj/6AKbNu27YSmaecjkYinqakJlFJkMhkkk0kjffWKJNDS0hLmnHdxzvc0NzdDURQIggBKKQqFAhhjqFgFdu7cuV9V1Wt+vz+8fv16FItFSJIEQggIIdB13SCgVxSB3bt3i5zzP6qq+qvGxkZh2bJls8ADAOccnPPKUqC1tXVtoVC4KQjCxs2bN0NVVWiaBlH83/C6rpvRrygF9u3b90tVVb8JhUJV4XAYuVwOoiiaEbeC55xbCXxYBQ4cOBDQNO3PnPPPmpqaUCwWkc1mQSk1QdvBGyn0wQm0tbW1MMa+CwaDPwqHw0ilUqCUmuCdIm9ca5r2QQmQgwcPnmGM/WblypUSYwyvXr0qAW6AtoMHAEKImUKrV6/WRVGE4ZTSWUdDRcN8Pt9kbW3tr7u6uq5+bwLRaLQ+n89/RyndFYlEMDo6ClVVS1LGLW2sBKqqqrB3714IgmDWif1oL3pd10EIwapVq2oymcxvAXw/AtFo9NNisdhZW1u7nBCCRCIBQohryjiBN0BwzuHxeMx7Rls1akPTNNONblYsFsEYg9frRSKRWD7vFDp69Kgnm81+rev6l5FIhKTTaUxOTpZEzyltnIhY5wKnGjHc+q7dpqamkMvl5lcDhw8fXj8zM3PD5/N9RClFPB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cmRmOnJlc291cmNlPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9saWNlbnNlcy9wdWJsaWNkb21haW4vIgogICAgICAgIC8+CiAgICAgICAgPGRjOnB1Ymxpc2hlcgogICAgICAgICAgPgogICAgICAgICAgPGNjOkFnZW50CiAgICAgICAgICAgICAgcmRmOmFib3V0PSJodHRwOi8vb3BlbmNsaXBhcnQub3JnLyIKICAgICAgICAgICAgPgogICAgICAgICAgICA8ZGM6dGl0bGUKICAgICAgICAgICAgICA+T3BlbmNsaXBhcnQ8L2RjOnRpdGxlCiAgICAgICAgICAgID4KICAgICAgICAgIDwvY2M6QWdlbnQKICAgICAgICAgID4KICAgICAgICA8L2RjOnB1Ymxpc2hlcgogICAgICAgID4KICAgICAgICA8ZGM6dGl0bGUKICAgICAgICAgID5Xb2xmIEVtYmxlbTwvZGM6dGl0bGUKICAgICAgICA+CiAgICAgICAgPGRjOmRhdGUKICAgICAgICAgID4yMDEyLTAxLTE4VDE5OjI2OjA3PC9kYzpkYXRlCiAgICAgICAgPgogICAgICAgIDxkYzpkZXNjcmlwdGlvbgogICAgICAgICAgPkhvd2xpbmcgd29sZiBpbiBjaXJjbGU8L2RjOmRlc2NyaXB0aW9uCiAgICAgICAgPgogICAgICAgIDxkYzpzb3VyY2UKICAgICAgICAgID5odHRwczovL29wZW5jbGlwYXJ0Lm9yZy9kZXRhaWwvMTY3MjI1L3dvbGYtZW1ibGVtLWJ5LWt1YmE8L2RjOnNvdXJjZQogICAgICAgID4KICAgICAgICA8ZGM6Y3JlYXRvcgogICAgICAgICAgPgogICAgICAgICAgPGNjOkFnZW50CiAgICAgICAgICAgID4KICAgICAgICAgICAgPGRjOnRpdGxlCiAgICAgICAgICAgICAgPmt1YmE8L2RjOnRpdGxlCiAgICAgICAgICAgID4KICAgICAgICAgIDwvY2M6QWdlbnQKICAgICAgICAgID4KICAgICAgICA8L2RjOmNyZWF0b3IKICAgICAgICA+CiAgICAgICAgPGRjOnN1YmplY3QKICAgICAgICAgID4KICAgICAgICAgIDxyZGY6QmFnCiAgICAgICAgICAgID4KICAgICAgICAgICAgPHJkZjpsaQogICAgICAgICAgICAgID5hbmltYWw8L3JkZjpsaQogICAgICAgICAgICA+CiAgICAgICAgICAgIDxyZGY6bGkKICAgICAgICAgICAgICA+YmxhY2s8L3JkZjpsaQogICAgICAgICAgICA+CiAgICAgICAgICAgIDxyZGY6bGkKICAgICAgICAgICAgICA+Y2lyY2xlPC9yZGY6bGkKICAgICAgICAgICAgPgogICAgICAgICAgICA8cmRmOmxpCiAgICAgICAgICAgICAgPmVtYmxlbTwvcmRmOmxpCiAgICAgICAgICAgID4KICAgICAgICAgICAgPHJkZjpsaQogICAgICAgICAgICAgID5oZWFkPC9yZGY6bGkKICAgICAgICAgICAgPgogICAgICAgICAgICA8cmRmOmxpCiAgICAgICAgICAgICAgPmhvd2w8L3JkZjpsaQogICAgICAgICAgICA+CiAgICAgICAgICAgIDxyZGY6bGkKICAgICAgICAgICAgICA+d2lsZDwvcmRmOmxpCiAgICAgICAgICAgID4KICAgICAgICAgICAgPHJkZjpsaQogICAgICAgICAgICAgID53b2xmPC9yZGY6bGkKICAgICAgICAgICAgPgogICAgICAgICAgPC9yZGY6QmFnCiAgICAgICAgICA+CiAgICAgICAgPC9kYzpzdWJqZWN0CiAgICAgICAgPgogICAgICA8L2NjOldvcmsKICAgICAgPgogICAgICA8Y2M6TGljZW5zZQogICAgICAgICAgcmRmOmFib3V0PSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9saWNlbnNlcy9wdWJsaWNkb21haW4vIgogICAgICAgID4KICAgICAgICA8Y2M6cGVybWl0cwogICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zI1JlcHJvZHVjdGlvbiIKICAgICAgICAvPgogICAgICAgIDxjYzpwZXJtaXRzCiAgICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjRGlzdHJpYnV0aW9uIgogICAgICAgIC8+CiAgICAgICAgPGNjOnBlcm1pdHMKICAgICAgICAgICAgcmRmOnJlc291cmNlPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyNEZXJpdmF0aXZlV29ya3MiCiAgICAgICAgLz4KICAgICAgPC9jYzpMaWNlbnNlCiAgICAgID4KICAgIDwvcmRmOlJERgogICAgPgogIDwvbWV0YWRhdGEKICA+Cjwvc3ZnCj4K";
  73. var ANS_TYPE_GOOGLE_RESULT=0,ANS_TYPE_ZDIC_HTML=2,ANS_TYPE_YOUDAO_WORD=3,ANS_TYPE_YOUDAO_SENTENCE=4,ANS_TYPE_ACCURATE=5;
  74. var CACHE_TYPE_GOOGLE_RESULT=0,CACHE_TYPE_ZDIC_HTML=1,CACHE_TYPE_YOUDAO_WORD=2,CACHE_TYPE_YOUDAO_SENTENCE=3,CACHE_TYPE_ACCURATE=4;
  75. var translatedDataMap=new Map();
  76. var translatedSoundMap=new Map();
  77. var lingoesServerConfigNameInStorage="lingoesServerConfig";
  78. var defaultLingoesServerConfigValue="0|0|127.0.0.1|11111";
  79. var lingoes_isEnabled=!1,lingoes_showingWay=0,lingoes_serverIp="127.0.0.1",lingoes_serverPort="11111";
  80. var youdaoConfigNameInStorage="youdaoConfig";
  81. var defaultYoudaoConfigValue="0|0|0";
  82. var youdao_isEnabled=!1,youdao_isOnlyForSingleWord=!0;
  83. var hotKeyNameInStorage="hotKeyName";
  84. var hotKeyNameForQSInStorage = "QSHotKeyName";
  85. var defaultHotKeyValue= "1|1|1|81"; //Ctrl+Alt+Q enabled
  86. var defaultHotKeyValueForQS="1|1|1|68"; //Ctrl+Alt+D enabled
  87. var hotKey_Ctrl=!0,hotKey_Alt=!0,hotKey_Code=81, hotkey_isActive = !0, isHotkeyEventRegistered=!1;
  88. var hotKey_Ctrl_forQS = !0, hotKey_Alt_forQS = !0, hotKey_Code_forQS = 68, hotkey_isActive_forQS = !0, isHotkeyEventRegistered_forQS = !1;
  89. var hotkeyType_forPlugin=0;
  90. var hotkeyType_forQS=1;
  91. var isPinned=!1;
  92. var isToolBarMoving=!1;
  93. var tBarOffsetX=0;
  94. var tBarOffsetY=0;
  95. var isEnableSimpleMode=!1;
  96. var isEnableSimpleModeDefaultConfig="0";
  97. var isEnableSimpleModeConfigString="isEnableSimpleModeConfigString";
  98. var isEnableRealtimeTranslationMode=!0;
  99. var isEnableRealtimeTranslationModeDefaultConfig="1";
  100. var isEnableRealtimeTranslationModeConfigString="isEnableRealtimeTranslationModeConfigString";
  101. var isRemoveWebsiteSelectingRestriction=!0;
  102. var isRemoveWebsiteSelectingRestrictionDefaultConfig="1";
  103. var isRemoveWebsiteSelectingRestrictionConfigString="isRemoveWebsiteSelectingRestrictionConfigString";
  104. var isWebsiteRestrictionRemoved=!1;
  105. var isEnableAnimalVoicePerception=!1;
  106. var isEnableAnimalVoicePerceptionDefaultConfig="0";
  107. var isEnableAnimalVoicePerceptionConfigString="isEnableAnimalVoicePerceptionConfigString"
  108. var isEnableAccurateMode=!1;
  109. var isEnableAccurateModeDefaultConfig="0";
  110. var isEnableAccurateModeConfigString="isEnableAccurateModeConfigString";
  111. var isTMode=!1;
  112. var isTModeDefaultConfig="0";
  113. var isTModeConfigString="isTMode";
  114. var animalVoice="嗷呜啊~"
  115. var animalVoiceDefaultConfig="嗷呜啊~"
  116. var animalVoiceConfigString="animalVoiceConfigString"
  117. var translatedDataConfigString="translatedDataConfigString";
  118. var translationTaskTimout=0;
  119. var translationTaskInterval=100;
  120. var maxTimesToDestroy=200;
  121. let accurateData={dy:maxTimesToDestroy,mx:0,my:0,md5:"",wh:null};
  122. var isExistsTranslationTask={
  123. get:function(){
  124. return GM_getValue("isExistsTranslationTaskConfigString","0")!=="0";
  125. },
  126. set:function(vl){
  127. GM_setValue("isExistsTranslationTaskConfigString",vl ? "1":"0");
  128. }
  129. };
  130.  
  131. //current target language for playing sound
  132. var curTarLanForSpeaker = uLanguageCode[currentTranslateLanguage];
  133.  
  134. let maxNResult=80;
  135. let tencentTStr="";
  136.  
  137. class howlingAnimalsTranslator{
  138. __codeTxt="嗷呜啊~";
  139. constructor(codeTxt){
  140. if(codeTxt!=null){
  141. codeTxt=codeTxt.trim();
  142. if(codeTxt.length==4){
  143. this.__codeTxt=codeTxt;
  144. }
  145. }
  146. }
  147. convert(txt){
  148. txt=txt.trim();
  149. if(txt.length<1){
  150. return "";
  151. }
  152. let result=this.__codeTxt[3]+this.__codeTxt[1]+this.__codeTxt[0];
  153. let offset=0;
  154. for(let i=0;i<txt.length;i++){
  155. let c=txt.charCodeAt(i);
  156. for(let b=12;b>=0;b-=4){
  157. let hex=(c>>b)+offset++&15;
  158. result+=this.__codeTxt[(hex>>2)];
  159. result+=this.__codeTxt[(hex&3)];
  160. }
  161. }
  162. result+=this.__codeTxt[2];
  163. return result;
  164. }
  165. deConvert(txt){
  166. txt=txt.trim();
  167. if(txt.length<4){
  168. return "";
  169. }
  170. let result="";
  171. let offset=0;
  172. for(let i=3;i<txt.length-1;){
  173. let c=0;
  174. for(let b=i+8;i<b;i++){
  175. c=c<<4|((this.__codeTxt.indexOf(txt[i++])<<2|this.__codeTxt.indexOf(txt[i]))+offset)&0xf;
  176. offset=(offset==0 ? 0x10000*0x10000-1:offset-1);
  177. }
  178. result+=String.fromCharCode(c);
  179. }
  180. return result;
  181. }
  182. identify(txt){
  183. txt=txt.trim()
  184. if(txt.length>11){
  185. if(txt[0]==this.__codeTxt[3] && txt[1]==this.__codeTxt[1] && txt[2]==this.__codeTxt[0] && txt.charAt(txt.length-1)==this.__codeTxt[2] && ((txt.length-4)%8)==0){
  186. for(let i=0;i<txt.length;i++){
  187. if(this.__codeTxt.indexOf(txt[i])<0)return false;
  188. }
  189. return true;
  190. }
  191. }
  192. return false;
  193. }
  194. }
  195. var animalVoiceTranslator=new howlingAnimalsTranslator(animalVoiceDefaultConfig);
  196.  
  197. function fetchNResult(){
  198. let n=document.getElementsByTagName("c-wiz");
  199. if(n.length>10){
  200. let s=n[8].getElementsByTagName("span");
  201. if(s){
  202. let result=""
  203. if(s.length>5){
  204. let sp=s[1].getElementsByTagName("span");
  205. if(sp){
  206. if(sp.length>0){
  207. for(let i=0;i<sp.length;i++){
  208. let spa=sp[i].getElementsByTagName("span");
  209. if(spa){
  210. if(spa.length>0){
  211. result+=spa[0].innerHTML;
  212. }
  213. }
  214. }
  215. if(result.trim().length>0){
  216. GM_setValue(translatedDataConfigString,result);
  217. isExistsTranslationTask.set(false);
  218. window.close();
  219. }
  220. }
  221. }
  222. }
  223. }
  224. }
  225. if(maxNResult-->0)setTimeout(fetchNResult,200);
  226. }
  227. function fetchTResult(){
  228. let n=document.getElementsByClassName("textinput");
  229. if(n){
  230. if(n.length>0){
  231. n[0].value=tencentTStr;
  232. triggerEvent(n[0],"propertychange");
  233. fetchZResult();
  234. return;
  235. }
  236. }
  237. if(maxNResult-->0)setTimeout(fetchTResult,200);
  238. }
  239. function fetchZResult(){
  240. let z=document.getElementsByClassName("textpanel-target-textblock");
  241. if(z){
  242. if(z.length>0){
  243. if(z[0].innerHTML!=="undefined" && z[0].innerHTML!==null){
  244. let s=z[0].innerHTML.trim();
  245. if(s.length>0){
  246. GM_setValue(translatedDataConfigString,`<style type="text/css">#gt_prefs_contentDiv span.hidden{display:none;};</style>${s}`);
  247. isExistsTranslationTask.set(false);
  248. window.close();
  249. return;
  250. }
  251. }
  252. }
  253. }
  254. if(maxNResult-->0)setTimeout(fetchZResult,100);
  255. }
  256. getModesConfigValue();
  257. if(isEnableAccurateMode){
  258. if(isExistsTranslationTask.get()){
  259. if(/translate\.google\.[com|cn]+\/\?op=translate\&sl=/gi.test(location.href)){
  260. if(translatorSettingLanguage===1){
  261. document.addEventListener("DOMContentLoaded",fetchNResult());
  262. /*
  263. document.onreadystatechange=function(e){
  264. if(document.readyState==="complete"){
  265. fetchNResult();
  266. }
  267. }
  268. //*/
  269. }
  270. else{
  271. fetchNResult();
  272. }
  273. return;
  274. }
  275. if(/^https:\/\/fanyi\.qq\.com\/$/gi.test(location.href)){
  276. document.onreadystatechange=function(e){
  277. if(document.readyState==="complete"){
  278. let dta=GM_getValue(translatedDataConfigString,null);
  279. if(dta!=null && dta!="undefined" && dta!==""){
  280. let s=dta.split("|");
  281. if(s.length===3){
  282. let zn=document.getElementsByTagName("ul");
  283. let sps=null;
  284. let i=0;
  285. tencentTStr=decodeURI(s[2]);
  286. for(;i<zn.length;i++){
  287. if(zn[i].hasAttribute("node-type")){
  288. if(zn[i].getAttribute("node-type")==="target_language_list"){
  289. sps=zn[i].getElementsByTagName("span");
  290. break;
  291. }
  292. }
  293. }
  294. if(sps){
  295. for(let n=0;n<sps.length;n++){
  296. if(sps[n].innerText===s[0]){
  297. triggerEvent(sps[n],"click");
  298. break;
  299. }
  300. }
  301. }
  302. sps=null;
  303. for(;i<zn.length;i++){
  304. if(zn[i].hasAttribute("node-type")){
  305. if(zn[i].getAttribute("node-type")==="target_language_list"){
  306. sps=zn[i].getElementsByTagName("span");
  307. break;
  308. }
  309. }
  310. }
  311. if(sps){
  312. for(let n=0;n<sps.length;n++){
  313. if(sps[n].innerText===s[1]){
  314. triggerEvent(sps[n],"click");
  315. break;
  316. }
  317. }
  318. }
  319. fetchTResult();
  320. }
  321. }
  322. }
  323. }
  324. return;
  325. }
  326. }
  327. }
  328. getHotKeyValue(hotkeyType_forPlugin);
  329. getHotKeyValue(hotkeyType_forQS);
  330. getLingoesConfigValue();
  331. getYoudaoConfigValue();
  332.  
  333. window.document.body.addEventListener("mouseup", googleTranslate, false);
  334.  
  335. var on = function (node, e, f) {
  336. node.addEventListener(e, f, false);
  337. };
  338. var $ = function (s) {
  339. return document.getElementById('gt_prefs_' + s);
  340. };
  341.  
  342.  
  343. var setup=function() {
  344. var d = document;
  345. if ($('setup')) return;
  346. var div = d.createElement('div');
  347. div.id = 'gt_prefs_setup';
  348. d.body.appendChild(div);
  349. var styleNode = GM_addStyle(`
  350. #gt_prefs_setup {opacity:0.9; box-shadow:-2px 0px 9px 5px #898D91;position:fixed;z-index:2147483647;top:30px;right:60px;padding:20px 30px;background:radial-gradient(circle, rgba(31,103,127,1) 0%, rgba(83,160,124,1) 94%, rgba(132,175,155,1) 96%, rgba(31,96,161,1) 98%, rgba(56,115,173,1) 98%, rgba(5,183,246,1) 100%);width:600px;border:1px solid black; border-radius:10px;}
  351. #gt_prefs_setup * { color:#deff08;text-align:left;line-height:normal;font-size:12px; }
  352. #gt_prefs_setup a { color:black;text-decoration:underline; }
  353. #gt_prefs_setup div { text-align:center;font-weight:bold;font-size:14px; }
  354. #gt_prefs_setup ul { margin:15px 0 15px 0;padding:0;list-style:none;border:0; }
  355. #gt_prefs_setup input,select {border:1px solid blue;border-radius:5px;width:auto;padding:2px;background:#53a07c;text-align:center;}
  356. #gt_prefs_setup li { margin:0;padding:6px 0;vertical-align:middle;border:0 }
  357. #gt_prefs_setup button { background:transparent;width:150px;margin:0 10px;text-align:center;border:1px blue solid;border-radius:5px;box-shadow:2px 2px 2px 1px #2C3E50;}
  358. #gt_prefs_setup textarea { width:98%; height:60px; margin:3px 0; text-align:center;border-radius:5px;}
  359. #gt_prefs_setup b { font-weight: bold; font-family: "微软雅黑", sans-serif; }
  360. #gt_prefs_setup button:disabled { color: graytext; }
  361. `);
  362. var sb_Title=["谷歌点击划词翻译设置","Google select text translator Setting"],
  363. sb_CurStatus = [["(启用中)", "(禁用中)"], ["(Enabled)", "(Disabled)"]],
  364. sb_HotkeyForQuickSearch = ["快速查询热键:", "Hotkey for Quick Search:"],
  365. sb_HotkeyActivatorForQuickSearch = ["启用热键", "Enable Hotkey"],
  366. sb_Usage = ["插件开关热键:", "Hotkey for Plugin switch:"],
  367. sb_HotKeyActivator=["启用热键","Enable Hotkey"],
  368. sb_CurVersion=["当前版本:","Current Version "],
  369. sb_CurAuthor=[",作者:",", Author: "],
  370. sb_CurUILanguage=[",Current UI Language:",", 当前界面语言:"],
  371. sb_UILanguage=[["Chinese Simplified","English"],["英文","中文"]],
  372. sb_SourceLanguage = ["指定源语言:", "Select the source language:"],
  373. sb_SourceLanguageSetToAuto = ["自动检测", "Auto Detect"],
  374. sb_TargetLanguage=["设置目标翻译语言:","Select the target language to translate:"],
  375. sb_Confirmation=[["确定","取消"],["Save","Cancel"]],
  376. sb_UseLingoesAPILocalServer=["启用本地灵格斯API服务(需要本机安装灵格斯词典软件,并在其设置中启用API服务器)。","Enable Lingoes Local API Server (Need Lingoes software installed, and enable it's API server)."],
  377. sb_LingoesAPIServerIP=["灵格斯API服务器 -- IP地址:","Lingoes Local API Server -- IP:"],
  378. sb_LingoesAPIServerPort=["端口号:","Port:"],
  379. sb_LingoesShowingWay=[["显示取词窗口","主界面取词","主界面翻译文字","查询方式:"],["Showing query result","Main UI query","Main UI translator","Query way:"]],
  380. sb_LingoesErrorWarning=[["输入的IPv4地址不规范!本地地址一般为:127.0.0.1","端口号必须为0-65535间的数字!"],["The Ipv4 address is wrong! For localhost server, use 127.0.0.1 please!","Port number must be a digital between 0 to 65535"]],
  381. sb_UseYoudaoSever=["启用有道翻译代替谷歌翻译引擎(注:仅限中英互译):","Use Youdao translator (PS: only used between Chinese and English):"],
  382. sb_YoudaoTranslationWay=[["全面启用","仅限单词"],["Totaly enabled","Only for words"]],
  383. sb_ErrorWarning=["输入的热键必须为字母或数字!","The hot key must be alphabet or digital!"],
  384. sb_SimpleMode=["简洁模式(仅翻译成目标语言)","Simple Mode (Show translated content only)"],
  385. sb_RealTimeTranslationMode=["启用对选定内容的实时翻译模式(否则需点击翻译图标进行翻译)","Enable real-time selection translating mode (Otherwise click an icon to translate)"],
  386. sb_RemoveSelectingRestriction=["移除网站对文本选定的限制(如果导致部分网站功能异常,请禁用该选项)","Remove website selection restriction (Disable this if website runs unusually)"],
  387. sb_AccurateMode=["对长句使用精确翻译模式(需借助临时弹出翻译引擎窗口获取翻译数据,速度较慢),选择引擎:","Use accurate mode for sentences (Need to popup the translation window to get translated data. It's slowly), Choose translator:"],
  388. sb_AccurateEngineSelection=[["谷歌翻译引擎","腾讯翻译引擎"],["Google Engine","Tencent Engine"]],
  389. sb_HowlingAnimalsPerception=["启用兽音感知(一种通过特定算法,将原语句转换成由“呜嗷啊~”组成的兽音句子。)","Enable Howling Animals Sentence perception (A specific algorithm that converts the original sentence into a sentence composed of `oooh~ah~`, just like howling animals. Especially exists in Chinese forums, uses to pass the censorship.)"];
  390. var divHtml = `
  391. <div>${sb_Title[translatorSettingLanguage]}${sb_CurStatus[translatorSettingLanguage][(isEnabled ? 0:1)]}</div>
  392. <ul>
  393. <li>${sb_CurVersion[translatorSettingLanguage]} <b>${gtVer}</b>${sb_CurAuthor[translatorSettingLanguage]}<b>Toprapid</b>${sb_CurUILanguage[translatorSettingLanguage]}
  394. <select id="gt_prefs_se_curUILanguage">
  395. <option value="0" selected="selected">${sb_UILanguage[translatorSettingLanguage][0]}</option>
  396. <option value="1">${sb_UILanguage[translatorSettingLanguage][1]}</option>
  397. </select>
  398. </li>
  399. <li>${sb_Usage[translatorSettingLanguage]}
  400. <input type="checkbox" id="gt_prefs_cb_ctrl" value="Ctrl" />Ctrl<b>+</b>
  401. <input type="checkbox" id="gt_prefs_cb_alt" value="Alt" />Alt<b>+</b>
  402. <input type="text" maxlength="1" style="text-transform:uppercase;" onclick="javascript:this.select();" id="gt_prefs_txt_key" value="${String.fromCharCode(hotKey_Code)}" />
  403. <input type="checkbox" id="gt_prefs_cb_stat" value="isActive" />${sb_HotKeyActivator[translatorSettingLanguage]}
  404. </li>
  405. <li>${sb_HotkeyForQuickSearch[translatorSettingLanguage]}
  406. <input type="checkbox" id="gt_prefs_cb_ctrl_forQS" value="Ctrl" />Ctrl<b>+</b>
  407. <input type="checkbox" id="gt_prefs_cb_alt_forQS" value="Alt" />Alt<b>+</b>
  408. <input type="text" maxlength="1" style="text-transform:uppercase;" onclick="javascript:this.select();" id="gt_prefs_txt_key_forQS" value="${String.fromCharCode(hotKey_Code_forQS)}" />
  409. <input type="checkbox" id="gt_prefs_cb_stat_forQS" value="isActive" />${sb_HotkeyActivatorForQuickSearch[translatorSettingLanguage]}
  410. </li>
  411. <li><input type="checkbox" id="gt_prefs_cb_stat_enable_simple_mode" value="isEnableSimpleMode" />${sb_SimpleMode[translatorSettingLanguage]}</li>
  412. <li>
  413. <input type="checkbox" id="gt_prefs_cb_stat_enable_accurate_mode" value="isEnableAccurateMode" />${sb_AccurateMode[translatorSettingLanguage]}
  414. <select id="gt_prefs_se_accurate_engine">
  415. <option value="0" ${!isTMode ? 'selected="selected"' : ''}>${sb_AccurateEngineSelection[translatorSettingLanguage][0]}</option>
  416. <option value="1" ${isTMode ? 'selected="selected"' : ''}>${sb_AccurateEngineSelection[translatorSettingLanguage][1]}</option>
  417. </select>
  418. </li>
  419. <li><input type="checkbox" id="gt_prefs_cb_stat_enable_realtime_translation_mode" value="isEnableRealtimeTranslationMode" />${sb_RealTimeTranslationMode[translatorSettingLanguage]}</li>
  420. <li><input type="checkbox" id="gt_prefs_cb_stat_remove_website_restriction" value="isRemoveWebsiteSelectingRestriction" />${sb_RemoveSelectingRestriction[translatorSettingLanguage]}</li>
  421. <li><input type="checkbox" id="gt_prefs_cb_stat_using_lingoes" onclick="javascript:document.getElementById('gt_prefs_li_lingoes_config').style.display=(this.checked ? 'block':'none');" value="isActive" />${sb_UseLingoesAPILocalServer[translatorSettingLanguage]}</li>
  422. <li id="gt_prefs_li_lingoes_config">${sb_LingoesAPIServerIP[translatorSettingLanguage]}
  423. <input type="text" maxlength="15" onclick="javascript:this.select();" id="gt_prefs_txt_lingoes_ip" value="${lingoes_serverIp}" />
  424. ${sb_LingoesAPIServerPort[translatorSettingLanguage]}
  425. <input type="text" maxlength="15" onclick="javascript:this.select();" id="gt_prefs_txt_lingoes_port" value="${lingoes_serverPort}" />
  426. <br/>
  427. ${sb_LingoesShowingWay[translatorSettingLanguage][3]}
  428. <select id="gt_prefs_se_lingoes_showingWay">
  429. `;
  430. for (let i=0;i<3;i++){
  431. divHtml+=`<option value="${i}" ${lingoes_showingWay===i ? 'selected="selected"':''}>${sb_LingoesShowingWay[translatorSettingLanguage][i]}</option>`
  432. }
  433. divHtml+=`</select></li>
  434. <li>
  435. <input type="checkbox" id="gt_prefs_cb_stat_using_youdao" value="isActive" />${sb_UseYoudaoSever[translatorSettingLanguage]}
  436. <select id="gt_prefs_se_youdao_trans_way">
  437. <option value="0" ${!youdao_isOnlyForSingleWord ? 'selected="selected"' : ''}>${sb_YoudaoTranslationWay[translatorSettingLanguage][0]}</option>
  438. <option value="1" ${youdao_isOnlyForSingleWord ? 'selected="selected"' : ''}>${sb_YoudaoTranslationWay[translatorSettingLanguage][1]}</option>
  439. </select>
  440. </li>
  441. <li>
  442. <input type="checkbox" id="gt_prefs_cb_stat_enable_howling_animals_perception" value="isActive" />${sb_HowlingAnimalsPerception[translatorSettingLanguage]}
  443. <input type="text" id="gt_prefs_eb_animal_voice_string" maxlength="4" value="${animalVoice}" />
  444. </li>
  445. <li>${sb_SourceLanguage[translatorSettingLanguage]}
  446. <select id="gt_prefs_se_curSourceLanguage">
  447. <option value="0" ${currentSourceLanguage < 0 ? 'selected="selected"' : ''}>${sb_SourceLanguageSetToAuto[translatorSettingLanguage]}</option>`;
  448. for (let i = 0; i < uLanguageCode.length; i++) {
  449. if (currentSourceLanguage === i) divHtml += `<option value="${i}" selected="selected">${uLanguageNames[translatorSettingLanguage][i]}-${uRegionNames[translatorSettingLanguage][i]}(${uLanguageCode[i]})</option>`;
  450. else divHtml += `<option value="${i}">${uLanguageNames[translatorSettingLanguage][i]}-${uRegionNames[translatorSettingLanguage][i]}(${uLanguageCode[i]})</option>`;
  451. }
  452. divHtml+=`</select>
  453. </li>
  454. <li>${sb_TargetLanguage[translatorSettingLanguage]}
  455. <select id="gt_prefs_se_curTargetLanguage">`;
  456. for (let i=0;i<uLanguageCode.length;i++){
  457. if (currentTranslateLanguage===i) divHtml += `<option value="${i}" selected="selected">${uLanguageNames[translatorSettingLanguage][i]}-${uRegionNames[translatorSettingLanguage][i]}(${uLanguageCode[i]})</option>`;
  458. else divHtml+=`<option value="${i}">${uLanguageNames[translatorSettingLanguage][i]}-${uRegionNames[translatorSettingLanguage][i]}(${uLanguageCode[i]})</option>`;
  459. }
  460. divHtml += `</select>
  461. </li>
  462. </ul>
  463. <div><button id="gt_prefs_ok">${sb_Confirmation[translatorSettingLanguage][0]}</button><button id="gt_prefs_cancel">${sb_Confirmation[translatorSettingLanguage][1]}</button></div>`;
  464. div.innerHTML= divHtml;
  465. div = null;
  466.  
  467. var close = function () {
  468. if (styleNode) {
  469. styleNode.parentNode.removeChild(styleNode);
  470. }
  471. var div = $('setup');
  472. div.parentNode.removeChild(div);
  473. };
  474.  
  475. on($('ok'), 'click', function () {
  476. //save lingoes server config
  477. if(!/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/.test($("txt_lingoes_ip").value.trim())){
  478. alert(sb_LingoesErrorWarning[translatorSettingLanguage][0]);
  479. return;
  480. }
  481. if (!/^[0-9]{1,5}$/.test($("txt_lingoes_port").value.trim())){
  482. alert(sb_LingoesErrorWarning[translatorSettingLanguage][1]);
  483. return;
  484. }
  485. var portNum=parseInt($("txt_lingoes_port").value.trim());
  486. if (portNum<0&&portNum>65535){
  487. alert(sb_LingoesErrorWarning[translatorSettingLanguage][1]);
  488. return;
  489. }
  490. saveLingoesSettings($("cb_stat_using_lingoes").checked, $("se_lingoes_showingWay").selectedIndex, $("txt_lingoes_ip").value.trim(), $("txt_lingoes_port").value.trim());
  491. saveYoudaoSettings($("cb_stat_using_youdao").checked, $("se_youdao_trans_way").selectedIndex, null);
  492. saveModeSettings(isTModeConfigString,(isTMode=($("se_accurate_engine").selectedIndex!==0)));
  493. saveModeSettings(isEnableSimpleModeConfigString,(isEnableSimpleMode=$("cb_stat_enable_simple_mode").checked));
  494. saveModeSettings(isEnableAccurateModeConfigString,(isEnableAccurateMode=$("cb_stat_enable_accurate_mode").checked));
  495. saveModeSettings(isEnableRealtimeTranslationModeConfigString,(isEnableRealtimeTranslationMode=$("cb_stat_enable_realtime_translation_mode").checked));
  496. saveModeSettings(isRemoveWebsiteSelectingRestrictionConfigString,(isRemoveWebsiteSelectingRestriction=$("cb_stat_remove_website_restriction").checked));
  497. saveModeSettings(isEnableAnimalVoicePerceptionConfigString,(isEnableAnimalVoicePerception=$("cb_stat_enable_howling_animals_perception").checked));
  498. let animalVoiceString=$("eb_animal_voice_string").value.trim();
  499. if(animalVoiceString.length==4){
  500. GM_setValue(animalVoiceConfigString,animalVoiceString);
  501. animalVoice=animalVoiceString;
  502. }
  503. if(isEnableAnimalVoicePerception){
  504. animalVoiceTranslator=new howlingAnimalsTranslator(animalVoice);
  505. }
  506. if($("translatorDiv")){
  507. if(isEnableSimpleMode){
  508. $("iconSimplified").style.display="block";
  509. $("iconDetailed").style.display="none";
  510. }
  511. else{
  512. $("iconSimplified").style.display="none";
  513. $("iconDetailed").style.display="block";
  514. }
  515. if(isEnableAccurateMode){
  516. $("iconAccurate").style.display="block";
  517. $("iconNonAccurate").style.display="none";
  518. }
  519. else{
  520. $("iconAccurate").style.display="none";
  521. $("iconNonAccurate").style.display="block";
  522. }
  523. if(isEnableRealtimeTranslationMode){
  524. $("iconRealtime").style.display="block";
  525. $("iconNotRealtime").style.display="none";
  526. $("iconForbidden").style.display="block";
  527. }
  528. else{
  529. $("iconRealtime").style.display="none";
  530. $("iconNotRealtime").style.display="block";
  531. $("iconForbidden").style.display="none";
  532. }
  533. }
  534. if(isRemoveWebsiteSelectingRestriction && !isWebsiteRestrictionRemoved){
  535. removeWebsiteSelectingRestriction();
  536. }
  537. if (translatorSettingLanguage===0){
  538. youdao_isEnabled= $("cb_stat_using_youdao").checked;
  539. GM_setValue(youdaoConfigNameInStorage,(youdao_isEnabled ? "1":"0")+"|1|0");
  540. }
  541. if ($("se_curUILanguage").selectedIndex > 0){
  542. translatorSettingLanguage= translatorSettingLanguage===0 ? 1:0;
  543. GM_setValue(translatorSettingLanguageInStorage, translatorSettingLanguage.toString());
  544. dictURL = "https://" + googleDomain[translatorSettingLanguage] + "/translate_a/single?client=t";
  545. alURL="https://"+googleDomain[translatorSettingLanguage] +"/?op=translate";
  546. }
  547. if ($("se_curSourceLanguage").selectedIndex !== currentSourceLanguage) {
  548. currentSourceLanguage = $("se_curSourceLanguage").selectedIndex - 1;
  549. GM_setValue(sourceTranslateLanguageNameInStorage, currentSourceLanguage.toString());
  550. }
  551. if ($("se_curTargetLanguage").selectedIndex!==currentTranslateLanguage){
  552. currentTranslateLanguage= $("se_curTargetLanguage").selectedIndex;
  553. GM_setValue(targetTranslateLanguageNameInStorage,currentTranslateLanguage.toString());
  554. }
  555. var kyc= $("txt_key").value.toUpperCase().charCodeAt(0);
  556. if (kyc!==hotKey_Code || $("cb_ctrl").checked!==hotKey_Ctrl || $("cb_alt").checked!==hotKey_Alt || $("cb_stat").checked!==hotkey_isActive){
  557. if (kyc<=128){
  558. makeAndSaveHotKeyValue($("cb_stat").checked, $("cb_ctrl").checked, $("cb_alt").checked, kyc, hotkeyType_forPlugin);
  559. }
  560. else{
  561. alert(sb_ErrorWarning[translatorSettingLanguage]);
  562. }
  563. }
  564. kyc = $("txt_key_forQS").value.toUpperCase().charCodeAt(0);
  565. if (kyc !== hotKey_Code_forQS || $("cb_ctrl_forQS").checked !== hotKey_Ctrl_forQS || $("cb_alt_forQS").checked !== hotKey_Alt_forQS || $("cb_stat_forQS").checked !== hotkey_isActive_forQS) {
  566. if (kyc <= 128) {
  567. makeAndSaveHotKeyValue($("cb_stat_forQS").checked, $("cb_ctrl_forQS").checked, $("cb_alt_forQS").checked, kyc, hotkeyType_forQS);
  568. }
  569. else {
  570. alert(sb_ErrorWarning[translatorSettingLanguage]);
  571. }
  572. }
  573. close();
  574. });
  575. if (lingoes_isEnabled) $("cb_stat_using_lingoes").checked = true;
  576. else $("li_lingoes_config").style.display = "none";
  577. $("se_youdao_trans_way").selectedIndex = youdao_isOnlyForSingleWord ? 1 : 0;
  578. $("se_accurate_engine").selectedIndex= isTMode ? 1:0;
  579. $("cb_stat_using_youdao").checked = youdao_isEnabled;
  580. $("cb_stat_enable_howling_animals_perception").checked = isEnableAnimalVoicePerception;
  581. $("eb_animal_voice_string").value = animalVoice;
  582. if (hotkey_isActive) $("cb_stat").checked = true;
  583. if (hotKey_Ctrl)$("cb_ctrl").checked = true;
  584. if (hotKey_Alt) $("cb_alt").checked = true;
  585. if (hotkey_isActive_forQS) $("cb_stat_forQS").checked = true;
  586. if (hotKey_Ctrl_forQS) $("cb_ctrl_forQS").checked = true;
  587. if (hotKey_Alt_forQS) $("cb_alt_forQS").checked = true;
  588. if(isEnableSimpleMode) $("cb_stat_enable_simple_mode").checked=true;
  589. if(isEnableAccurateMode) $("cb_stat_enable_accurate_mode").checked=true;
  590. if(isEnableRealtimeTranslationMode) $("cb_stat_enable_realtime_translation_mode").checked=true;
  591. if(isRemoveWebsiteSelectingRestriction)$("cb_stat_remove_website_restriction").checked=true;
  592. on($('cancel'), 'click', close);
  593. };
  594.  
  595. function saveLingoesSettings(isEnabled,showingWay,ip,port){
  596. lingoes_isEnabled=isEnabled;
  597. var lingoesConfigStr = (lingoes_isEnabled ? "1|" : "0|") + (lingoes_showingWay = showingWay).toString() + "|" + (lingoes_serverIp = ip) + "|" + (lingoes_serverPort = port);
  598. GM_setValue(lingoesServerConfigNameInStorage, lingoesConfigStr);
  599. }
  600.  
  601. function saveYoudaoSettings(isEnabled,showingWay,Reserved) {
  602. youdao_isEnabled=isEnabled;
  603. youdao_isOnlyForSingleWord = showingWay === 1;
  604. GM_setValue(youdaoConfigNameInStorage, (youdao_isEnabled ? "1|" : "0|") + (youdao_isOnlyForSingleWord ? "1|" : "0|") + (Reserved == null ? "0" : Reserved));
  605. }
  606.  
  607. function saveModeSettings(configStr,isEnable){
  608. GM_setValue(configStr, (isEnable==true ? "1":"0"));
  609. }
  610.  
  611. function makeAndSaveHotKeyValue(hkStat,hkCtrl,hkAlt,keyCode,hotkeyType) {
  612. var kv;
  613. switch(hotkeyType){
  614. case hotkeyType_forPlugin:
  615. kv = ((hotkey_isActive = hkStat) ? "1|" : "0|") + ((hotKey_Ctrl = hkCtrl) ? "1|" : "0|") + ((hotKey_Alt = hkAlt) ? "1|" : "0|") + (hotKey_Code = keyCode).toString();
  616. GM_setValue(hotKeyNameInStorage, kv);
  617. break;
  618. case hotkeyType_forQS:
  619. kv = ((hotkey_isActive_forQS = hkStat) ? "1|" : "0|") + ((hotKey_Ctrl_forQS = hkCtrl) ? "1|" : "0|") + ((hotKey_Alt_forQS = hkAlt) ? "1|" : "0|") + (hotKey_Code_forQS = keyCode).toString();
  620. GM_setValue(hotKeyNameForQSInStorage,kv);
  621. break;
  622. default:
  623. console.log("Error occured while make and save hot key value.");
  624. return;
  625. }
  626. registerHotKeyEvent(hotkeyType);
  627. }
  628.  
  629. function getHotKeyValue(hotkeyType) {
  630. var keyCodes="";
  631. switch (hotkeyType){
  632. case hotkeyType_forPlugin:
  633. keyCodes = GM_getValue(hotKeyNameInStorage, defaultHotKeyValue).split("|");
  634. if (keyCodes.length !== 4) keyCodes = defaultHotKeyValue.split("|");
  635. hotKey_Ctrl = keyCodes[1] === "1";
  636. hotKey_Alt = keyCodes[2] === "1";
  637. hotKey_Code = parseInt(keyCodes[3]);
  638. hotkey_isActive = keyCodes[0] === "1";
  639. break;
  640. case hotkeyType_forQS:
  641. keyCodes = GM_getValue(hotKeyNameForQSInStorage, defaultHotKeyValueForQS).split("|");
  642. if (keyCodes.length !== 4) keyCodes = defaultHotKeyValueForQS.split("|");
  643. hotKey_Ctrl_forQS = keyCodes[1] === "1";
  644. hotKey_Alt_forQS = keyCodes[2] === "1";
  645. hotKey_Code_forQS= parseInt(keyCodes[3]);
  646. hotkey_isActive_forQS = keyCodes[0] === "1";
  647. break;
  648. default:
  649. return;
  650. }
  651. registerHotKeyEvent(hotkeyType);
  652. }
  653.  
  654. function getLingoesConfigValue(){
  655. var rst = GM_getValue(lingoesServerConfigNameInStorage, defaultLingoesServerConfigValue).split("|");
  656. lingoes_isEnabled = rst[0] === "1";
  657. lingoes_showingWay = parseInt(rst[1]);
  658. lingoes_serverIp = rst[2];
  659. lingoes_serverPort = rst[3];
  660. }
  661.  
  662. function getModesConfigValue(){
  663. let rst=GM_getValue(isEnableSimpleModeConfigString,isEnableSimpleModeDefaultConfig);
  664. isEnableSimpleMode= rst==="0" ? false:true;
  665. rst=GM_getValue(isEnableRealtimeTranslationModeConfigString,isEnableRealtimeTranslationModeDefaultConfig);
  666. isEnableRealtimeTranslationMode= rst==="0" ? false:true;
  667. rst=GM_getValue(isRemoveWebsiteSelectingRestrictionConfigString,isRemoveWebsiteSelectingRestrictionDefaultConfig);
  668. isRemoveWebsiteSelectingRestriction= rst==="0" ? false:true;
  669. rst=GM_getValue(isEnableAccurateModeConfigString,isEnableAccurateModeDefaultConfig);
  670. isEnableAccurateMode= rst==="0" ? false:true;
  671. rst=GM_getValue(isTModeConfigString,isTModeDefaultConfig);
  672. isTMode= rst==="0" ? false:true;
  673. rst=GM_getValue(isEnableAnimalVoicePerceptionConfigString,isEnableAnimalVoicePerceptionDefaultConfig);
  674. isEnableAnimalVoicePerception= rst==="0" ? false:true;
  675. animalVoice=GM_getValue(animalVoiceConfigString,animalVoiceDefaultConfig);
  676. if(animalVoice!=animalVoiceDefaultConfig){
  677. animalVoiceTranslator=new howlingAnimalsTranslator(animalVoice);
  678. }
  679. }
  680.  
  681. function getYoudaoConfigValue() {
  682. var rst = GM_getValue(youdaoConfigNameInStorage, defaultYoudaoConfigValue);
  683. youdao_isEnabled = rst[0] === "1";
  684. youdao_isOnlyForSingleWord = rst[1] === "1";
  685. }
  686.  
  687. function registerHotKeyEvent(hotkeyType){
  688. switch(hotkeyType){
  689. case hotkeyType_forPlugin:
  690. if (hotkey_isActive) {
  691. if (!isHotkeyEventRegistered) {
  692. window.document.body.addEventListener("keyup", toggleGoogleTranslate, false);
  693. isHotkeyEventRegistered = !0;
  694. }
  695. }
  696. else {
  697. if (isHotkeyEventRegistered) {
  698. window.document.body.removeEventListener("keyup", toggleGoogleTranslate, false);
  699. isHotkeyEventRegistered = !1;
  700. }
  701. }
  702. break;
  703. case hotkeyType_forQS:
  704. if (hotkey_isActive_forQS) {
  705. if (!isHotkeyEventRegistered_forQS) {
  706. window.document.body.addEventListener("keyup", toggleQuickSearch, false);
  707. isHotkeyEventRegistered_forQS = !0;
  708. }
  709. }
  710. else {
  711. if (isHotkeyEventRegistered_forQS) {
  712. window.document.body.removeEventListener("keyup", toggleQuickSearch, false);
  713. isHotkeyEventRegistered_forQS = !1;
  714. }
  715. }
  716. break;
  717. default:
  718. return;
  719. }
  720. }
  721.  
  722. GM_registerMenuCommand("Google select text translator Setting(谷歌划词设置)", setup);
  723.  
  724. function createToolTip(){
  725. let tp=$("toolTip");
  726. if(!tp){
  727. tp=document.createElement("span");
  728. tp.id="gt_prefs_toolTip";
  729. document.body.appendChild(tp);
  730. GM_addStyle(`
  731. #gt_prefs_toolTip{position: absolute;background: #eafdff;border-radius: .4em;display:none;color:blue;font-weight:bold;font-size:14px;}
  732. #gt_prefs_toolTip:after {content: '';position:absolute;bottom: 0;left: 50%;width:auto;height:auto;border: 20px solid transparent;border-top-color: #eafdff;border-bottom: 0;border-left: 0;margin-left: -10px;margin-bottom: -20px;}
  733. `)
  734. }
  735. return tp;
  736. }
  737.  
  738. var loadingIconUI={
  739. get(){
  740. let li=$("loading_icon");
  741. if(!li){
  742. li=document.createElement("img");
  743. li.id="gt_prefs_loading_icon";
  744. li.setAttribute("src",loadingIconBase64Data);
  745. li.width=64;
  746. li.height=64;
  747. li.style.zIndex=9999;
  748. li.style.display="none";
  749. li.style.position="fixed";
  750. document.body.appendChild(li);
  751. }
  752. return li;
  753. },
  754. show(pos){
  755. let li=this.get();
  756. if(pos){
  757. li.style.left=pos.mx+"px";
  758. li.style.top=pos.my+"px";
  759. }
  760. li.style.display="block";
  761. },
  762. hide(){
  763. this.get().style.display="none";
  764. }
  765. }
  766.  
  767. function createTranslatorIcon(){
  768. let ci=$("translator_icon");
  769. if(!ci){
  770. ci=document.createElement("img");
  771. ci.id="gt_prefs_translator_icon";
  772. ci.setAttribute("src",translatorIconBase64Data);
  773. ci.width=32;
  774. ci.height=32;
  775. ci.style.zIndex=9999;
  776. ci.style.display="none";
  777. ci.style.position="fixed";
  778. ci.setAttribute("isHovering","false")
  779. ci.setAttribute("timerHandle","-1")
  780. ci.onmouseover=function(e){
  781. if(ci.getAttribute("isHovering")=="false"){
  782. ci.setAttribute("isHovering","true");
  783. setTimeout(()=>{
  784. if(ci.getAttribute("isHovering")==="true"){
  785. ci.style.display="none";
  786. ci.setAttribute("isHovering","false");
  787. toolTip.show(this,e);
  788. setTimeout(function(){
  789. toolTip.hide();
  790. },2000);
  791. isTranslatorDisabledTemporarily=!1;
  792. googleTranslate(e);
  793. }
  794. },200);
  795. }
  796. };
  797. ci.onmouseout=(e)=>{ci.setAttribute("isHovering","false");};
  798. document.body.appendChild(ci);
  799. }
  800. return ci;
  801. }
  802.  
  803. var realtimeTranslatorUI={
  804. n:0,
  805. delayTime:5000,
  806. get:function(){
  807. let rti=$("realtime_translator_icon");
  808. if(!rti){
  809. rti=document.createElement("img");
  810. rti.id="gt_prefs_realtime_translator_icon";
  811. rti.setAttribute("src",translatorIconBase64Data);
  812. rti.width=32;
  813. rti.height=32;
  814. rti.style.zIndex=9999;
  815. rti.style.display="none";
  816. rti.style.position="fixed";
  817. rti.onclick=function(e){
  818. var selectedText = window.getSelection().toString().trim();
  819. if (selectedText) {
  820. oldText=selectedText;
  821. searchedTextProcessor.addText(oldText);
  822. GetTranslation(oldText, e.clientX, e.clientY);
  823. }
  824. realtimeTranslatorUI.hide();
  825. }
  826. document.body.appendChild(rti);
  827. }
  828. return rti;
  829. },
  830. show:function(){
  831. let rti=$("realtime_translator_icon");
  832. if(rti){
  833. rti.style.display="block";
  834. }
  835. },
  836. hide:function(){
  837. let rti=$("realtime_translator_icon");
  838. if(rti){
  839. rti.style.display="none";
  840. this.destroy();
  841. }
  842. },
  843. delay:function(){
  844. let rti=$("realtime_translator_icon");
  845. this.n=setTimeout(function(){
  846. realtimeTranslatorUI.hide();
  847. },this.delayTime);
  848. },
  849. destroy:function(){
  850. if(this.n){
  851. clearTimeout(this.n);
  852. this.n=0;
  853. }
  854. }
  855. };
  856.  
  857.  
  858. var toolTip={
  859. s:{"gt_prefs_iconForbidden":["暂停","Disable"],"gt_prefs_iconPrevious":["上一个","Previous"],"gt_prefs_iconSetting":["设置","Setting"],"gt_prefs_iconSearch":["搜索","Search"],"gt_prefs_iconClose":["关闭","Close"],"gt_prefs_iconNext":["下一个","Next"],"gt_prefs_iconCopy":["拷贝","Copy"],"gt_prefs_iconPin":["固定","Pin to screen"],"gt_prefs_translator_icon":["点击翻译","Click to translate"],"gt_prefs_iconDetailed":["详解模式","Detailed Mode"],"gt_prefs_iconSimplified":["简洁模式","Simplified Mode"],"gt_prefs_iconRealtime":["实时翻译模式","Real-time Translation Mode"],"gt_prefs_iconNotRealtime":["点击图标翻译模式","Click-icon Translation Mode"],"gt_prefs_tBar":["按住拖动窗口","Press down and drag"],"gt_prefs_iconAccurate":["精确翻译模式","Accurate Translation Mode"],"gt_prefs_iconNonAccurate":["普通模式","Normal Mode"]},
  860. show(el,e){
  861. let tp=createToolTip();
  862. tp.innerHTML=toolTip.s[el.id][translatorSettingLanguage];
  863. let oL=0;
  864. if($("translatorDiv"))if($("tBar")){oL=$("translatorDiv").offsetLeft+$("tBar").offsetLeft;}
  865. let oS= translatorSettingLanguage===0 ? (tp.innerHTML.length*tp.innerHTML.length-Math.ceil(tp.innerHTML.length/5)*10+5):(tp.innerHTML.length*2-10+Math.ceil(tp.innerHTML.length/10)*10);
  866. tp.style.left=(el.offsetLeft+oL-oS)+"px";
  867. tp.style.top=(el.offsetTop+el.parentNode.offsetTop+el.parentNode.parentNode.offsetTop-40)+"px";
  868. tp.style.display="block";
  869. },
  870. hide(){
  871. $("toolTip").style.display="none";
  872. }
  873. };
  874.  
  875. function toggleGoogleTranslate(e) {
  876. if(e.keyCode === 27){
  877. if(isToolBarMoving){
  878. window.removeEventListener("mousemove", divMove, true);
  879. isToolBarMoving=!1;
  880. return;
  881. }
  882. }
  883. if (e.keyCode === hotKey_Code && (hotKey_Alt ? e.altKey : e.altKey === false) && (hotKey_Ctrl ? e.ctrlKey : e.ctrlKey === false)) {
  884. if (isEnabled) {
  885. window.document.body.removeEventListener("mouseup", googleTranslate, false);
  886. alert(translatorSettingLanguage ? "Google select text translator is disabled!":"谷歌点击划词翻译,已禁用!");
  887. isEnabled = isTranslatorDisabledTemporarily = false;
  888. translatorDivUI.hide();
  889. } else {
  890. window.document.body.addEventListener("mouseup", googleTranslate, false);
  891. alert(translatorSettingLanguage ? "Google select text translator is enabled!" : "谷歌点击划词翻译,已启用!");
  892. isEnabled = isTranslatorDisabledTemporarily = true;
  893. }
  894. }
  895. }
  896.  
  897. var quickSearchDiv=null;
  898. var searchBox=null;
  899. var oldSIdx=-1,oldDIdx=-1;
  900. function showQuickSearch(){
  901. //Showing quick searching pannel
  902. if (!quickSearchDiv){
  903. GM_addStyle(`
  904. #gt_prefs_quickSearch { position:fixed;z-index:998;top:30%;left:30%;width:40%;padding:0.3%;background:radial-gradient(ellipse at center, #EDF4FC 0%,#e3edf9 60%,#c9d7e5 80%, #c3cedb 90%, #bac6d3 95%, #adb5bc 100%);border:1px solid black;box-shadow:-2px 0px 9px 5px #898D91;opacity:0.9; border-radius:5px;}
  905. #gt_prefs_quickSearch * { color:black;text-align:left;line-height:normal;font-size:12px; }
  906. #gt_prefs_quickSearch a { color:black;text-decoration:underline; }
  907. #gt_prefs_quickSearch div { text-align:center;font-weight:bold;font-size:14px; }
  908. #gt_prefs_quickSearch ul { margin:15px 0 15px 0;padding:0;list-style:none;background:#eee;border:0; }
  909. #gt_prefs_quickSearch input {width:99%;border:1px solid gray;padding:2px;background:white;text-align:center;}
  910. #gt_prefs_quickSearch select {width:auto;border:1px solid gray;padding:2px;background:white;text-align:center;color:Green;}
  911. #gt_prefs_quickSearch li { margin:0;padding:6px 0;vertical-align:middle;background:#eee;border:0 }
  912. #gt_prefs_quickSearch button { width:150px;margin:0 10px;text-align:center;background:transparent;border-radius:5px;box-shadow:2px 2px 2px 1px gray;}
  913. #gt_prefs_quickSearch textarea { width:98%; height:98%; margin:3px 0; }
  914. #gt_prefs_quickSearch p,b { font-weight: bold;color:Green; margin:2px 0px; font-family: "微软雅黑", sans-serif;text-align:center; }
  915. #gt_prefs_quickSearch button:disabled { color: graytext; }
  916. `);
  917. quickSearchDiv = document.createElement('div');
  918. quickSearchDiv.id = 'gt_prefs_quickSearch';
  919. document.body.appendChild(quickSearchDiv);
  920. searchBox=null;
  921. searchBox=document.createElement("textarea");
  922. searchBox.id ="gt_prefs_searchBox";
  923. searchBox.value = "";
  924. searchBox.align="center";
  925. searchBox.onkeyup=function (e) {
  926. //ENTER
  927. if (e.keyCode===13 && e.ctrlKey){
  928. queryIt();
  929. }
  930. //ESC
  931. if (e.keyCode===27){
  932. if (searchBox.value==="") quickSearchDiv.style.display = "none";
  933. else searchBox.value="";
  934. }
  935. }
  936. var queryIt=function () {
  937. var queryStr = searchBox.value.trim();
  938. if (queryStr === "") {
  939. quickSearchDiv.style.display = "none";
  940. return;
  941. }
  942. var nSIdx= $("srcLanguageSelector").selectedIndex;
  943. var nDIdx= $("dstLanguageSelector").selectedIndex;
  944. if (oldText===queryStr){
  945. if (nSIdx===oldSIdx&&nDIdx===oldDIdx) {
  946. var translatorDiv = $("translatorDiv");
  947. if (translatorDiv) {
  948. if (translatorDiv.style.display === "none") translatorDiv.style.display = "block";
  949. }
  950. return;
  951. }
  952. }
  953. translateIt((oldSIdx=nSIdx) <= 0 ? "auto" : uLanguageCode[nSIdx - 1], uLanguageCode[(oldDIdx=nDIdx)], oldText = queryStr, quickSearchDiv.offsetLeft, quickSearchDiv.offsetTop + quickSearchDiv.offsetHeight);
  954. }
  955. var hintText=document.createElement("p");
  956. hintText.id = "gt_prefs_hintText";
  957. hintText.innerText=translatorSettingLanguage===0 ? "输入要查询的单词或句子(按回车进行查询,按ESC退出查询):":"Enter the word or sentence you want to query ( Press enter to query, ESC to exit or clear.) :";
  958. var srcLanguageSelector=document.createElement("select");
  959. srcLanguageSelector.id = "gt_prefs_srcLanguageSelector";
  960. var divHtml=`<option value="0" ${currentSourceLanguage < 0 ? 'selected="selected"' : ''}>${translatorSettingLanguage===0 ? "自动检测":"Auto Detect"}</option>;`;
  961. for (let i = 0; i < uLanguageCode.length; i++) {
  962. if (currentSourceLanguage === i) divHtml += `<option value="${i}" selected="selected">${uLanguageNames[translatorSettingLanguage][i]}-${uRegionNames[translatorSettingLanguage][i]}(${uLanguageCode[i]})</option>`;
  963. else divHtml += `<option value="${i}">${uLanguageNames[translatorSettingLanguage][i]}-${uRegionNames[translatorSettingLanguage][i]}(${uLanguageCode[i]})</option>`;
  964. }
  965. srcLanguageSelector.innerHTML=divHtml;
  966. var dstLanguageSelector=document.createElement("select");
  967. dstLanguageSelector.id="gt_prefs_dstLanguageSelector";
  968. divHtml = "";
  969. for (let i = 0; i < uLanguageCode.length; i++) {
  970. if (currentTranslateLanguage === i) divHtml += `<option value="${i}" selected="selected">${uLanguageNames[translatorSettingLanguage][i]}-${uRegionNames[translatorSettingLanguage][i]}(${uLanguageCode[i]})</option>`;
  971. else divHtml += `<option value="${i}">${uLanguageNames[translatorSettingLanguage][i]}-${uRegionNames[translatorSettingLanguage][i]}(${uLanguageCode[i]})</option>`;
  972. }
  973. dstLanguageSelector.innerHTML=divHtml;
  974. var languageChooseParagraph= document.createElement("p");
  975. languageChooseParagraph.appendChild(document.createTextNode(translatorSettingLanguage === 0 ? "源语言:" : "Source:"));
  976. languageChooseParagraph.appendChild(srcLanguageSelector);
  977. languageChooseParagraph.appendChild(document.createTextNode(translatorSettingLanguage === 0 ? "==>目标语言:" : "==>Destination:"));
  978. languageChooseParagraph.appendChild(dstLanguageSelector);
  979. var btnQuery=document.createElement("button");
  980. btnQuery.onclick=queryIt;
  981. btnQuery.innerText = translatorSettingLanguage === 0 ? "查询" : "Query";
  982. var btnExit=document.createElement("button");
  983. btnExit.onclick=function (e) {
  984. quickSearchDiv.style.display = "none";
  985. }
  986. btnExit.innerText = translatorSettingLanguage === 0 ? "退出" : "Exit";
  987. var btnConvertToHowlingText=document.createElement("button");
  988. btnConvertToHowlingText.innerText = translatorSettingLanguage === 0 ? "转为兽音" : "Convert to Howling Text";
  989. btnConvertToHowlingText.onclick=()=>{
  990. let sBox=document.getElementById("gt_prefs_searchBox");
  991. if(sBox){
  992. sBoxTxt=sBox.value.trim();
  993. if(sBoxTxt.length>0){
  994. divAnimalTextResult=getHowlingAnimalsHtml(animalVoiceTranslator.convert(sBoxTxt));
  995. var translatorDiv = $("translatorDiv");
  996. if(!translatorDiv){
  997. translatorDiv=createTranslatorDiv();
  998. }
  999. contentDiv=$("contentDiv");
  1000. if(contentDiv){
  1001. contentDiv.innerHTML="";
  1002. let el=document.createElement("div");
  1003. el.innerHTML=divAnimalTextResult;
  1004. el.style.fontSize="14px";
  1005. el.style.fontWeight="normal";
  1006. el.style.color="Green";
  1007. contentDiv.append(el);
  1008. translatorDivUI.show(quickSearchDiv.offsetLeft, quickSearchDiv.offsetTop + quickSearchDiv.offsetHeight);
  1009. }
  1010. }
  1011. }
  1012. }
  1013. var btnParagraph=document.createElement("p");
  1014. btnParagraph.appendChild(btnQuery);
  1015. btnParagraph.appendChild(btnExit);
  1016. btnParagraph.appendChild(btnConvertToHowlingText);
  1017. quickSearchDiv.appendChild(hintText);
  1018. quickSearchDiv.appendChild(searchBox);
  1019. quickSearchDiv.appendChild(languageChooseParagraph);
  1020. quickSearchDiv.appendChild(btnParagraph);
  1021. searchBox.focus();
  1022. return;
  1023. }
  1024. if (quickSearchDiv.style.display === "none"){
  1025. quickSearchDiv.style.display = "block";
  1026. searchBox.focus();
  1027. }
  1028. else quickSearchDiv.style.display="none";
  1029. }
  1030. function toggleQuickSearch(e) {
  1031. if (e.keyCode === hotKey_Code_forQS && (hotKey_Alt_forQS ? e.altKey : e.altKey === false) && (hotKey_Ctrl_forQS ? e.ctrlKey : e.ctrlKey === false)) {
  1032. showQuickSearch();
  1033. }
  1034. }
  1035.  
  1036. function GetTranslation(queryStr, mx, my) {
  1037. currentTranslateLanguage = parseInt(GM_getValue(targetTranslateLanguageNameInStorage, defaultTranslateLanguage));
  1038. currentSourceLanguage = parseInt(GM_getValue(sourceTranslateLanguageNameInStorage, defaultSourceLanguage));
  1039. queryStr=optimizeQueryString(queryStr);
  1040. if (lingoes_isEnabled){
  1041. var url=null;
  1042. if (lingoes_showingWay<2){
  1043. if (!/\s+/gi.test(queryStr)) {
  1044. switch(lingoes_showingWay){
  1045. case 0:
  1046. url = `http://${lingoes_serverIp}:${lingoes_serverPort}/lingoes?cmd=mini_search&text=${encodeURI(queryStr)}&pos_x=${mx}&pos_y=${my}`;
  1047. break;
  1048. case 1:
  1049. url = `http://${lingoes_serverIp}:${lingoes_serverPort}/lingoes?cmd=main_search&text=${encodeURI(queryStr)}&pos_x=${mx}&pos_y=${my}`;
  1050. break;
  1051. }
  1052. }
  1053. }
  1054. else{
  1055. url = `http://${lingoes_serverIp}:${lingoes_serverPort}/lingoes?cmd=main_translator&text=${encodeURI(queryStr)}&pos_x=${mx}&pos_y=${my}`;
  1056. }
  1057. if (url!=null){
  1058. GM_xmlhttpRequest({
  1059. method:"GET",
  1060. url:url,
  1061. headers: {
  1062. "User-Agent": UA,
  1063. "Accept": "application/json"
  1064. },
  1065. onerror: function (err) {
  1066. alert(translatorSettingLanguage===0 ? "与灵格斯API服务器的通信失败,已自动禁用灵格斯词典调用功能!\n请保证您的电脑安装有灵格斯词典软件,并在设置中启用了API服务器,且正确的设置了IP与端口地址!":"Failed to fetch from lingoes API sever, disable the query from lingoes automatically!\n Please ensure you got a lingoes, and enabled the API server from it's setting, and sets the right ip and port number in the setting of this plugin.");
  1067. console.log("failed to fetch from lingoes sever, disable lingoes server automatically.",err);
  1068. saveLingoesSettings(false,lingoes_showingWay,lingoes_serverIp,lingoes_serverPort);
  1069. }
  1070. });
  1071. }
  1072. }
  1073. translateIt(currentSourceLanguage < 0 ? "auto" : uLanguageCode[currentSourceLanguage], uLanguageCode[currentTranslateLanguage], queryStr, mx, my);
  1074. }
  1075.  
  1076. function checkIsSoundIconClicked(e) {
  1077. return (e.target.className === "gt_prefs_img_for_play_sound"||e.target.id==="gt_prefs_show_or_hide_examples");
  1078. //return e.target.id === "gt_prefs_img_for_play_sound1" || e.target.id === "gt_prefs_img_for_play_sound2" || e.target.id === "gt_prefs_img_for_play_sound3";
  1079. }
  1080.  
  1081. function mouseDown(e){
  1082. window.addEventListener('mousemove', divMove, true);
  1083. isToolBarMoving=!0;
  1084. var div=$("translatorDiv");
  1085. tBarOffsetX=e.clientX-div.offsetLeft;
  1086. tBarOffsetY=e.clientY-div.offsetTop;
  1087. }
  1088.  
  1089. function divMove(e){
  1090. var div = $("translatorDiv");
  1091. div.style.position = 'absolute';
  1092. let xpos=e.clientX - tBarOffsetX;
  1093. let ypos=e.clientY - tBarOffsetY;
  1094. div.style.top = ypos + "px";
  1095. div.style.left = xpos + "px";
  1096. }
  1097.  
  1098. function optimizeQueryString(t){
  1099. return t.replace('-\n', '').replace('\n', ' ').replace(/[&]+/g, currentSourceLanguage >= 0 && currentSourceLanguage < 3 ? "和" : " and ").replace(/[\+]+/g, currentSourceLanguage >= 0 && currentSourceLanguage < 3 ? "加" : " plus ");
  1100. }
  1101.  
  1102. function createTranslatorDiv(){
  1103. translatorDiv = document.createElement('div');
  1104. translatorDiv.id = "gt_prefs_translatorDiv";
  1105. document.body.appendChild(translatorDiv);
  1106. translatorDiv.style.color = "black";
  1107. translatorDiv.style.fontSize="12px";
  1108. translatorDiv.style.textAlign = "left";
  1109. translatorDiv.style.display = "block";
  1110. translatorDiv.style.position = "absolute";
  1111. translatorDiv.style.background = "radial-gradient(ellipse at center, #EDF4FC 0%,#e3edf9 60%,#c9d7e5 80%, #c3cedb 90%, #bac6d3 95%, #adb5bc 100%)";
  1112. translatorDiv.style.borderRadius = "5px";
  1113. translatorDiv.style.boxShadow = "-2px 0px 9px 5px #898D91";
  1114. translatorDiv.style.opacity = "0.9";
  1115. translatorDiv.style.padding="5px";
  1116. translatorDiv.style.margin="0";
  1117. translatorDiv.style.zIndex = 900;
  1118. translatorDiv.style.width = "400px";
  1119. translatorDiv.style.height="auto";
  1120. translatorDiv.style.wordWrap = "break-word";
  1121. translatorDiv.onmouseleave=function (e) {
  1122. if(!isPinned){
  1123. timerHide=setTimeout(function(){translatorDiv.style.display = "none"},10000);
  1124. }
  1125. }
  1126. translatorDiv.onmouseenter= clearTimerHide;
  1127. GM_addStyle(`
  1128. .gt_prefs_img_for_play_sound{width:16px;height:16px;}
  1129. .gt_prefs_translator_div_li{list-style:none;margin:0;padding:2px;background:none;width:100%;color:inherit;font-family:Tahoma;font-size:14px;font-weight:bold;}
  1130. .gt_prefs_translator_div_li b{color:Green;}
  1131. .gt_prefs_translator_div_li a{color:Blue;}
  1132. .gt_prefs_translator_div_li span{color:#39538c;font-weight:normal;}
  1133. .gt_prefs_translator_div_li p{color:Red;font-size:16px;}
  1134. .gt_prefs_translator_div_li em{color:#131930;font-style:normal;}
  1135. .gt_prefs_translator_div_li h1{color:#771b1b;font-size:18px;}
  1136. #gt_prefs_sample_ul li{font-weight:normal;list-style-type:upper-roman;}
  1137. .gt_prefs_main_word{font-weight:bold;color:#116f89;};
  1138. `);
  1139. let tBar=document.createElement('div');
  1140. tBar.id="gt_prefs_tBar";
  1141. tBar.style.width="100%";
  1142. tBar.style.height="20px";
  1143. tBar.style.borderRadius="5px";
  1144. tBar.onmouseenter=function(e){
  1145. tBar.style.background="linear-gradient(90deg, #ABCDEF 0%, #ABCDEF 40%, #E3EDF9 50%,#C3CEDB 100%)";
  1146. tBar.style.opacity="0.8";
  1147. toolTip.show(this,e);
  1148. }
  1149. tBar.onmouseout=function(e){
  1150. tBar.style.background="transparent";
  1151. toolTip.hide();
  1152. }
  1153. on(tBar,'mousedown', mouseDown);
  1154. let iconAccurate=document.createElement('img');
  1155. let iconNonAccurate=document.createElement('img');
  1156. let iconRealtime=document.createElement('img');
  1157. let iconNotRealtime=document.createElement('img');
  1158. let iconForbidden=document.createElement('img');
  1159. let iconSimplified=document.createElement('img');
  1160. let iconDetailed=document.createElement('img');
  1161. let iconPrevious=document.createElement('img');
  1162. let iconSetting=document.createElement('img');
  1163. let iconSearch=document.createElement('img');
  1164. let iconClose=document.createElement('img');
  1165. let iconNext=document.createElement('img');
  1166. let iconCopy=document.createElement('img');
  1167. let iconPin=document.createElement('img');
  1168. tBar.style.margin=iconAccurate.style.margin=iconNonAccurate.style.margin=iconRealtime.style.margin=iconNotRealtime.style.margin=iconForbidden.style.margin=iconSimplified.style.margin=iconDetailed.style.margin=iconPrevious.style.margin=iconSetting.style.margin=iconSearch.style.margin=iconClose.style.margin=iconNext.style.margin=iconCopy.style.margin=iconPin.style.margin="0";
  1169. tBar.style.padding=iconAccurate.style.padding=iconNonAccurate.style.padding=iconRealtime.style.padding=iconNotRealtime.style.padding=iconForbidden.style.padding=iconSimplified.style.padding=iconDetailed.style.padding=iconPrevious.style.padding=iconSetting.style.padding=iconSearch.style.padding=iconClose.style.padding=iconNext.style.padding=iconCopy.style.padding=iconPin.style.padding="0";
  1170. iconRealtime.setAttribute('src',realtimeIconBase64Data);
  1171. iconAccurate.setAttribute('src',accurateIconBase64Data);
  1172. iconNonAccurate.setAttribute('src',nonAccurateIconBase64Data);
  1173. iconNotRealtime.setAttribute('src',notRealtimeIconBase64Data);
  1174. iconForbidden.setAttribute('src',forbiddenIconBase64Data);
  1175. iconSimplified.setAttribute('src',simplifiedIconBase64Data);
  1176. iconDetailed.setAttribute('src',detailedIconBase64Data);
  1177. iconPrevious.setAttribute('src',previousIconBase64Data);
  1178. iconSetting.setAttribute('src',settingIconBase64Data);
  1179. iconSearch.setAttribute('src',searchIconBase64Data);
  1180. iconClose.setAttribute('src',closeIconBase64Data);
  1181. iconNext.setAttribute('src',nextIconBase64Data);
  1182. iconCopy.setAttribute('src',copyIconBase64Data);
  1183. iconPin.setAttribute('src',pinIconBase64Data);
  1184. iconNonAccurate.width=iconAccurate.width=iconForbidden.width=iconRealtime.width=iconNotRealtime.width=iconSimplified.width=iconDetailed.width=iconPrevious.width=iconSetting.width=iconSearch.width=iconClose.width=iconNext.width=iconCopy.width=iconPin.width=20;
  1185. iconNonAccurate.height=iconAccurate.height=iconForbidden.height=iconRealtime.height=iconNotRealtime.height=iconSimplified.height=iconDetailed.height=iconPrevious.height=iconSetting.height=iconSearch.height=iconClose.height=iconNext.height=iconCopy.height=iconPin.height=20;
  1186. iconForbidden.style.cssFloat=iconAccurate.style.cssFloat=iconNonAccurate.style.cssFloat=iconRealtime.style.cssFloat=iconNotRealtime.style.cssFloat=iconSimplified.style.cssFloat=iconDetailed.style.cssFloat=iconPrevious.style.cssFloat=iconSetting.style.cssFloat=iconSearch.style.cssFloat=iconClose.style.cssFloat=iconNext.style.cssFloat=iconCopy.style.cssFloat=iconPin.style.cssFloat="right";
  1187. iconForbidden.id="gt_prefs_iconForbidden";
  1188. iconForbidden.style.border=(isEnabled ? "none":"1px solid red");
  1189. iconForbidden.onclick=function(e){
  1190. isTranslatorDisabledTemporarily=!0;
  1191. $("translatorDiv").style.display="none";
  1192. }
  1193. iconForbidden.onmouseenter=function(e){
  1194. toolTip.show(this,e);
  1195. }
  1196. iconForbidden.onmouseleave=function(e){
  1197. toolTip.hide();
  1198. }
  1199. iconAccurate.id="gt_prefs_iconAccurate";
  1200. iconAccurate.onclick=function(e){
  1201. this.style.display="none";
  1202. saveModeSettings(isEnableAccurateModeConfigString,(isEnableAccurateMode=false));
  1203. $("iconNonAccurate").style.display="block";
  1204. }
  1205. iconAccurate.onmouseenter=function(e){
  1206. toolTip.show(this,e);
  1207. }
  1208. iconAccurate.onmouseleave=function(e){
  1209. toolTip.hide();
  1210. }
  1211. iconNonAccurate.id="gt_prefs_iconNonAccurate";
  1212. iconNonAccurate.onclick=function(e){
  1213. this.style.display="none";
  1214. saveModeSettings(isEnableAccurateModeConfigString,(isEnableAccurateMode=true));
  1215. $("iconAccurate").style.display="block";
  1216. }
  1217. iconNonAccurate.onmouseenter=function(e){
  1218. toolTip.show(this,e);
  1219. }
  1220. iconNonAccurate.onmouseleave=function(e){
  1221. toolTip.hide();
  1222. }
  1223. isEnableAccurateMode ? iconNonAccurate.style.display="none":iconAccurate.style.display="none";
  1224. iconRealtime.id="gt_prefs_iconRealtime";
  1225. iconRealtime.onclick=function(e){
  1226. saveModeSettings(isEnableRealtimeTranslationModeConfigString,isEnableRealtimeTranslationMode=false);
  1227. this.style.display="none";
  1228. $("iconNotRealtime").style.display="block";
  1229. $("iconForbidden").style.display="none";
  1230. }
  1231. iconRealtime.onmouseenter=function(e){
  1232. toolTip.show(this,e);
  1233. }
  1234. iconRealtime.onmouseleave=function(e){
  1235. toolTip.hide();
  1236. }
  1237. iconNotRealtime.id="gt_prefs_iconNotRealtime";
  1238. iconNotRealtime.onclick=function(e){
  1239. saveModeSettings(isEnableRealtimeTranslationModeConfigString,isEnableRealtimeTranslationMode=true);
  1240. this.style.display="none";
  1241. $("iconRealtime").style.display="block";
  1242. $("iconForbidden").style.display="block";
  1243. }
  1244. iconNotRealtime.onmouseenter=function(e){
  1245. toolTip.show(this,e);
  1246. }
  1247. iconNotRealtime.onmouseleave=function(e){
  1248. toolTip.hide();
  1249. }
  1250. if(isEnableRealtimeTranslationMode){
  1251. iconNotRealtime.style.display="none";
  1252. }
  1253. else{
  1254. iconRealtime.style.display="none";
  1255. iconForbidden.style.display="none";
  1256. }
  1257. iconSimplified.id="gt_prefs_iconSimplified";
  1258. iconSimplified.onclick=function(e){
  1259. this.style.display="none";
  1260. $("iconDetailed").style.display="block";
  1261. saveModeSettings(isEnableSimpleModeConfigString,(isEnableSimpleMode=false));
  1262. }
  1263. iconSimplified.onmouseenter=function(e){
  1264. toolTip.show(this,e);
  1265. }
  1266. iconSimplified.onmouseleave=function(e){
  1267. toolTip.hide();
  1268. }
  1269. iconDetailed.id="gt_prefs_iconDetailed";
  1270. iconDetailed.onclick=function(e){
  1271. this.style.display="none";
  1272. $("iconSimplified").style.display="block";
  1273. saveModeSettings(isEnableSimpleModeConfigString,(isEnableSimpleMode=true));
  1274. }
  1275. iconDetailed.onmouseenter=function(e){
  1276. toolTip.show(this,e);
  1277. }
  1278. iconDetailed.onmouseleave=function(e){
  1279. toolTip.hide();
  1280. }
  1281. isEnableSimpleMode==!1 ? iconSimplified.style.display="none":iconDetailed.style.display="none";
  1282. iconPrevious.id="gt_prefs_iconPrevious";
  1283. iconPrevious.style.display="none";
  1284. iconPrevious.onmouseenter=function(e){
  1285. toolTip.show(this,e);
  1286. }
  1287. iconPrevious.onmouseleave=function(e){
  1288. toolTip.hide();
  1289. }
  1290. iconPrevious.onclick=function(e){
  1291. searchedTextProcessor.showPreviousText();
  1292. }
  1293. iconNext.id="gt_prefs_iconNext";
  1294. iconNext.style.display="none";
  1295. iconNext.onmouseenter=function(e){
  1296. toolTip.show(this,e);
  1297. }
  1298. iconNext.onmouseleave=function(e){
  1299. toolTip.hide();
  1300. }
  1301. iconNext.onclick=function(e){
  1302. searchedTextProcessor.showNextText();
  1303. }
  1304. iconSearch.id="gt_prefs_iconSearch";
  1305. iconSearch.onmouseenter=function(e){
  1306. toolTip.show(this,e);
  1307. }
  1308. iconSearch.onmouseleave=function(e){
  1309. toolTip.hide();
  1310. }
  1311. iconSearch.onclick=function(e){
  1312. showQuickSearch();
  1313. }
  1314. iconSetting.id="gt_prefs_iconSetting";
  1315. iconSetting.onmouseenter=function(e){
  1316. toolTip.show(this,e);
  1317. }
  1318. iconSetting.onmouseleave=function(e){
  1319. toolTip.hide();
  1320. }
  1321. iconSetting.onclick=function(e){
  1322. setup();
  1323. $("setup").style.display= $("setup").style.display==="block" ? "none":"block";
  1324.  
  1325. }
  1326. iconClose.id="gt_prefs_iconClose";
  1327. iconClose.onmouseenter=function(e){
  1328. toolTip.show(this,e);
  1329. }
  1330. iconClose.onmouseleave=function(e){
  1331. toolTip.hide();
  1332. }
  1333. iconClose.onclick=function(e){
  1334. $("translatorDiv").style.display="none";
  1335. }
  1336. iconCopy.id="gt_prefs_iconCopy";
  1337. iconCopy.onmouseenter=function(e){
  1338. toolTip.show(this,e);
  1339. }
  1340. iconCopy.onmouseleave=function(e){
  1341. toolTip.hide();
  1342. }
  1343. iconCopy.onclick=function(e){
  1344. if(window.getSelection){
  1345. let range = document.createRange();
  1346. range.selectNode($("contentDiv"));
  1347. window.getSelection().removeAllRanges();
  1348. window.getSelection().addRange(range);
  1349. document.execCommand("Copy",false,null);
  1350. window.getSelection().removeAllRanges();
  1351. alert(translatorSettingLanguage===0 ? "复制成功":"Copy Done");
  1352. }
  1353. }
  1354. iconPin.id="gt_prefs_iconPin";
  1355. iconPin.style.border="1px none";
  1356. iconPin.onmouseenter=function(e){
  1357. toolTip.show(this,e);
  1358. }
  1359. iconPin.onmouseleave=function(e){
  1360. toolTip.hide();
  1361. }
  1362. iconPin.onclick=function(e){
  1363. iconPin.style.border=((isPinned=!isPinned) ? "solid":"none");
  1364. }
  1365. tBar.appendChild(iconClose);
  1366. tBar.appendChild(iconPin);
  1367. tBar.appendChild(iconSetting);
  1368. tBar.appendChild(iconSearch);
  1369. tBar.appendChild(iconForbidden);
  1370. tBar.appendChild(iconSimplified);
  1371. tBar.appendChild(iconDetailed);
  1372. tBar.appendChild(iconAccurate);
  1373. tBar.appendChild(iconNonAccurate);
  1374. tBar.appendChild(iconRealtime);
  1375. tBar.appendChild(iconNotRealtime);
  1376. tBar.appendChild(iconCopy);
  1377. tBar.appendChild(iconNext);
  1378. tBar.appendChild(iconPrevious);
  1379. translatorDiv.appendChild(tBar);
  1380. contentDiv=document.createElement("div");
  1381. contentDiv.id="gt_prefs_contentDiv";
  1382. contentDiv.style.margin=contentDiv.style.padding="0";
  1383. contentDiv.onclick = function (e) {
  1384. if(!isPinned){
  1385. if(!checkIsSoundIconClicked(e))translatorDiv.style.display="none";
  1386. }
  1387. }
  1388. translatorDiv.appendChild(contentDiv);
  1389. return translatorDiv;
  1390. }
  1391. function googleTranslate(e) {
  1392. if(isToolBarMoving){
  1393. window.removeEventListener("mousemove", divMove, true);
  1394. isToolBarMoving=!1;
  1395. return;
  1396. }
  1397. if (checkIsSoundIconClicked(e))return;
  1398. var selectedText = window.getSelection().toString().trim();
  1399. if(selectedText){
  1400. if(!isEnableRealtimeTranslationMode){
  1401. let rti=realtimeTranslatorUI.get();
  1402. rti.style.top=(e.clientY+15)+"px";
  1403. rti.style.left=(e.clientX+15)+"px";
  1404. translatorDivUI.hide();
  1405. rti.style.display="block";
  1406. realtimeTranslatorUI.destroy();
  1407. realtimeTranslatorUI.delay();
  1408. return;
  1409. }
  1410. if(isTranslatorDisabledTemporarily){
  1411. let ci=createTranslatorIcon();
  1412. ci.style.top=(e.clientY+15)+"px";
  1413. ci.style.left=(e.clientX+15)+"px";
  1414. translatorDivUI.hide();
  1415. ci.style.display="block";
  1416. tHandle=parseInt(ci.getAttribute("timerHandle"));
  1417. if(tHandle>-1){clearTimeout(tHandle);}
  1418. t=setTimeout(function(){
  1419. createTranslatorIcon().style.display="none";
  1420. },5000);
  1421. ci.setAttribute("timerHandle",""+t)
  1422. return;
  1423. }
  1424. if (selectedText === oldText && $('iconPrevious').style.display==="block"){
  1425. if(!translatorDivUI.isShowing())translatorDivUI.show(e.clientX,e.clientY);
  1426. return;
  1427. }
  1428. oldText = selectedText;
  1429. searchedTextProcessor.addText(oldText);
  1430. GetTranslation(oldText, e.clientX, e.clientY);
  1431. }
  1432. else{
  1433. if(!isPinned){
  1434. translatorDivUI.hide();
  1435. isTranslatorDisabledTemporarily=true
  1436. }
  1437. if(!isEnableRealtimeTranslationMode) realtimeTranslatorUI.hide();
  1438. if(isTranslatorDisabledTemporarily)createTranslatorIcon().style.display="none";
  1439. }
  1440. }
  1441.  
  1442. var translatorDivUI={
  1443. show(mx,my){
  1444. var translatorDiv = $("translatorDiv");
  1445. if(translatorDiv){
  1446. translatorDiv.style.display="block";
  1447. if(mx!=null && my!=null){
  1448. translatorDiv.style.left = mx + "px";
  1449. if (mx + 400 + 30 >= window.innerWidth) {
  1450. translatorDiv.style.left = parseInt(translatorDiv.style.left) - 400 + "px";
  1451. }
  1452. if(translatorDiv.offsetHeight>=window.innerHeight){
  1453. translatorDiv.style.height=(window.innerHeight/2)+"px";
  1454. translatorDiv.style.overflow="auto";
  1455. }
  1456. else{
  1457. translatorDiv.style.height="auto";
  1458. translatorDiv.style.overflow="visible";
  1459. if(translatorDiv.offsetHeight>=window.innerHeight){
  1460. translatorDiv.style.height=(window.innerHeight/2)+"px";
  1461. translatorDiv.style.overflow="auto";
  1462. }
  1463. }
  1464. translatorDiv.style.top=(my>(window.innerHeight-translatorDiv.offsetHeight) ? window.innerHeight-translatorDiv.offsetHeight+self.pageYOffset:my+self.pageYOffset)+"px";
  1465. }
  1466. }
  1467. },
  1468. hide(){
  1469. var translatorDiv = $("translatorDiv");
  1470. if(translatorDiv){
  1471. translatorDiv.style.display="none";
  1472. }
  1473. },
  1474. isShowing(){
  1475. var translatorDiv = $("translatorDiv");
  1476. return translatorDiv!=null ? translatorDiv.style.display==="block":!1;
  1477. }
  1478. };
  1479.  
  1480. var timerHide=-1;
  1481. function clearTimerHide(){
  1482. if (timerHide > 0){
  1483. clearTimeout(timerHide);
  1484. timerHide=-1;
  1485. }
  1486. }
  1487. function popup(mx, my, result) {
  1488. loadingIconUI.hide();
  1489. var translatorDiv = $("translatorDiv");
  1490. if (!translatorDiv){
  1491. translatorDiv=createTranslatorDiv();
  1492. }
  1493. var contentDiv=$("contentDiv");
  1494. contentDiv.innerHTML="";
  1495. clearTimerHide();
  1496. translatorDiv.style.display="block";
  1497. // parse
  1498. var resultTxt = getTargetAnswer(result);
  1499. if (resultTxt) createShower();
  1500. else {
  1501. console.log("resultTxt is null!");
  1502. return;
  1503. }
  1504. // main window
  1505. // first insert into dom then there is offsetHeight!IMPORTANT!
  1506. if(!isPinned){
  1507. translatorDivUI.show(mx,my);
  1508. }
  1509.  
  1510. function createShower() {
  1511. var el = null;
  1512. switch (resultTxt[0]) {
  1513. case ANS_TYPE_ACCURATE:
  1514. el = document.createElement("div");
  1515. el.innerHTML=resultTxt[1];
  1516. el.style.fontSize="14px";
  1517. el.style.fontWeight="normal";
  1518. el.style.color="Green";
  1519. break;
  1520. case ANS_TYPE_ZDIC_HTML:
  1521. el = document.createElement("div");
  1522. el.id="shiyi_content";
  1523. el.innerHTML=zdictStyle+resultTxt[1];
  1524. el.style.height = "500px";
  1525. el.style.width="100%";
  1526. el.style.margin = "0";
  1527. el.style.padding = "0";
  1528. el.style.border="none";
  1529. el.style.color="black";
  1530. el.style.textDecoration="none";
  1531. el.style.overflow = "auto";
  1532. break;
  1533. case ANS_TYPE_YOUDAO_SENTENCE:
  1534. el = document.createElement('ul');
  1535. el.style.margin = "0";
  1536. el.style.padding = "0";
  1537. resultTxt[1].translation.map(function (trans) {
  1538. var li = document.createElement('li');
  1539. li.className="gt_prefs_translator_div_li";
  1540. li.appendChild(document.createTextNode(trans));
  1541. el.appendChild(li);
  1542. });
  1543. break;
  1544. case ANS_TYPE_YOUDAO_WORD:
  1545. el = document.createElement("div");
  1546. el.style.fontSize = "12px";
  1547. el.style.fontFamily="Tahoma";
  1548. el.style.margin = "0";
  1549. el.style.padding = "0";
  1550. var basic = resultTxt[1].basic;
  1551. var header = document.createElement('p');
  1552. // header
  1553. var span = document.createElement('span');
  1554. span.innerHTML = resultTxt[1].query;
  1555. header.appendChild(span);
  1556. // phonetic if there is
  1557. var phonetic = basic.phonetic;
  1558. if (phonetic) {
  1559. var phoneticNode = document.createElement('span');
  1560. phoneticNode.innerHTML = '[' + phonetic + ']&nbsp;&nbsp;';
  1561. phoneticNode.style.cursor = "pointer";
  1562. header.appendChild(phoneticNode);
  1563. var img3 = document.createElement('img');
  1564. img3.setAttribute('src', speakerIconBase64Data);
  1565. img3.className = "gt_prefs_img_for_play_sound";
  1566. img3.onclick = function (e) {
  1567. if (e.target === img3) {
  1568. e.stopPropagation();
  1569. YouDaoPlay(resultTxt[1].query);
  1570. }
  1571. }
  1572. header.appendChild(img3);
  1573. }
  1574. header.style.color = "darkBlue";
  1575. header.style.margin = "0";
  1576. header.style.padding = "0";
  1577. span.style.fontweight = "900";
  1578. span.style.color = "black";
  1579.  
  1580. el.appendChild(header);
  1581. var hr = document.createElement('hr');
  1582. hr.style.margin = "0";
  1583. hr.style.padding = "0";
  1584. hr.style.height = "1px";
  1585. hr.style.borderTop = "dashed 1px black";
  1586. el.appendChild(hr);
  1587. var ul = document.createElement('ul');
  1588. // ul style
  1589. ul.style.margin = "0";
  1590. ul.style.padding = "0";
  1591. basic.explains.map(function (trans) {
  1592. var li = document.createElement('li');
  1593. li.style.listStyle = "none";
  1594. li.style.margin = "0";
  1595. li.style.padding = "0";
  1596. li.style.background = "none";
  1597. li.style.color = "inherit";
  1598. li.appendChild(document.createTextNode(trans));
  1599. ul.appendChild(li);
  1600. });
  1601. el.appendChild(ul);
  1602. break;
  1603. case ANS_TYPE_GOOGLE_RESULT:
  1604. el=processGoogleResult(JSON.parse(resultTxt[1]));
  1605. break;
  1606. default:
  1607. return;
  1608. }
  1609. contentDiv.appendChild(el);
  1610. }
  1611. }
  1612.  
  1613. function processGoogleResult(arr){
  1614. let el = document.createElement('ul');
  1615. el.className="gt_prefs_translator_div_li";
  1616. el.style.padding = el.style.margin = "0";
  1617. let z={
  1618. sb_details:["【翻译】","<< Translation >>"],
  1619. sb_meaning:["【释义】","<< Meaning >>"],
  1620. sb_suggestedTranslation:["【可能的翻译】","<< Other Translation >>"],
  1621. sb_more:["【点击显示例句】","<< Click to show examples >>"],
  1622. sb_hideMore:["【点击隐藏例句】","<< Click to hide examples >>"],
  1623. ce(tpe){
  1624. let n=document.createElement(tpe);
  1625. if(tpe==="li")n.className = "gt_prefs_translator_div_li";
  1626. return n;
  1627. },
  1628. ap(elm){
  1629. if(elm){
  1630. el.appendChild(elm);
  1631. return el;
  1632. }
  1633. return null;
  1634. },
  1635. app(els,eld){
  1636. if(els){
  1637. if(eld){
  1638. els.appendChild(eld);
  1639. return els;
  1640. }
  1641. }
  1642. return null;
  1643. },
  1644. aps(ela,tpe,innerStr){
  1645. if(innerStr){
  1646. if(tpe==="pr"){
  1647. innerStr="["+innerStr+"]";
  1648. tpe="a";
  1649. }
  1650. let s=z.ce(tpe);
  1651. s.style.padding=s.style.margin="0";
  1652. s.innerHTML= innerStr;
  1653. ela.appendChild(s);
  1654. return ela;
  1655. }
  1656. return null;
  1657. },
  1658. cv(txt,lan){
  1659. if(txt){
  1660. var img1 = z.ce('img');
  1661. img1.setAttribute('src', speakerIconBase64Data);
  1662. img1.className = "gt_prefs_img_for_play_sound";
  1663. img1.onclick=function () {
  1664. playTTS(lan,txt);
  1665. }
  1666. return img1;
  1667. }
  1668. },
  1669. apv(ela,txt,lan){
  1670. if(txt){
  1671. ela.appendChild(z.cv(txt,lan));
  1672. return ela;
  1673. }
  1674. return null;
  1675. },
  1676. gor(arr,el,isShowTitle){
  1677. if(arr[5]){
  1678. if(arr[5][0][2]){
  1679. if(isShowTitle)z.app(el,z.aps(z.ce("li"),"h1",z.sb_suggestedTranslation[translatorSettingLanguage]));
  1680. for(let i=0;i<arr[5][0][2].length;i++){
  1681. let lis=z.ce("li");
  1682. lis.innerHTML=`<i>${i+1}.&nbsp</i>`;
  1683. for(let ii=0;ii<arr[5].length;ii++){
  1684. if(arr[5][ii][2]){
  1685. if(arr[5][ii][2][i]){
  1686. z.aps(lis,"span",arr[5][ii][2][i][0]);
  1687. }
  1688. }
  1689. }
  1690. z.app(el,lis);
  1691. }
  1692. return true;
  1693. }
  1694. }
  1695. return false;
  1696. }
  1697. };
  1698. if(arr){
  1699. let len=arr.length;
  1700. if(len>8){
  1701. if(isEnableSimpleMode)if(z.gor(arr,el,false))return el;
  1702. if(arr[0]){
  1703. let totalRet=arr[0].length-1;
  1704. let b1=new Array(totalRet);
  1705. let b2=new Array(totalRet);
  1706. let v1=new Array(totalRet);
  1707. let v2=new Array(totalRet);
  1708. for(let k=0;k<totalRet;k++){
  1709. if(arr[0][k]){
  1710. if(arr[0][k][1]){
  1711. b1[k] = z.ce("b");
  1712. b1[k].innerHTML=arr[0][k][1];
  1713. v1[k]=z.cv(arr[0][k][1],arr[2]);
  1714. }
  1715. if(arr[0][k][0]){
  1716. b2[k]=z.ce("b");
  1717. b2[k].innerHTML=arr[0][k][0];
  1718. v2[k]=z.cv(arr[0][k][0],curTarLanForSpeaker);
  1719. }
  1720. }
  1721. }
  1722. let li1=z.ce("li");
  1723. if(isEnableSimpleMode){
  1724. for(let i=0;i<totalRet;i++){
  1725. z.app(li1,b2[i]);
  1726. }
  1727. z.ap(li1);
  1728. return el;
  1729. }
  1730. let li2=z.ce("li");
  1731. switch(totalRet){
  1732. case -1:
  1733. console.log("Error occured. Google result return an unnormal data.");
  1734. break;
  1735. case 0:
  1736. if(arr[0][0]){
  1737. if(arr[0][0][1]){
  1738. let l1=z.ce("li");
  1739. z.aps(l1,"b",arr[0][0][1]);
  1740. z.apv(l1,arr[0][0][1],arr[2]);
  1741. z.ap(l1);
  1742. }
  1743. if(arr[0][0][0]){
  1744. let l2=z.ce("li");
  1745. z.aps(l2,"b",arr[0][0][0]);
  1746. z.apv(l2,arr[0][0][0],curTarLanForSpeaker);
  1747. z.ap(l2);
  1748. }
  1749. }
  1750. break;
  1751. case 1:
  1752. z.app(li1,b1[0]);
  1753. z.app(li2,b2[0]);
  1754. if(arr[0][1]){
  1755. if(arr[0][1].length>=2){
  1756. if(arr[0][1][0]){
  1757. z.app(li1,v1[0]);
  1758. z.aps(li1,"b",arr[0][1][1]);
  1759. z.apv(li1,arr[0][1][1],arr[2]);
  1760. z.app(li2,v2[0]);
  1761. z.aps(li2,"b",arr[0][1][0]);
  1762. z.apv(li2,arr[0][1][0],curTarLanForSpeaker);
  1763. z.ap(li1);
  1764. z.ap(li2);
  1765. break;
  1766. }
  1767. if(arr[0][1].length>2){
  1768. z.aps(li2,"pr",arr[0][1][2]);
  1769. if(arr[0][1].length>3){
  1770. z.aps(li1,"pr",arr[0][1][3]);
  1771. }
  1772. }
  1773. }
  1774. }
  1775. z.ap(z.app(li1,v1[0]));
  1776. z.ap(z.app(li2,v2[0]));
  1777. break;
  1778. default:
  1779. for(let k=0;k<totalRet;k++){
  1780. z.app(li1,b1[k]);
  1781. z.app(li1,v1[k]);
  1782. z.app(li2,b2[k]);
  1783. z.app(li2,v2[k]);
  1784. }
  1785. if(arr[0][totalRet]){
  1786. z.ap(li1);
  1787. z.ap(z.aps(z.ce("p"),"pr",arr[0][totalRet][3]));
  1788. z.ap(li2);
  1789. z.ap(z.aps(z.ce("p"),"pr",arr[0][totalRet][2]));
  1790. }
  1791. else{
  1792. z.ap(li1);
  1793. z.ap(li2);
  1794. }
  1795. break;
  1796. }
  1797. }
  1798. if(arr[1]){
  1799. z.ap(z.aps(z.ce("li"),"h1",z.sb_details[translatorSettingLanguage]));
  1800. for(let i=0;i<arr[1].length;i++){
  1801. let lit=z.ce("li");
  1802. z.aps(lit,"p",arr[1][i][0]);
  1803. for(let ii=0;ii<arr[1][i][2].length;ii++){
  1804. z.aps(lit,"em",arr[1][i][2][ii][0]);
  1805. let t="("
  1806. for(let iii=0;iii<arr[1][i][2][ii][1].length;iii++){
  1807. t+=arr[1][i][2][ii][1][iii]+", ";
  1808. }
  1809. t=t.substr(0,t.length-2)+");&nbsp;";
  1810. z.aps(lit,"span",t);
  1811. }
  1812. z.ap(lit);
  1813. }
  1814. }
  1815. z.gor(arr,el,true);
  1816. }
  1817. if(len>12){
  1818. if(arr[12]){
  1819. z.ap(z.aps(z.ce("li"),"h1",z.sb_meaning[translatorSettingLanguage]));
  1820. for(let o=0;o<arr[12].length;o++){
  1821. z.ap(z.aps(z.ce("li"),"p",arr[12][o][0]));
  1822. for(let oo=0;oo<arr[12][o][1].length;oo++){
  1823. z.ap(z.aps(z.ce("li"),"b",arr[12][o][1][oo][0]));
  1824. if(arr[12][o][1][oo][2])z.ap(z.aps(z.ce("li"),"span",arr[12][o][1][oo][2]));
  1825. }
  1826. }
  1827. }
  1828. }
  1829. if(len>13){
  1830. if(arr[13]){
  1831. let liSample=z.ce("li");
  1832. liSample.id="gt_prefs_liSample";
  1833. liSample.onclick=function(e){
  1834. let divSample=$('dSample');
  1835. let lSample=$('liSample');
  1836. if(divSample){
  1837. if(divSample.style.display==="none"){
  1838. divSample.style.display="block";
  1839. liSample.innerHTML=`<h1 id="gt_prefs_show_or_hide_examples">${z.sb_hideMore[translatorSettingLanguage]}<h1>`;
  1840. }
  1841. else{
  1842. divSample.style.display="none";
  1843. liSample.innerHTML=`<h1 id="gt_prefs_show_or_hide_examples">${z.sb_more[translatorSettingLanguage]}<h1>`;
  1844. }
  1845. }
  1846. }
  1847. liSample.innerHTML=`<h1 id="gt_prefs_show_or_hide_examples">${z.sb_more[translatorSettingLanguage]}<h1>`;
  1848. z.ap(liSample);
  1849. let dSample=z.ce("li");
  1850. dSample.id="gt_prefs_dSample";
  1851. let ulSample=z.ce("ul");
  1852. ulSample.id="gt_prefs_sample_ul";
  1853. for(let j=0;j<arr[13][0].length;j++){
  1854. z.aps(ulSample,"li",arr[13][0][j][0]);
  1855. }
  1856. dSample.appendChild(ulSample);
  1857. z.ap(dSample);
  1858. dSample.style.display="none";
  1859. }
  1860. }
  1861. return el;
  1862. }
  1863. return null;
  1864. }
  1865.  
  1866. var searchedTextProcessor={
  1867. addText:function(txt){
  1868. if(searchedTextProcessor.isTextNotExisted(txt)){
  1869. searchedTextCache.push(txt);
  1870. searchedTextIndex=searchedTextCache.length-1;
  1871. let iconNext=$('iconNext');
  1872. if(iconNext)iconNext.style.display="none";
  1873. }
  1874. if(searchedTextIndex>0){
  1875. let iconPrevious=$('iconPrevious');
  1876. if(iconPrevious)iconPrevious.style.display="block";
  1877. }
  1878. },
  1879. getCurrentText:function(){
  1880. return searchedTextCache[searchedTextIndex];
  1881. },
  1882. isTextNotExisted:function(txt){
  1883. for(let n=0;n<searchedTextCache.length;n++){
  1884. if(searchedTextCache[n]===txt)return false;
  1885. }
  1886. return true;
  1887. },
  1888. showTranslation:function(){
  1889. let translatorDiv=document.getElementById('gt_prefs_translatorDiv');
  1890. GetTranslation(searchedTextCache[searchedTextIndex],translatorDiv.offsetLeft,translatorDiv.offsetTop);
  1891. },
  1892. showPreviousText:function(){
  1893. let iconPrevious=document.getElementById('gt_prefs_iconPrevious');
  1894. let iconNext=document.getElementById('gt_prefs_iconNext');
  1895. if(--searchedTextIndex<0){
  1896. iconPrevious.style.display="none";
  1897. searchedTextIndex=0;
  1898. }
  1899. else{
  1900. if(searchedTextIndex===0){
  1901. iconPrevious.style.display="none";
  1902. }
  1903. if(searchedTextIndex<searchedTextCache.length-1){
  1904. iconNext.style.display="block";
  1905. }
  1906. this.showTranslation();
  1907. }
  1908. },
  1909. showNextText:function(){
  1910. let iconPrevious=document.getElementById('gt_prefs_iconPrevious');
  1911. let iconNext=document.getElementById('gt_prefs_iconNext');
  1912. if(++searchedTextIndex>searchedTextCache.length-1){
  1913. iconNext.style.display="none";
  1914. searchedTextIndex=searchedTextCache.length-1;
  1915. }
  1916. else{
  1917. if(searchedTextIndex===searchedTextCache.length-1){
  1918. iconNext.style.display="none";
  1919. }
  1920. if(searchedTextIndex>0){
  1921. iconPrevious.style.display="block";
  1922. }
  1923. this.showTranslation();
  1924. }
  1925. }
  1926. };
  1927.  
  1928. function checkIsWordOrNot(txt,maxWordLength, isChineseWord) {
  1929. if (isChineseWord)return txt.length <= maxWordLength && /^([\u4E00-\u9FA5]|[\uFF00-\uFF20]|[\u3000-\u301C])+$/g.test(txt);
  1930. else return txt.length <= maxWordLength && !/\s+/gi.test(txt);
  1931. }
  1932.  
  1933. function getHowlingAnimalsHtml(txt){
  1934. return `<div id="gt_prefs_howlingAnimalsHtml" style="margin:2px;padding:0px;"><img src="${howlingAnimalsIconBase64Data}" width="20" height="20"></img>${txt}</div>`;
  1935. }
  1936.  
  1937. function translateIt(srcLanguage, dstLanguage, queryStr, mx, my) {
  1938. queryStr = queryStr.trim();
  1939. if (queryStr === "") return;
  1940. curTarLanForSpeaker=dstLanguage;
  1941. var targetMd5 = (new MD5).MD5(queryStr, srcLanguage + dstLanguage, null);
  1942. if (translatedDataMap.has(targetMd5)) {
  1943. popup(mx, my, translatedDataMap.get(targetMd5));
  1944. }
  1945. else {
  1946. loadingIconUI.show({"mx":mx,"my":my});
  1947. if(isEnableAnimalVoicePerception){
  1948. if(animalVoiceTranslator.identify(queryStr)){
  1949. let resultAnimalVoiceText=getHowlingAnimalsHtml(animalVoiceTranslator.deConvert(queryStr));
  1950. translatedDataMap.set(targetMd5,[CACHE_TYPE_ACCURATE, resultAnimalVoiceText]);
  1951. popup(mx,my,[CACHE_TYPE_ACCURATE,resultAnimalVoiceText])
  1952. return;
  1953. }
  1954. }
  1955. if(isEnableAccurateMode){
  1956. accurateData.md5=targetMd5;
  1957. accurateData.mx=mx;
  1958. accurateData.my=my;
  1959. accurateData.dy=maxTimesToDestroy;
  1960. accurateData.wh=null;
  1961. }
  1962. var googleCallBackFunc = function (arrayTxt) {
  1963. if (arrayTxt != 'undefined' && arrayTxt != null) {
  1964. translatedDataMap.set(targetMd5,[CACHE_TYPE_GOOGLE_RESULT, arrayTxt]);
  1965. popup(mx, my, [CACHE_TYPE_GOOGLE_RESULT, arrayTxt]);
  1966. }
  1967. };
  1968. var youdaoCallBackFunc=function (repArray, bIsSuccess) {
  1969. if (bIsSuccess) {
  1970. if (repArray != null || repArray != "undefined") {
  1971. var dictJson = JSON.parse(repArray);
  1972. translatedDataMap.set(targetMd5,[dictJson.basic ? CACHE_TYPE_YOUDAO_WORD:CACHE_TYPE_YOUDAO_SENTENCE, dictJson]);
  1973. popup(mx, my, [dictJson.basic ? CACHE_TYPE_YOUDAO_WORD : CACHE_TYPE_YOUDAO_SENTENCE, dictJson]);
  1974. return;
  1975. }
  1976. }
  1977. GoogleRequest(queryStr, srcLanguage, dstLanguage, googleCallBackFunc);
  1978. };
  1979. var getYoudaoTranslation=function (maxWordLength) {
  1980. if (youdao_isEnabled) {
  1981. if (youdao_isOnlyForSingleWord) {
  1982. if (checkIsWordOrNot(queryStr, maxWordLength, false)) YoudaoRequest(queryStr, youdaoCallBackFunc);
  1983. else GoogleRequest(queryStr, srcLanguage, dstLanguage, googleCallBackFunc);
  1984. }
  1985. else YoudaoRequest(queryStr, youdaoCallBackFunc);
  1986. }
  1987. else GoogleRequest(queryStr, srcLanguage, dstLanguage, googleCallBackFunc);
  1988. };
  1989. switch (dstLanguage){
  1990. case "zh-cn":
  1991. case "zh-tw":
  1992. case "zh-hk":
  1993. //if query string is chinese word with max four characters
  1994. if (checkIsWordOrNot(queryStr, 4, true)) {
  1995. ZdicRequest(queryStr, function (repHtml, finalUrl, bIsSuccess) {
  1996. if (bIsSuccess) {
  1997. if (repHtml != null && repHtml != "undefined" && repHtml.trim()!="") {
  1998. translatedDataMap.set(targetMd5,[CACHE_TYPE_ZDIC_HTML, repHtml]);
  1999. popup(mx, my, [CACHE_TYPE_ZDIC_HTML, repHtml]);
  2000. return;
  2001. }
  2002. }
  2003. getYoudaoTranslation(8);
  2004. });
  2005. return;
  2006. }
  2007. else getYoudaoTranslation(8);
  2008. return;
  2009. case "en-hk":
  2010. case "en-us":
  2011. case "en-gb":
  2012. case "en-ww":
  2013. case "en-ca":
  2014. case "en-au":
  2015. //if translate from Chinese to English
  2016. if (/([\u4E00-\u9FA5]|[\uFF00-\uFF20]|[\u3000-\u301C])+/g.test(queryStr)){
  2017. getYoudaoTranslation(30);
  2018. return;
  2019. }
  2020. break;
  2021. default:
  2022. break;
  2023. }
  2024. GoogleRequest(queryStr, srcLanguage, dstLanguage, googleCallBackFunc);
  2025. }
  2026. }
  2027.  
  2028. function playSound(buffer) {
  2029. window.AudioContext = window.AudioContext || window.webkitAudioContext;
  2030. var source = audioContext.createBufferSource();
  2031. source.buffer = buffer;
  2032. source.connect(audioContext.destination);
  2033. source.start(0);
  2034. }
  2035.  
  2036. function YouDaoPlay(word) {
  2037. var txtMd5 = (new MD5).MD5(word, "YouDaoEnToCn" + CACHE_TYPE_YOUDAO_WORD, null);
  2038. if (translatedSoundMap.has(txtMd5)) {
  2039. playSound(translatedSoundMap.get(txtMd5));
  2040. return;
  2041. }
  2042. GM_xmlhttpRequest({
  2043. method: "GET",
  2044. url: `https://dict.youdao.com/dictvoice?type=2&audio=${encodeURI(word)}`,
  2045. responseType: 'arraybuffer',
  2046. onload: function(resp) {
  2047. try {
  2048. audioContext.decodeAudioData(resp.response, function (buffer) {
  2049. translatedSoundMap.set(txtMd5,buffer);
  2050. playSound(buffer);
  2051. });
  2052. } catch (e) {
  2053. console.log(e);
  2054. }
  2055. }
  2056. });
  2057. }
  2058.  
  2059. function YoudaoRequest(queryStr,callBackFunc) {
  2060. GM_xmlhttpRequest({
  2061. method: "GET",
  2062. url: `http://fanyi.youdao.com/openapi.do?type=data&doctype=json&version=1.1&relatedUrl=http%3A%2F%2Ffanyi.youdao.com%2F%23&keyfrom=fanyiweb&key=null&translate=on&q=${queryStr}&ts=${(new Date().getTime()).toString()}`,
  2063. headers: {
  2064. "Accept": "application/json"
  2065. },
  2066. onload: function (resp) {
  2067. if (resp.statusText==="OK"){
  2068. callBackFunc(resp.responseText,true);
  2069. return;
  2070. }
  2071. callBackFunc(null,false);
  2072. }
  2073. });
  2074. }
  2075.  
  2076. function ZdicRequest(queryStr,callBackFunc) {
  2077. GM_xmlhttpRequest({
  2078. method: "GET",
  2079. url: "https://www.zdic.net/hans/"+encodeURI(queryStr),
  2080. headers:{
  2081. "User-Agent": UA,
  2082. "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
  2083. "Accept-Encoding": "GBK,gzip,deflate"
  2084. },
  2085. onload: function (resp) {
  2086. try {
  2087. if (resp.readyState === 4) {
  2088. let repTxt=resp.responseText;
  2089. //if got the right answer
  2090. if (resp.responseText.indexOf("<title>查无此结果</title>") < 0) {
  2091. if (resp.responseText.indexOf("<title>全站搜索</title>") < 0) {
  2092. let beginIndex=repTxt.indexOf(`<div class="homograph-entry">`);
  2093. let endIndex=repTxt.lastIndexOf(`<div class="res_c_right">`)-7;
  2094. var result1=repTxt.substring(beginIndex,endIndex);//.replace(/src="\/\/img\.zdic\.net/gi,`src="https://img.zdic.net`).replace(/data-original="\/\/img\.zdic\.net\//gi,`data-original="https://img.zdic.net/`);
  2095. callBackFunc(result1, resp.finalUrl, true);
  2096. return;
  2097. }
  2098. }
  2099. }
  2100. } catch (e) {
  2101. console.log(e);
  2102. }
  2103. callBackFunc(null, null, false);
  2104. }
  2105. });
  2106. }
  2107.  
  2108. function getTargetAnswer(resultObj) {
  2109. if (resultObj) {
  2110. switch(resultObj[0]){
  2111. case CACHE_TYPE_ZDIC_HTML:
  2112. return [ANS_TYPE_ZDIC_HTML, resultObj[1]];
  2113. case CACHE_TYPE_YOUDAO_SENTENCE:
  2114. return [ANS_TYPE_YOUDAO_SENTENCE, resultObj[1]];
  2115. case CACHE_TYPE_YOUDAO_WORD:
  2116. return [ANS_TYPE_YOUDAO_WORD, resultObj[1]];
  2117. case CACHE_TYPE_GOOGLE_RESULT:
  2118. return [ANS_TYPE_GOOGLE_RESULT, resultObj[1]];
  2119. case CACHE_TYPE_ACCURATE:
  2120. return[ANS_TYPE_ACCURATE,resultObj[1]];
  2121. default:
  2122. break;
  2123. }
  2124. }
  2125. return null;
  2126. }
  2127.  
  2128. function init_google_value_tk() {
  2129. var url = "https://" + googleDomain[translatorSettingLanguage] + "/translate_a/element.js";
  2130. GM_xmlhttpRequest({
  2131. method: "GET",
  2132. url: url,
  2133. onreadystatechange: function (resp) {
  2134. if (resp.readyState == 4) {
  2135. if (resp.status == 200) {
  2136. if(init_google_value_tk_parse(resp.responseText)){
  2137. location.reload();
  2138. }
  2139. else{
  2140. alert(translatorSettingLanguage===0 ? "谷歌令牌初始化失败,转为使用有道翻译,请联系作者改进程序。":"Google token initialized failed, use youdao translator instead. Please contact the author to fix this problem.");
  2141. }
  2142. }
  2143. }
  2144. }
  2145. });
  2146. }
  2147.  
  2148. function init_google_value_tk_parse(responseText) {
  2149. let indexStr="c._ctkk='";
  2150. let bIdx=responseText.indexOf(indexStr);
  2151. if(bIdx>0){
  2152. bIdx+=indexStr.length;
  2153. let eIdx=responseText.indexOf("';",bIdx);
  2154. if(eIdx>0){
  2155. let tkk=responseText.substring(bIdx,eIdx);
  2156. if(tkk!=null){
  2157. GM_setValue(tokenNameInStorage[translatorSettingLanguage], tkk)
  2158. return true;
  2159. }
  2160. }
  2161. }
  2162. return false;
  2163. }
  2164.  
  2165. function googleTK(text) {
  2166. var uM = GM_getValue(tokenNameInStorage[translatorSettingLanguage],null);
  2167. if (uM == 'undefined' || uM == null) {
  2168. init_google_value_tk();
  2169. return null;
  2170. }
  2171. var cb = "&";
  2172. var k = "";
  2173. var Gf = "=";
  2174. var Vb = "+-a^+6";
  2175. var t = "a";
  2176. var Yb = "+";
  2177. var Zb = "+-3^+b+-f";
  2178. var jd = ".";
  2179. var sM = function (a) {
  2180. return function () {
  2181. return a;
  2182. };
  2183. };
  2184. var tM = function (a, b) {
  2185. for (var c = 0; c < b.length - 2; c += 3) {
  2186. var d = b.charAt(c + 2);
  2187. d = d >= t ? d.charCodeAt(0) - 87 : Number(d);
  2188. d = b.charAt(c + 1) == Yb ? a >>> d : a << d;
  2189. a = b.charAt(c) == Yb ? a + d & 4294967295 : a ^ d;
  2190. }
  2191. return a;
  2192. };
  2193. var vM = function (a) {
  2194. try{
  2195. var b;
  2196. if (null !== uM) {
  2197. b = uM;
  2198. } else {
  2199. b = sM(String.fromCharCode(84));
  2200. var c = sM(String.fromCharCode(75));
  2201. b = [b(), b()];
  2202. b[1] = c();
  2203. b = (uM = window[b.join(c())] || k) || k;
  2204. }
  2205. var d = sM(String.fromCharCode(116));
  2206. c = sM(String.fromCharCode(107));
  2207. d = [d(), d()];
  2208. d[1] = c();
  2209. c = cb + d.join(k) + Gf;
  2210. d = b.split(jd);
  2211. b = Number(d[0]) || 0;
  2212.  
  2213. for (var e = [], f = 0, g = 0; g < a.length; g++) {
  2214. var m = a.charCodeAt(g);
  2215. 128 > m ? e[f++] = m : (2048 > m ? e[f++] = m >> 6 | 192 : (55296 == (m & 64512) && g + 1 < a.length && 56320 == (a.charCodeAt(g + 1) & 64512) ? (m = 65536 + ((m & 1023) << 10) + (a.charCodeAt(++g) & 1023), e[f++] = m >> 18 | 240, e[f++] = m >> 12 & 63 | 128) : e[f++] = m >> 12 | 224, e[f++] = m >> 6 & 63 | 128), e[f++] = m & 63 | 128);
  2216. }
  2217. a = b || 0;
  2218. for (f = 0; f < e.length; f++) {
  2219. a += e[f];
  2220. a = tM(a, Vb);
  2221. }
  2222. a = tM(a, Zb);
  2223. a ^= Number(d[1]) || 0;
  2224. 0 > a && (a = (a & 2147483647) + 2147483648);
  2225. a %= 1E6;
  2226. return a.toString() + jd + (a ^ b);
  2227. }
  2228. catch(err){
  2229. console.log(err);
  2230. }
  2231. };
  2232. return vM(text);
  2233. }
  2234.  
  2235. function translationTaskProcessor(){
  2236. if(accurateData.dy-->0){
  2237. if(!isExistsTranslationTask.get()){
  2238. translationTaskTimout=0;
  2239. let s=GM_getValue(translatedDataConfigString,"");
  2240. if(s.length>0){
  2241. accurateData.wh.close();
  2242. accurateData.wh=null;
  2243. translatedDataMap.set(accurateData.md5,[CACHE_TYPE_ACCURATE,s]);
  2244. GM_setValue(translatedDataConfigString,"");
  2245. popup(accurateData.mx,accurateData.my,[CACHE_TYPE_ACCURATE,s]);
  2246. }
  2247. }
  2248. else translationTaskTimout=setTimeout(translationTaskProcessor,translationTaskInterval);
  2249. }
  2250. else{
  2251. translationTaskTimout=0;
  2252. isExistsTranslationTask.set(false);
  2253. GM_setValue(translatedDataConfigString,"");
  2254. loadingIconUI.hide();
  2255. }
  2256. }
  2257.  
  2258. // Google Translate Request
  2259. function GoogleRequest(txt, sl, tl, parse) {
  2260. if(isEnableAccurateMode){
  2261. if(!isExistsTranslationTask.get()){
  2262. let iN=/\s+/g.test(txt);
  2263. if(!iN){
  2264. if(/([\u4E00-\u9FA5]|[\uFF00-\uFF20]|[\u3000-\u301C])+/g.test(txt))iN=(txt.length>4);
  2265. }
  2266. if(iN){
  2267. if(isTMode){
  2268. if(tLanguageCode[currentSourceLanguage+1]!=="xxx" && tLanguageCode[currentTranslateLanguage+1]!=="xxx"){
  2269. GM_setValue(translatedDataConfigString,`${tLanguageCode[currentSourceLanguage+1]}|${tLanguageCode[currentTranslateLanguage+1]}|${encodeURI(txt)}`);
  2270. if((accurateData.wh=window.open("https://fanyi.qq.com/","_blank","height=100,width=100,top="+window.screen.height+",left="+window.screen.width+",location=0,menubar=0,status=0,titlebar=0,toolbar=0"))){
  2271. isExistsTranslationTask.set(true);
  2272. translationTaskTimout=setTimeout(translationTaskProcessor,translationTaskInterval);
  2273. return;
  2274. }
  2275. }
  2276. }
  2277. let vlUrl=alURL+ "&sl=" + sl + "&tl=" + tl + "&text=" + encodeURI(txt);
  2278. if((accurateData.wh=window.open(vlUrl,"_blank","height=100,width=100,top="+window.screen.height+",left="+window.screen.width+",location=0,menubar=0,status=0,titlebar=0,toolbar=0"))){
  2279. isExistsTranslationTask.set(true);
  2280. translationTaskTimout=setTimeout(translationTaskProcessor,translationTaskInterval);
  2281. return;
  2282. }
  2283. else{
  2284. saveModeSettings(isEnableAccurateModeConfigString,false);
  2285. $("iconAccurate").style.display="none";
  2286. $("iconNonAccurate").style.display="block";
  2287. }
  2288. }
  2289. }
  2290. else{
  2291. if(accurateData.wh){
  2292. accurateData.wh.close();
  2293. accurateData.wh=null;
  2294. }
  2295. if(translationTaskTimout!==0){
  2296. clearTimeout(translationTaskTimout);
  2297. translationTaskTimout=0;
  2298. }
  2299. isExistsTranslationTask.set(false);
  2300. }
  2301. }
  2302. var tk = googleTK(txt);
  2303. if(!tk){
  2304. loadingIconUI.hide();
  2305. return;
  2306. }
  2307. var Url = dictURL +
  2308. "&hl=auto" +
  2309. "&sl=" + sl + "&tl=" + tl +
  2310. "&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&dt=at&ie=UTF-8&oe=UTF-8&otf=2&trs=1&inputm=1&ssel=0&tsel=0&source=btn&kc=3" +
  2311. "&tk=" + tk +
  2312. "&q=" + encodeURI(txt);
  2313. var method = 'POST';
  2314. var Data = '';
  2315. var Hdr = {
  2316. "User-Agent": UA,
  2317. "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
  2318. "Accept-Encoding": "gzip, deflate"
  2319. };
  2320. var Q = Url.split('&q=');
  2321. Url = Q[0];
  2322. Data = '&q=' + Q[1];
  2323. Hdr["Content-Length"] = Data.length + '';
  2324. Hdr["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
  2325. GM_xmlhttpRequest({
  2326. method: method,
  2327. url: Url,
  2328. data: Data,
  2329. headers: Hdr,
  2330. onload: function (resp) {
  2331. try {
  2332. //console.log(resp.responseText);
  2333. parse(resp.responseText, tl);
  2334. } catch (e) {
  2335. console.log(e);
  2336. }
  2337. }
  2338. });
  2339. }
  2340.  
  2341.  
  2342. function playTTS(lang,text) {
  2343. text = text.replace(/[«»'"]/g, ' ');
  2344. var txtMd5 = (new MD5).MD5(text, lang + CACHE_TYPE_GOOGLE_RESULT, null);
  2345. if (translatedSoundMap.has(txtMd5)){
  2346. playSound(translatedSoundMap.get(txtMd5));
  2347. return;
  2348. }
  2349. var tk = googleTK(text);
  2350. var Url = ttsURL + "&ie=UTF-8&total=1&idx=0" +
  2351. "&tl=" + lang +
  2352. "&q=" + text +
  2353. "&textlen=" + text.length +
  2354. "&tk=" + tk;
  2355. GM_xmlhttpRequest({
  2356. method: "GET",
  2357. url: Url,
  2358. responseType: 'arraybuffer',
  2359. onload: function (response) {
  2360. try {
  2361. audioContext.decodeAudioData(response.response, function (buffer) {
  2362. translatedSoundMap.set(txtMd5,buffer);
  2363. playSound(buffer);
  2364. });
  2365. } catch (e) {
  2366. console.log(e);
  2367. }
  2368. }
  2369. });
  2370. }
  2371.  
  2372.  
  2373. 'use strict';
  2374.  
  2375. class MD5{
  2376. /*
  2377. * Add integers, wrapping at 2^32. This uses 16-bit operations internally
  2378. * to work around bugs in some JS interpreters.
  2379. */
  2380. safe_add(x, y) {
  2381. var lsw = (x & 0xFFFF) + (y & 0xFFFF),
  2382. msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  2383. return (msw << 16) | (lsw & 0xFFFF);
  2384. }
  2385.  
  2386. /*
  2387. * Bitwise rotate a 32-bit number to the left.
  2388. */
  2389. bit_rol(num, cnt) {
  2390. return (num << cnt) | (num >>> (32 - cnt));
  2391. }
  2392.  
  2393. /*
  2394. * These functions implement the four basic operations the algorithm uses.
  2395. */
  2396. md5_cmn(q, a, b, x, s, t) {
  2397. return this.safe_add(this.bit_rol(this.safe_add(this.safe_add(a, q), this.safe_add(x, t)), s), b);
  2398. }
  2399.  
  2400. md5_ff(a, b, c, d, x, s, t) {
  2401. return this.md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
  2402. }
  2403.  
  2404. md5_gg(a, b, c, d, x, s, t) {
  2405. return this.md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
  2406. }
  2407.  
  2408. md5_hh(a, b, c, d, x, s, t) {
  2409. return this.md5_cmn(b ^ c ^ d, a, b, x, s, t);
  2410. }
  2411.  
  2412. md5_ii(a, b, c, d, x, s, t) {
  2413. return this.md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
  2414. }
  2415.  
  2416. /*
  2417. * Calculate the MD5 of an array of little-endian words, and a bit length.
  2418. */
  2419. binl_md5(x, len) {
  2420. /* append padding */
  2421. x[len >> 5] |= 0x80 << ((len) % 32);
  2422. x[(((len + 64) >>> 9) << 4) + 14] = len;
  2423.  
  2424. var i, olda, oldb, oldc, oldd,
  2425. a = 1732584193,
  2426. b = -271733879,
  2427. c = -1732584194,
  2428. d = 271733878;
  2429.  
  2430. for (i = 0; i < x.length; i += 16) {
  2431. olda = a;
  2432. oldb = b;
  2433. oldc = c;
  2434. oldd = d;
  2435.  
  2436. a = this.md5_ff(a, b, c, d, x[i], 7, -680876936);
  2437. d = this.md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
  2438. c = this.md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
  2439. b = this.md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
  2440. a = this.md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
  2441. d = this.md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
  2442. c = this.md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
  2443. b = this.md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
  2444. a = this.md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
  2445. d = this.md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
  2446. c = this.md5_ff(c, d, a, b, x[i + 10], 17, -42063);
  2447. b = this.md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
  2448. a = this.md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
  2449. d = this.md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
  2450. c = this.md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
  2451. b = this.md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
  2452.  
  2453. a = this.md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
  2454. d = this.md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
  2455. c = this.md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
  2456. b = this.md5_gg(b, c, d, a, x[i], 20, -373897302);
  2457. a = this.md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
  2458. d = this.md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
  2459. c = this.md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
  2460. b = this.md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
  2461. a = this.md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
  2462. d = this.md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
  2463. c = this.md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
  2464. b = this.md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
  2465. a = this.md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
  2466. d = this.md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
  2467. c = this.md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
  2468. b = this.md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
  2469.  
  2470. a = this.md5_hh(a, b, c, d, x[i + 5], 4, -378558);
  2471. d = this.md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
  2472. c = this.md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
  2473. b = this.md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
  2474. a = this.md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
  2475. d = this.md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
  2476. c = this.md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
  2477. b = this.md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
  2478. a = this.md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
  2479. d = this.md5_hh(d, a, b, c, x[i], 11, -358537222);
  2480. c = this.md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
  2481. b = this.md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
  2482. a = this.md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
  2483. d = this.md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
  2484. c = this.md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
  2485. b = this.md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
  2486.  
  2487. a = this.md5_ii(a, b, c, d, x[i], 6, -198630844);
  2488. d = this.md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
  2489. c = this.md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
  2490. b = this.md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
  2491. a = this.md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
  2492. d = this.md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
  2493. c = this.md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
  2494. b = this.md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
  2495. a = this.md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
  2496. d = this.md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
  2497. c = this.md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
  2498. b = this.md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
  2499. a = this.md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
  2500. d = this.md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
  2501. c = this.md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
  2502. b = this.md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
  2503.  
  2504. a = this.safe_add(a, olda);
  2505. b = this.safe_add(b, oldb);
  2506. c = this.safe_add(c, oldc);
  2507. d = this.safe_add(d, oldd);
  2508. }
  2509. return [a, b, c, d];
  2510. }
  2511.  
  2512. /*
  2513. * Convert an array of little-endian words to a string
  2514. */
  2515. binl2rstr(input) {
  2516. var i,
  2517. output = '';
  2518. for (i = 0; i < input.length * 32; i += 8) {
  2519. output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
  2520. }
  2521. return output;
  2522. }
  2523.  
  2524. /*
  2525. * Convert a raw string to an array of little-endian words
  2526. * Characters >255 have their high-byte silently ignored.
  2527. */
  2528. rstr2binl(input) {
  2529. var i,
  2530. output = [];
  2531. output[(input.length >> 2) - 1] = undefined;
  2532. for (i = 0; i < output.length; i += 1) {
  2533. output[i] = 0;
  2534. }
  2535. for (i = 0; i < input.length * 8; i += 8) {
  2536. output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
  2537. }
  2538. return output;
  2539. }
  2540.  
  2541. /*
  2542. * Calculate the MD5 of a raw string
  2543. */
  2544. rstr_md5(s) {
  2545. return this.binl2rstr(this.binl_md5(this.rstr2binl(s), s.length * 8));
  2546. }
  2547.  
  2548. /*
  2549. * Calculate the HMAC-MD5, of a key and some data (raw strings)
  2550. */
  2551. rstr_hmac_md5(key, data) {
  2552. var i,
  2553. bkey = this.rstr2binl(key),
  2554. ipad = [],
  2555. opad = [],
  2556. hash;
  2557. ipad[15] = opad[15] = undefined;
  2558. if (bkey.length > 16) {
  2559. bkey = this.binl_md5(bkey, key.length * 8);
  2560. }
  2561. for (i = 0; i < 16; i += 1) {
  2562. ipad[i] = bkey[i] ^ 0x36363636;
  2563. opad[i] = bkey[i] ^ 0x5C5C5C5C;
  2564. }
  2565. hash = this.binl_md5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8);
  2566. return this.binl2rstr(this.binl_md5(opad.concat(hash), 512 + 128));
  2567. }
  2568.  
  2569. /*
  2570. * Convert a raw string to a hex string
  2571. */
  2572. rstr2hex(input) {
  2573. var hex_tab = '0123456789abcdef',
  2574. output = '',
  2575. x,
  2576. i;
  2577. for (i = 0; i < input.length; i += 1) {
  2578. x = input.charCodeAt(i);
  2579. output += hex_tab.charAt((x >>> 4) & 0x0F) +
  2580. hex_tab.charAt(x & 0x0F);
  2581. }
  2582. return output;
  2583. }
  2584.  
  2585. /*
  2586. * Encode a string as utf-8
  2587. */
  2588. str2rstr_utf8(input) {
  2589. return unescape(encodeURIComponent(input));
  2590. }
  2591.  
  2592. /*
  2593. * Take string arguments and return either raw or hex encoded strings
  2594. */
  2595. raw_md5(s) {
  2596. return this.rstr_md5(this.str2rstr_utf8(s));
  2597. }
  2598.  
  2599. hex_md5(s) {
  2600. return this.rstr2hex(this.raw_md5(s));
  2601. }
  2602.  
  2603. raw_hmac_md5(k, d) {
  2604. return this.rstr_hmac_md5(this.str2rstr_utf8(k), this.str2rstr_utf8(d));
  2605. }
  2606.  
  2607. hex_hmac_md5(k, d) {
  2608. return this.rstr2hex(this.raw_hmac_md5(k, d));
  2609. }
  2610.  
  2611. MD5(string, key, raw) {
  2612. if (!key) {
  2613. if (!raw) {
  2614. return this.hex_md5(string);
  2615. } else {
  2616. return this.raw_md5(string);
  2617. }
  2618. }
  2619. if (!raw) {
  2620. return this.hex_hmac_md5(key, string);
  2621. } else {
  2622. return this.raw_hmac_md5(key, string);
  2623. }
  2624. }
  2625. }
  2626. function triggerEvent(el,evtName){
  2627. var evt;
  2628. if(document.createEvent){
  2629. evt = document.createEvent("HTMLEvents");
  2630. evt.initEvent(evtName, true, true);
  2631. evt.eventName = evtName;
  2632. el.dispatchEvent(evt);
  2633. } else {
  2634. evt = document.createEventObject();
  2635. evt.eventName = evtName;
  2636. evt.eventType = evtName;
  2637. el.fireEvent("on" + evt.eventType, evt);
  2638. }
  2639. }
  2640. function removeWebsiteSelectingRestriction(){
  2641. GM_addStyle(`*{-webkit-user-select:text !important;-moz-user-select:text !important;-ms-user-select:text !important;user-select:text !important;}`);
  2642. [].forEach.call(['copy', 'cut', 'paste', 'select', 'selectstart'],function(event) {document.addEventListener(event, function(e) { e.stopPropagation(); }, true);});
  2643. isWebsiteRestrictionRemoved=true;
  2644. }
  2645. if(isRemoveWebsiteSelectingRestriction){
  2646. removeWebsiteSelectingRestriction();
  2647. }
  2648. var zdictStyle=`
  2649. <style type="text/css">
  2650. #shiyi_content{height: 500px; width: 100%; margin: 0px; padding: 0px; border: none; color: black; text-decoration: none; overflow: auto;background:transparent;}
  2651. #shiyi_content .homograph-entry{margin: 0px; padding: 0px; border: none;word-wrap:break-word;box-sizing:border-box;}
  2652. #shiyi_content .page{font-size:16px;}
  2653. #shiyi_content .nr-box{ padding-top: 0;border: 1px solid #af9a87;padding: 15px;background: transparent;margin-bottom: 20px;-webkit-column-break-inside: avoid;page-break-inside: avoid;break-inside: avoid;}
  2654. #shiyi_content .nr-box-shiyi .jbjs {border-right: solid 4px #c99464;}
  2655. #shiyi_content .nr-box-header {background: #f3e8df;padding: 10px 15px;margin: 0 -15px 1em -15px;font-size: 12px;}
  2656. #shiyi_content .zib-title {float: right;font-size: 16px;}
  2657. #shiyi_content .nr-box-shiyi h2.h2_entry {font-size: 1.8em;margin-bottom: 0;}
  2658. #shiyi_content .h2_entry {font-size: 1.4em;margin-bottom: .5em;}
  2659. #shiyi_content .page .dictname {font-size: .7em;}
  2660. #shiyi_content .page .zdict .definitions, .page .zdict .derivs, .page .zdict .etyms {margin-bottom: 1em;}
  2661. #shiyi_content span.z_ts2, span.z_ts3, span.z_ts4 {background-image:transparent;height: 18px;line-height: 18px;color: #660000;font-size: 12px;text-align: center;display: inline-block;font-weight: normal;margin-right: 5px;padding: 0;}
  2662. #shiyi_content span.z_ts2 {background-position: 0 -78px;width: 33px;}
  2663. #shiyi_content .jnr, .bknr, .wknr {margin: .5em;line-height: 1.5em;}
  2664. #shiyi_content .p, p {margin-bottom: 1em;}
  2665. #shiyi_content .dicpy {font-size: 20px;font-family: Arial;color: #660000;font-weight: normal;}
  2666. #shiyi_content .encs {color: #339900;}
  2667. #shiyi_content .diczx1 {color: #660000;}
  2668. #shiyi_content .h_line1 {clear: both;height: 3px;width: 98%; margin-bottom: 3px;background-color:gray;text-indent: -9999px;}
  2669. #shiyi_content span.z_ts4 {background-position: 0 -114px;width: 55px;}
  2670. #shiyi_content span.z_ts2, span.z_ts3, span.z_ts4 {background-color:#F1DED6;border:1px #B07D7E solid;border-radius:3px;height: 18px;line-height: 18px;color: #660000;font-size: 12px;text-align: center;display: inline-block;font-weight: normal;margin-right: 5px;padding: 0;}
  2671. #shiyi_content .gnr .gycd {line-height: 1.5;padding-bottom: 5px;}
  2672. #shiyi_content .pz {border-bottom: 1px dashed #F1E9E7;padding-bottom: 5px;}
  2673. #shiyi_content ruby {display: inline-table;text-align: center;white-space: nowrap;text-indent: 0;margin: 0;vertical-align: -20%;}
  2674. #shiyi_content ruby > rb, ruby > rbc {display: table-row-group;line-height: 90%;}
  2675. #shiyi_content rbc > rb, rtc > rt {display: table-cell;letter-spacing: 0;}
  2676. #shiyi_content rt {text-indent: 0px;line-height: normal;-webkit-text-emphasis: none;}
  2677. #shiyi_content .gnr .pz ruby rtc {font-size: 12px;color: #8F6652;line-height: 30px;}
  2678. #shiyi_content .pz ruby rtc {font-size: 12px;color: #8F6652;line-height: 30px;}
  2679. #shiyi_content ruby > rt, ruby > rbc + rtc {display: table-header-group;font-size: 60%;line-height: 40%;letter-spacing: 0;}
  2680. #shiyi_content ruby > rbc + rtc + rtc {display: table-footer-group;font-size: 60%;line-height: 40%;letter-spacing: 0;}
  2681. #shiyi_content ol, ul {list-style-type: none;}
  2682. #shiyi_content .gnr .gycd {line-height: 1.5;padding-bottom: 5px;}
  2683. #shiyi_content .gnr .gc_uono {list-style: outside none none;text-indent: 2em;}
  2684. #shiyi_content .gnr .def {margin: 5px 0 5px;line-height: 1.6em;}
  2685. #shiyi_content .gnr .gc_sy {clear: both;display: block;margin-bottom: 2pt;}
  2686. #shiyi_content .gnr .gc_lz {clear: both;display: block;}
  2687. #shiyi_content .gnr .gc_fy, .gc_jy {clear: both;display: block;font-size: 85%;margin-top: 2px;font-weight: 700;color: #666;}
  2688. #shiyi_content .gnr .gc_jfy_i {background-color: #633;border-radius: 4px;color: white;font-size: 100%;line-height: 1;padding: 2px;margin-right: 5px;}
  2689. #shiyi_content .page .copyright {color: gray;font-size: small;margin-top: 10px;}
  2690. #shiyi_content .contentslot, .mpuslot_b {margin-top: 20px;text-align: center;}
  2691. #shiyi_content .nr-box-shiyi.wljs {border-right: solid 4px #aea4a4;}
  2692. #shiyi_content .page .zdict .definitions, .page .zdict .derivs, .page .zdict .etyms {margin-bottom: 1em;}
  2693. #shiyi_content .cnr h3 {color: #660000;font-size: 16px;line-height: 2em;font-weight: bold;}
  2694. #shiyi_content .jnr, .bknr, .wknr {margin: .5em;line-height: 1.5em;}
  2695. #shiyi_content .cnr li {counter-increment: li;}
  2696. #shiyi_content .jnr ol {list-style: none;counter-reset: li;}
  2697. #shiyi_content .jnr li {counter-increment: li;}
  2698. #shiyi_content .dichr {margin-top: 5px;width: 100%;clear: both;color: #af9a87;border-bottom: solid 1px;}
  2699. #shiyi_content .enbox {padding: 10px 0 5px 0;border-top: 1px solid #efe3e3;margin: 5px;background:transparent;}
  2700. #shiyi_content .jnr p {margin-bottom: .5em;line-height: 1.5em;}
  2701. #shiyi_content .enbox p {font-size: 14px;color: #327311;}
  2702. #shiyi_content .wytl{display:none;}
  2703. </style>
  2704. `;
  2705. }
  2706.  
  2707. googleTranslatorByToprapid_Main();