// ==UserScript== // @name 扇贝单词小助手 // @namespace http://tampermonkey.net/ // @version 1.8.15 // @homepageURL https://greasyfork.org/zh-CN/scripts/419996-%E6%89%87%E8%B4%9D%E5%8D%95%E8%AF%8D%E5%B0%8F%E5%8A%A9%E6%89%8B // @description 数字小键盘快捷键,数字键3:US发音,数字键4:UK发音,数字5:扇贝单词与柯林斯词典的切换,数字6:例句发音,数字7:真题例句发音,数字0:隐藏展示柯林斯词典中的英文,专注模式,让你更专注背单词,黑暗模式,更护眼。显示/隐藏扇贝例句和柯林斯例句中文翻译的按钮,并关联数字键8 // @author ddrrcc // @match https://web.shanbay.com/wordsweb/* // @grant GM_info // @grant GM_setValue // @grant GM_getValue // @connect greasyfork.org // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @icon https://static.baydn.com/static/img/shanbay_favicon.png // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js // @require https://cdn.bootcdn.net/ajax/libs/toastr.js/latest/js/toastr.min.js // @require https://cdn.bootcdn.net/ajax/libs/limonte-sweetalert2/10.12.5/sweetalert2.all.min.js // @grant unsafeWindow // @downloadURL none // ==/UserScript== (function(){function a(a){$(".BayTrans_paraphrase__2JMIz,.CollinsTrans_pos__3szum,.CollinsTrans_paraphraseList__3SZ3y > li > span:nth-child(3),.index_name__1gkfJ").css({"font-size":a+`px`,"font-weight":"bold"})}function b(){document.webkitIsFullScreen||($(".Nav_nav__3kyeO").show(),$(".Nav_container__sBZA1").show(),$(".SubNav_itemsWrapper__1mM4u").show(),toastr.warning("\u9000\u51FA\u4E13\u6CE8\u6A21\u5F0F\uFF0C\u4E0D\u8981\u88AB\u5916\u754C\u5E72\u6270\u54DF\uFF01\u5EFA\u8BAE\u5F00\u542F\u4E13\u6CE8\u6A21\u5F0F\uFF01"))}function c(){$(".Nav_nav__3kyeO").hide(),$(".Nav_container__sBZA1").hide(),$(".SubNav_itemsWrapper__1mM4u").hide(),toastr.success("\u8FDB\u5165\u4E13\u6CE8\u6A21\u5F0F\uFF0C\u66F4\u4E13\u6CE8\u4E8E\u80CC\u5355\u8BCD\uFF01");let a=document.documentElement,b=a.requestFullScreen||a.webkitRequestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen;if(b)b.call(a);else if("undefined"!=typeof window.ActiveXObject){let a=new ActiveXObject("WScript.Shell");null!=a&&a.SendKeys("{F11}")}}function d(){$(".Nav_nav__3kyeO").show(),$(".Nav_container__sBZA1").show(),$(".SubNav_itemsWrapper__1mM4u").show(),toastr.warning("\u9000\u51FA\u4E13\u6CE8\u6A21\u5F0F\uFF0C\u4E0D\u8981\u88AB\u5916\u754C\u5E72\u6270\u54DF\uFF01\u5EFA\u8BAE\u5F00\u542F\u4E13\u6CE8\u6A21\u5F0F\uFF01");let a=document,b=a.cancelFullScreen||a.mozCancelFullScreen||a.msExitFullscreen||a.webkitExitFullscreen||a.exitFullscreen;if(b)b.call(a);else if("undefined"!=typeof window.ActiveXObject){let a=new ActiveXObject("WScript.Shell");null!=a&&a.SendKeys("{F11}")}}function e(){const a=document.createElement("style");a.id="theme-css-dark",a.innerHTML=` html{filter: invert(100%) hue-rotate(180deg);scrollbar-width: none;} ::-webkit-scrollbar{display:none} img,video {filter: invert(100%) hue-rotate(180deg);}`,document.querySelector("head").appendChild(a)}function f(){document.querySelector("#theme-css-dark").remove()}function g(){let b=new MutationObserver(function(b){b.forEach(function(){if(n=o.getValue("current_val"),$(".index_exampleEN__3OIEA,.index_sentenceEn__1Qjgx").after(""),GM_getValue("check2")&&$(".btn.btn-primary.btn-xs").next().hide(),$(".btn.btn-primary.btn-xs").click(a=>{var b=$(a.target);b.next().toggle()}),$(".BayTrans_paraphrase__2JMIz > p").css({"font-size":`inherit`}),a(n),GM_getValue("check")&&$(".CollinsTrans_senseEn__17oYf").hide(),GM_getValue("check3")){var b=$(".index_tab__37Cha.index_active__1bHoy").html();j=b==$(".index_tabNavs__3tWev:eq(0) > p:eq(1)").html(),j&&$(".index_audio__1mSVg:first > img").click()}$(".AppletTip_close__2lEIB").click()})});b.observe($(".StudyPage_studyPage__1Ri5C").get(0),{childList:!0})}var h=Math.abs;$(document.head).append(``),$(document.head).append(``);var i,j;const k=GM_info.script.version,l=GM_info.script.homepage,m=GM_info.script.name;var n;let o={getValue(a){return GM_getValue(a)},setValue(a,b){GM_setValue(a,b)}};({initValue(){[{name:"current_val",value:15},{name:"has_init",value:!1}].forEach(a=>{o.getValue(a.name)===void 0&&o.setValue(a.name,a.value)})},showSetting(){Swal.fire({title:"\u8BF7\u9009\u62E9\u5B57\u4F53\u5927\u5C0F",icon:"info",input:"range",showCancelButton:!0,confirmButtonText:"\u4FDD\u5B58",cancelButtonText:"\u8FD8\u539F",showCloseButton:!0,inputLabel:"\u62D6\u52A8\u6ED1\u5757\u89C2\u5BDF\u5B57\u4F53\u5927\u5C0F\u53D8\u5316",inputAttributes:{min:15,max:25,step:.1},footer:"
最新版本:${b}
`,footer:"\u4FDD\u6301\u6700\u65B0\u7248\u672C\uFF0C\u66F4\u597D\u7684\u4F53\u9A8C",confirmButtonText:"\u66F4\u65B0"}).then(b=>{b.value&&(window.open("https://greasyfork.org/"+$(a.response).find(".install-link").attr("href"),"_self"),setTimeout(()=>{Swal.fire({icon:"success",title:"\u63D0\u793A",allowOutsideClick:!1,allowEscapeKey:!1,html:"\u66F4\u65B0\u540E\uFF0C\u8BF7\u70B9\u51FB\u5237\u65B0",footer:"\u70B9\u51FB\u5237\u65B0\uFF0C\u52A0\u8F7D\u6700\u65B0\u7248\u672C",confirmButtonText:"\u5237\u65B0"}).then(a=>{a.value&&window.location.reload()})},500))})}})}()})();