EnstylerJS

MyDealz Enstyler enhanced features incl. Amazon Mobile Redirect

目前为 2017-10-15 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name EnstylerJS
  3. // @namespace Enstyler
  4. // @description MyDealz Enstyler enhanced features incl. Amazon Mobile Redirect
  5. // @include https://nl.pepper.com/*
  6. // @include https://www.preisjaeger.at/*
  7. // @include https://www.mydealz.de/*
  8. // @include https://www.hotukdeals.com/*
  9. // @include https://userstyles.org/styles/128262/*
  10. // @include https://www.amazon.*/gp/aw/*
  11. // @version 3.10.147-min
  12. // @grant GM_getValue
  13. // @grant GM_setValue
  14. // @grant GM_xmlhttpRequest
  15. // // gnadelwartz hosted includes
  16. // @require https://cdn.rawgit.com/gnadelwartz/zepto-modules/468559e1b3dc6463a0eada49ff71d7b5407a8a26/zepto-noajax-min.js
  17. // @require https://cdn.rawgit.com/gnadelwartz/GM_config/0e4b1e4c0dd6b08499082c679850ebc0f56e6ca4/GM_config-min.js
  18. // @require https://cdn.rawgit.com/gnadelwartz/Enstyler/5b7154c71d70e16e8cffc286ed8afa4188b8477a/translations.js
  19. // @require https://cdn.rawgit.com/bitwiseshiftleft/sjcl/4fc74ff92fd6b836cc596cc0ee940ef6cc8db7c6/sjcl.js
  20. // @require https://cdn.rawgit.com/pieroxy/lz-string/c58a22021000ac2d99377cc0bf9ac193a12563c5/libs/lz-string.min.js
  21. // @run-at document-start
  22. // ==/UserScript==
  23. // commented source: https://greasyfork.org/de/scripts/24244-enstylerjs-develop?version=223879
  24. // diff to last release: https://greasyfork.org/de/scripts/24244-enstylerjs-develop/diff?v1=223879&v2=223667&context=3&w=1
  25.  
  26. function EnstylerInit() {
  27. (enUserLogin = $(".avatar--type-nav").length) ? (enUserName = $(".navDropDown a").attr(enHREF), enUserName = enUserName.replace(/.*\/profile\/([^\/]+).*/, "$1"), GM_setValue("enConfSyncUser", enUserName)) : enUserName = GM_getValue("enConfSyncUser"),
  28. enSection = enLocParser.pathname.replace(/\/([^\/]+\/*).*/, "/$1");
  29. }
  30.  
  31. function EnstylerDealActions() {
  32. if (enCSSDealz = GM_config.get("enConfCSSDealz"), myDealAction = GM_config.get("enConfDealAction"), myTouch = GM_config.get("enConfTouch"), myCompact = GM_config.get("enConfCompact"), myFixHtml = GM_config.get("enConfFixHtml"),
  33. myVotebar = GM_config.get("enConfDealVotebar"), myVotescale = GM_config.get("enConfDealVotescale"), myDealAction) {
  34. $("footer ul").length && (enDealFooter = "%0D%0A%0D%0A-- %0D%0A" + $("footer ul li p").first().html().replace(/<br>/g, "%0D%0A").replace(/<.*?>/g, ""));
  35. var e = enLocParser.pathname, n = 0;
  36. switch ("" != enUserName && (e = e.replace(enUserName + "/", "")), $(".ico--type-grid-subNavActive, .thread-list--type-card ").length && (n = 1), enDealAdd = enDealAction[0] + enDealAction[1 + n] + enDealAction[3],
  37. !0) {
  38. case e.endsWith("profile/saved-deals"):
  39. enDealAdd += enDealAction[4] + enDealAction[5 + n], +enDealAction[7], enDealUnbook = !0;
  40. break;
  41.  
  42. case e.endsWith("profile/diskussion"):
  43. case enUserLogin && e.endsWith(enUserName):
  44. enDealAdd += enDealAction[8] + enDealAction[9 + n] + enDealAction[11];
  45. }
  46. enDealAdd = enLangLocalize(enDealAdd + enDealAction[12] + enDealAction[13 + n] + enDealAction[15], enDealLang, enLANG), enSocialAdd = enLangLocalize(enDealAction[16] + enDealAction[17] + enDealAction[19], enDealLang, enLANG);
  47. var t = enHideTemp;
  48. myCompact && (t += ".space--fromW3-t-3 {padding: .3em !important;} .threadGrid-headerMeta, .threadGrid-title {height: 2.3em;}.space--mt-2, .space--mv-2 {margin-top: .25em;} .vote-box {height: 2.1em}"),
  49. myTouch && (t += "article .threadGrid-footerMeta .ico:before, article .threadItem-footerMeta .ico:before, article .threadCardLayout--row--small .ico:before{-webkit-transform: scale(1.5); transform: scale(1.5); width: 1.5em; left: .4em;}.ico--reduce3 {left: .4em;}article a.btn--circle {-webkit-transform: scale(1.5); transform: scale(1.5); left: -1em; margin-left: 3em; width: 4em;}.vote-down, .vote-up {padding-top: 0.25em; padding-bottom: 0.25em}"),
  50. addStyleString(t);
  51. }
  52. EnstylerDealActionsDo();
  53. }
  54.  
  55. function EnstylerDealActionsDo() {
  56. var e, n, t, a, o, i, l, s;
  57. enMyCSSID = genUserKey(MyCSS), (myDealAction || myTouch || myFixHtml || myVotebar) && $("article").not(".enClassActionDone, .enClassHidden").each(function() {
  58. var c = "c" != $(this).attr("id")[0];
  59. if (myDealAction && c) {
  60. e = $(".cept-comment-link", $(this)), n = $(".thread-title a", $(this)), s = n.length, s || (n = $(".thread-title", $(this)));
  61. var r = $(this).find(".userHtml");
  62. if (r.length && enTranslateText(r), enTranslateText(n), $("threadWidget-item", $(this)).length) return;
  63. o = $(".vote-temp", $(this)), o.length && (o = parseInt(o.text()), myVotebar && (l = $(".vote-temp", $(this)).attr("class").replace(/.*charcoal|.*vote-temp--/i, ""), i = o / (myVotescale / 70) + 10, 0 > i && (i *= -3),
  64. $(this).prepend('<div class="votebar vote-progress voteBar--' + l + '" style="width: ' + i + '%"></div>')), $(this).hasClass("thread--type-card") && (o = 0), o > myVotescale / 2.51 ? $(this).find(".vote-box").after(enDealFlame) : -myVotescale / 10.1 > o && $(this).find(".vote-box").after(enDealIce)),
  65. s ? ($("button.meta-ribbon-btn.hide--fromW3", $(this)).remove(), $("span.meta-ribbon.hide--toW3", $(this)).removeClass("hide--toW3"), $(".threadGrid-title .thread-title.lineClamp--2", $(this)).removeClass("lineClamp--2"),
  66. r.length || (myCompact && ($(".threadGrid-image, .threadGrid-body", $(this)).remove(), $(".threadGrid-dealBtn", $(this)).css("grid-column", "3")), $(".threadGrid-image", $(this)).css("width", "50%")),
  67. t = n[0].outerHTML.replace(/\n|\r/, "").replace(/^.*href="/, "").replace(/".*/, ""), a = enDealComposeMail($(this), n.text(), t, enDealAdd), e.append(a)) : (enCSSDealz && $(this).find("a.btn--twitter").length && (a = $(this).find("a.btn--twitter")[0].outerHTML.replace(/&amp;text=/g, "?ID=" + enMyCSSID + "&amp;text="),
  68. $(this).find("a.btn--twitter").replaceWith(a), a = $(this).find("a.btn--facebook")[0].outerHTML.replace(/&amp;title=/g, "?ID=" + enMyCSSID + "&amp;title="), $(this).find("a.btn--facebook").replaceWith(a),
  69. a = $(this).find("a.btn--whatsapp")[0].outerHTML.replace(/" rel="no/, "?ID=" + enMyCSSID + '" rel="no'), $(this).find("a.btn--whatsapp").replaceWith(a)), a = enDealComposeMail($(this), n.text(), "" + enLocParser, enSocialAdd),
  70. $(this).find("a.btn--twitter").parent().append(a));
  71. }
  72. myTouch && c && (a = $(this).find("div.aGrid, p.imgFrame--noBorder"), a.length && a.html(a.html().replace(/(<a .*?)href=/, "$1noklick=").replace(/ img--dummy.*" data-lazy-img="{&quot;src&quot;:&quot;/, '" src="').replace(/&quot;,&quot;finishClass&quot;:.* alt="/, '" alt="'))),
  73. myFixHtml && $(this).find("div.userHtml").each(function() {
  74. $(this).html($(this).html().replace(/[^ -~Ä-ü€$✘►○●✰]+|(&nbsp;)+|(\n\r)+|<\/p>|<div>/g, " ").replace(/<\/div>/g, "<br>").replace(/<p>|<br>( *<br>)+/g, "<br><br>").replace(/(<li>)(<br>)+|<br>*(<br><\/li>)/g, "$1"));
  75. }), myTouch && c && $(this).find("button .avatar").each(function() {
  76. $(this).prop("outerHTML", $(this).prop("outerHTML").replace(/thread-avatar/, "avatar--type-m"));
  77. }), $(this).addClass("enClassActionDone");
  78. });
  79. }
  80.  
  81. function enDealComposeMail(e, n, t, a) {
  82. n = encodeURIComponent(("Gnadelwartz" == enUserName ? "KayDealz" : enInternationalName) + ": " + n.replace(/\r|\n|\t/g, " ").replace(/ */g, " ")), n.length < 100 && e.find("span.thread-price").length && (n += encodeURIComponent(" -> " + e.find("span.thread-price").text().replace(/ |\t/g, "")));
  83. var o = t;
  84. return enCSSDealz && (o = t.replace(/^https:\/\/.*?\//, "https://dealz.rrr.de/" + enInternationalName + "/") + "?ID=" + enMyCSSID), a.replace(enPATTERN[enHREF], "\n\r" + t).replace(enPATTERN[enTEXT], truncStringWord(n, 160, "%20") + "&body=" + n + "%0D%0A%0D%0A" + o + enDealFooter);
  85. }
  86.  
  87. function EnstylerPagePickerCreate() {
  88. if (EnstylerPagePickerRemove(), GM_config.get("enConfPagePicker")) {
  89. var e, n, t, a = 1, o = 1;
  90. if ($(selectList).empty(), $("div.text--color-charcoalTint").length) {
  91. var i = $("nav > div.text--color-charcoalTint").html().replace(/\r?\n|\r/g);
  92. isNaN(a = parseInt(i.replace(/.*currentPage=/, ""))) && (a = 1), isNaN(o = parseInt(i.replace(/.*lastPage=/, ""))) && (o = a);
  93. }
  94. for (x = 1; x <= o; ) t = document.createElement("option"), t.text = x, selectList.add(t), n = x, e = Math.abs(x - a), x < 10 || 5 > e ? x++ : x < 1e3 && e > 600 ? x += Math.floor(e / 100) : x += Math.floor(e / 2);
  95. a > o && (o = a), o > n && (t = document.createElement("option"), t.text = o, selectList.add(t)), selectList.value = a;
  96. var l = [ ".js-navDropDown-messages", "enPageEnum js-navDropDown-messages vAlign--all-m" ];
  97. $(".test-loginButton").length && (l[0] = ".test-loginButton"), $(".voteBar").length && (l = [ ".voteBar--sticky-off--hide.hAlign--all-r", "enPageEnum subNavMenu-link subNavMenu-btn voteBar--sticky-off--hide" ]),
  98. selectList.setAttribute("class", l[1]), $(l[0]).before(selectList);
  99. }
  100. }
  101.  
  102. function EnstylerPagePickerDo() {
  103. location.search.match(/^page=/) ? selectList.value = parseint(location.search.replace(/^page=/, "")) : $(".js-sticky .text--color-charcoalTint").length && (selectList.value = parseInt($(".js-sticky .text--color-charcoalTint").html().replace(/\r?\n|\r/g).split('--toW2">' + EnstylerSiteConfig("page"))[1]));
  104. }
  105.  
  106. function EnstylerPageAction() {
  107. var e = "page=" + $(this).val(), n = ("" + enLocParser).replace(/page=.*|#.*/, "");
  108. n += n.endsWith("?") || n.endsWith("&") ? e : "?" + e, "/deals/" == enSection && (n += "#thread-comments"), window.location = n;
  109. }
  110.  
  111. function EnstylerPagePickerRemove() {
  112. $(".enPageEnum").remove();
  113. }
  114.  
  115. function EnstylerBlacklist() {
  116. enUserLogin && !GM_config.get("enConfWhitelist").includes(enUserName) && (GM_config.set("enConfWhitelist", "@" + enUserName + "," + GM_config.get("enConfWhitelist")), GM_config.setValue("enConfWhitelist", GM_config.get("enConfWhitelist")));
  117. var e = GM_config.get("enConfBlacklist").replace(unwantedRegex[0], "");
  118. enBlack = RegExp(e.replace(/^,|,$/g, "").replace(/(.),(.)/g, "$1|$2"), "i"), enBlackTrue = !" ".match(enBlack), enBlackTrue || "" == e || alert(confLang("regexfailed")), enWhite = RegExp(GM_config.get("enConfWhitelist").replace(/^,|,$/g, "").replace(/(.),(.)/g, "$1|$2"), "i"),
  119. enWhiteTrue = !" ".match(enWhite), enBlackTemp = GM_config.get("enConfHideColder"), EnstylerBlacklistRemove(), EnstylerBlacklistDo();
  120. }
  121.  
  122. function EnstylerBlacklistDo() {
  123. if (GM_config.get("enConfBlackEnable") && (enBlackTrue || enBlackTemp >= -900)) {
  124. var e;
  125. $("article").not(".enClassBlackDone, .threadWidget-item").each(function() {
  126. $(this).addClass(enClassBlackDone), e = "c" != $(this).attr("id")[0] ? $("a.thread-category", $(this)).text() + " " + $(".thread-title a", $(this)).text() + " @" + $("a.user", $(this)).text() : $(".userHtml", $(this)).text() + " @" + $(".vwo-user-link", $(this)).text(),
  127. e = e.replace(unwantedRegex[1], " "), enWhiteTrue && e.match(enWhite) || (parseInt($(".vote-temp", $(this)).text()) <= enBlackTemp || enBlackTrue && e.match(enBlack)) && ($(this).addClass(enClassHidden),
  128. enBlacklisted++, EnstylerLastSeenSkip("#" + $(this).attr(enID)));
  129. }), EnstylerBlacklistShow();
  130. }
  131. }
  132.  
  133. function EnstylerBlacklistShow() {
  134. enJSfieldDefs.enConfUnblacklist.label = enUnblackText.replace(enPATTERN[enTEXT], enBlacklisted);
  135. }
  136.  
  137. function EnstylerBlacklistRemove() {
  138. EnstylerBlacklistUnhide(), $(".enClassBlackDone").removeClass(enClassBlackDone);
  139. }
  140.  
  141. function EnstylerBlacklistUnhide() {
  142. enBlacklisted = 0, EnstylerBlacklistShow(), $(".enClassHidden").removeClass(enClassHidden);
  143. }
  144.  
  145. function EnstylerFixedNav() {
  146. if (GM_config.get("enConfNavFixed") && "/deals/" != enSection && "/gutscheine/" != enSection) {
  147. var e = $("header").html();
  148. $("header").replaceWith('<header class="enFixedNav">' + e + "</header>");
  149. var n = myFixedCSS.every;
  150. enSection == EnstylerSiteConfig("discussion") && (n += myFixedCSS.discus), ($(".nav-subheadline").length || "/profile/" == enSection) && (n += myFixedCSS.subnav), n = n.replace(enPATTERN[enTEXT], enMainHeigth),
  151. addStyleString(n);
  152. }
  153. }
  154.  
  155. function EnstylerDealTime() {
  156. TodayStart.setHours(0, 0, 0, 0), $("section.thread-list--type-card").length || (today = enLangLocalize('<span class="hide--toW2"><EN-LANG:today> </span>', enTimeLang, enLANG), oclock = enLangLocalize('<span class="hide--toW2"> <EN-LANG:oclock></span>', enTimeLang, enLANG)),
  157. yesterday = enLangLocalize("<EN-LANG:yesterday> ", enTimeLang, enLANG), EnstylerDealTimeDo();
  158. }
  159.  
  160. function EnstylerDealTimeDo() {
  161. if (GM_config.get("enConfDealTime")) {
  162. var e, n, t = Date.now();
  163. $("time").not("." + EnstylerTimeSeen).each(function() {
  164. if ($(this).addClass(EnstylerTimeSeen), e = $(this).attr("datetime"), void 0 !== e) DealDate.setTime(1e3 * e); else {
  165. if (e = $(this).text(), e.length < 8 || "Preisjaeger" == enInternationalName || e.match(/ 20[012][0-9]$/)) return;
  166. DealDate.setTime(t - (60 * parseInt(e.replace(/.* ([0-9].*) [hu].*/, "$1")) + parseInt(e.replace(/.* ([0-9].*) m.*/, "$1"))) * enMs2Min);
  167. }
  168. switch (e = $(this).html(), n = (t - DealDate) / enMs2Min, !0) {
  169. case 60 > n || n > 7200:
  170. return;
  171.  
  172. case n > 1440:
  173. e += " (" + ("" + DealDate).slice(16, 21) + oclock + ")";
  174. break;
  175.  
  176. case TodayStart > DealDate:
  177. e = yesterday + ("" + DealDate).slice(16, 21) + oclock;
  178. break;
  179.  
  180. default:
  181. e += " (" + today + ("" + DealDate).slice(16, 21) + oclock + ")";
  182. }
  183. $(this).html(e);
  184. });
  185. }
  186. }
  187.  
  188. function EnstylerLastSeen() {
  189. LastSeenOnce && (LastSeenOnce = !1, enSection.match(enMainSectionMatch) ? (enSeenArticle = GM_getValue(enSec, ""), SyncLastSeen(), EnstylerLastSeenDo(), "" == enLocParser.search && $("article").not(".threadWidget-item").each(function() {
  190. return $(this).length ? (GM_setValue(enSec, $(this).attr(enID)), GM_setValue(enSec + "Last", enSeenArticle), SaveLastSeen(), !1) : void 0;
  191. })) : EnstylerLastSeenLast());
  192. }
  193.  
  194. function EnstylerLastSeenDo() {
  195. "" != enSec && (GM_setValue("enLastCheck" + enSec, Date.now() / enMs2Min), "" !== enSeenArticle || "" !== enLoadedArticle ? (GM_setValue(enSec + "Last", enSeenArticle), $("#" + enSeenArticle).addClass("enClassMarkArticle"),
  196. $("#" + enLoadedArticle).addClass("enClassMarkArticleLoad")) : GM_setValue(enSec, "thread_1"));
  197. }
  198.  
  199. function EnstylerLastSeenLast() {
  200. var e = GM_getValue(enNewestBase + "LastSec", "");
  201. GM_setValue(e, GM_getValue(e + "Last", ""));
  202. }
  203.  
  204. function EnstylerLastSeenSkip(e) {
  205. e == "#" + GM_getValue(enSec, "") && (GM_setValue(enSec, enSeenArticle) = $(e).next().attr(enID), EnstylerLastSeenDo());
  206. }
  207.  
  208. function enCheckUpdates() {
  209. if (GM_config.get("enConfInjectCSS")) {
  210. var e = Date.now() / enMs2Min - GM_getValue("enLastUpdateCheck", "0");
  211. (e > enUpdateInterval || 0 > e) && enUpdateCSS();
  212. }
  213. }
  214.  
  215. function enUpdateCSS() {
  216. var e = parseInt(Date.now() / enMs2Min), n = enComposeUpdateOpt();
  217. enCacheExternalResource(enUpdateUrl + n, MyCSS), GM_setValue("enLastUpdateCheck", e), enSaveMyCSS();
  218. }
  219.  
  220. function enComposeUpdateOpt() {
  221. var e = GM_getValue(enCssOpt, "");
  222. if ("" == e || !e.startsWith("#")) return "";
  223. e = e.replace(/\n/g, "");
  224. var n = e.split(";");
  225. e = "";
  226. for (var t = 0; t < n.length; t++) if ("" != n[t]) {
  227. var a = n[t].split(":");
  228. a.length < 2 || (e += "&" + a[1].slice(0, -1) + "=" + a[1]);
  229. }
  230. return e = "?" + e.slice(1);
  231. }
  232.  
  233. function EnstylerMenuActions() {
  234. EnstylerNavRemove(), enInternational || EnstylerAddNav("Main", "<EN-LANG:discussion>", EnstylerSiteConfig("discussion"), "enMainDiscussion"), EnstylerAddNav("Main", "<EN-LANG:enstyler>", '<EN-LANG:enhref>" target="_blank', "enMainHomepage", "building"),
  235. EnstylerAddNav("MainButton", "<EN-LANG:settings>", showEnstylerConfig, EnstylerButton, "filter-subNavBg");
  236. }
  237.  
  238. function EnstylerAddNav(e, n, t, a, o) {
  239. (void 0 === o || "" == o) && (o = enNavIconPat);
  240. var i = !1, l = enMenuItemCode[e].replace(enPATTERN[enID], a).replace(enPATTERN[enTEXT], n);
  241. o != enNavIconPat && (l = l.split(enNavIconPat).join("--type-" + o)), "function" == typeof t ? i = !0 : l = l.replace(enPATTERN[enHREF], t), "M" == e[0] && ("" == enAddMain && $(".nav-link.navMenu-trigger").click(debounce(300, EnstylerMainDo)),
  242. enAddMain += l, i && (enAddMainFunc[enAddMainCount++] = {
  243. ID: a,
  244. target: t
  245. }));
  246. }
  247.  
  248. function EnstylerMainDo() {
  249. $(".popover-content nav .navMenu-div").first().before(enLangLocalize(enAddMain, enMenuLang, enLANG));
  250. var e = $(".popover--mainNav"), n = 35 * (enAddMain.split(enNavEntry).length - 1) + parseInt(e.attr("style").split("height: ")[1]);
  251. e.attr("style", e.attr("style").replace(/height: [0-9.]*px/, "height: " + n + "px"));
  252. for (var t = 0; enAddMainCount > t; t++) $("section #" + enAddMainFunc[t].ID).click(enAddMainFunc[t].target);
  253. }
  254.  
  255. function EnstylerNavRemove() {
  256. enAddMain = "", enAddMainFunc = [], enAddMainCount = 0, $(".navMenu-page").unbind("click"), $(".enNavEntry").remove();
  257. }
  258.  
  259. function confLang(e) {
  260. return enLangLocalize("<EN-LANG:" + e + ">", enConfigLang, enLANG);
  261. }
  262.  
  263. function showEnstylerConfig() {
  264. enGMConfigOpen ? GM_config.close() : (GM_config.open(), $(".popover--mainNav").remove(), enGMConfigOpen = !0);
  265. }
  266.  
  267. function confLangOpen() {
  268. GM_config.set("enConfLang", GM_getValue("enLang", "")), $('.GM_config button[id$="_saveBtn"]').html(enConfigLang[enLANG].save), $('.GM_config button[id$="_closeBtn"]').html(enConfigLang[enLANG].close);
  269. }
  270.  
  271. function SyncSettings() {
  272. EnGetValue(enCssOpt, enSetValue), EnGetValue(enSettings, enSetSettings);
  273. }
  274.  
  275. function SaveSettings() {
  276. GM_config.get("enConfInjectCSS") && (EnSaveValue(enCssOpt, GM_getValue(enCssOpt)), enSaveMyCSS());
  277. for (var e = "", n = 0; n < enSaveSettings.length; n++) e += enSaveSettings[n] + "=" + GM_config.get(enSaveSettings[n]) + "&";
  278. EnSaveValue(enSettings, e);
  279. }
  280.  
  281. function SaveLastSeen() {
  282. if (enAutoSync) {
  283. var e = (GM_config.get("enConfSyncTime") * enMs2Min / 2, Date.now() / enMs2Min), n = e - GM_getValue("enLastCheck" + enSec, "0");
  284. n > 5 && (delay = 500), sleepAsync(function() {
  285. EnSaveValue(enSec, GM_getValue(enSec, ""));
  286. }, GM_config.get("enConfSyncTime", 10) * enMs2Min / 2);
  287. }
  288. }
  289.  
  290. function SyncLastSeen() {
  291. if (enAutoSync) {
  292. var e = Date.now() / enMs2Min, n = e - GM_getValue("enLastCheck" + enSec, "0");
  293. (n > enSyncInterval || 0 > n) && (GM_setValue("enLastCheck" + enSec, e), EnGetValue(enSec, enSetLastSeen));
  294. }
  295. }
  296.  
  297. function enSetLastSeen(e, n) {
  298. enLoadedArticle = n, EnstylerLastSeenDo(), enLoadedArticle.replace(/thread_/i, "") > enSeenArticle.replace(/thread_/i, "") && enSetValue(e + "Last", n);
  299. }
  300.  
  301. function enSaveMyCSS() {
  302. EnSaveValue(MyCSS, GM_getValue(MyCSS).replace(/^.*?{/, "").replace(/} *@-moz-document.*/, ""), !1);
  303. }
  304.  
  305. function checkSyncSettings() {
  306. var e = GM_config.fields.enSyncKeyInput.toValue();
  307. null === e && (e = $("#undefined_field_enSyncKeyInput").val());
  308. GM_config.get("enConfSyncKey");
  309. e.length < 6 && (checkSyncReset(), e = enSyncOff), enSyncKey = e, GM_config.fields.enConfSyncKey.node.value = e, GM_config.set("enConfSyncKey", e), GM_config.fields.enSyncKeyInput.value = e, GM_config.fields.enSyncKeyInput.reload();
  310. }
  311.  
  312. function checkSyncReset() {
  313. GM_config.fields.enSyncKeyInput.value = enSyncOff, GM_config.fields.enSyncKeyInput.reload(), $("#undefined_field_enSyncKeyInput").val(enSyncOff), syncCheckBug > 0 && ($("#undefined_field_enSyncKeyInput").on("change", function() {
  314. checkSyncSettings();
  315. }), syncCheckBug--);
  316. }
  317.  
  318. function enSetSettings(e, n) {
  319. for (var t = n.split("&"), a = 0; a < t.length; a++) {
  320. GM_config.set("enConfSyncKey", enSyncOff);
  321. var o = t[a].split("=");
  322. o.length < 2 || (GM_config.fields[o[0]].value = o[1], GM_config.fields[o[0]].reload());
  323. }
  324. }
  325.  
  326. function enSaveCSS() {
  327. enSendCSS(), enSetHome(), enUpdateCSS(), EnstylerHomeButton();
  328. }
  329.  
  330. function enAmazonMobileRedirect() {
  331. var e = "" + enLocParser;
  332. return e.startsWith("https://www.amazon") ? (GM_config.get("enConfAmazonRedirect") && (e.includes("/gp/aw/d/") ? window.location.replace(e.replace("/gp/aw/d/", "/dp/")) : e.includes("/gp/aw/ol/") ? window.location.replace(e.replace("/gp/aw/ol/", "/gp/offer-listing/")) : (enDebugLog("AMAZON redirect failed ... redirect to main page"),
  333. window.location = enLocParser.protocol + enLocParser.host)), !1) : !0;
  334. }
  335.  
  336. function EnstylerStart() {
  337. EnstylerFixedNav();
  338. EnstylerLastSeen(), EnstylerDealTime(), EnstylerBlacklist(), EnstylerDealActions();
  339. }
  340.  
  341. function EnstylerDelayedInit() {
  342. var e = $(".nav").css("background-color"), n = shadeRGBColor($(".btn--mode-special").first().css("background-color"), .1), t = shadeRGBColor(e, .7);
  343. addStyleString(" .GM_config {background-color: " + e + " !important; color: " + t + "; top: " + enMainHeigth + "px !important;} .GM_config .section_header {background-color: " + shadeRGBColor(e, -.25) + " !important; color: " + t + " !important;} .nav-link-text:hover, .js-navDropDown-messages:hover, .js-navDropDown-activities:hover { background-color: " + shadeRGBColor(e, .1) + " !important;} .GM_config input[type=button] { background-color: " + n + " !important; border-color: " + n + " !important; min-width: 10em;} .GM_config input[type=button]:hover, .btn--mode-special:hover { background-color: " + shadeRGBColor(n, .2) + " !important; border-color: " + shadeRGBColor(n, .2) + " !important;}"),
  344. EnstylerMenuActions(), EnstylerPagePickerCreate(), $(".js-pagi-bottom").bind("DOMSubtreeModified", debounce(100, function() {
  345. EnstylerLastSeenDo(), EnstylerPagePickerDo(), EnstylerDealTimeDo(), EnstylerBlacklistDo(), EnstylerDealActionsDo();
  346. }));
  347. }
  348.  
  349. function WaitForBody() {
  350. if (enAmazonMobileRedirect(), $("section, footer").length) {
  351. if (GM_config.get("enConfInjectCSS") && addStyleString(GM_getValue("Enstyler2_CSS", ""), 'domain("' + enLocParser.hostname), enLocParser.pathname.match(enDisableScript)) return enDebugLog("disable Enstyler for path: " + enLocParser.pathname),
  352. void enDebugLog("regex: /settings$/");
  353. WaitForDOM();
  354. } else setTimeout(WaitForBody, 10);
  355. }
  356.  
  357. function WaitForDOM() {
  358. myColor = $(".nav, #navigation").css("background-color").replace(/rgba.*/, ""), $(".vwo-deal-button, #footer").length && "" == !myColor ? MAIN() : setTimeout(WaitForDOM, 100);
  359. }
  360.  
  361. function MAIN() {
  362. const e = Date.now();
  363. if (EnstylerInit(), enCheckUpdates(), addStyleString(enCSS), document.body.appendChild(enGMFrame), "userstyles.org" != enInternationalSite) {
  364. var n = shadeRGBColor($(".bg--main").css("background-color"), -.08);
  365. addStyleString(".bg--off {background-color: " + n + "!important;}"), enMainHeigth = getOuterHeight("header"), EnstylerStart(), EnstylerStartupDelay = Date.now() - e, EnstylerDelayedInit();
  366. } else GM_config.get("enConfInjectCSS") && addStyleString(GM_getValue("Enstyler2_CSS", ""), "url(https://userstyles.org"), EnstylerHomeButton(), setUserClick(), enSetHome(), GM_config.get("enConfInjectCSS") && addStyleString(".install-status { display: none; }"),
  367. "#style-info" == enLocParser.hash && showNotSaved();
  368. }
  369.  
  370. function showEnstylerCSS() {
  371. enGetHome(), GM_config.open();
  372. }
  373.  
  374. function EnstylerHomeButton() {
  375. $("#advancedsettings_area").attr("class", "advancedsettings_shown"), $(".advanced_button").remove(), $("select, input").unbind(), input.setAttribute("style", "font-size: 1.1em; padding: 0.8em;"), $("#button_middle").after(input),
  376. window.scrollTo(0, 600);
  377. }
  378.  
  379. function setUserClick() {
  380. $("#setting-455195").change(HideShowLogoSelect), $("#setting-451668").change(HideShowEnstyler);
  381. }
  382.  
  383. function enGetHome() {
  384. var e, n, t, a = "";
  385. $("#style-settings select").each(function() {
  386. e = $(this).attr(enID), n = $(this).val(), t = $("option[value=" + n + "]").text(), a += "#" + e + ":" + n + ":" + t + ";\n";
  387. }), $("#style-settings input[type=text]").each(function() {
  388. e = $(this).attr(enID), n = $(this).val(), t = "RGB-Clolor", a += "#" + e + ":" + n + ":" + t + ";\n";
  389. }), $("#style-settings input:checked").each(function() {
  390. e = $(this).attr(enID), n = $(this).val(), t = $("label[for=" + e + "]").text(), a += "#" + e + ":" + n + ":" + t + ";\n";
  391. }), GM_config.set("saveOpt", a), GM_setValue(enCssOpt, a), EnSaveValue(enCssOpt, a);
  392. }
  393.  
  394. function enSetHome() {
  395. input.value = confLang("options");
  396. var e = GM_getValue(enCssOpt, "");
  397. e = e.replace(/\n/g, "");
  398. var n = e.split(";");
  399. if ("" != e && e.startsWith("#")) {
  400. for (var t = 0; t < n.length; t++) {
  401. var a = n[t].split(":");
  402. a[0].startsWith("#setting") ? ($(a[0]).val(""), $(a[0]).val(a[1])) : a[0].startsWith("#option") ? $(a[0]).prop("checked", !0) : "" != a[0] && enDebugLog('ignoring unkown option: "' + a + '"');
  403. }
  404. addStyleString(GM_config.get("enConfInjectCSS") ? ".install-status { display: none; }" : ".install-status { display: inline; }"), HideShowLogoSelect(), HideShowEnstyler();
  405. }
  406. }
  407.  
  408. function showNotSaved() {
  409. input.value = confLang("optnotsave"), EnstylerHomeButton();
  410. }
  411.  
  412. function ShowHideItem(e, n, t, a) {
  413. $("#style-settings " + t).each(function() {
  414. -1 != $(this).text().indexOf(a) && ($(e).val() == n ? $(this).parent().addClass(enClassHidden) : $(this).parent().removeClass(enClassHidden));
  415. });
  416. }
  417.  
  418. function HideShowLogoSelect() {
  419. ShowHideItem("#setting-455195", "ik-logo1", "label", "MyDealz Logo");
  420. }
  421.  
  422. function HideShowEnstyler() {
  423. ShowHideItem("#setting-451668", "ik-compact1", "label", "... ");
  424. }
  425.  
  426. function enSendCSS() {
  427. isMozilla && "#style-info" == enLocParser.hash && "string" == typeof GM_info.scriptHandler && GM_info.scriptHandler.match(/usi/i) && window.open(document.referrer + "/1/" + enComposeCSS());
  428. }
  429.  
  430. function enCatchCSS() {
  431. var e = enLocParser.search.replace(/\?/, "#").replace(/=/g, ":").replace(/\&|$/g, ":notext;\n#");
  432. GM_setValue(enCssOpt, e), GM_setValue("enLastUpdateCheck", 0), window.close();
  433. }
  434.  
  435. function enComposeCSS() {
  436. var e = GM_getValue(enCssOpt, "");
  437. if ("" == e || !e.startsWith("#")) return "";
  438. e = e.replace(/\n/g, "");
  439. var n = e.split(";");
  440. e = "";
  441. for (var t = 0; t < n.length; t++) if ("" != n[t]) {
  442. var a = n[t].split(":");
  443. a.length < 2 || (e += "&" + a[0] + "=" + a[1]);
  444. }
  445. return e = "?" + e.slice(1).replace(/#/g, ""), enDebugLog(e), e;
  446. }
  447.  
  448. function mobileLog(e) {
  449. GM_setValue(saveLog, GM_getValue(saveLog) + e + "\n");
  450. }
  451.  
  452. function mobileShowLog() {
  453. alert(GM_getValue(saveLog));
  454. }
  455.  
  456. function mobileClearLog() {
  457. GM_setValue(saveLog, "Enstyler Log\n");
  458. }
  459.  
  460. function EnstylerSiteConfig(e) {
  461. return enGetSiteConfig(enInternationalName, e);
  462. }
  463.  
  464. function enGetSiteConfig(e, n) {
  465. return enSiteConfig.hasOwnProperty(e) && enSiteConfig[e].hasOwnProperty(n) ? enSiteConfig[e][n] : "";
  466. }
  467.  
  468. function enLangLocalize(e, n, t) {
  469. return enDealLang.hasOwnProperty(t) || (t = "de"), e = e.replace(enLangPat, function(e, a) {
  470. return n.hasOwnProperty(t) && n[t].hasOwnProperty(a) ? n[t][a] : a;
  471. }), e.match(enLangPat) ? enLangLocalize(e, n, t) : e;
  472. }
  473.  
  474. function addStyleString(e, n) {
  475. if (void 0 === n && (n = ""), e.match(enUserScript.detect)) {
  476. "" == n && (n = enLocParser.hostname);
  477. var t = e.split(n);
  478. e = "";
  479. for (var a = 1; a < t.length; a++) -1 != t[a].indexOf("{") && (e += t[a].replace(enUserScript.split, "").replace(enUserScript.next, ""));
  480. }
  481. for (var o, i = 0, l = enCSSmax; e.length > l && (o = e.substring(l).indexOf("}.")) > 0; ) addStyleString(e.slice(i, l += o + 1)), i = l, l += enCSSmax;
  482. var s = document.createElement("style");
  483. s.innerHTML = e.slice(i), document.body.appendChild(s);
  484. }
  485.  
  486. function capitalizeFirstLetter(e) {
  487. return e[0].toUpperCase() + e.slice(1);
  488. }
  489.  
  490. function truncStringWord(e, n, t) {
  491. return void 0 === t && (t = " "), e.length > n ? (e = e.substr(0, n - 1), e.substr(0, e.lastIndexOf(t)) + "...") : e;
  492. }
  493.  
  494. function sleepAsync(e, n) {
  495. setTimeout(e, n);
  496. }
  497.  
  498. function shadeRGBColor(e, n) {
  499. if (void 0 === n && (n = .1), void 0 === e) return "rgba(0,0,0,0)";
  500. var t = e.split(","), a = 0 > n ? 0 : 255, o = 0 > n ? -1 * n : n, i = parseInt(t[0].slice(4)), l = parseInt(t[1]), s = parseInt(t[2]);
  501. return "rgb(" + (Math.round((a - i) * o) + i) + "," + (Math.round((a - l) * o) + l) + "," + (Math.round((a - s) * o) + s) + ")";
  502. }
  503.  
  504. function debounce(e, n) {
  505. var t = null;
  506. return function() {
  507. clearTimeout(t), t = setTimeout(function() {
  508. n.call(this);
  509. }, e);
  510. };
  511. }
  512.  
  513. function enCacheExternalResource(e, n) {
  514. GM_xmlhttpRequest({
  515. method: "GET",
  516. url: e,
  517. onload: function(e) {
  518. var t = e.responseText.replace(/\r\n/g, " ").replace(enStripComments, "").replace(enFixCSS, "100%");
  519. GM_setValue(n, t), addStyleString(t);
  520. },
  521. onerror: function(e) {
  522. alert(confLang("cssfailed"));
  523. }
  524. });
  525. }
  526.  
  527. function getOuterHeight(e) {
  528. e = "string" == typeof e ? document.querySelector(e) : e;
  529. var n = window.getComputedStyle(e), t = parseFloat(n.marginTop) + parseFloat(n.marginBottom);
  530. return Math.ceil(e.offsetHeight + t);
  531. }
  532.  
  533. function enTranslateText(thisObj) {
  534. if (enLANG != enSiteLANG && thisObj.length) {
  535. var text = thisObj.html().replace(/\n|\r|\t/g, ""), html = text.replace(/.*?(<[ai].*)/, "$1");
  536. html === text && (html = "");
  537. var text = text.replace(/<(a|i).*$/, "");
  538. if ("" === text && (text = html, html = ""), text.length <= enMaxTrans) var query = enTranslateQuery.replace(/<ENSTYLER-LANG-HERE>/, enLANG).replace(/<ENSTYLER-HTML-HERE>/, encodeURI(text)), ret = GM_xmlhttpRequest({
  539. method: "GET",
  540. url: query,
  541. onload: function(res) {
  542. var trans = eval("(" + res.responseText + ")")[0][0][0];
  543. try {
  544. for (x = 1; x < 5; x++) trans += eval("(" + res.responseText + ")")[0][x][0];
  545. } catch (e) {}
  546. thisObj.html(trans + " " + html);
  547. }
  548. });
  549. }
  550. }
  551.  
  552. function EnSaveValue(e, n, t) {
  553. if ("" != enUserName && enSyncKey != enSyncOff) {
  554. if (void 0 === t && (t = !0), e + n == enSaveUrlLast) return;
  555. enSaveUrlLast = e + n;
  556. var a = t ? enEncrypt(n) : LZString.compressToEncodedURIComponent(n), o = enSaveURL + "ID=" + genUserKey(e) + "&value=" + a;
  557. GM_xmlhttpRequest({
  558. method: "GET",
  559. url: o
  560. });
  561. }
  562. }
  563.  
  564. function genUserKey(e) {
  565. return sha256_hex(enUserName + ":" + enSyncKey + "&key=" + e);
  566. }
  567.  
  568. function EnGetValue(e, n, t) {
  569. if ("" == enUserName && (enUserName = GM_getValue("enConfSyncUser")), "" != enUserName && enSyncKey != enSyncOff) {
  570. void 0 === t && (t = !0);
  571. var a = "https://dealz.rrr.de/enstyler/load.php?ID=" + genUserKey(e);
  572. GM_xmlhttpRequest({
  573. method: "GET",
  574. url: a,
  575. onload: function(a) {
  576. 200 === a.status && a.responseText.length > 5 && n(e, t ? enDecrypt(a.responseText) : LZString.decompressFromEncodedURIComponent(a.responseText));
  577. }
  578. });
  579. }
  580. }
  581.  
  582. function enSetValue(e, n) {
  583. GM_setValue(e + "", n + "");
  584. }
  585.  
  586. function enEncrypt(e) {
  587. return btoa(sjcl.encrypt(sha256_hex(enUserName + ":" + enSyncKey), e));
  588. }
  589.  
  590. function enDecrypt(e) {
  591. return sjcl.decrypt(sha256_hex(enUserName + ":" + enSyncKey), atob(e));
  592. }
  593.  
  594. function sha256_hex(e) {
  595. return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(e));
  596. }
  597.  
  598. const DEBUG = !1, DEBUGXX = !1, DEBUGXXX = !1, enLocParser = location, enInternationalSite = enLocParser.hostname.replace("www.", ""), enInternationalName = capitalizeFirstLetter(enInternationalSite.replace(/^\.|\..*/g, "")), enInternational = "Mydealz" != enInternationalName;
  599.  
  600. var enUpdateInterval = 1440, enMs2Min = 6e4, enUserLogin = !1, enUserName = "", enSection = enLocParser.pathname.replace(/\/([^\/]+\/*).*/, "/$1");
  601.  
  602. const enSyncOff = "off";
  603.  
  604. var enSyncKey = enSyncOff, enAutoSync = !1, enSyncInterval = 5, isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
  605.  
  606. /Linux/i.test(navigator.userAgent) && void 0 !== GM_info.scriptHandler && GM_info.scriptHandler.startsWith("USI") && (isMobile = !0);
  607.  
  608. const saveLog = "enMobileLog";
  609.  
  610. var enDebugLog = console.error;
  611.  
  612. isMobile && (enDebugLog = mobileLog);
  613.  
  614. var enInitTime;
  615.  
  616. const enDisableScript = /settings$/, enLangPat = /<EN-LANG:(.*?)>/g;
  617.  
  618. var enLANG;
  619.  
  620. const enSiteLANG = void 0 === enSiteConfig[enInternationalName] ? "en" : enSiteConfig[enInternationalName].lang;
  621.  
  622. "" == (enLANG = GM_getValue("enLang", "")) && (GM_setValue("enLANG", ""), enLANG = enSiteLANG);
  623.  
  624. const enDealAction = [ '<a title="<EN-LANG:post>" class="link ico ico--pos-l ico--type-comment-blue linkPlain space--h-3"href="<ENSTYLER-HREF-HERE>#comment-form" data-handler="track" data-track="{&quot;action&quot;:&quot;scroll_to_comment_add_form&quot;,&quot;label&quot;:&quot;engagement&quot;}">', '<span class="hide--toW3"><EN-LANG:post></span><span class="hide--fromW3 hide--toW2"><EN-LANG:po></span>', "", "</a>", '<a title="<EN-LANG:remove>" class="link text--color-blue ico ico--type-bookmark-blue linkPlain ico--pos-l space--h-3"data-handler="track replace" data-replace="{&quot;endpoint&quot;:&quot;https://www.mydealz.de/threads/<ENSTYLER-THREADID-HERE>/remove&quot;,&quot;method&quot;:&quot;post&quot;}" data-track="{&quot;action&quot;:&quot;save_thread&quot;,&quot;label&quot;:&quot;engagement&quot;}">', '<span class="hide--toW3"><EN-LANG:remove></span><span class="hide--fromW3 hide--toW2"><EN-LANG:rem></span>', "", "</a>", '<a title="<EN-LANG:edit>" class="link text--color-blue ico ico--type-pencil-blue linkPlain ico--pos-l space--h-3"href="<ENSTYLER-HREF-HERE>/edit" data-handler="track" data-track="{&quot;action&quot;:&quot;goto_Update startededit_form&quot;,&quot;beacon&quot;:true}">', '<span class="hide--toW3"><EN-LANG:edit></span><span class="hide--fromW3 hide--toW2"><EN-LANG:ed></span>', "", "<span></a>", '<a title="<EN-LANG:mail>" class="link text--color-blue ico ico--type-mail-blue linkPlain ico--pos-l space--h-3"href="mailto:?subject=<ENSTYLER-TEXT-HERE>" <span class="hide--toW3">', '<span class="hide--toW3"><EN-LANG:mail></span><span class="hide--fromW3 hide--toW2"><EN-LANG:ma></span>', "", "<span></a>", '<a title="<EN-LANG:mail>" class="btn btn--whatsapp btn--circle size--all-xs space--ml-2" style="background-color: #69be28;"', 'href="mailto:?subject=<ENSTYLER-TEXT-HERE>"><span class="ico ico--type-mail-white ico--reduce size--all-xxl">', "</span></a>", "</span></a>" ], enDealFlame = '<span class="vote-tempIco ico ico--type-flame2-red threadTempBadge-icon" style="position: unset; margin-left: .5em;"></span>', enDealIce = '<span class="vote-tempIco ico ico--type-snowflake-blueTint threadTempBadge-icon" style="position: unset; margin-left: .5em;"></span>', enHideTemp = ".threadTempBadge { display: none; } .flex--justify-space-between { justify-content: unset !important; }", enDealMarker = "#thread_";
  625.  
  626. var enDealAdd = "", enSocialAdd, enDealUnbook = !1, enDealFooter = "", enCSSDealz, enMyCSSID, myDealAction, myTouch, myFixHtml, myVotebar, myVotescale, myCompact;
  627.  
  628. const EnstylerPageEnum = "enPageEnum", selectList = document.createElement("select");
  629.  
  630. selectList.id = EnstylerPageEnum, selectList.setAttribute("class", EnstylerPageEnum), selectList.onchange = EnstylerPageAction;
  631.  
  632. const enClassHidden = "enClassHidden", enClassBlackDone = "enClassBlackDone";
  633.  
  634. var enBlacklisted = 0;
  635.  
  636. const unwantedRegex = [ /[\[\]\(\)\{\}\?\:\;\!\"\*\+\ ]/g, /[\[\]\(\)\{\}\?\.\:\;\!\"\*\+\,]/g ];
  637.  
  638. var enBlack, enBlackTrue, enWhite, enWhiteTrue, enBlackTemp;
  639.  
  640. const myFixedCSS = {
  641. every: ".enFixedNav { display: block; position: fixed; width: 100%; z-index: 120;} .subNav, .profileHeader, .tabbedInterface, .splitPage-wrapper {margin-top: <ENSTYLER-TEXT-HERE>px}",
  642. subnav: ".subNav {margin-top: 0 !important;} .nav-subheadline {margin-top: <ENSTYLER-TEXT-HERE>px}",
  643. discus: ".tGrid.page2-center.height--all-full {margin-top: calc(<ENSTYLER-TEXT-HERE>px + 10px);} #footer .page-content { padding-top: calc(<ENSTYLER-TEXT-HERE>px + 10px);}"
  644. };
  645.  
  646. var DealDate = new Date(), TodayStart = new Date(), EnstylerTimeSeen = "enTimeSeen", today = "", oclock = "", yesterday;
  647.  
  648. const enNewestBase = "enNewest" + enInternationalSite, enSec = enNewestBase + "-" + enSection.replace(/\//, "");
  649.  
  650. var LastSeenOnce = !0, enSeenArticle = "", enLoadedArticle = "";
  651.  
  652. const enUpdateUrl = "https://userstyles.org/styles/128262/enstyler2-style-your-mydealz.css", MyCSS = "Enstyler2_CSS", enCssOpt = "EnstylerCssOpt", enMainSectionMatch = /^\/$|^\/hot$|^\/new$|^\/settings$|^\/discussed$|^\/hei%C3%9F$|^\/diskutiert$/, enHREF = "href", enID = "id", enTEXT = "text", enPATTERN = {
  653. href: /<ENSTYLER-HREF-HERE>/g,
  654. id: /<ENSTYLER-THREADID-HERE>/g,
  655. text: /<ENSTYLER-TEXT-HERE>/g
  656. }, enNavEntry = "enNavEntry", enMenuItemCode = {
  657. Main: '<a class="enNavEntry navMenu-link" id="<ENSTYLER-THREADID-HERE>" href="<ENSTYLER-HREF-HERE>" data-handler="track" data-track="{&quot;action&quot;:&quot;goto_main_target&quot;,&quot;beacon&quot;:true}"><span class="navMenu-link-ico ico ico--type-discussion-navMenuLayerItem navMenu-ico--selected--type-discussion navMenu-ico--hover--type-discussion"></span><ENSTYLER-TEXT-HERE></a>',
  658. Sub: '<li class="enNavEntry subNavMenu-item--separator test-tablink-discussed"><a href="<ENSTYLER-HREF-HERE>" class="subNavMenu-item subNavMenu-link space--h-4 vAlign--all-m" id="<ENSTYLER-THREADID-HERE>" data-handler="track" data-track="{&quot;action&quot;:&quot;goto_menu_target sort&quot;,&quot;label&quot;:&quot;diskutiert&quot;,&quot;beacon&quot;:true}"><span class="box--all-i size--all-xl vAlign--all-m"><ENSTYLER-TEXT-HERE></span><span class="js-vue-container--threadcount" data-handler="vue" data-vue="{&quot;count&quot;:null}"></span></a></li>',
  659. MainButton: '<a class="enNavEntry navMenu-link" id="<ENSTYLER-THREADID-HERE>"><span class="navMenu-link-ico ico ico--type-discussion"></span><ENSTYLER-TEXT-HERE></a>',
  660. SubButton: '<li class="enNavEntry subNavMenu-item--separator test-tablink-discussed"><a class="subNavMenu-item subNavMenu-link space--h-4 vAlign--all-m" id="<ENSTYLER-THREADID-HERE>"><span class="box--all-i size--all-xl vAlign--all-m"><ENSTYLER-TEXT-HERE></span></a></li>'
  661. }, enMenuItemLength = enMenuItemCode.length, EnstylerButton = "EnstylerButton";
  662.  
  663. var enNavIconPat = "--type-discussion", enAddMain = "", enAddMainFunc = [], enAddMainCount = 0;
  664.  
  665. const enJSAutoUpdate = GM_info.scriptWillUpdate;
  666.  
  667. var enUpdateWindow;
  668.  
  669. const enUnblackText = enLangLocalize("<EN-LANG:unblack> <ENSTYLER-TEXT-HERE> Dealz", enConfigLang, enLANG), enJSfieldDefs = {
  670. enstylerCSS: {
  671. section: [ confLang("features"), "" ],
  672. label: confLang("configcss"),
  673. type: "button",
  674. click: function() {
  675. enUpdateWindow = window.open("https://userstyles.org/styles/128262", "UserCSS", "left=0,top=0"), GM_setValue("enLastUpdateCheck", 0);
  676. }
  677. },
  678. enstylerJS: {
  679. label: confLang("userscript"),
  680. type: "button",
  681. click: function() {
  682. enUpdateWindow = window.open("https://greasyfork.org/scripts/24243-enstylerjs/code/EnstylerJS.user.js", "UserScript", "width=110,height=110,left=0,top=0"), sleepAsync(enUpdateWindow.close, 5e3);
  683. }
  684. },
  685. dontCookies: {
  686. label: confLang("cookies"),
  687. type: "button",
  688. click: function() {
  689. window.open("https://addons.mozilla.org/firefox/addon/self-destructing-cookies/");
  690. }
  691. },
  692. mobileDebugClear: {
  693. label: "Clear Debuglog",
  694. type: "button",
  695. click: function() {
  696. mobileClearLog();
  697. }
  698. },
  699. mobileDebugShow: {
  700. label: "Show Debuglog on mobile",
  701. type: "button",
  702. click: function() {
  703. mobileShowLog();
  704. }
  705. },
  706. enConfInjectCSS: {
  707. label: confLang("injectcss"),
  708. type: "checkbox",
  709. default: !0
  710. },
  711. Section: {
  712. section: [ confLang("config"), "" ],
  713. type: "hidden"
  714. },
  715. enConfNavFixed: {
  716. label: confLang("navfixed"),
  717. type: "checkbox",
  718. default: !0
  719. },
  720. enConfDealAction: {
  721. label: confLang("dealaction"),
  722. type: "checkbox",
  723. default: !0
  724. },
  725. enConfDealVotebar: {
  726. label: confLang("dealvotebar"),
  727. type: "checkbox",
  728. default: !0
  729. },
  730. enConfDealVotescale: {
  731. label: confLang("dealvotescale"),
  732. type: "select",
  733. options: enSiteConfig.votescale,
  734. default: "500"
  735. },
  736. enConfTouch: {
  737. label: confLang("touch"),
  738. type: "checkbox",
  739. default: !1
  740. },
  741. enConfCompact: {
  742. label: confLang("compact"),
  743. type: "checkbox",
  744. default: !1
  745. },
  746. enConfCSSDealz: {
  747. label: confLang("cssdealz"),
  748. type: "checkbox",
  749. default: !0
  750. },
  751. enConfAmazonRedirect: {
  752. label: confLang("amazon"),
  753. type: "checkbox",
  754. default: !0
  755. },
  756. enConfPagePicker: {
  757. label: confLang("picker"),
  758. type: "checkbox",
  759. default: !0
  760. },
  761. enConfDealTime: {
  762. label: confLang("dealtime"),
  763. type: "checkbox",
  764. default: !0
  765. },
  766. enConfFixHtml: {
  767. label: confLang("fixhtml"),
  768. type: "checkbox",
  769. default: !0
  770. },
  771. enConfBlackEnable: {
  772. label: confLang("blacklist"),
  773. type: "checkbox",
  774. default: !0
  775. },
  776. enConfHideColder: {
  777. label: confLang("blackcold"),
  778. type: "select",
  779. options: enSiteConfig.blackcold,
  780. default: "-20"
  781. },
  782. enConfBlacklist: {
  783. label: confLang("black"),
  784. type: "text",
  785. size: 70,
  786. default: confLang("examples")
  787. },
  788. enConfWhitelist: {
  789. label: confLang("white"),
  790. type: "text",
  791. size: 70,
  792. default: ""
  793. },
  794. enConfUnblacklist: {
  795. label: confLang("unblack"),
  796. type: "button",
  797. click: function() {
  798. EnstylerBlacklistUnhide();
  799. }
  800. },
  801. enConfLang: {
  802. label: confLang("lang"),
  803. type: "select",
  804. options: enSiteConfig.languages,
  805. default: ""
  806. },
  807. syncsection: {
  808. section: [ confLang("syncconf"), "" ],
  809. type: "hidden"
  810. },
  811. enConfAutoSync: {
  812. label: confLang("autosync"),
  813. type: "checkbox",
  814. default: !0
  815. },
  816. enConfSyncTime: {
  817. label: confLang("synctime"),
  818. type: "select",
  819. options: enSiteConfig.synctimes,
  820. default: "10"
  821. },
  822. enSyncKeyInput: {
  823. label: confLang("synckey"),
  824. type: "text",
  825. size: 16,
  826. save: !1,
  827. default: "off"
  828. },
  829. enConfSyncKey: {
  830. type: "hidden",
  831. default: enSyncOff
  832. },
  833. enConfSync: {
  834. label: confLang("sync"),
  835. type: "button",
  836. click: function() {
  837. SyncSettings();
  838. }
  839. }
  840. }, enSaveSettings = [ "enConfNavFixed", "enConfDealAction", "enConfDealVotebar", "enConfTouch", "enConfAmazonRedirect", "enConfPagePicker", "enConfFixHtml", "enConfDealTime", "enConfBlackEnable", "enConfHideColder", "enConfDealVotescale", "enConfBlacklist", "enConfWhitelist", "enConfLang", "enConfAutoSync", "enConfCompact" ], enHomefieldDefs = {
  841. saveOpt: {
  842. section: [ confLang("savecss"), "" ],
  843. label: confLang("howtocss"),
  844. type: "textarea",
  845. size: 70
  846. },
  847. enConfInjectCSS: {
  848. label: confLang("injectcss"),
  849. type: "checkbox",
  850. default: !0
  851. },
  852. enConfLang: {
  853. type: "hidden",
  854. options: enSiteConfig.languages,
  855. default: ""
  856. }
  857. }, enGMFrame = document.createElement("div");
  858.  
  859. enGMFrame.setAttribute("class", "GM_config");
  860.  
  861. var enGMConfigOpen = !1;
  862.  
  863. const enRemoveConfig = [ {
  864. check: !1,
  865. switch: "enConfBlackEnable",
  866. remove: "enConfWhitelist"
  867. }, {
  868. check: !1,
  869. switch: "enConfBlackEnable",
  870. remove: "enConfBlacklist"
  871. }, {
  872. check: !1,
  873. switch: "enConfBlackEnable",
  874. remove: "enConfHideColder"
  875. }, {
  876. check: !1,
  877. switch: "enConfBlackEnable",
  878. remove: "enConfUnblacklist"
  879. } ], enSettings = "enSettings";
  880.  
  881. var syncCheckBug = 1;
  882.  
  883. if (window.location.hostname.endsWith("userstyles.org")) GM_config.init({
  884. id: "GM_config",
  885. title: confLang("headline") + " CSS",
  886. fields: enHomefieldDefs,
  887. events: {
  888. open: function() {
  889. confLangOpen();
  890. },
  891. save: function() {
  892. enSaveCSS(), GM_config.close(), sleepAsync(window.close, 1e3);
  893. },
  894. close: function() {
  895. enGMConfigOpen = !1;
  896. }
  897. },
  898. frame: enGMFrame
  899. }); else {
  900. var enFixedNavLast = !1;
  901. GM_config.init({
  902. id: enInternational ? "GM_config" + enInternationalSite : "GM_config",
  903. title: confLang("headline"),
  904. fields: enJSfieldDefs,
  905. events: {
  906. init: function() {
  907. GM_config.fields.enSyncKeyInput.value = GM_config.fields.enConfSyncKey.value;
  908. },
  909. open: function(e) {
  910. syncCheckBug = 1, GM_config.get("enConfSyncKey").length < 6 && (GM_config.set("enConfSyncKey", enSyncOff), checkSyncReset()), $("#GM_config_field_enSyncKeyInput").on("change", function() {
  911. checkSyncSettings();
  912. }), enFixedNavLast = GM_config.get("enConfNavFixed"), confLangOpen(), $(enRemoveConfig).each(function() {
  913. GM_config.get(this["switch"]) == this.check && GM_config.fields[this.remove].remove();
  914. }), enJSAutoUpdate && GM_config.fields.enstylerJS.remove(), isMozilla || GM_config.fields.dontCookies.remove(), GM_config.fields.mobileDebugShow.remove(), GM_config.fields.mobileDebugClear.remove();
  915. },
  916. save: function() {
  917. "auto" == GM_config.get("enConfLang") ? GM_setValue("enLang", "") : GM_setValue("enLang", GM_config.get("enConfLang")), SaveSettings(), GM_config.get("enConfNavFixed") || GM_config.get("enConfNavFixed") == enFixedNavLast || window.location.reload(!1),
  918. GM_config.close(), enCheckUpdates(), EnstylerStart(), EnstylerMenuActions(), EnstylerPagePickerCreate();
  919. },
  920. close: function() {
  921. enGMConfigOpen = !1;
  922. }
  923. },
  924. frame: enGMFrame
  925. }), enSyncKey = GM_config.get("enConfSyncKey"), enAutoSync = GM_config.get("enConfAutoSync"), enSyncInterval = GM_config.get("enConfSyncTime", enSyncInterval);
  926. }
  927.  
  928. const enCSS = '.threadWidget-footer::after {display: none !important}; .GM_config {left: 5% !iportant; top: 8% !important; height: auto !important; max-width: 35em !important; background-color: white;} .GM_config input, .GM_config button, .GM_config textarea { border: 1px solid; margin: 0.5em 0em 0.2em 1em; padding: 0.1em;} .GM_config .reset { font-size: 9pt; padding-right: 1em; } .GM_config { border: none !important; box-shadow: 1px 6px 9px -1px rgba(0, 0, 0, 0.3); left: 8% !important; height: auto !important; min-width: 21em; max-width: 37em !important; } .GM_config .config_header {font-size: 14pt !important; border: none !important; padding-top: 0.5em; color: #69be28; font-weight: bold; text-align: center;} .GM_config .section_header { border: none !important; background-color:#005293 !important; color: #8eaacd !important; text-align: center; margin-top: 1em;} .GM_config .field_label:hover {color: white;} .GM_config div[id$="_section_0"] {text-align: center;} .GM_config .config_var {display: inline-block;} .GM_config .field_label {display: inline-block; min-width: 14em; margin-left: 2em; } .GM_config button, .GM_config input[type=button] { font-weight: bold; text-align: center; color: #fff; background-color: #58a618 !important; } .GM_config button:hover {background-color: #a5d867 !important; border-color: #a5d867 !important;} .enClassHidden, #EnPopup_closeBtn {display: none;}';
  929.  
  930. var enMainHeigth, input = document.createElement("input");
  931.  
  932. input.type = "button", input.setAttribute(enID, EnstylerButton), input.onclick = showEnstylerCSS, input.value = confLang("options"), !enLocParser.hostname.endsWith("usertyle.org") && enLocParser.search.match(/ik-maxwidth/i) && enCatchCSS();
  933.  
  934. const isMozilla = void 0 === GM_info.scriptHandler || !GM_info.scriptHandler.startsWith("Tamp"), enUserScript = {
  935. detect: /.*?@-moz-document .*?\{\s*/,
  936. split: /^.*?\{/,
  937. next: /}\s*@-moz-document.*/
  938. }, enCSSmax = 16100, enStripComments = /\/\*.*?\*\/| *|\t/g, enFixCSS = /1111.11%/g, enTranslateQuery = "https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=<ENSTYLER-LANG-HERE>&dt=t&q=<ENSTYLER-HTML-HERE>", enMaxTrans = 300, enSaveURL = "https://dealz.rrr.de/enstyler/save.php?";
  939.  
  940. var enSaveUrlLast = "";
  941.  
  942. WaitForBody();