diff --git a/README.md b/README.md index b495684..26692a2 100644 --- a/README.md +++ b/README.md @@ -25,23 +25,20 @@ Legacy | [(GitHub) Install](https://github.com/magicoflolis/twitter-translator/r > The menu and CSS have been compressed to reduce file size. Comments can be found under `src/main.js` on GitHub. -* [ Script ] Support for External & Internal Translators! -* [ Menu ] Config Menu! -* [ Menu ] Multiple language support! -* [ Menu ] Support for matching Twitter colors -* [ Menu ] Support for matching Twitter theme -* [ Site ] Support for [TwitLonger](https://www.twitlonger.com) -* [ Site ] Support for [TweetDeck](https://tweetdeck.twitter.com) -* [ Site ] Support for every [Nitter](https://github.com/zedeus/nitter/wiki/Instances#official-instances) -* [ Script ] Now works while logged out! -* [ Script ] Added "Restore to Defaults" button. -* [ Site ] Added mobile.twitter.com -* [ Menu ] Will automatically default to current sites theme. -* [ Menu ] Will automatically select the current language of the site. -* Each [ WIP ] is functional. -* [ WIP ] Every theme can be applied to any site! +* Support for External & Internal Translators! +* Multi language Config menu! +* Multi language Translator support! +* Colors and themes can be customized. +* Automatically match websites Theme +* Automatically match websites Language +* Supports mobile [Twitter](https://mobile.twitter.com/) +* Supports [TwitLonger](https://www.twitlonger.com) +* Supports [TweetDeck](https://tweetdeck.twitter.com) +* Supports every [Nitter](https://github.com/zedeus/nitter/wiki/Instances#official-instances) +* Support for multiple Bios / Tweets on websites! +* [ Misc ] Works while logged out! +* [ Misc ] "Restore to Defaults" button. * [ WIP ] Added help for each menu item. -* [ WIP ] Reworked the menus CSS. ### Supported @@ -63,14 +60,12 @@ Yandex Translate | ✅ |[link](https://translate.yandex.com/)| ❌ | ## Bugs / Issues * [ User Script ] *May* conflict with [Magic Userscript+ : Show Site All UserJS](https://greasyfork.org/scripts/421603). -* [ Script ] *Sometimes* "Translate tweet" won't appear on Twitter. (Clicking a picture and opening the right sidebar to view the Tweet & Replies) * [ Translator ] MyMemory API doesn't work in Bios. * [ Menu ] Cannot be moved or disabled. ( WIP ) **Footnotes:** * [ Translator ] Twitters built-in translation uses Google Translate, TweetDeck uses Bing Microsoft Translator. -* [ TweetDeck ] Only appears in one column. * [ Translator ] Yandex Translate may default to Russian. ![YandexHelp](https://raw.githubusercontent.com/magicoflolis/twitter-translator/master/assets/ExternalTranslator4.gif) @@ -89,6 +84,5 @@ Yandex Translate | ✅ |[link](https://translate.yandex.com/)| ❌ | * Fix any bugs along the way. * Automatically match Twitter colors. * Show multiple translators at once. -* Show multiple on TweetDeck. * Support for direct messages. * Support more translators. diff --git a/dist/css/twittertranslator.css b/dist/css/twittertranslator.css index 6cae4bf..e7da108 100644 --- a/dist/css/twittertranslator.css +++ b/dist/css/twittertranslator.css @@ -1 +1 @@ -#tetMenuButton>span{color:#fff !important}#tetSelector>select{background-color:transparent;border:transparent}#tetSelector>select:focus{box-shadow:none !important}.tet-at span{color:#6e767d}.navbackground.d1tet{background-color:rgba(91,112,131,.4)}.navbackground.d2tet{background-color:rgba(0,0,0,.4)}.navbackground.d3tet{background-color:rgba(91,112,131,.4)}.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:transparent}.r-demo.r-14lw9ot,.tet-help-container.r-14lw9ot,#apifield.r-14lw9ot,#tetSelector.r-14lw9ot{border-color:#536471}.r-demo.r-yfoy6g,.tet-help-container.r-yfoy6g,#apifield.r-yfoy6g,#tetSelector.r-yfoy6g{border-color:#38444d}.r-demo.nitter,.r-demo.r-tetTD,.r-demo.r-kemksi,.tet-help-container.nitter,.tet-help-container.r-tetTD,.tet-help-container.r-kemksi,#apifield.nitter,#apifield.r-tetTD,#apifield.r-kemksi,#tetSelector.nitter,#tetSelector.r-tetTD,#tetSelector.r-kemksi{border-color:#2f3336}.r-14lw9ot>div#tetName span{color:#536471}.r-kemksi>div#tetName span,.r-yfoy6g>div#tetName span{color:#6e767d}.tetBtn.nitter{border:transparent}.Button--primary{border-color:#1da1f2;box-shadow:#1da1f2 0px 0px 0px 1px}.r-tetTD{border-radius:14px;background-color:#15202b}.r-tetTD #tetName span{color:#8899a6}.prf-header>div>.tet.tet-td{color:#fff !important}.tet-td{color:#1da1f2}.tet-td#tetName{color:#1da1f2 !important}.tet-td#tetName span{color:inherit !important}.tet-td.tet{color:#8899a6}.r-hoverTD{background-color:#005fd1}.tet-border-black{border-color:#000}.r-9ilb82{color:#6e767d}.r-1kqtdi0{border-color:#2f3336}.r-urgr8i{background-color:#1d9bf0}.r-p1n3y5{border-color:#1d9bf0 !important}.r-1q3imqu{background-color:#1a91da}.r-1bih22f{box-shadow:#1da1f2 0px 0px 0px 1px}.tetBtn.tweetdeck{background-color:#1da1f2;color:#fff}.tetBtn.tweetdeck#tetName{color:#1da1f2}.tetBtn.tweetdeck#tetName span{color:inherit !important}.r-13gxpu9{color:#1d9bf0}.r-13gxpu9#tetName{color:#1d9bf0 !important}.r-13gxpu9#tetName span{color:inherit !important}.r-1vkxrha{background-color:#ffd400}.r-v6khid{border-color:#ffd400 !important}.r-61mi1v{color:#ffd400}.r-61mi1v#tetName{color:#ffd400 !important}.r-61mi1v#tetName span{color:inherit !important}.r-1kplyi6{background-color:#e69c1c}.r-cdj8wb{box-shadow:#ffad1f 0px 0px 0px 1px}.r-1dgebii{background-color:#f91880}.r-1iofnty{border-color:#f91880 !important}.r-daml9f{color:#f91880}.r-daml9f#tetName{color:#f91880 !important}.r-daml9f#tetName span{color:inherit !important}.r-1ucxkr8{background-color:#ca2055}.r-jd07pc{box-shadow:#e0245e 0px 0px 0px 1px}.r-168457u{background-color:#7856ff}.r-njt2r9{background-color:#865dca}.r-hy56xe{border-color:#7856ff !important}.r-11mmphe{box-shadow:#794bc4 0px 0px 0px 1px}.r-xfsgu1{color:#7856ff}.r-xfsgu1#tetName{color:#7856ff !important}.r-xfsgu1#tetName span{color:inherit !important}.r-18z3xeu{background-color:#ff7a00}.r-1kplyi6{background-color:#dc541f}.r-1xl5njo{border-color:#ff7a00 !important}.r-b8m25f{box-shadow:#f45d22 0px 0px 0px 1px}.r-1qkqhnw{color:#ff7a00}.r-1qkqhnw#tetName{color:#ff7a00 !important}.r-1qkqhnw#tetName span{color:inherit !important}.r-b5skir{background-color:#00ba7c}.r-zx61xx{background-color:#15ac59}.r-5ctkeg{border-color:#00ba7c !important}.r-1cqwhho{box-shadow:#17bf63 0px 0px 0px 1px}.r-nw8l94{color:#00ba7c}.r-nw8l94#tetName{color:#00ba7c !important}.r-nw8l94#tetName span{color:inherit !important}.r-yfoy6g{background-color:#15202b}.r-14lw9ot{background-color:#fff}.r-kemksi{background-color:#000}.r-18jsvk2{color:#0f1419}.r-demo{border-style:solid !important;border-radius:16px !important;border-width:1px !important}.r-jwli3a{color:#fff}.tetNitterHover{background-color:#ff6c60}.tetNitter{border-color:#ffaca0 !important;box-shadow:#ffaca0 0px 0px 0px 1px !important}.tetBtn.nitter{color:#fff;background-color:#ff6c60}h1.tetNTextColor{color:#888889}.nitter{border-color:#ff6c60;background-color:#0f0f0f}.nitter div#tetName span{color:#ff6c60}input.tetNTextColor,select.tetNTextColor,div.tetNTextColor,svg.tetNTextColor,label.tetNTextColor>span{color:#f8f8f2}.tetNText span{color:#ff6c60 !important}.tetNBackground{background-color:#161616}.btNav,.txt-s0pan,.txt-s1pan,.tet-av,.tetAlertBtns>div{align-items:center !important}#tetName,.r-demo,#tetadvanced,#tethelper,.tetAlertTxt,.tet-header{cursor:default}.txt-s0pan{flex-shrink:1;max-width:100%;flex-direction:inherit !important}.txt-s0pan .txt-s1pan{max-width:inherit !important;flex-direction:inherit !important;white-space:normal !important}.txt-s0pan .txt-s1pan>div{white-space:inherit !important}.txt-s0pan,.tetAlertBtns,.r-demo,.tet-av,.r-hover,#apifield{outline-style:none !important}.txt-s1pan>div,.tet-dc,.tet-at,.tethelper-info,.tethelper-header,.tetAlertTxt,.tet-info,.tetAlertBtns>div,#tetSelector>select{font-size:15px !important}.txt-s1pan>div,h1.tetAlertTxt,.tetAlertBtns>div,.tethelper-header{font-weight:700 !important}.tet,#tetDemo,.tet-dc,.tet-at,.tethelper-info,div.tetAlertTxt,.tet-info,.tet-icon-info,#tweet-text,#tetSelector>#tetName{font-weight:400}.tet,#tetDemo,.tetswitch>label,#tetSelector>#tetName{line-height:16px}.tet-sp1an>div,.tet-at{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tet-dc,.txt-s1pan>div,.tet-header,#tetSelector>#tetName,#tetSelector>select{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}.tet,#tweet-text,.tetAlertTxt span,.tetAlertBtns>div,.tet-main{font-family:"TwitterChirp",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}div.tetAlertTxt,.tet-info,.tet-dc,.tet-at,.tethelper-info,.tetAlertBtns>div,.txt-s1pan>div,#tetSelector>select{line-height:20px}.tetAvatarFrame,#tetAvatar{align-items:stretch;border:0px solid #000;box-sizing:border-box;display:flex;flex-basis:auto;flex-direction:column;flex-shrink:0;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;z-index:0}#tetSelector{min-width:0px;overflow-wrap:break-word}#tetSelector #tetName{min-width:0px;position:absolute;overflow-wrap:break-word}.tet,.tet-info,#tweet-text{margin-top:1% !important}#tweet-text,.tet-demoframe{position:relative}.tetAlertTxt{text-align:center}.tet{flex-wrap:wrap;font-size:13px;overflow-wrap:break-word;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-min-content;height:-moz-min-content;height:min-content;display:flex}.tetAvatarFrame{padding-bottom:100%;width:100%;display:block;z-index:0;position:absolute;top:0px;right:0px;left:0px;bottom:0px}.tetAvatarFrame #tetAvatar{background-image:url("https://abs.twimg.com/favicons/twitter.ico");background-size:cover;background-repeat:no-repeat;background-position:center center;z-index:-1;background-color:rgba(0,0,0,0);height:100%;width:100%;position:absolute}.tet-main{padding:0px 32px 32px 32px !important;flex-shrink:1;flex-grow:1;width:100%;margin-left:auto;margin-right:auto}.tet-options{display:inline-grid;grid-template-rows:1fr 1fr 1fr}.tet-header{min-width:0px;text-align:center;white-space:normal;display:grid;margin:32px 0px 12px 0px !important}.tet-header .tet-info-name{line-height:28px;font-size:23px;font-weight:800}.tet-header .tet-info{color:#6e767d}.tetAlert{right:0px;left:0px;bottom:0px;position:fixed !important;z-index:10000 !important}.tetAlert h1.tetAlertTxt{line-height:24px;font-size:20px;min-width:0px}.tetAlert h1.tetAlertTxt span{font-family:inherit}.tetAlert .tetAlertTxt span{white-space:normal;text-align:center;overflow-wrap:break-word}.tetAlert div.tetAlertTxt{min-width:0px;width:100%}.tetAlert .tetConfirmation{width:20%;border-radius:16px;left:40%;top:40%;position:fixed}.tetAlert .tetAlertBtns{margin:2% 25% 2% 25%;white-space:nowrap;transition-property:background-color,box-shadow;transition-duration:.2s;flex-grow:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-color:rgba(0,0,0,0);overflow:hidden;border-width:1px;border-style:solid;cursor:pointer}.tetAlert .tetAlertBtns:nth-child(2){margin:0px 25% 4% 25%}.tetAlert .tetAlertBtns>div{overflow-wrap:break-word;min-width:0px;justify-content:center;flex-grow:1;flex-direction:row;text-align:center;display:flex}.tetAlert .tetAlertBtns>div>span{line-height:inherit !important;overflow-wrap:break-word;min-width:0px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0px solid #000;box-sizing:border-box;display:inline;margin:0px;padding:0px}.tetAlert .tetAlertBtns>div>span>span{border:0px solid #000;box-sizing:border-box;display:inline;margin:0px;padding:0px}#tetForm,#tetadvanced,#tethelper{border-radius:16px}#tetForm>div,#tetadvanced>div,#tethelper>div{border-radius:16px;flex-grow:1;flex-shrink:1}#tetForm .tetBackground .tetTextColor,#tetadvanced .tetBackground .tetTextColor,#tethelper .tetBackground .tetTextColor{overflow-wrap:break-word}#tetForm .tetBackground .tetTextColor span,#tetadvanced .tetBackground .tetTextColor span,#tethelper .tetBackground .tetTextColor span{overflow-wrap:break-word}#tetForm{max-width:80vw;max-height:90vh;min-width:600px !important;flex-shrink:1;overflow:hidden}#tetForm .tet-containter{width:100%}#tetForm .tet-containter.tet-fg{margin-left:auto;margin-right:auto}#tetadvanced,#tethelper{max-width:90vw;max-height:90vh;min-width:500px;min-height:100px;flex-shrink:1;margin-left:1%;margin-right:1%}.tet-container{overflow:auto !important}.tethelper-header{white-space:nowrap;line-height:23px !important;min-width:0px}.tetadvanced-container section.tetcheckbox>label,.tetadvanced-container section.tetselect{display:flex;justify-content:space-between;padding:.825em}.tetadvanced-container section.tetcheckbox>label{cursor:pointer}.tetadvanced-container .tetswitch{position:relative;width:38px;-webkit-user-select:none !important;-moz-user-select:none !important;-ms-user-select:none !important;user-select:none !important;margin:5px}.tetadvanced-container .tetswitch>input{display:none}.tetadvanced-container .tetswitch>label{display:block;overflow:hidden;cursor:pointer;height:16px;padding:0;border-radius:20px;border:1px solid #000;background-color:#464646}.tetadvanced-container .tetswitch>label:before{content:"";display:block;width:20px;height:20px;margin:-2px;background:#dadce0;position:absolute;top:0;right:20px;border-radius:20px}.tetadvanced-container .tetswitch>input:checked+label{margin-left:0;background-color:rgba(29,160,242,.384)}.tetadvanced-container .tetswitch>input:checked+label:before{right:0px;background-color:#1d9bf0}.tet-head,.tet-dc>span,.tet-demotext,.tetTextColor span,.tetConfirmation span,#tetName span,#tweet-text>span,#tetMenuButton>span{color:inherit;font:inherit;font-family:inherit;white-space:inherit;overflow-wrap:break-word}option[disabled=""],.rm,button:not(.mini)>#tetSVG,button.mini>span{display:none !important}.tetFreeze{overflow:hidden !important;-ms-scroll-chaining:none !important;overscroll-behavior:none !important}#tetMenuButton{z-index:10;width:8vw;height:auto;position:fixed;top:65%;left:0px}#tetMenuButton.tetTD{left:90% !important;top:0% !important}#tetMenuButton>svg{position:relative;max-width:100%;height:1.25em;fill:currentcolor;margin-right:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;right:35% !important}#tetMenuButton,.tetAlertBtns,#tetReload,#tetReset{list-style:none;text-align:inherit;text-decoration:none;border-radius:15px;justify-content:center;display:flex !important;font-family:inherit !important;font-size:20px !important;font-weight:bold !important;padding:0px !important;outline:none !important}button.tetBtn.mini{border:transparent !important;background:transparent !important}#tetMenuButton,.tetAlertBtns,#tetReload,#tetReset,#tet,.tet{cursor:pointer !important}.tet.tet-td{display:inherit}#tet{justify-items:center}#apifield{width:initial}#apifield,#tetName,#tetSelector>select{padding-left:2% !important}#apifield,#tetSelector{border-radius:4px;border-width:1px;margin:2% 6% 0px 6%}#tetSelector>select{text-align:left;padding-top:12px;padding-right:0px;padding-bottom:0px;cursor:pointer;border-radius:0px;margin:0px;-webkit-appearance:none;-moz-appearance:none;appearance:none}#tetReload,#tetReset{margin:2% 25% 0px 25%}.r-demo{margin:0px 32px 0px 32px !important;padding:12px 0px 12px 0px !important;overflow:hidden;flex-direction:row !important;flex-shrink:1;flex-grow:1}.r-demo .tet-av{width:100%;margin:2px 12px 0px 12px !important;flex-grow:0;flex-shrink:1;flex-basis:48px;height:48px;overflow:hidden;display:block}.r-demo .tet-txt{flex-basis:0px;flex-grow:1;justify-content:center}.r-demo .tet-txt .txt-header{margin-bottom:2px;align-items:start;justify-content:space-between;flex-direction:row;max-width:100%}.r-demo .tet-txt .txt-header .tet-at{display:flex;margin-left:4px;overflow-wrap:break-word;min-width:0px}#tetDemo{margin:4px 0px 0px 0px;font-size:13px;flex-wrap:wrap;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;min-width:0px;display:flex !important}.btNav{justify-content:center !important;flex-direction:row !important;top:0px !important}.btNav a,.btNav :link{text-decoration:none !important}.btNav a:hover,.btNav :link:hover{text-decoration:none !important}.btNav span{font-family:inherit}.btNav,.navbackground{position:fixed !important;width:100vw;height:100vh}.navbackground{top:0;left:0}.navbackground.warn{z-index:10 !important}.tet-icon-container,.tetadvanced-icon-container{cursor:pointer;display:inline-flex;position:absolute;bottom:10px;text-align:center;border-radius:9999px;z-index:1}.tet-icon-container{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:35px;right:10px}.tet-icon-container .tet-icon-info{color:#fff;display:inline;width:35px;height:35px;line-height:35px;border-radius:inherit;font-family:"fontello";font-size:23px}.tet-icon-container .tet-help-container{position:static;border-style:solid;border-width:2px;border-radius:inherit;line-height:35px;font-size:16px;font-weight:normal;text-decoration:none;margin-left:10px}.tet-icon-container .tet-help-container a{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:inline-block;margin-left:10px;margin-right:10px}.tetadvanced-icon-container{left:10px;width:28px;height:28px}.tetadvanced-icon-container .tetadvanced-icon{height:1.75rem;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;max-width:100%;fill:currentcolor;border-radius:inherit;display:inline-block}.mini{min-height:3% !important;overflow:hidden;background:transparent;border-color:transparent}.r-hover{-webkit-text-decoration-line:underline !important;text-decoration-line:underline !important}#tweet-text{font-size:23px !important;line-height:28px !important} +#tetMenuButton>span{color:#fff !important}#tetSelector>select{background-color:rgba(0,0,0,0);border:rgba(0,0,0,0)}#tetSelector>select:focus{box-shadow:none !important}.tet-at span{color:#6e767d}.navbackground.d1tet{background-color:rgba(91,112,131,.4)}.navbackground.d2tet{background-color:rgba(0,0,0,.4)}.navbackground.d3tet{background-color:rgba(91,112,131,.4)}.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:rgba(0,0,0,0)}.r-demo.r-14lw9ot,.tet-help-container.r-14lw9ot,#apifield.r-14lw9ot,#tetSelector.r-14lw9ot{border-color:#536471}.r-demo.r-yfoy6g,.tet-help-container.r-yfoy6g,#apifield.r-yfoy6g,#tetSelector.r-yfoy6g{border-color:#38444d}.r-demo.nitter,.r-demo.r-tetTD,.r-demo.r-kemksi,.tet-help-container.nitter,.tet-help-container.r-tetTD,.tet-help-container.r-kemksi,#apifield.nitter,#apifield.r-tetTD,#apifield.r-kemksi,#tetSelector.nitter,#tetSelector.r-tetTD,#tetSelector.r-kemksi{border-color:#2f3336}.r-14lw9ot>div#tetName span{color:#536471}.r-kemksi>div#tetName span,.r-yfoy6g>div#tetName span{color:#6e767d}.tetBtn.nitter{border:rgba(0,0,0,0)}.Button--primary{border-color:#1da1f2;box-shadow:#1da1f2 0px 0px 0px 1px}.r-tetTD{border-radius:14px;background-color:#15202b}.r-tetTD #tetName span{color:#8899a6}.prf-header>div>.tet.tet-td{color:#fff !important}.tet-td{color:#1da1f2}.tet-td#tetName{color:#1da1f2 !important}.tet-td#tetName span{color:inherit !important}.tet-td.tet{color:#8899a6}.r-hoverTD{background-color:#005fd1}.tet-border-black{border-color:#000}.r-9ilb82{color:#6e767d}.r-1kqtdi0{border-color:#2f3336}.r-urgr8i{background-color:#1d9bf0}.r-p1n3y5{border-color:#1d9bf0 !important}.r-1q3imqu{background-color:#1a91da}.r-1bih22f{box-shadow:#1da1f2 0px 0px 0px 1px}.tetBtn.tweetdeck{background-color:#1da1f2;color:#fff}.tetBtn.tweetdeck#tetName{color:#1da1f2}.tetBtn.tweetdeck#tetName span{color:inherit !important}.r-13gxpu9{color:#1d9bf0}.r-13gxpu9#tetName{color:#1d9bf0 !important}.r-13gxpu9#tetName span{color:inherit !important}.r-1vkxrha{background-color:#ffd400}.r-v6khid{border-color:#ffd400 !important}.r-61mi1v{color:#ffd400}.r-61mi1v#tetName{color:#ffd400 !important}.r-61mi1v#tetName span{color:inherit !important}.r-1kplyi6{background-color:#e69c1c}.r-cdj8wb{box-shadow:#ffad1f 0px 0px 0px 1px}.r-1dgebii{background-color:#f91880}.r-1iofnty{border-color:#f91880 !important}.r-daml9f{color:#f91880}.r-daml9f#tetName{color:#f91880 !important}.r-daml9f#tetName span{color:inherit !important}.r-1ucxkr8{background-color:#ca2055}.r-jd07pc{box-shadow:#e0245e 0px 0px 0px 1px}.r-168457u{background-color:#7856ff}.r-njt2r9{background-color:#865dca}.r-hy56xe{border-color:#7856ff !important}.r-11mmphe{box-shadow:#794bc4 0px 0px 0px 1px}.r-xfsgu1{color:#7856ff}.r-xfsgu1#tetName{color:#7856ff !important}.r-xfsgu1#tetName span{color:inherit !important}.r-18z3xeu{background-color:#ff7a00}.r-1kplyi6{background-color:#dc541f}.r-1xl5njo{border-color:#ff7a00 !important}.r-b8m25f{box-shadow:#f45d22 0px 0px 0px 1px}.r-1qkqhnw{color:#ff7a00}.r-1qkqhnw#tetName{color:#ff7a00 !important}.r-1qkqhnw#tetName span{color:inherit !important}.r-b5skir{background-color:#00ba7c}.r-zx61xx{background-color:#15ac59}.r-5ctkeg{border-color:#00ba7c !important}.r-1cqwhho{box-shadow:#17bf63 0px 0px 0px 1px}.r-nw8l94{color:#00ba7c}.r-nw8l94#tetName{color:#00ba7c !important}.r-nw8l94#tetName span{color:inherit !important}.r-yfoy6g{background-color:#15202b}.r-14lw9ot{background-color:#fff}.r-kemksi{background-color:#000}.r-18jsvk2{color:#0f1419}.r-demo{border-style:solid !important;border-radius:16px !important;border-width:1px !important}.r-jwli3a{color:#fff}.tetNitterHover{background-color:#ff6c60}.tetNitter{border-color:#ffaca0 !important;box-shadow:#ffaca0 0px 0px 0px 1px !important}.tetBtn.nitter{color:#fff;background-color:#ff6c60}h1.tetNTextColor{color:#888889}.nitter{border-color:#ff6c60;background-color:#0f0f0f}.nitter div#tetName span{color:#ff6c60}input.tetNTextColor,select.tetNTextColor,div.tetNTextColor,svg.tetNTextColor,label.tetNTextColor>span{color:#f8f8f2}.tetNText span{color:#ff6c60 !important}.tetNBackground{background-color:#161616}.btNav,.txt-s0pan,.txt-s1pan,.tet-av,.tetAlertBtns>div{align-items:center !important}#tetName,.r-demo,#tetadvanced,#tethelper,.tetAlertTxt,.tet-header{cursor:default}.txt-s0pan{flex-shrink:1;max-width:100%;flex-direction:inherit !important}.txt-s0pan .txt-s1pan{max-width:inherit !important;flex-direction:inherit !important;white-space:normal !important}.txt-s0pan .txt-s1pan>div{white-space:inherit !important}.txt-s0pan,.tetAlertBtns,.r-demo,.tet-av,.r-hover,#apifield{outline-style:none !important}.txt-s1pan>div,.tet-dc,.tet-at,.tethelper-info,.tethelper-header,.tetAlertTxt,.tet-info,.tetAlertBtns>div,#tetSelector>select{font-size:15px !important}.txt-s1pan>div,h1.tetAlertTxt,.tetAlertBtns>div,.tethelper-header{font-weight:700 !important}.tet,#tetDemo,.tet-dc,.tet-at,.tethelper-info,div.tetAlertTxt,.tet-info,.tet-icon-info,#tweet-text,#tetSelector>#tetName{font-weight:400}.tet,#tetDemo,.tetswitch>label,#tetSelector>#tetName{line-height:16px}.tet-sp1an>div,.tet-at{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tet-dc,.txt-s1pan>div,.tet-header,#tetSelector>#tetName,#tetSelector>select{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}.tet,#tweet-text,.tetAlertTxt span,.tetAlertBtns>div,.tet-main{font-family:"TwitterChirp",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}div.tetAlertTxt,.tet-info,.tet-dc,.tet-at,.tethelper-info,.tetAlertBtns>div,.txt-s1pan>div,#tetSelector>select{line-height:20px}.tetAvatarFrame,#tetAvatar{align-items:stretch;border:0px solid #000;box-sizing:border-box;display:flex;flex-basis:auto;flex-direction:column;flex-shrink:0;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;z-index:0}#tetSelector{min-width:0px;overflow-wrap:break-word}#tetSelector #tetName{min-width:0px;position:absolute;overflow-wrap:break-word}.tet,.tet-info,#tweet-text{margin-top:1% !important}#tweet-text,.tet-demoframe{position:relative}.tetAlertTxt{text-align:center}.tet{flex-wrap:wrap;font-size:13px;overflow-wrap:break-word;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-min-content;height:-moz-min-content;height:min-content;display:flex}.tetAvatarFrame{padding-bottom:100%;width:100%;display:block;z-index:0;position:absolute;top:0px;right:0px;left:0px;bottom:0px}.tetAvatarFrame #tetAvatar{background-image:url("https://abs.twimg.com/favicons/twitter.ico");background-size:cover;background-repeat:no-repeat;background-position:center center;z-index:-1;background-color:rgba(0,0,0,0);height:100%;width:100%;position:absolute}.tet-main{padding:0px 32px 32px 32px !important;flex-shrink:1;flex-grow:1;width:100%;margin-left:auto;margin-right:auto}.tet-options{display:inline-grid;grid-template-rows:1fr 1fr 1fr}.tet-header{min-width:0px;text-align:center;white-space:normal;display:grid;margin:32px 0px 12px 0px !important}.tet-header .tet-info-name{line-height:28px;font-size:23px;font-weight:800}.tet-header .tet-info{color:#6e767d}.tetAlert{right:0px;left:0px;bottom:0px;position:fixed !important;z-index:10000 !important}.tetAlert h1.tetAlertTxt{line-height:24px;font-size:20px;min-width:0px}.tetAlert h1.tetAlertTxt span{font-family:inherit}.tetAlert .tetAlertTxt span{white-space:normal;text-align:center;overflow-wrap:break-word}.tetAlert div.tetAlertTxt{min-width:0px;width:100%}.tetAlert .tetConfirmation{width:20%;border-radius:16px;left:40%;top:40%;position:fixed}.tetAlert .tetAlertBtns{margin:2% 25% 2% 25%;white-space:nowrap;transition-property:background-color,box-shadow;transition-duration:.2s;flex-grow:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-color:rgba(0,0,0,0);overflow:hidden;border-width:1px;border-style:solid;cursor:pointer}.tetAlert .tetAlertBtns:nth-child(2){margin:0px 25% 4% 25%}.tetAlert .tetAlertBtns>div{overflow-wrap:break-word;min-width:0px;justify-content:center;flex-grow:1;flex-direction:row;text-align:center;display:flex}.tetAlert .tetAlertBtns>div>span{line-height:inherit !important;overflow-wrap:break-word;min-width:0px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0px solid #000;box-sizing:border-box;display:inline;margin:0px;padding:0px}.tetAlert .tetAlertBtns>div>span>span{border:0px solid #000;box-sizing:border-box;display:inline;margin:0px;padding:0px}#tetForm,#tetadvanced,#tethelper{border-radius:16px}#tetForm>div,#tetadvanced>div,#tethelper>div{border-radius:16px;flex-grow:1;flex-shrink:1}#tetForm .tetBackground .tetTextColor,#tetadvanced .tetBackground .tetTextColor,#tethelper .tetBackground .tetTextColor{overflow-wrap:break-word}#tetForm .tetBackground .tetTextColor span,#tetadvanced .tetBackground .tetTextColor span,#tethelper .tetBackground .tetTextColor span{overflow-wrap:break-word}#tetForm{max-width:80vw;max-height:90vh;min-width:600px !important;flex-shrink:1;overflow:hidden}#tetForm .tet-containter{width:100%}#tetForm .tet-containter.tet-fg{margin-left:auto;margin-right:auto}#tetadvanced,#tethelper{max-width:90vw;max-height:90vh;min-width:500px;min-height:100px;flex-shrink:1;margin-left:1%;margin-right:1%}.tet-container{overflow:auto !important}.tethelper-header{white-space:nowrap;line-height:23px !important;min-width:0px}.tetadvanced-container section.tetcheckbox>label,.tetadvanced-container section.tetselect{display:flex;justify-content:space-between;padding:.825em}.tetadvanced-container section.tetcheckbox>label{cursor:pointer}.tetadvanced-container .tetswitch{position:relative;width:38px;-webkit-user-select:none !important;-moz-user-select:none !important;-ms-user-select:none !important;user-select:none !important;margin:5px}.tetadvanced-container .tetswitch>input{display:none}.tetadvanced-container .tetswitch>label{display:block;overflow:hidden;cursor:pointer;height:16px;padding:0;border-radius:20px;border:1px solid #000;background-color:#464646}.tetadvanced-container .tetswitch>label:before{content:"";display:block;width:20px;height:20px;margin:-2px;background:#dadce0;position:absolute;top:0;right:20px;border-radius:20px}.tetadvanced-container .tetswitch>input:checked+label{margin-left:0;background-color:rgba(29,160,242,.384)}.tetadvanced-container .tetswitch>input:checked+label:before{right:0px;background-color:#1d9bf0}.tet-head,.tet-dc>span,.tet-demotext,.tetTextColor span,.tetConfirmation span,#tetName span,#tweet-text>span,#tetMenuButton>span{color:inherit;font:inherit;font-family:inherit;white-space:inherit;overflow-wrap:break-word}option[disabled=""],.rm,button:not(.mini)>#tetSVG,button.mini>span{display:none !important}.tetFreeze{overflow:hidden !important;-ms-scroll-chaining:none !important;overscroll-behavior:none !important}#tetMenuButton{z-index:10;width:8vw;height:auto;position:fixed;top:65%;left:0px}#tetMenuButton.tetTD{left:90% !important;top:0% !important}#tetMenuButton>svg{position:relative;max-width:100%;height:1.25em;fill:currentcolor;margin-right:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;right:35% !important}#tetMenuButton,.tetAlertBtns,#tetReload,#tetReset{list-style:none;text-align:inherit;text-decoration:none;border-radius:15px;justify-content:center;display:flex !important;font-family:inherit !important;font-size:20px !important;font-weight:bold !important;padding:0px !important;outline:none !important}button.tetBtn.mini{border:rgba(0,0,0,0) !important;background:rgba(0,0,0,0) !important}#tetMenuButton,.tetAlertBtns,#tetReload,#tetReset,#tet,.tet{cursor:pointer !important}.tet.tet-td{display:inherit}#tet{justify-items:center}#apifield{width:initial}#apifield,#tetName,#tetSelector>select{padding-left:2% !important}#apifield,#tetSelector{border-radius:4px;border-width:1px}#apifield,.tet-options>#tetSelector{margin:2% 6% 0px 6%}#tetSelector>select{text-align:left;padding-top:12px;padding-right:0px;padding-bottom:0px;cursor:pointer;border-radius:0px;margin:0px;-webkit-appearance:none;-moz-appearance:none;appearance:none}#tetReload,#tetReset{margin:2% 25% 0px 25%}.r-demo{margin:0px 32px 0px 32px !important;padding:12px 0px 12px 0px !important;overflow:hidden;flex-direction:row !important;flex-shrink:1;flex-grow:1}.r-demo .tet-av{width:100%;margin:2px 12px 0px 12px !important;flex-grow:0;flex-shrink:1;flex-basis:48px;height:48px;overflow:hidden;display:block}.r-demo .tet-txt{flex-basis:0px;flex-grow:1;justify-content:center}.r-demo .tet-txt .txt-header{margin-bottom:2px;align-items:start;justify-content:space-between;flex-direction:row;max-width:100%}.r-demo .tet-txt .txt-header .tet-at{display:flex;margin-left:4px;overflow-wrap:break-word;min-width:0px}#tetDemo{margin:4px 0px 0px 0px;font-size:13px;flex-wrap:wrap;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;min-width:0px;display:flex !important}.btNav{justify-content:center !important;flex-direction:row !important;top:0px !important}.btNav a,.btNav :link{text-decoration:none !important}.btNav a:hover,.btNav :link:hover{text-decoration:none !important}.btNav span{font-family:inherit}.btNav,.navbackground{position:fixed !important;width:100vw;height:100vh}.navbackground{top:0;left:0}.navbackground.warn{z-index:10 !important}.tet-icon-container,.tetadvanced-icon-container{cursor:pointer;display:inline-flex;position:absolute;bottom:10px;text-align:center;border-radius:9999px;z-index:1}.tet-icon-container{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:35px;right:25px}.tet-icon-container .tet-icon-info{color:#fff;display:inline;width:35px;height:35px;line-height:35px;border-radius:inherit;font-family:"fontello";font-size:23px}.tet-icon-container .tet-help-container{position:static;border-style:solid;border-width:2px;border-radius:inherit;line-height:35px;font-size:16px;font-weight:normal;text-decoration:none;margin-left:10px}.tet-icon-container .tet-help-container a{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:inline-block;margin-left:10px;margin-right:10px}.tetadvanced-icon-container{left:10px;width:28px;height:28px}.tetadvanced-icon-container .tetadvanced-icon{height:1.75rem;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;max-width:100%;fill:currentcolor;border-radius:inherit;display:inline-block}.mini{min-height:3% !important;overflow:hidden;background:rgba(0,0,0,0);border-color:rgba(0,0,0,0)}.r-hover{-webkit-text-decoration-line:underline !important;text-decoration-line:underline !important}#tweet-text{font-size:23px !important;line-height:28px !important} diff --git a/dist/twittertranslator.user.js b/dist/twittertranslator.user.js index 3367efc..3873734 100644 --- a/dist/twittertranslator.user.js +++ b/dist/twittertranslator.user.js @@ -55,7 +55,7 @@ // @description:ru-RU Добавляет сторонних переводчиков в Twitter // @description:ru Добавляет сторонних переводчиков в Twitter // @description:es Añade traductores de terceros a Twitter -// @version 0.33 +// @version 0.34 // @author Magic // @icon https://abs.twimg.com/favicons/twitter.ico // @downloadURL https://github.com/magicoflolis/twitter-translator/releases/latest/download/twittertranslator.user.js @@ -96,7 +96,7 @@ // @grant GM_deleteValue // @grant GM_info // @grant GM_xmlhttpRequest -// @require https://code.jquery.com/jquery-3.6.0.slim.min.js?_=1644176035993 +// @require https://code.jquery.com/jquery-3.6.0.slim.min.js?_=1649632365457 // ==/UserScript== // Uncompressed source code: @@ -105,13 +105,16 @@ // Compiler: // https://swc.rs/ -let twCSS = `.prf-header>div>.tet{display:inline-block !important;width:100% !important}.css-1dbjc4n{align-items:stretch;border-style:solid;border-width:0px;box-sizing:border-box;display:flex;flex-basis:auto;flex-direction:column;flex-shrink:0;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;z-index:0}select{height:auto !important}`, -tetCSS = `#tetMenuButton>span{color:#fff !important}#tetSelector>select{background-color:transparent;border:transparent}#tetSelector>select:focus{box-shadow:none !important}.tet-at span{color:#6e767d}.navbackground.d1tet{background-color:rgba(91,112,131,.4)}.navbackground.d2tet{background-color:rgba(0,0,0,.4)}.navbackground.d3tet{background-color:rgba(91,112,131,.4)}.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:transparent}.r-demo.r-14lw9ot,.tet-help-container.r-14lw9ot,#apifield.r-14lw9ot,#tetSelector.r-14lw9ot{border-color:#536471}.r-demo.r-yfoy6g,.tet-help-container.r-yfoy6g,#apifield.r-yfoy6g,#tetSelector.r-yfoy6g{border-color:#38444d}.r-demo.nitter,.r-demo.r-tetTD,.r-demo.r-kemksi,.tet-help-container.nitter,.tet-help-container.r-tetTD,.tet-help-container.r-kemksi,#apifield.nitter,#apifield.r-tetTD,#apifield.r-kemksi,#tetSelector.nitter,#tetSelector.r-tetTD,#tetSelector.r-kemksi{border-color:#2f3336}.r-14lw9ot>div#tetName span{color:#536471}.r-kemksi>div#tetName span,.r-yfoy6g>div#tetName span{color:#6e767d}.tetBtn.nitter{border:transparent}.Button--primary{border-color:#1da1f2;box-shadow:#1da1f2 0px 0px 0px 1px}.r-tetTD{border-radius:14px;background-color:#15202b}.r-tetTD #tetName span{color:#8899a6}.prf-header>div>.tet.tet-td{color:#fff !important}.tet-td{color:#1da1f2}.tet-td#tetName{color:#1da1f2 !important}.tet-td#tetName span{color:inherit !important}.tet-td.tet{color:#8899a6}.r-hoverTD{background-color:#005fd1}.tet-border-black{border-color:#000}.r-9ilb82{color:#6e767d}.r-1kqtdi0{border-color:#2f3336}.r-urgr8i{background-color:#1d9bf0}.r-p1n3y5{border-color:#1d9bf0 !important}.r-1q3imqu{background-color:#1a91da}.r-1bih22f{box-shadow:#1da1f2 0px 0px 0px 1px}.tetBtn.tweetdeck{background-color:#1da1f2;color:#fff}.tetBtn.tweetdeck#tetName{color:#1da1f2}.tetBtn.tweetdeck#tetName span{color:inherit !important}.r-13gxpu9{color:#1d9bf0}.r-13gxpu9#tetName{color:#1d9bf0 !important}.r-13gxpu9#tetName span{color:inherit !important}.r-1vkxrha{background-color:#ffd400}.r-v6khid{border-color:#ffd400 !important}.r-61mi1v{color:#ffd400}.r-61mi1v#tetName{color:#ffd400 !important}.r-61mi1v#tetName span{color:inherit !important}.r-1kplyi6{background-color:#e69c1c}.r-cdj8wb{box-shadow:#ffad1f 0px 0px 0px 1px}.r-1dgebii{background-color:#f91880}.r-1iofnty{border-color:#f91880 !important}.r-daml9f{color:#f91880}.r-daml9f#tetName{color:#f91880 !important}.r-daml9f#tetName span{color:inherit !important}.r-1ucxkr8{background-color:#ca2055}.r-jd07pc{box-shadow:#e0245e 0px 0px 0px 1px}.r-168457u{background-color:#7856ff}.r-njt2r9{background-color:#865dca}.r-hy56xe{border-color:#7856ff !important}.r-11mmphe{box-shadow:#794bc4 0px 0px 0px 1px}.r-xfsgu1{color:#7856ff}.r-xfsgu1#tetName{color:#7856ff !important}.r-xfsgu1#tetName span{color:inherit !important}.r-18z3xeu{background-color:#ff7a00}.r-1kplyi6{background-color:#dc541f}.r-1xl5njo{border-color:#ff7a00 !important}.r-b8m25f{box-shadow:#f45d22 0px 0px 0px 1px}.r-1qkqhnw{color:#ff7a00}.r-1qkqhnw#tetName{color:#ff7a00 !important}.r-1qkqhnw#tetName span{color:inherit !important}.r-b5skir{background-color:#00ba7c}.r-zx61xx{background-color:#15ac59}.r-5ctkeg{border-color:#00ba7c !important}.r-1cqwhho{box-shadow:#17bf63 0px 0px 0px 1px}.r-nw8l94{color:#00ba7c}.r-nw8l94#tetName{color:#00ba7c !important}.r-nw8l94#tetName span{color:inherit !important}.r-yfoy6g{background-color:#15202b}.r-14lw9ot{background-color:#fff}.r-kemksi{background-color:#000}.r-18jsvk2{color:#0f1419}.r-demo{border-style:solid !important;border-radius:16px !important;border-width:1px !important}.r-jwli3a{color:#fff}.tetNitterHover{background-color:#ff6c60}.tetNitter{border-color:#ffaca0 !important;box-shadow:#ffaca0 0px 0px 0px 1px !important}.tetBtn.nitter{color:#fff;background-color:#ff6c60}h1.tetNTextColor{color:#888889}.nitter{border-color:#ff6c60;background-color:#0f0f0f}.nitter div#tetName span{color:#ff6c60}input.tetNTextColor,select.tetNTextColor,div.tetNTextColor,svg.tetNTextColor,label.tetNTextColor>span{color:#f8f8f2}.tetNText span{color:#ff6c60 !important}.tetNBackground{background-color:#161616}.btNav,.txt-s0pan,.txt-s1pan,.tet-av,.tetAlertBtns>div{align-items:center !important}#tetName,.r-demo,#tetadvanced,#tethelper,.tetAlertTxt,.tet-header{cursor:default}.txt-s0pan{flex-shrink:1;max-width:100%;flex-direction:inherit !important}.txt-s0pan .txt-s1pan{max-width:inherit !important;flex-direction:inherit !important;white-space:normal !important}.txt-s0pan .txt-s1pan>div{white-space:inherit !important}.txt-s0pan,.tetAlertBtns,.r-demo,.tet-av,.r-hover,#apifield{outline-style:none !important}.txt-s1pan>div,.tet-dc,.tet-at,.tethelper-info,.tethelper-header,.tetAlertTxt,.tet-info,.tetAlertBtns>div,#tetSelector>select{font-size:15px !important}.txt-s1pan>div,h1.tetAlertTxt,.tetAlertBtns>div,.tethelper-header{font-weight:700 !important}.tet,#tetDemo,.tet-dc,.tet-at,.tethelper-info,div.tetAlertTxt,.tet-info,.tet-icon-info,#tweet-text,#tetSelector>#tetName{font-weight:400}.tet,#tetDemo,.tetswitch>label,#tetSelector>#tetName{line-height:16px}.tet-sp1an>div,.tet-at{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tet-dc,.txt-s1pan>div,.tet-header,#tetSelector>#tetName,#tetSelector>select{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}.tet,#tweet-text,.tetAlertTxt span,.tetAlertBtns>div,.tet-main{font-family:"TwitterChirp",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}div.tetAlertTxt,.tet-info,.tet-dc,.tet-at,.tethelper-info,.tetAlertBtns>div,.txt-s1pan>div,#tetSelector>select{line-height:20px}.tetAvatarFrame,#tetAvatar{align-items:stretch;border:0px solid #000;box-sizing:border-box;display:flex;flex-basis:auto;flex-direction:column;flex-shrink:0;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;z-index:0}#tetSelector{min-width:0px;overflow-wrap:break-word}#tetSelector #tetName{min-width:0px;position:absolute;overflow-wrap:break-word}.tet,.tet-info,#tweet-text{margin-top:1% !important}#tweet-text,.tet-demoframe{position:relative}.tetAlertTxt{text-align:center}.tet{flex-wrap:wrap;font-size:13px;overflow-wrap:break-word;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-min-content;height:-moz-min-content;height:min-content;display:flex}.tetAvatarFrame{padding-bottom:100%;width:100%;display:block;z-index:0;position:absolute;top:0px;right:0px;left:0px;bottom:0px}.tetAvatarFrame #tetAvatar{background-image:url("https://abs.twimg.com/favicons/twitter.ico");background-size:cover;background-repeat:no-repeat;background-position:center center;z-index:-1;background-color:rgba(0,0,0,0);height:100%;width:100%;position:absolute}.tet-main{padding:0px 32px 32px 32px !important;flex-shrink:1;flex-grow:1;width:100%;margin-left:auto;margin-right:auto}.tet-options{display:inline-grid;grid-template-rows:1fr 1fr 1fr}.tet-header{min-width:0px;text-align:center;white-space:normal;display:grid;margin:32px 0px 12px 0px !important}.tet-header .tet-info-name{line-height:28px;font-size:23px;font-weight:800}.tet-header .tet-info{color:#6e767d}.tetAlert{right:0px;left:0px;bottom:0px;position:fixed !important;z-index:10000 !important}.tetAlert h1.tetAlertTxt{line-height:24px;font-size:20px;min-width:0px}.tetAlert h1.tetAlertTxt span{font-family:inherit}.tetAlert .tetAlertTxt span{white-space:normal;text-align:center;overflow-wrap:break-word}.tetAlert div.tetAlertTxt{min-width:0px;width:100%}.tetAlert .tetConfirmation{width:20%;border-radius:16px;left:40%;top:40%;position:fixed}.tetAlert .tetAlertBtns{margin:2% 25% 2% 25%;white-space:nowrap;transition-property:background-color,box-shadow;transition-duration:.2s;flex-grow:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-color:rgba(0,0,0,0);overflow:hidden;border-width:1px;border-style:solid;cursor:pointer}.tetAlert .tetAlertBtns:nth-child(2){margin:0px 25% 4% 25%}.tetAlert .tetAlertBtns>div{overflow-wrap:break-word;min-width:0px;justify-content:center;flex-grow:1;flex-direction:row;text-align:center;display:flex}.tetAlert .tetAlertBtns>div>span{line-height:inherit !important;overflow-wrap:break-word;min-width:0px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0px solid #000;box-sizing:border-box;display:inline;margin:0px;padding:0px}.tetAlert .tetAlertBtns>div>span>span{border:0px solid #000;box-sizing:border-box;display:inline;margin:0px;padding:0px}#tetForm,#tetadvanced,#tethelper{border-radius:16px}#tetForm>div,#tetadvanced>div,#tethelper>div{border-radius:16px;flex-grow:1;flex-shrink:1}#tetForm .tetBackground .tetTextColor,#tetadvanced .tetBackground .tetTextColor,#tethelper .tetBackground .tetTextColor{overflow-wrap:break-word}#tetForm .tetBackground .tetTextColor span,#tetadvanced .tetBackground .tetTextColor span,#tethelper .tetBackground .tetTextColor span{overflow-wrap:break-word}#tetForm{max-width:80vw;max-height:90vh;min-width:600px !important;flex-shrink:1;overflow:hidden}#tetForm .tet-containter{width:100%}#tetForm .tet-containter.tet-fg{margin-left:auto;margin-right:auto}#tetadvanced,#tethelper{max-width:90vw;max-height:90vh;min-width:500px;min-height:100px;flex-shrink:1;margin-left:1%;margin-right:1%}.tet-container{overflow:auto !important}.tethelper-header{white-space:nowrap;line-height:23px !important;min-width:0px}.tetadvanced-container section.tetcheckbox>label,.tetadvanced-container section.tetselect{display:flex;justify-content:space-between;padding:.825em}.tetadvanced-container section.tetcheckbox>label{cursor:pointer}.tetadvanced-container .tetswitch{position:relative;width:38px;-webkit-user-select:none !important;-moz-user-select:none !important;-ms-user-select:none !important;user-select:none !important;margin:5px}.tetadvanced-container .tetswitch>input{display:none}.tetadvanced-container .tetswitch>label{display:block;overflow:hidden;cursor:pointer;height:16px;padding:0;border-radius:20px;border:1px solid #000;background-color:#464646}.tetadvanced-container .tetswitch>label:before{content:"";display:block;width:20px;height:20px;margin:-2px;background:#dadce0;position:absolute;top:0;right:20px;border-radius:20px}.tetadvanced-container .tetswitch>input:checked+label{margin-left:0;background-color:rgba(29,160,242,.384)}.tetadvanced-container .tetswitch>input:checked+label:before{right:0px;background-color:#1d9bf0}.tet-head,.tet-dc>span,.tet-demotext,.tetTextColor span,.tetConfirmation span,#tetName span,#tweet-text>span,#tetMenuButton>span{color:inherit;font:inherit;font-family:inherit;white-space:inherit;overflow-wrap:break-word}option[disabled=""],.rm,button:not(.mini)>#tetSVG,button.mini>span{display:none !important}.tetFreeze{overflow:hidden !important;-ms-scroll-chaining:none !important;overscroll-behavior:none !important}#tetMenuButton{z-index:10;width:8vw;height:auto;position:fixed;top:65%;left:0px}#tetMenuButton.tetTD{left:90% !important;top:0% !important}#tetMenuButton>svg{position:relative;max-width:100%;height:1.25em;fill:currentcolor;margin-right:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;right:35% !important}#tetMenuButton,.tetAlertBtns,#tetReload,#tetReset{list-style:none;text-align:inherit;text-decoration:none;border-radius:15px;justify-content:center;display:flex !important;font-family:inherit !important;font-size:20px !important;font-weight:bold !important;padding:0px !important;outline:none !important}button.tetBtn.mini{border:transparent !important;background:transparent !important}#tetMenuButton,.tetAlertBtns,#tetReload,#tetReset,#tet,.tet{cursor:pointer !important}.tet.tet-td{display:inherit}#tet{justify-items:center}#apifield{width:initial}#apifield,#tetName,#tetSelector>select{padding-left:2% !important}#apifield,#tetSelector{border-radius:4px;border-width:1px;margin:2% 6% 0px 6%}#tetSelector>select{text-align:left;padding-top:12px;padding-right:0px;padding-bottom:0px;cursor:pointer;border-radius:0px;margin:0px;-webkit-appearance:none;-moz-appearance:none;appearance:none}#tetReload,#tetReset{margin:2% 25% 0px 25%}.r-demo{margin:0px 32px 0px 32px !important;padding:12px 0px 12px 0px !important;overflow:hidden;flex-direction:row !important;flex-shrink:1;flex-grow:1}.r-demo .tet-av{width:100%;margin:2px 12px 0px 12px !important;flex-grow:0;flex-shrink:1;flex-basis:48px;height:48px;overflow:hidden;display:block}.r-demo .tet-txt{flex-basis:0px;flex-grow:1;justify-content:center}.r-demo .tet-txt .txt-header{margin-bottom:2px;align-items:start;justify-content:space-between;flex-direction:row;max-width:100%}.r-demo .tet-txt .txt-header .tet-at{display:flex;margin-left:4px;overflow-wrap:break-word;min-width:0px}#tetDemo{margin:4px 0px 0px 0px;font-size:13px;flex-wrap:wrap;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;min-width:0px;display:flex !important}.btNav{justify-content:center !important;flex-direction:row !important;top:0px !important}.btNav a,.btNav :link{text-decoration:none !important}.btNav a:hover,.btNav :link:hover{text-decoration:none !important}.btNav span{font-family:inherit}.btNav,.navbackground{position:fixed !important;width:100vw;height:100vh}.navbackground{top:0;left:0}.navbackground.warn{z-index:10 !important}.tet-icon-container,.tetadvanced-icon-container{cursor:pointer;display:inline-flex;position:absolute;bottom:10px;text-align:center;border-radius:9999px;z-index:1}.tet-icon-container{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:35px;right:10px}.tet-icon-container .tet-icon-info{color:#fff;display:inline;width:35px;height:35px;line-height:35px;border-radius:inherit;font-family:"fontello";font-size:23px}.tet-icon-container .tet-help-container{position:static;border-style:solid;border-width:2px;border-radius:inherit;line-height:35px;font-size:16px;font-weight:normal;text-decoration:none;margin-left:10px}.tet-icon-container .tet-help-container a{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:inline-block;margin-left:10px;margin-right:10px}.tetadvanced-icon-container{left:10px;width:28px;height:28px}.tetadvanced-icon-container .tetadvanced-icon{height:1.75rem;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;max-width:100%;fill:currentcolor;border-radius:inherit;display:inline-block}.mini{min-height:3% !important;overflow:hidden;background:transparent;border-color:transparent}.r-hover{-webkit-text-decoration-line:underline !important;text-decoration-line:underline !important}#tweet-text{font-size:23px !important;line-height:28px !important}`, -nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var(--border_grey)}.r-demo.nitter,.tet-help-container.nitter,#apifield.nitter,#tetSelector.nitter{border-color:var(--border_grey)}.tetNitterHover{background-color:var(--fg_dark)}.tetNitter{border-color:var(--accent_border) !important;box-shadow:var(--accent_border) !important}.tetNitter #tetName{color:var(--fg_dark)}.tetBtn.nitter{color:var(--fg_color);background-color:var(--fg_dark)}h1.tetNTextColor{color:var(--grey)}.nitter{background-color:var(--bg_color)}.nitter div#tetName{color:var(--fg_dark)}input.tetNTextColor,select.tetNTextColor,div.tetNTextColor,svg.tetNTextColor,label.tetNTextColor>span{color:var(--fg_color)}.tetNText span{color:var(--fg_dark) !important}.tetNBackground{background-color:var(--bg_panel)}`; +let twCSS = `.prf-header>div>.tet{display:inline-block !important;width:100% !important}.css-1dbjc4n{align-items:stretch;border-style:solid;border-width:0px;box-sizing:border-box;display:flex;flex-basis:auto;flex-direction:column;flex-shrink:0;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;z-index:0}select{height:auto !important} +`, +tetCSS = `#tetMenuButton>span{color:#fff !important}#tetSelector>select{background-color:rgba(0,0,0,0);border:rgba(0,0,0,0)}#tetSelector>select:focus{box-shadow:none !important}.tet-at span{color:#6e767d}.navbackground.d1tet{background-color:rgba(91,112,131,.4)}.navbackground.d2tet{background-color:rgba(0,0,0,.4)}.navbackground.d3tet{background-color:rgba(91,112,131,.4)}.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:rgba(0,0,0,0)}.r-demo.r-14lw9ot,.tet-help-container.r-14lw9ot,#apifield.r-14lw9ot,#tetSelector.r-14lw9ot{border-color:#536471}.r-demo.r-yfoy6g,.tet-help-container.r-yfoy6g,#apifield.r-yfoy6g,#tetSelector.r-yfoy6g{border-color:#38444d}.r-demo.nitter,.r-demo.r-tetTD,.r-demo.r-kemksi,.tet-help-container.nitter,.tet-help-container.r-tetTD,.tet-help-container.r-kemksi,#apifield.nitter,#apifield.r-tetTD,#apifield.r-kemksi,#tetSelector.nitter,#tetSelector.r-tetTD,#tetSelector.r-kemksi{border-color:#2f3336}.r-14lw9ot>div#tetName span{color:#536471}.r-kemksi>div#tetName span,.r-yfoy6g>div#tetName span{color:#6e767d}.tetBtn.nitter{border:rgba(0,0,0,0)}.Button--primary{border-color:#1da1f2;box-shadow:#1da1f2 0px 0px 0px 1px}.r-tetTD{border-radius:14px;background-color:#15202b}.r-tetTD #tetName span{color:#8899a6}.prf-header>div>.tet.tet-td{color:#fff !important}.tet-td{color:#1da1f2}.tet-td#tetName{color:#1da1f2 !important}.tet-td#tetName span{color:inherit !important}.tet-td.tet{color:#8899a6}.r-hoverTD{background-color:#005fd1}.tet-border-black{border-color:#000}.r-9ilb82{color:#6e767d}.r-1kqtdi0{border-color:#2f3336}.r-urgr8i{background-color:#1d9bf0}.r-p1n3y5{border-color:#1d9bf0 !important}.r-1q3imqu{background-color:#1a91da}.r-1bih22f{box-shadow:#1da1f2 0px 0px 0px 1px}.tetBtn.tweetdeck{background-color:#1da1f2;color:#fff}.tetBtn.tweetdeck#tetName{color:#1da1f2}.tetBtn.tweetdeck#tetName span{color:inherit !important}.r-13gxpu9{color:#1d9bf0}.r-13gxpu9#tetName{color:#1d9bf0 !important}.r-13gxpu9#tetName span{color:inherit !important}.r-1vkxrha{background-color:#ffd400}.r-v6khid{border-color:#ffd400 !important}.r-61mi1v{color:#ffd400}.r-61mi1v#tetName{color:#ffd400 !important}.r-61mi1v#tetName span{color:inherit !important}.r-1kplyi6{background-color:#e69c1c}.r-cdj8wb{box-shadow:#ffad1f 0px 0px 0px 1px}.r-1dgebii{background-color:#f91880}.r-1iofnty{border-color:#f91880 !important}.r-daml9f{color:#f91880}.r-daml9f#tetName{color:#f91880 !important}.r-daml9f#tetName span{color:inherit !important}.r-1ucxkr8{background-color:#ca2055}.r-jd07pc{box-shadow:#e0245e 0px 0px 0px 1px}.r-168457u{background-color:#7856ff}.r-njt2r9{background-color:#865dca}.r-hy56xe{border-color:#7856ff !important}.r-11mmphe{box-shadow:#794bc4 0px 0px 0px 1px}.r-xfsgu1{color:#7856ff}.r-xfsgu1#tetName{color:#7856ff !important}.r-xfsgu1#tetName span{color:inherit !important}.r-18z3xeu{background-color:#ff7a00}.r-1kplyi6{background-color:#dc541f}.r-1xl5njo{border-color:#ff7a00 !important}.r-b8m25f{box-shadow:#f45d22 0px 0px 0px 1px}.r-1qkqhnw{color:#ff7a00}.r-1qkqhnw#tetName{color:#ff7a00 !important}.r-1qkqhnw#tetName span{color:inherit !important}.r-b5skir{background-color:#00ba7c}.r-zx61xx{background-color:#15ac59}.r-5ctkeg{border-color:#00ba7c !important}.r-1cqwhho{box-shadow:#17bf63 0px 0px 0px 1px}.r-nw8l94{color:#00ba7c}.r-nw8l94#tetName{color:#00ba7c !important}.r-nw8l94#tetName span{color:inherit !important}.r-yfoy6g{background-color:#15202b}.r-14lw9ot{background-color:#fff}.r-kemksi{background-color:#000}.r-18jsvk2{color:#0f1419}.r-demo{border-style:solid !important;border-radius:16px !important;border-width:1px !important}.r-jwli3a{color:#fff}.tetNitterHover{background-color:#ff6c60}.tetNitter{border-color:#ffaca0 !important;box-shadow:#ffaca0 0px 0px 0px 1px !important}.tetBtn.nitter{color:#fff;background-color:#ff6c60}h1.tetNTextColor{color:#888889}.nitter{border-color:#ff6c60;background-color:#0f0f0f}.nitter div#tetName span{color:#ff6c60}input.tetNTextColor,select.tetNTextColor,div.tetNTextColor,svg.tetNTextColor,label.tetNTextColor>span{color:#f8f8f2}.tetNText span{color:#ff6c60 !important}.tetNBackground{background-color:#161616}.btNav,.txt-s0pan,.txt-s1pan,.tet-av,.tetAlertBtns>div{align-items:center !important}#tetName,.r-demo,#tetadvanced,#tethelper,.tetAlertTxt,.tet-header{cursor:default}.txt-s0pan{flex-shrink:1;max-width:100%;flex-direction:inherit !important}.txt-s0pan .txt-s1pan{max-width:inherit !important;flex-direction:inherit !important;white-space:normal !important}.txt-s0pan .txt-s1pan>div{white-space:inherit !important}.txt-s0pan,.tetAlertBtns,.r-demo,.tet-av,.r-hover,#apifield{outline-style:none !important}.txt-s1pan>div,.tet-dc,.tet-at,.tethelper-info,.tethelper-header,.tetAlertTxt,.tet-info,.tetAlertBtns>div,#tetSelector>select{font-size:15px !important}.txt-s1pan>div,h1.tetAlertTxt,.tetAlertBtns>div,.tethelper-header{font-weight:700 !important}.tet,#tetDemo,.tet-dc,.tet-at,.tethelper-info,div.tetAlertTxt,.tet-info,.tet-icon-info,#tweet-text,#tetSelector>#tetName{font-weight:400}.tet,#tetDemo,.tetswitch>label,#tetSelector>#tetName{line-height:16px}.tet-sp1an>div,.tet-at{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tet-dc,.txt-s1pan>div,.tet-header,#tetSelector>#tetName,#tetSelector>select{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}.tet,#tweet-text,.tetAlertTxt span,.tetAlertBtns>div,.tet-main{font-family:"TwitterChirp",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}div.tetAlertTxt,.tet-info,.tet-dc,.tet-at,.tethelper-info,.tetAlertBtns>div,.txt-s1pan>div,#tetSelector>select{line-height:20px}.tetAvatarFrame,#tetAvatar{align-items:stretch;border:0px solid #000;box-sizing:border-box;display:flex;flex-basis:auto;flex-direction:column;flex-shrink:0;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;z-index:0}#tetSelector{min-width:0px;overflow-wrap:break-word}#tetSelector #tetName{min-width:0px;position:absolute;overflow-wrap:break-word}.tet,.tet-info,#tweet-text{margin-top:1% !important}#tweet-text,.tet-demoframe{position:relative}.tetAlertTxt{text-align:center}.tet{flex-wrap:wrap;font-size:13px;overflow-wrap:break-word;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-min-content;height:-moz-min-content;height:min-content;display:flex}.tetAvatarFrame{padding-bottom:100%;width:100%;display:block;z-index:0;position:absolute;top:0px;right:0px;left:0px;bottom:0px}.tetAvatarFrame #tetAvatar{background-image:url("https://abs.twimg.com/favicons/twitter.ico");background-size:cover;background-repeat:no-repeat;background-position:center center;z-index:-1;background-color:rgba(0,0,0,0);height:100%;width:100%;position:absolute}.tet-main{padding:0px 32px 32px 32px !important;flex-shrink:1;flex-grow:1;width:100%;margin-left:auto;margin-right:auto}.tet-options{display:inline-grid;grid-template-rows:1fr 1fr 1fr}.tet-header{min-width:0px;text-align:center;white-space:normal;display:grid;margin:32px 0px 12px 0px !important}.tet-header .tet-info-name{line-height:28px;font-size:23px;font-weight:800}.tet-header .tet-info{color:#6e767d}.tetAlert{right:0px;left:0px;bottom:0px;position:fixed !important;z-index:10000 !important}.tetAlert h1.tetAlertTxt{line-height:24px;font-size:20px;min-width:0px}.tetAlert h1.tetAlertTxt span{font-family:inherit}.tetAlert .tetAlertTxt span{white-space:normal;text-align:center;overflow-wrap:break-word}.tetAlert div.tetAlertTxt{min-width:0px;width:100%}.tetAlert .tetConfirmation{width:20%;border-radius:16px;left:40%;top:40%;position:fixed}.tetAlert .tetAlertBtns{margin:2% 25% 2% 25%;white-space:nowrap;transition-property:background-color,box-shadow;transition-duration:.2s;flex-grow:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-color:rgba(0,0,0,0);overflow:hidden;border-width:1px;border-style:solid;cursor:pointer}.tetAlert .tetAlertBtns:nth-child(2){margin:0px 25% 4% 25%}.tetAlert .tetAlertBtns>div{overflow-wrap:break-word;min-width:0px;justify-content:center;flex-grow:1;flex-direction:row;text-align:center;display:flex}.tetAlert .tetAlertBtns>div>span{line-height:inherit !important;overflow-wrap:break-word;min-width:0px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0px solid #000;box-sizing:border-box;display:inline;margin:0px;padding:0px}.tetAlert .tetAlertBtns>div>span>span{border:0px solid #000;box-sizing:border-box;display:inline;margin:0px;padding:0px}#tetForm,#tetadvanced,#tethelper{border-radius:16px}#tetForm>div,#tetadvanced>div,#tethelper>div{border-radius:16px;flex-grow:1;flex-shrink:1}#tetForm .tetBackground .tetTextColor,#tetadvanced .tetBackground .tetTextColor,#tethelper .tetBackground .tetTextColor{overflow-wrap:break-word}#tetForm .tetBackground .tetTextColor span,#tetadvanced .tetBackground .tetTextColor span,#tethelper .tetBackground .tetTextColor span{overflow-wrap:break-word}#tetForm{max-width:80vw;max-height:90vh;min-width:600px !important;flex-shrink:1;overflow:hidden}#tetForm .tet-containter{width:100%}#tetForm .tet-containter.tet-fg{margin-left:auto;margin-right:auto}#tetadvanced,#tethelper{max-width:90vw;max-height:90vh;min-width:500px;min-height:100px;flex-shrink:1;margin-left:1%;margin-right:1%}.tet-container{overflow:auto !important}.tethelper-header{white-space:nowrap;line-height:23px !important;min-width:0px}.tetadvanced-container section.tetcheckbox>label,.tetadvanced-container section.tetselect{display:flex;justify-content:space-between;padding:.825em}.tetadvanced-container section.tetcheckbox>label{cursor:pointer}.tetadvanced-container .tetswitch{position:relative;width:38px;-webkit-user-select:none !important;-moz-user-select:none !important;-ms-user-select:none !important;user-select:none !important;margin:5px}.tetadvanced-container .tetswitch>input{display:none}.tetadvanced-container .tetswitch>label{display:block;overflow:hidden;cursor:pointer;height:16px;padding:0;border-radius:20px;border:1px solid #000;background-color:#464646}.tetadvanced-container .tetswitch>label:before{content:"";display:block;width:20px;height:20px;margin:-2px;background:#dadce0;position:absolute;top:0;right:20px;border-radius:20px}.tetadvanced-container .tetswitch>input:checked+label{margin-left:0;background-color:rgba(29,160,242,.384)}.tetadvanced-container .tetswitch>input:checked+label:before{right:0px;background-color:#1d9bf0}.tet-head,.tet-dc>span,.tet-demotext,.tetTextColor span,.tetConfirmation span,#tetName span,#tweet-text>span,#tetMenuButton>span{color:inherit;font:inherit;font-family:inherit;white-space:inherit;overflow-wrap:break-word}option[disabled=""],.rm,button:not(.mini)>#tetSVG,button.mini>span{display:none !important}.tetFreeze{overflow:hidden !important;-ms-scroll-chaining:none !important;overscroll-behavior:none !important}#tetMenuButton{z-index:10;width:8vw;height:auto;position:fixed;top:65%;left:0px}#tetMenuButton.tetTD{left:90% !important;top:0% !important}#tetMenuButton>svg{position:relative;max-width:100%;height:1.25em;fill:currentcolor;margin-right:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;right:35% !important}#tetMenuButton,.tetAlertBtns,#tetReload,#tetReset{list-style:none;text-align:inherit;text-decoration:none;border-radius:15px;justify-content:center;display:flex !important;font-family:inherit !important;font-size:20px !important;font-weight:bold !important;padding:0px !important;outline:none !important}button.tetBtn.mini{border:rgba(0,0,0,0) !important;background:rgba(0,0,0,0) !important}#tetMenuButton,.tetAlertBtns,#tetReload,#tetReset,#tet,.tet{cursor:pointer !important}.tet.tet-td{display:inherit}#tet{justify-items:center}#apifield{width:initial}#apifield,#tetName,#tetSelector>select{padding-left:2% !important}#apifield,#tetSelector{border-radius:4px;border-width:1px}#apifield,.tet-options>#tetSelector{margin:2% 6% 0px 6%}#tetSelector>select{text-align:left;padding-top:12px;padding-right:0px;padding-bottom:0px;cursor:pointer;border-radius:0px;margin:0px;-webkit-appearance:none;-moz-appearance:none;appearance:none}#tetReload,#tetReset{margin:2% 25% 0px 25%}.r-demo{margin:0px 32px 0px 32px !important;padding:12px 0px 12px 0px !important;overflow:hidden;flex-direction:row !important;flex-shrink:1;flex-grow:1}.r-demo .tet-av{width:100%;margin:2px 12px 0px 12px !important;flex-grow:0;flex-shrink:1;flex-basis:48px;height:48px;overflow:hidden;display:block}.r-demo .tet-txt{flex-basis:0px;flex-grow:1;justify-content:center}.r-demo .tet-txt .txt-header{margin-bottom:2px;align-items:start;justify-content:space-between;flex-direction:row;max-width:100%}.r-demo .tet-txt .txt-header .tet-at{display:flex;margin-left:4px;overflow-wrap:break-word;min-width:0px}#tetDemo{margin:4px 0px 0px 0px;font-size:13px;flex-wrap:wrap;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;min-width:0px;display:flex !important}.btNav{justify-content:center !important;flex-direction:row !important;top:0px !important}.btNav a,.btNav :link{text-decoration:none !important}.btNav a:hover,.btNav :link:hover{text-decoration:none !important}.btNav span{font-family:inherit}.btNav,.navbackground{position:fixed !important;width:100vw;height:100vh}.navbackground{top:0;left:0}.navbackground.warn{z-index:10 !important}.tet-icon-container,.tetadvanced-icon-container{cursor:pointer;display:inline-flex;position:absolute;bottom:10px;text-align:center;border-radius:9999px;z-index:1}.tet-icon-container{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:35px;right:25px}.tet-icon-container .tet-icon-info{color:#fff;display:inline;width:35px;height:35px;line-height:35px;border-radius:inherit;font-family:"fontello";font-size:23px}.tet-icon-container .tet-help-container{position:static;border-style:solid;border-width:2px;border-radius:inherit;line-height:35px;font-size:16px;font-weight:normal;text-decoration:none;margin-left:10px}.tet-icon-container .tet-help-container a{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:inline-block;margin-left:10px;margin-right:10px}.tetadvanced-icon-container{left:10px;width:28px;height:28px}.tetadvanced-icon-container .tetadvanced-icon{height:1.75rem;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;max-width:100%;fill:currentcolor;border-radius:inherit;display:inline-block}.mini{min-height:3% !important;overflow:hidden;background:rgba(0,0,0,0);border-color:rgba(0,0,0,0)}.r-hover{-webkit-text-decoration-line:underline !important;text-decoration-line:underline !important}#tweet-text{font-size:23px !important;line-height:28px !important} +`, +nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var(--border_grey)}.r-demo.nitter,.tet-help-container.nitter,#apifield.nitter,#tetSelector.nitter{border-color:var(--border_grey)}.tetNitterHover{background-color:var(--fg_dark)}.tetNitter{border-color:var(--accent_border) !important;box-shadow:var(--accent_border) !important}.tetNitter #tetName{color:var(--fg_dark)}.tetBtn.nitter{color:var(--fg_color);background-color:var(--fg_dark)}h1.tetNTextColor{color:var(--grey)}.nitter{background-color:var(--bg_color)}.nitter div#tetName{color:var(--fg_dark)}input.tetNTextColor,select.tetNTextColor,div.tetNTextColor,svg.tetNTextColor,label.tetNTextColor>span{color:var(--fg_color)}.tetNText span{color:var(--fg_dark) !important}.tetNBackground{background-color:var(--bg_panel)} +`; "use strict"; (async ()=>{ - let tetInfo = { + let defaultDelay = "none", tetInfo = { icon: GM_info.script.icon, name: GM_info.script.name, version: GM_info.script.version, @@ -120,10 +123,10 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var const isHTML = (str, doc = new DOMParser().parseFromString(str, "text/html"))=>{ return Array.from(doc.body.childNodes).some((node)=>node.nodeType === 1 ); - }, qs = (element, all)=>{ + }, + qs = (element, all)=>{ return !all ? document.querySelector(element) : document.querySelectorAll(element); }, defaultDesc = "Pretend I'm a foreign language.", lh = window.location.host, lr = window.location.href, find = { - hider: /logout|login|signin|signout|profile|keyboard_shortcuts|display|video|photo|compose/.test(lr), logout: !document.cookie.includes("twid"), twitter: lh === "twitter.com" || lh === "mobile.twitter.com", tweetdeck: lh === "tweetdeck.twitter.com", @@ -1023,11 +1026,10 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var fn: checkLng } }; - let TETConfig = { - }, autoTheme = find.twitter ? qs("body").style.backgroundColor : find.tweetdeck ? "tweetdeck" : find.twitlonger ? "rgb(255, 255, 255)" : "nitter", cBG = "rgba(91, 112, 131, 0.4)", cColor = "r-p1n3y5 r-1bih22f", cHover = "r-1q3imqu", cText = "r-jwli3a", cTheme = "r-kemksi", cSub = "r-13gxpu9", // deeplfn = "", + let TETConfig = {}, cBG = "rgba(91, 112, 131, 0.4)", cColor = "r-p1n3y5 r-1bih22f", cHover = "r-1q3imqu", cText = "r-jwli3a", cTheme = "r-kemksi", cSub = "r-13gxpu9", // deeplfn = "", tet = { - ael (event, callback, elm = document) { - return elm.addEventListener(event, callback); + ael (event, callback, elm = document) { + return elm.addEventListener(event, callback); }, defaultcfg: { debug: /Dev/.test(tetInfo.name), @@ -1036,6 +1038,7 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var display: "text + icon", colors: "r-urgr8i", theme: "auto", + delay: defaultDelay, api: { deepl: "", google: "", @@ -1063,7 +1066,7 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var return new Promise((resolve)=>setTimeout(resolve, ms) ); }, - async check (args) { + async check (args) { while(args){ await new Promise((resolve)=>requestAnimationFrame(resolve) ); @@ -1076,7 +1079,7 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var } ; }, - err (...error) { + err (...error) { console.error('[%cTET%c] %cERROR', 'color: rgb(29, 155, 240);', '', 'color: rgb(249, 24, 128);', ...error); handleError(); }, @@ -1116,24 +1119,24 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var e.preventDefault(); e.stopPropagation(); }, - info (...message) { + info (...message) { if (!TETConfig.debug) { return; } ; console.info('[%cTET%c] %cINF', 'color: rgb(29, 155, 240);', '', 'color: rgb(0, 186, 124);', ...message); }, - loadCSS (css, name = "common") { + loadCSS (css, name = "common") { document.head.insertAdjacentHTML('beforeend', ``); }, - log (...message) { + log (...message) { if (!TETConfig.debug) { return; } ; console.log('[%cTET%c] %cDBG', 'color: rgb(29, 155, 240);', '', 'color: rgb(255, 212, 0);', ...message); }, - observe (element, callback, options = { + observe (element, callback, options = { subtree: true, childList: true }) { @@ -1142,7 +1145,7 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var observer.observe(element, options); return observer; }, - async query (element) { + async query (element) { while(document.querySelector(element) === null){ await new Promise((resolve)=>requestAnimationFrame(resolve) ); @@ -1154,7 +1157,8 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var GM_setValue("Config", JSON.stringify(TETConfig)); localStorage.TETConfig = JSON.stringify(TETConfig); } - }, menu = `\n`; + }, menu = `\n`, autoTheme = find.twitter ? tet.query("body").then((e)=>e.style.backgroundColor + ) : find.tweetdeck ? "tweetdeck" : find.twitlonger ? "rgb(255, 255, 255)" : "nitter"; function checkLng() { return { tw: this.tw, @@ -1187,7 +1191,8 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var yes: this.quest.yes, no: this.quest.no }; - }; + } + ; async function configDisplay() { let dis = TETConfig.display, tra = TETConfig.translator, v = icons.fn(); return new Promise((resolve)=>{ @@ -1200,12 +1205,12 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var } ; }).then((cDisplay)=>{ - var _lang; - let tw = languages[(_lang = TETConfig.lang) !== null && _lang !== void 0 ? _lang : "en"].fn().tw; + let tw = languages[TETConfig.lang ?? "en"].fn().tw; $('#tetDemo').html(`${tw} ${cDisplay}`); $('.tet').length ? $('.tet').html(`${tw} ${cDisplay}`) : false; }); - }; + } + ; async function openlink(source, content, tr) { return new Promise((resolve)=>{ if (tr == 'lingva') { @@ -1225,12 +1230,14 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var } }).then((link)=>window.open(link, '_blank') ); - }; + } + ; function TETBtnClick(source, src, content, mode) { - mode = mode !== null && mode !== void 0 ? mode : "append"; - src = src !== null && src !== void 0 ? src : "auto"; + let tdStyle = 'align-items: end !important;font-size: inherit !important;font-weight: inherit !important;line-height: inherit !important;'; + mode = mode ?? "append"; + src = src ?? "auto"; let tetBtn = $(`
`), inlineText = `
`; - mode === "append" ? tetBtn.appendTo(source) : mode === "prepend" ? tetBtn.prependTo(source) : mode === "td" ? (source.after(tetBtn), tetBtn.attr('id', 'tet-column'), tetBtn.attr('style', 'align-items: end !important;')) : mode === "td-tweet" ? (source.before(tetBtn), tetBtn.attr('id', 'tet-tweet'), tetBtn.attr('style', 'align-items: end !important;')) : mode === "td-bio" ? (tetBtn.appendTo(source), tetBtn.attr('id', 'tet-bio')) : tetBtn.prependTo(mode); + mode === "append" ? tetBtn.appendTo(source) : mode === "prepend" ? tetBtn.prependTo(source) : mode === "nitter" ? (source.parent().parent().after(tetBtn), tetBtn.attr("style", 'margin-left: 58px; padding: 1%;')) : mode === "tdTweet" ? (source.after(tetBtn), tetBtn.attr("style", tdStyle)) : mode === "tdBio" ? (source.after(tetBtn), tetBtn.attr("style", `${tdStyle} padding-bottom: 4px !important;`)) : tetBtn.prependTo(mode); tetBtn.on("click", (e)=>{ tet.halt(e); let res, tr = TETConfig.translator; @@ -1278,62 +1285,70 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var }; const site = { nitter () { - let trTweet = $('#m > div > div > div.tweet-content.media-body'), trBio = $('div.profile-bio > p'); - return !$('.tet').length ? trTweet.length ? TETBtnClick(trTweet, "auto", trTweet.text(), $(".conversation")) : trBio.length ? TETBtnClick(trBio.parent(), "auto", trBio.text()) : false : false; - }, - tweetdeck () { - let translateTweet = $('a.js-translate-call-to-action'), btContainer = translateTweet.siblings().eq(2); // "Tweet" - if ($(".js-tweet.tweet-detail").length) { - if (!$('#tet-column').length) { - // tet.log("Injecting tweet button"); - TETBtnClick(translateTweet, $('p.js-tweet-text[lang]').attr("lang"), btContainer.text(), "td"); - } - ; - if (!$('#tet-tweet').length) { - let msg = Array.prototype.slice.apply(qs("p[lang]", true)), findNext = msg.map((item)=>item.nextElementSibling - ), findText = msg.map((item)=>item.textContent - ).filter((e)=>e - ), findLng = msg.map((item)=>item.lang - ).filter((e)=>e - ); - findLng.forEach((divs, i)=>{ - if (divs !== "und" && findText[i] && $(findNext[i]).length) { - TETBtnClick($(findNext[i]), findLng[i], findText[i], "td-tweet"); + let twt = $("div.tweet-content.media-body"), bio = $('div.profile-bio > p'), twtFN = ()=>{ + if (twt.length && !twt.siblings(".tet").length) { + for(let i = 0; i < twt.length; i++){ + let e = twt.eq(i); + if (!e.siblings(".tet").length) { + TETBtnClick(e, "auto", e.text(), "nitter"); } ; - }); + } + } + bio.length && !bio.parent().parent().siblings(".tet").length ? TETBtnClick(bio.parent().parent(), "auto", bio.text()) : false; + }; + TETConfig.delay !== "none" ? tet.delay(TETConfig.delay).then(()=>twtFN() + ) : twtFN(); + }, + tweetdeck () { + let twt = $("a.js-translate-call-to-action"), bio = $("p.prf-bio"), twtFN = ()=>{ + bio.length && !bio.siblings(".tet").length ? TETBtnClick(bio, "auto", bio.text(), "tdBio") : false; + if (twt.length && !twt.siblings(".tet").length) { + for(let i = 0; i < twt.length; i++){ + let e = twt.eq(i); + e.siblings("p[lang]").length && !e.siblings(".tet").length ? TETBtnClick(e, e.siblings("p[lang]").attr("lang"), e.siblings("p[lang]").text(), "tdTweet") : false; + } + ; } ; - } - ; + }; + TETConfig.delay !== "none" ? tet.delay(TETConfig.delay).then(()=>twtFN() + ) : twtFN(); }, twitlonger () { - let content = $('p#posttext').text(), source = $('.actions.text-right'); - return !$(".tet").length && source.length ? TETBtnClick(source, "auto", content, "prepend") : false; + let content = $('p#posttext').text(), source = $('.actions.text-right'), twtFN = ()=>{ + source.length && !source.siblings(".tet").length ? TETBtnClick(source, "auto", content, "prepend") : false; + }; + TETConfig.delay !== "none" ? tet.delay(TETConfig.delay).then(()=>twtFN() + ) : twtFN(); }, - twitter (btContainer, content = '') { - let translateTweet = $("div[lang]").eq(0).siblings().eq(0).children("span"), translateBio = $('div[data-testid="UserDescription"]').eq(0).siblings().eq(0).children("span"), source = translateTweet.parent().parent(), loggout = document.cookie.includes("twid"), tweetbtn = (user = "loggedin")=>{ - // tet.log("Injecting tweet button"); - (user === "logout") ? (btContainer = $("div[lang]").eq(0), source = btContainer.parent()) : (btContainer = translateTweet.parent().siblings().eq(0), source = translateTweet.parent().parent()); - btContainer.children("span").each((index, item)=>{ - let tweet = $(item).html().trim(); - tweet && tweet != '' && !isHTML(tweet) ? content += tweet : false; - }); - TETBtnClick(source, btContainer.attr("lang"), content); - }, biobtn = (user = "loggedin")=>{ - // tet.log("Injecting bio button"); - (user === "logout") ? (btContainer = $('div[data-testid="UserDescription"]').eq(0), source = $('div[data-testid="UserDescription"]').eq(0).parent()) : (btContainer = translateBio.parent().siblings().eq(0), source = translateBio.parent().parent()); - btContainer.children("span").each((index, item)=>{ - let bio = $(item).html().trim(); - bio && bio != '' && !isHTML(bio) ? content += bio : false; - }); - TETBtnClick(source, "auto", content); + twitter (content = '') { + let elm = $("div.css-18t94o4.r-6koalj.r-1w6e6rj.r-37j5jr.r-n6v787.r-16dba41.r-1cwl3u0.r-14gqq1x.r-bcqeeo.r-qvutc0"), twtFN = ()=>{ + for(let i = 0; i < elm.length; i++){ + let e = elm.eq(i), translateTweet = e.siblings("div[lang]"), translateBio = e.siblings("div[data-testid]"); // Bio container + if (!e.siblings(".tet").length) { + if (translateBio.length) { + translateBio.children("span").each((index, item)=>{ + let bio = $(item).html().trim(); + bio && bio != '' && !isHTML(bio) ? content += bio : false; + }); + TETBtnClick(e.parent(), "auto", content); + } + if (translateTweet.length) { + translateTweet.children("span").each((index, item)=>{ + let tweet = $(item).html().trim(); + tweet && tweet != '' && !isHTML(tweet) ? content += tweet : false; + }); + TETBtnClick(e.parent(), e.siblings("div[lang]").attr("lang"), content); + } + } + ; + } + ; }; - find.hider ? (tet.info("Hiding menu"), $('#tetMenuButton').attr('style', 'z-index: -1 !important;')) : $('#tetMenuButton').attr('style', ''); - if (!$('.tet').length) { - return translateBio.length ? biobtn() : $('div[data-testid="UserDescription"]').length && !loggout ? biobtn("logout") : translateTweet.length ? tweetbtn() : !translateTweet.length && !loggout && $("div[lang]").attr("lang") !== TETConfig.lang ? tweetbtn("logout") : false; - } - ; + TETConfig.delay !== "none" ? tet.delay(TETConfig.delay).then(()=>twtFN() + ) : twtFN(); + /logout|login|signin|signout|profile|keyboard_shortcuts|display|video|photo|compose/.test(document.location.pathname) ? (tet.info("Hiding menu"), $('#tetMenuButton').attr('style', 'z-index: -1 !important;')) : $('#tetMenuButton').attr('style', ''); }, async inject () { tet.info("Site:", lh); @@ -1348,10 +1363,6 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var }) : find.tweetdeck ? tet.query("section.js-column > div").then(()=>{ tet.observe(document.body, ()=>this.tweetdeck() ); - tet.query(".js-modals-container").then((selector)=>{ - tet.observe(selector, ()=>!$("#tet-bio").length && $('div.prf-header').length ? TETBtnClick($('p.prf-bio').parent(), "auto", $('p.prf-bio').text(), "td-bio") : false - ); - }); }) : find.twitlonger ? tet.query("#postcontent").then(this.twitlonger()) : find.nitter ? tet.query(".container").then(this.nitter()) : false; } }; @@ -1359,42 +1370,30 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var try { tet.info("Menu initialize"); tet.query('body').then($("body").append(menu)); - let nav = $('.navbackground'), menuBtn = $('button#tetMenuButton'), tetSel = qs('div#tetSelector', true), selLG = qs('select#languages'), selCS = qs('select#colorselect'), selTH = qs('select#theme'), selTR = qs('select#translator'), selDS = qs('select#display'), libre = qs('input.libre', true), lingva = qs('input.lingva'), dlAPI = qs('input.deepl'), goAPI = qs('input.google'), selAPI = qs('select#api-version'), dColor = $(".tetDisplayColor"), tColor = $(".tetTextColor"), tBG = $(".tetBackground"), legacyCheck = (th = TETConfig.theme)=>{ + let nav = $('.navbackground'), menuBtn = $('button#tetMenuButton'), tetSel = qs('div#tetSelector', true), selLG = qs('select#languages'), selCS = qs('select#colorselect'), selTH = qs('select#theme'), selTR = qs('select#translator'), selDS = qs('select#display'), selDI = qs('select#delayInject'), libre = qs('input.libre', true), lingva = qs('input.lingva'), dlAPI = qs('input.deepl'), goAPI = qs('input.google'), selAPI = qs('select#api-version'), dColor = $(".tetDisplayColor"), tColor = $(".tetTextColor"), tBG = $(".tetBackground"), autoCheck = (th = TETConfig.theme)=>{ let isAuto = /auto/.test(th), tv = isAuto ? autoTheme : th; - if (tetInfo.version === "0.32") { - return tv = th === "#FFFFFF" ? "rgb(255, 255, 255)" : th === "#15202B" ? "rgb(21, 32, 43)" : th === "#000000" ? "rgb(0, 0, 0)" : th; - } - ; return isAuto ? tv = "auto" : tv; }, tetFn = (e)=>{ tet.halt(e); $(e.target).toggleClass(`${cColor}`).children("div#tetName").toggleClass(`${cSub}`); }; - var _deepl; - dlAPI.value = (_deepl = TETConfig.api.deepl) !== null && _deepl !== void 0 ? _deepl : ""; - var _libre; - libre[0].value = (_libre = TETConfig.api.libre) !== null && _libre !== void 0 ? _libre : ""; - var _libre1; - libre[1].value = (_libre1 = TETConfig.url.libre) !== null && _libre1 !== void 0 ? _libre1 : tet.defaultcfg.url.libre; - var _lingva; - lingva.value = (_lingva = TETConfig.url.lingva) !== null && _lingva !== void 0 ? _lingva : tet.defaultcfg.url.lingva; - var _google; - goAPI.value = (_google = TETConfig.api.google) !== null && _google !== void 0 ? _google : ""; + dlAPI.value = TETConfig.api.deepl ?? ""; + libre[0].value = TETConfig.api.libre ?? ""; + libre[1].value = TETConfig.url.libre ?? tet.defaultcfg.url.libre; + lingva.value = TETConfig.url.lingva ?? tet.defaultcfg.url.lingva; + goAPI.value = TETConfig.api.google ?? ""; selAPI.value = TETConfig.api.version; - var _lang; - selLG.value = (_lang = TETConfig.lang) !== null && _lang !== void 0 ? _lang : "en"; - var _value, ref2; - let v = languages[(ref2 = (_value = selLG.value) !== null && _value !== void 0 ? _value : TETConfig.lang) !== null && ref2 !== void 0 ? ref2 : "en"].fn(); - var _colors; - selCS.value = (_colors = TETConfig.colors) !== null && _colors !== void 0 ? _colors : "r-1dgebii"; - selTH.value = legacyCheck(); + selLG.value = TETConfig.lang ?? "en"; + let v = languages[(selLG.value ?? TETConfig.lang) ?? "en"].fn(); + selCS.value = TETConfig.colors ?? "r-1dgebii"; + selTH.value = autoCheck(); selTR.value = TETConfig.translator; selDS.value = TETConfig.display; + selDI.value = TETConfig.delay; qs("input#debug").checked = TETConfig.debug; qs(".tet-url").value = TETConfig.url[selTR.value]; const TETLanguageChange = (m)=>{ - var ref; - v = languages[(ref = m !== null && m !== void 0 ? m : TETConfig.lang) !== null && ref !== void 0 ? ref : "en"].fn(); + v = languages[(m ?? TETConfig.lang) ?? "en"].fn(); $('button#tetMenuButton').attr('title', v.menu); $('button#tetMenuButton > span').text(v.menu); $('select#languages').siblings().children("span").text(v.lg); @@ -1429,25 +1428,29 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var $('.tethelper-info.tetds').text(v.display); $('.tethelper-info.tetcol').text(v.color); $('.tethelper-info.tetth').text(v.theme); + $('#delayInject > option[value="none"]').text(`0ms (${v.df})`); configDisplay(); tet.log("Language:", TETConfig.lang); }, demoUpdate = (txt)=>$(".tet-demotext").text(txt) , TETMenuUpdate = (cSel, type)=>{ - if (type === "theme") { - let isAuto = /auto/.test(cSel); - isAuto ? cSel = autoTheme : false; - cText = "r-jwli3a"; - cBG = "rgba(91, 112, 131, 0.4)"; - cSel == "rgb(255, 255, 255)" ? (cBG = "rgba(0, 0, 0, 0.4)", cTheme = "r-14lw9ot", cText = "r-18jsvk2") : cSel == "rgb(21, 32, 43)" ? cTheme = "r-yfoy6g" : cSel == "nitter" ? (cBG = "rgba(0, 0, 0, 0.4)", cTheme = "nitter", cText = "tetNTextColor") : cSel == "tweetdeck" ? (cBG = "rgba(0, 0, 0, 0.4)", cTheme = "r-tetTD") : cTheme = "r-kemksi"; - isAuto ? cSel = "auto" : cSel; - } else if (type === "colors") { + if(type === "theme") { + let isAuto = /auto/.test(cSel); + isAuto ? cSel = autoTheme : false; + cText = "r-jwli3a"; + cBG = "rgba(91, 112, 131, 0.4)"; + (cSel == "rgb(255, 255, 255)") ? (cBG = "rgba(0, 0, 0, 0.4)",cTheme = "r-14lw9ot",cText = "r-18jsvk2") : + (cSel == "rgb(21, 32, 43)") ? (cTheme = "r-yfoy6g") : + (cSel == "nitter") ? (cBG = "rgba(0, 0, 0, 0.4)",cTheme = "nitter",cText = "tetNTextColor") : + (cSel == "tweetdeck") ? (cBG = "rgba(0, 0, 0, 0.4)",cTheme = "r-tetTD") : + cTheme = "r-kemksi"; + isAuto ? cSel = "auto" : cSel; + } else if (type === "colors") { return cSel == "r-urgr8i" ? (cHover = "r-1q3imqu", cColor = "r-p1n3y5 r-1bih22f", cSub = "r-13gxpu9") : cSel == "nitter" ? (cHover = "tetNitterHover", cColor = "tetNitter", cSub = "tetNText") : cSel == "tweetdeck" ? (cHover = "r-hoverTD", cColor = "Button--primary", cSub = "tet-td") : cSel == "r-1vkxrha" ? (cHover = "r-1kplyi6", cColor = "r-v6khid r-cdj8wb", cSub = "r-61mi1v") : cSel == "r-1dgebii" ? (cHover = "r-1ucxkr8", cColor = "r-1iofnty r-jd07pc", cSub = "r-daml9f") : cSel == "r-168457u" ? (cHover = "r-njt2r9", cColor = "r-hy56xe r-11mmphe", cSub = "r-xfsgu1") : cSel == "r-18z3xeu" ? (cHover = "r-1kplyi6", cColor = "r-1xl5njo r-b8m25f", cSub = "r-1qkqhnw") : cSel == "r-b5skir" ? (cHover = "r-zx61xx", cColor = "r-5ctkeg r-1cqwhho", cSub = "r-nw8l94") : (cHover = "r-1q3imqu", cColor = "r-p1n3y5 r-1bih22f", cSub = "r-13gxpu9"); } else if (type == "translator") { $(".tet-url").show(); return cSel == "bingIT" ? ($(".bing").show(), $(".deepl").hide(), $(".google").hide(), $(".libre").hide(), $(".lingva").hide()) : cSel == "googleIT" ? ($(".google").show(), $(".bing").hide(), $(".deepl").hide(), $(".libre").hide(), $(".lingva").hide()) : cSel == "deeplIT" ? ($(".deepl").show(), $(".bing").hide(), $(".google").hide(), $(".libre").hide(), $(".lingva").hide()) : cSel == "libre" ? ($(".libre").show(), $(".bing").hide(), $(".deepl").hide(), $(".google").hide(), $(".lingva").hide(), $(".tet-url").hide()) : cSel == "lingva" || cSel == "lingvaIT" ? ($(".lingva").show(), $(".bing").hide(), $(".deepl").hide(), $(".google").hide(), $(".libre").hide(), $(".tet-url").hide()) : $('.tetFields').hide(); } }; - //#region Nitter/TweetDeck/Twitlonger if (!find.twitter && !find.tweetdeck && !find.twitlonger) { tet.loadCSS(twCSS, "foreign"); tet.loadCSS(nitterCSS, "nitter"); @@ -1463,9 +1466,7 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var tet.loadCSS(twCSS, "foreign"); tetAvatar = $(`link[rel="shortcut icon"]`).attr("href"); $('#tetAvatar').attr('style', `background-image: url(${tetAvatar}) !important;`); - } - ; - //#endregion + }; nav.attr("style", `background-color:${cBG}`); TETMenuUpdate(selTR.value, "translator"); tet.each(tBG, cTheme); @@ -1502,8 +1503,7 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var menuBtn.attr("style", ""); menuBtn.toggleClass("mini"); $(e.target).removeClass("warn").toggleClass("rm"); - var ref, ref1; - ((ref1 = (ref = selLG.value !== "en") !== null && ref !== void 0 ? ref : defaultLang !== "en") !== null && ref1 !== void 0 ? ref1 : defaultLang !== "en-US") ? demoUpdate("Hey look, I'm a foreign language!") : demoUpdate(defaultDesc); + ((selLG.value !== "en") ?? defaultLang !== "en") ?? defaultLang !== "en-US" ? demoUpdate("Hey look, I'm a foreign language!") : demoUpdate(defaultDesc); TETConfig.api.google = goAPI.value; TETConfig.api.deepl = dlAPI.value; TETConfig.api.libre = libre[0].value; @@ -1577,6 +1577,9 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var TETConfig.api.deepl = dlAPI.value; TETConfig.api.version = e.target.value; }, selAPI); + tet.ael("change", (e)=>{ + TETConfig.delay = e.target.value; + }, selDI); tet.ael("change", (e)=>{ TETConfig.debug = e.target.value; }, qs("input#debug")); @@ -1610,18 +1613,13 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var tet.info("Menu setup complete"); } catch (e) { tet.err(e); - /** [Common Error] Reloads page when TETConfig.api.deepl is not found */ if (e instanceof TypeError) { + if (e instanceof TypeError) { handleError(); tet.delay(200).then(()=>window.location.reload() ); - } - ; + }; } }; - // Section from `AC-baidu-重定向优化百度搜狗谷歌必应搜索_favicon_双列` - // Link: https://greasyfork.org/scripts/14178/code - // Version: 25.01 - // Line: 674. await Promise.all([ GM_getValue("Config") ]).then((data)=>{ @@ -1638,8 +1636,7 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var const localData = localStorage.TETConfig; localData && localData.length > 0 ? TETConfig = JSON.parse(localData) : false; for(let key in tet.defaultcfg){ - var ref; - (ref = typeof TETConfig[key]) !== null && ref !== void 0 ? ref : TETConfig[key] = tet.defaultcfg[key]; + typeof TETConfig[key] ?? (TETConfig[key] = tet.defaultcfg[key]); } ; tet.info("Configuration loaded"); @@ -1662,4 +1659,4 @@ nitterCSS = `.r-demo,.tet-help-container,#apifield,#tetSelector{border-color:var } ; }); -})(); +})(); \ No newline at end of file diff --git a/package.json b/package.json index c75f63f..9311d9e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "Twitter External Translator", "description": "Adds external & internal translators to various sites.", "author": "Magic ", - "version": "0.33", + "version": "0.34", "license": "GPL-3.0-only", "homepage": "https://github.com/magicoflolis/twitter-translator#twitter-external-translator", "bugs": { @@ -19,25 +19,25 @@ "lint:Beautify": "js-beautify -r ./dist/twittertranslator.user.js --config .jsbeautifyrc.json" }, "devDependencies": { - "@babel/cli": "^7.16.0", - "@babel/core": "^7.16.5", - "@babel/preset-env": "^7.16.5", - "@swc/cli": "^0.1.55", - "@swc/core": "^1.2.123", - "@types/babel__core": "^7.1.17", - "@types/jquery": "^3.5.11", + "@babel/cli": "^7.17.6", + "@babel/core": "^7.17.9", + "@babel/preset-env": "^7.16.11", + "@swc/cli": "^0.1.57", + "@swc/core": "^1.2.165", + "@types/babel__core": "^7.1.19", + "@types/jquery": "^3.5.14", "@types/sass": "^1.43.1", - "autoprefixer": "^10.4.0", - "eslint": "^8.5.0", - "eslint-config-prettier": "^8.3.0", - "http-server": "^14.0.0", - "js-beautify": "^1.14.0", - "node-watch": "^0.7.2" + "autoprefixer": "^10.4.4", + "eslint": "^8.13.0", + "eslint-config-prettier": "^8.5.0", + "http-server": "^14.1.0", + "js-beautify": "^1.14.3", + "node-watch": "^0.7.3" }, "dependencies": { - "dotenv": "^10.0.0", + "dotenv": "^16.0.0", "jquery": "^3.6.0", - "sass": "^1.45.1" + "sass": "^1.50.0" }, "repository": { "type": "git", diff --git a/src/main.js b/src/main.js index f8e5124..599fa00 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,8 @@ /* eslint-env greasemonkey */ (async () => { //#region Config -let tetInfo = { +let defaultDelay = "none", +tetInfo = { icon: GM_info.script.icon, name: GM_info.script.name, version: GM_info.script.version, @@ -20,7 +21,6 @@ defaultDesc = "Pretend I'm a foreign language.", lh = window.location.host, lr = window.location.href, find = { - hider: (/logout|login|signin|signout|profile|keyboard_shortcuts|display|video|photo|compose/.test(lr)), logout: (!document.cookie.includes("twid")), twitter: (lh === "twitter.com" || lh === "mobile.twitter.com"), tweetdeck: (lh === "tweetdeck.twitter.com"), @@ -928,7 +928,6 @@ languages = { }; //#endregion let TETConfig = {}, -autoTheme = find.twitter ? qs("body").style.backgroundColor : find.tweetdeck ? "tweetdeck" : find.twitlonger ? "rgb(255, 255, 255)" : "nitter", cBG = "rgba(91, 112, 131, 0.4)", cColor = "r-p1n3y5 r-1bih22f", cHover = "r-1q3imqu", @@ -953,6 +952,7 @@ tet = { display: "text + icon", colors: "r-urgr8i", theme: "auto", + delay: defaultDelay, api: { deepl: "", google: "", @@ -1290,6 +1290,22 @@ menu = `
@@ -1302,7 +1318,8 @@ menu = `