Enstyler

MyDealz Enstyler enhanced features

当前为 2018-08-10 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Enstyler
  3. // @namespace dealz.rrr.de
  4. // @description MyDealz Enstyler enhanced features
  5. // @author gnadelwartz
  6. // @license LGPL-3.0; http://www.gnu.org/licenses/lgpl-3.0.txt
  7. // @include https://nl.pepper.com/*
  8. // @include https://www.preisjaeger.at/*
  9. // @include https://www.mydealz.de/*
  10. // @include https://www.hotukdeals.com/*
  11. // @include https://userstyles.org/styles/128262/*
  12. // @include https://www.amazon.*/gp/aw/*
  13. // @version 4.08.102
  14. // @grant GM_getValue
  15. // @grant GM_setValue
  16. // @grant GM_xmlhttpRequest
  17. // @require https://unpkg.com/umbrellajs
  18. // @require https://cdn.rawgit.com/gnadelwartz/GM_config/3bfccb1cb4238694566ec491ee83d8df94da18d5/GM_config-min.js
  19. // @require https://cdn.rawgit.com/gnadelwartz/Enstyler/4d8dda9f1fc01e86406f2a3cb6e6865b487bc52e/translations.js
  20. // @require https://cdn.rawgit.com/pieroxy/lz-string/c58a22021000ac2d99377cc0bf9ac193a12563c5/libs/lz-string.min.js
  21. // @require https://cdn.rawgit.com/gnadelwartz/sjcl/20de886688dcabda2da1a42cd89790aacc987b09/sjcl.js
  22. // @require https://cdn.rawgit.com/delight-im/ShortURL/68cd83d33d04fb251f39dea184f7a3050b55f22d/JavaScript/ShortURL.js
  23. // @run-at document-start
  24. // ==/UserScript==
  25. // @ the original development source with comments can be found here: https://greasyfork.org/de/scripts/24244-enstylerjs-develop
  26. // @ if you don't trust this minimized script use the development source.
  27. function EnstylerInit() {
  28. (enUserLogin = u(".avatar--type-nav").length) ? (enUserName = (enUserName = u(".navDropDown a").attr(enHREF)).replace(/.*\/profile\/([^\/]+).*/, "$1"), GM_setValue("enCSyncUser", enUserName)) : enUserName = GM_getValue("enCSyncUser", ""),
  29. enSection = enLocParser.pathname.replace(/\/([^\/]+\/*).*/, "/$1");
  30. }
  31.  
  32. function EnstylerDealActions() {
  33. if (enTransTags = 5, myDealAction) {
  34. u("footer ul").length && (enDealFooter = "%0D%0A%0D%0A-- %0D%0A" + u("footer ul li p").first().innerHTML.replace(/<br>/g, "%0D%0A").replace(/<.*?>/g, ""));
  35. var e = enLocParser.pathname;
  36. switch ("" != enUserName && (e = e.replace(enUserName + "/", "")), enDealAdd = enDealAction[0], !0) {
  37. case e.endsWith("profile/diskussion"):
  38. case enUserLogin && e.endsWith(enUserName):
  39. enDealAdd += enDealAction[2];
  40. }
  41. enDealAdd = enLangLocalize(enDealAdd + enDealAction[3], enDealLang, enLANG), enSocialAdd = enLangLocalize(enDealAction[4], enDealLang, enLANG);
  42. }
  43. EnstylerDealActionsDo();
  44. }
  45.  
  46. function EnstylerDealActionsDo() {
  47. var e, t, n, a, o, i, r, l, s, c, d, f;
  48. enMyCSSID = enUserKey(""), (myDealAction || myTouch || myFixHtml || myVotebar || myPrice || enBlackTemp == enValOff) && (s = u(".thread--type-list, .cept-listing--card").length, u("article").not(".enClassActionDone, ." + enClassHidden).each(function(g) {
  49. if (u(g).addClass("enClassActionDone"), !u(g).hasClass("threadWidget--type-card--item")) if (null !== (e = u(g).attr(enID))) {
  50. if (n = u(g).find(".thread-title a"), c = "c" != e[0], enBlackTemp != enValOff && (c ? s ? (d = (u(g).find(".thread-title a").text() + " @" + u(g).find("a.user").text()).replace(unwantedRegex[1], " "),
  51. l = null !== (l = u(g).find(".vote-temp")).text() ? parseInt(l.text()) : 9999) : (l = 9999, d = "") : (d = (u(g).find(".userHtml").text() + " @" + u(g).find("a.user").text()).replace(unwantedRegex[1], " "),
  52. l = 0), (!enWhiteTrue || !d.match(enWhite)) && (enBlackTemp >= l || enBlackTrue && d.match(enBlack)))) {
  53. var p = u(g).parent();
  54. p.hasClass("threadCardLayout--card") ? p.addClass(enClassHidden) : u(g).addClass(enClassHidden), enBlacklisted++;
  55. }
  56. myFixHtml && u(g).find(".userHtml").each(function(e) {
  57. u(e).html(u(e).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"));
  58. }), myPrice && c && (d = u(g).find(".thread-price.text--b")).length && ((o = u(g).find(".cept-dealBtn")).hasClass("ico--type-redirect-white") ? o.html(d.html()) : o.html(d.html() + '<span class="ico ico--type-redirect-white size--all-xl space--l-1"></span>'),
  59. u(g).find(".cept-tb").html(d.html())), myDealAction && c && (s || (n = u(g).find(".thread-title"), enTransTags = 20), enTranslateGoogle(n), (i = u(g).find(".vote-temp")).length && (i = parseInt(i.text()),
  60. myVotebar && (l = u(g).find(".vote-temp").attr("class").replace(/.*charcoal|.*vote-temp--/i, ""), 0 > (r = i / (myVotescale / 70) + 5) && (r *= -3), f = g, s || (f = u(u(g).find("div").first())), u(f).prepend('<div class="votebar vote-progress voteBar--' + l + '" style="width: ' + r + '%;"></div>'),
  61. u(g).hasClass("thread--type-card") && (i = 0), i > myVotescale / 2.51 ? u(f).prepend(enDealFlame) : -myVotescale / 10.1 > i && u(f).prepend(enDealIce))), s ? (u(g).find("span.meta-ribbon.hide--toW3").removeClass("hide--toW3"),
  62. u(g).find(".threadGrid-title .thread-title.lineClamp--2").removeClass("lineClamp--2"), a = n.first().outerHTML.replace(/\n|\r|\t/g, "").replace(/^.*href="/, "").replace(/".*/, ""), o = enDealComposeAction(u(g), n.text(), a, enDealAdd),
  63. u(g).find(".cept-comment-link").append(o)) : (o = enDealComposeAction(u(g), n.text(), enLocParser.toString(), enSocialAdd), u(g).find("a.btn--twitter").parent().append(o))), (t = u(g).find(".userHtml")).length && enTranslateGoogle(t),
  64. c && (o = u(g).find(".threadGrid-image, .threadCardLayout--row--image")).length && o.html(o.html().replace(/ img--dummy.*" data-lazy-img="{&quot;src&quot;:&quot;/, '" src="').replace(/&quot;,&quot;finishClass&quot;:.*">/, '">'));
  65. } else u(g).remove();
  66. }), EnstylerBlacklistShow());
  67. }
  68.  
  69. function enDealComposeAction(e, t, n, a) {
  70. 100 > (t = encodeURIComponent(("Gnadelwartz" == enUserName ? "KayDealz" : enInterName) + ": " + t.replace(/\r|\n|\t/g, " ").replace(/ */g, " "))).length && e.find("span.thread-price").length && (t += encodeURIComponent(" -> " + e.find("span.thread-price").text().replace(/ |\t/g, "")));
  71. var o = n;
  72. return enCCMail && (o = n.replace(/^https:\/\/.*?\//, "https://dealz.rrr.de/" + enInterName + "/") + "?ID=" + enMyCSSID), a.replace(enPATTERN[enHREF], "\n\r" + n).replace(enPATTERN[enTEXT], truncStringWord(t, 160, "%20") + "&body=" + t + "%0D%0A%0D%0A" + o + enDealFooter);
  73. }
  74.  
  75. function EnstylerBlacklist() {
  76. enUserLogin && !GM_config.get("enConfWhitelist").includes(enUserName) && GM_config.set("enConfWhitelist", "@" + enUserName + "," + GM_config.get("enConfWhitelist"));
  77. var e = GM_config.get("enConfBlacklist").replace(unwantedRegex[0], "");
  78. enBlack = RegExp(e.replace(/^,|,$/g, "").replace(/(.),(.)/g, "$1|$2"), "i"), (enBlackTrue = !" ".match(enBlack)) || "" == e || alert(confLang("regexfailed")), enWhite = RegExp(GM_config.get("enConfWhitelist").replace(/^,|,$/g, "").replace(/(.),(.)/g, "$1|$2"), "i"),
  79. enWhiteTrue = !" ".match(enWhite), enBlackTemp = GM_config.get("enCBlackC"), enBlackTrue = enBlackTrue && enBlackTemp != enValOff;
  80. }
  81.  
  82. function EnstylerBlacklistShow() {
  83. enConfDefs.default.enCUnblackL.label = enUnblackText.replace(enPATTERN[enTEXT], enBlacklisted);
  84. }
  85.  
  86. function EnstylerBlacklistUnhide() {
  87. enBlacklisted = 0, EnstylerBlacklistShow(), u("." + enClassHidden).removeClass(enClassHidden);
  88. }
  89.  
  90. function EnstylerPagePickerCreate() {
  91. if (GM_config.get("enCPageP")) {
  92. var e, t, n, a = 1, o = 1;
  93. u(selectList).empty();
  94. var i = u("nav .cept-last-page");
  95. if (i.length) {
  96. var r = u("nav .pagination-page .hide--fromW2");
  97. isNaN(a = parseInt(r.html())) && (a = 1), isNaN(o = parseInt(i.html())) && (o = a);
  98. } else o = a = enLocParser.search.length ? parseInt(enLocParser.search.replace(/.*=/, "")) : 1;
  99. for (var l = 1; o >= l; ) (n = document.createElement("option")).text = l, selectList.add(n), t = l, e = Math.abs(a - l), 10 > l || 5 > e ? l++ : l += 1e3 > l && e > 600 ? e / 3.5 : Math.floor(e / 2),
  100. e > 9 && l > 9 && (l = 50 > e || 50 > l ? 2 * Math.floor(l / 2) : 5 * Math.floor(l / 5));
  101. a > o && (o = a), o > t && ((n = document.createElement("option")).text = o, selectList.add(n)), selectList.value = a;
  102. var s = [ ".js-navDropDown-messages", enPEnum + " js-navDropDown-messages vAlign--all-m" ];
  103. u(".test-loginButton").length && (s[0] = ".test-loginButton"), u(".voteBar").length && (s = [ ".voteBar--sticky-off--hide.hAlign--all-r", enPEnum + " subNavMenu-link subNavMenu-btn voteBar--sticky-off--hide" ]),
  104. selectList.setAttribute("class", s[1]), u(s[0]).before(selectList);
  105. }
  106. }
  107.  
  108. function EnstylerPagePickerDo() {
  109. enLocParser.search.length ? selectList.value = parseInt(location.search.replace(/.*=/, "")) : selectList.value = 1;
  110. }
  111.  
  112. function EnstylerPageAction() {
  113. var e = document.getElementById(enPEnum), t = "page=" + e.options[e.selectedIndex].value, n = enLocParser.toString().replace(/page=.*|#.*/, "");
  114. n.endsWith("?") || n.endsWith("&") ? n += t : n += "?" + t, "/deals/" == enSection && (n += "#thread-comments"), window.location = n;
  115. }
  116.  
  117. function EnstylerFixedNav() {
  118. var e = u(".subNavMenu .subNavMenu-layer").first();
  119. if (GM_config.get("enCNavF")) if ("/deals/" != enSection && "/gutscheine/" != enSection) {
  120. var t = u("header.js-sticky").html();
  121. u("header.forceLayer").replace('<header class="enFixedNav">' + t + "</header>");
  122. var n = myFixedCSS.every;
  123. enSection == EnstylerSiteConfig("discussion") && (n += myFixedCSS.discus), (u(".nav-subheadline").length || "/profile/" == enSection) && (n += myFixedCSS.subnav), addStyleString(n);
  124. } else e = u(".vote-box").first();
  125. e && e.after(enMenuButton);
  126. }
  127.  
  128. function EnstylerDealTime() {
  129. TodayStart.setHours(0, 0, 0, 0), today = enLangLocalize('<span class="hide--toW2"><EN-LANG:today>&nbsp;</span>', enTimeLang, enLANG), oclock = enLangLocalize('<span class="hide--toW2">&nbsp;<EN-LANG:oclock></span>', enTimeLang, enLANG),
  130. yesterday = enLangLocalize("<EN-LANG:yesterday> ", enTimeLang, enLANG), EnstylerDealTimeDo();
  131. }
  132.  
  133. function EnstylerDealTimeDo() {
  134. if (myDealTime) {
  135. var e, t, n, a = Date.now();
  136. u(".meta-ribbon, time, .metaRibbon").not("." + EnstylerTimeSeen).each(function(o) {
  137. if (u(o).addClass(EnstylerTimeSeen), !(e = u(o).html()).includes(" am ")) {
  138. switch (DealDate.setTime(a - (60 * parseInt(e.replace(/.* ([0-9].*) [hu].*|.*/, "$1")) + parseInt(e.replace(/.* ([0-9].*) m.*|.*/, "$1"))) * enTime2Min), t = (a - DealDate) / enTime2Min, n = DealDate.toString().slice(16, 21),
  139. !0) {
  140. case 5 > n.length || 60 > t:
  141. return;
  142.  
  143. case t > 1440:
  144. e += "&nbsp;(" + n + oclock + ")";
  145. break;
  146.  
  147. case TodayStart > DealDate:
  148. e = yesterday + n + oclock;
  149. break;
  150.  
  151. default:
  152. e += "&nbsp;(" + today + n + oclock + ")";
  153. }
  154. u(o).html(e);
  155. }
  156. });
  157. }
  158. }
  159.  
  160. function EnstylerLastSeen() {
  161. if (LastSeenOnce) if (LastSeenOnce = !1, enSection.match(enMainSectionMatch)) {
  162. if (enSeArt = GM_getValue(enSec, ""), SyncLastSeen(), EnstylerLastSeenDo(), "" == enLocParser.search) {
  163. var e = !1;
  164. u("article").not(".threadWidget-item").each(function(t) {
  165. e || 0 != u(t).find(".cept-pinned-flag").length || (GM_setValue(enSec, u(t).attr(enID)), GM_setValue(enSec + "Last", enSeArt), SaveLastSeen(), e = !0);
  166. });
  167. }
  168. } else EnstylerLastSeenLast();
  169. }
  170.  
  171. function EnstylerLastSeenDo() {
  172. if ("" != enSec) if (GM_setValue("enLastCheck" + enSec, Date.now() / enMs2Min), enSeArt) {
  173. GM_setValue(enSec + "Last", enSeArt);
  174. var e = u("#" + enSeArt);
  175. e.addClass("enClassMarkArticle"), enLaArt.startsWith("thread_") && (e = u("#" + enLaArt)).addClass("enClassMarkArticleLoad");
  176. } else GM_setValue(enSec, "thread_1");
  177. }
  178.  
  179. function EnstylerLastSeenLast() {
  180. var e = GM_getValue(enNewestBase + "LastSec", "");
  181. GM_setValue(e, GM_getValue(e + "Last", ""));
  182. }
  183.  
  184. function enCheckUpdates() {
  185. var e = Date.now() / enMs2Min - GM_getValue("enLastUpdateCheck", "0");
  186. (e > enUpdInt || 0 > e) && enUpdateCSS();
  187. }
  188.  
  189. function enUpdateCSS() {
  190. var e = parseInt(Date.now() / enMs2Min), t = enComposeUpdateOpt();
  191. enCacheExternalResource(enUpdateUrl + t, MyCSS), GM_setValue("enLastUpdateCheck", e), enSaveMyCSS();
  192. }
  193.  
  194. function enComposeUpdateOpt() {
  195. var e = GM_getValue(enCssOpt, "");
  196. if ("" == e || !e.startsWith("#")) return "";
  197. var t = (e = e.replace(/\n/g, "")).split(";");
  198. e = "";
  199. for (var n = 0; n < t.length; n++) if ("" != t[n]) {
  200. var a = t[n].split(":");
  201. 2 > a.length || (e += "&" + a[1].slice(0, -1) + "=" + a[1]);
  202. }
  203. return "?" + e.slice(1);
  204. }
  205.  
  206. function EnstylerMenuActions() {
  207. enInter || EnstylerAddNav("Main", "<EN-LANG:discussion>", EnstylerSiteConfig("discussion"), "enMainDiscussion"), EnstylerAddNav("Main", "<EN-LANG:enstyler>", '<EN-LANG:enhref>" target="_blank', "enMainHomepage", "home"),
  208. EnstylerAddNav("Main", "Enstyler Discussion", "https://www.mydealz.de/diskussion/enstyler-856062", "enMainHomepage", "page"), EnstylerAddNav("Main", "Enstyler Deal-O-Mat", "https://dealz.rrr.de/deal-O-mat/", "enMainHomepage", "home"),
  209. EnstylerAddNav("MainButton", "<EN-LANG:settings>", showEnstylerConfig, EnstylerButton, "gear-grey");
  210. }
  211.  
  212. function EnstylerAddNav(e, t, n, a, o) {
  213. void 0 !== o && "" != o || (o = enNavIconPat);
  214. var i = !1, r = enMenuItemCode[e].replace(enPATTERN[enID], a).replace(enPATTERN[enTEXT], t);
  215. o != enNavIconPat && (r = r.split(enNavIconPat).join("#" + o)), "function" == typeof n ? i = !0 : r = r.replace(enPATTERN[enHREF], n), "M" == e[0] && ("" == enAddMain && u(".nav-link.navMenu-trigger").on("click", function() {
  216. setTimeout(EnstylerMainDo, 200);
  217. }), enAddMain += r, i && (enAddMainFunc[enAddMainCount++] = {
  218. ID: a,
  219. target: n
  220. }));
  221. }
  222.  
  223. function EnstylerMainDo() {
  224. if (!enAddMainDone) {
  225. enAddMainDone = !0, u(".popover-content nav .navMenu-div").first().insertAdjacentHTML("beforebegin", enLangLocalize(enAddMain, enMenuLang, enLANG));
  226. var e = u(".popover--mainNav"), t = 35 * (enAddMain.split(enNavEntry).length - 1) + parseInt(e.attr("style").split("height: ")[1]);
  227. e.attr("style", e.attr("style").replace(/height: [0-9.]*px/, "height: " + t + "px"));
  228. for (var n = 0; enAddMainCount > n; n++) u("section #" + enAddMainFunc[n].ID).on("click", enAddMainFunc[n].target);
  229. }
  230. }
  231.  
  232. function confLang(e) {
  233. return enLangLocalize("<EN-LANG:" + e + ">", enConfigLang, enLANG);
  234. }
  235.  
  236. function confMess(e) {
  237. return enLangLocalize("<EN-LANG:" + e + ">", enMessageLang, enLANG);
  238. }
  239.  
  240. function showEnstylerConfig() {
  241. u("body").prepend('<div id="enOverDim"></div>'), GM_config.open(), document.getElementById("main").click(), enGMConfigOpen = !0;
  242. }
  243.  
  244. function closeEnstylerConfig() {
  245. u("#enOverDim").remove(), enGMConfigOpen = !1;
  246. }
  247.  
  248. function confLangOpen() {
  249. u('.GM_config button[id$="_saveBtn"]').html(confLang("save")), u('.GM_config button[id$="_closeBtn"]').html(confLang("close")), u("#GM_config_resetLink").html(confMess("reset"));
  250. }
  251.  
  252. function EnstylerSyncIDShow() {
  253. enSyncKey != enValOff && (u('.GM_config input[id$="_field_enCSync"]').first().value = confLang("sync") + " " + enUserKey(""));
  254. }
  255.  
  256. function SyncSettings() {
  257. EnGetValue("", enSetValue), EnGetValue(enSettings, enSetSettings);
  258. }
  259.  
  260. function SaveSettings() {
  261. EnSaveValue(enCssOpt, GM_getValue(enCssOpt, "")), enSaveMyCSS();
  262. for (var e = "", t = 0; t < enSaveSettings.length; t++) e += enSaveSettings[t] + "=" + GM_config.get(enSaveSettings[t]) + "&";
  263. EnSaveValue(enSettings, e);
  264. }
  265.  
  266. function SaveLastSeen() {
  267. enAutoSync && (Date.now() / enMs2Min - GM_getValue("enLastCheck" + enSec, "0") > 5 && (delay = 500), setTimeout(function() {
  268. EnSaveValue(enSec, GM_getValue(enSec, ""));
  269. }, 1 * enMs2Min / 2));
  270. }
  271.  
  272. function SyncLastSeen() {
  273. if (enAutoSync) {
  274. var e = Date.now() / enMs2Min, t = e - GM_getValue("enLastCheck" + enSec, "0");
  275. (t > 1 || 0 > t) && (GM_setValue("enLastCheck" + enSec, e), EnGetValue(enSec, enSetLastSeen));
  276. }
  277. }
  278.  
  279. function enSetLastSeen(e, t) {
  280. enLaArt = t, EnstylerLastSeenDo(), enLaArt.replace(/thread_/i, "") > enSeArt.replace(/thread_/i, "") && enSetValue(e + "Last", t);
  281. }
  282.  
  283. function enSaveMyCSS() {
  284. EnSaveValue("", extraCSS + GM_getValue(MyCSS, "").replace(/^.*?{/, "").replace(/} *@-moz-document.*/, ""), !1);
  285. }
  286.  
  287. function enSetSettings(e, t) {
  288. for (var n = t.split("&"), a = 0; a < n.length; a++) {
  289. var o = n[a].split("=");
  290. o.length >= 2 && enSaveSettings.includes(o[0]) && ("false" == o[1] ? GM_config.fields[o[0]].value = !1 : GM_config.fields[o[0]].value = o[1], GM_config.fields[o[0]].reload());
  291. }
  292. }
  293.  
  294. function enAmazonMobileRedirect() {
  295. var e = enLocParser.href;
  296. return !!e.startsWith("https://www.amazon") && (GM_config.get("enCRedirect") && (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"),
  297. window.location = enLocParser.protocol + enLocParser.host)), !0);
  298. }
  299.  
  300. function EnstylerStart() {
  301. EnstylerShowPage(), EnstylerFixedNav(), EnstylerLastSeen(), EnstylerDealTime(), EnstylerBlacklist(), EnstylerDealActions();
  302. }
  303.  
  304. function EnstylerRedo() {
  305. EnstylerShowPage(), EnstylerLastSeenDo(), EnstylerPagePickerDo(), EnstylerDealTimeDo(), EnstylerDealActionsDo();
  306. }
  307.  
  308. function EnstylerShowPage() {
  309. if (myDealTime) {
  310. var e = u(".search-input");
  311. e.lenth || e.nodes[0].setAttribute("placeholder", enShowDate + enLangLocalize(" <EN-LANG:oclock>", enTimeLang, enLANG) + ("/" == enLocParser.pathname ? " (home" : " (" + enLocParser.pathname.replace(/(^.*)[\/]|-.*/g, "")) + (enLocParser.search.length ? " |" + enLocParser.search.replace(/.*=/, "") + "|" : "") + ")");
  312. }
  313. }
  314.  
  315. function EnstylerDelayedInit() {
  316. var e = shadeRGBColor(getStyle(u(".nav").first(), "background-color"), .1), t = shadeRGBColor(getStyle(u(".btn--mode-special").first(), "background-color"), .1), n = shadeRGBColor(e, .7), a = medainRGBColor(getStyle(u("#main").first(), "background-color")) > 100 ? "" : ".notification-item {color: #111;} body, .user, .thread-title, .subNavMenu-link, .mute--text2 {color: #aaa !important} .notification-item--read, .card-title, .mute--text, .userHtml-quote, .userHtml .userHtml-quote-source, .widget-title, .linkGrey, .thread-userOptionLink, .btn--mode-white--dark, .btn--mode-boxSec, .thread--expired.thread--type-card, .thread--expired.thread--type-list {color: #888;} article, section {border: 1px #666 solid} img, .votebar, .vote-tempIco, .vote-temp, .vote-temp--hot, .text--color-red, .vote-btn, .emoji, .ico, .dot {filter: grayscale(.25);}";
  317. addStyleString(" .GM_config {background-color: " + e + " !important; color: " + n + ";} .GM_config select {background-color: " + e + " !important;} .GM_config .section_header, .GM_config .config_header {background-color: " + shadeRGBColor(e, -.25) + " !important; color: " + n + " !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: " + t + " !important; border-color: " + t + " !important; min-width: 10em;} .GM_config input[type=button]:hover, .btn--mode-special:hover { background-color: " + shadeRGBColor(t, .2) + " !important; border-color: " + shadeRGBColor(t, .2) + " !important;} .bg--inverted { background-color: " + t + " }" + a),
  318. EnstylerMenuActions(), EnstylerPagePickerCreate(), isMobile ? u("#main").on("DOMSubtreeModified", debounce(300, function() {
  319. window.requestAnimationFrame(EnstylerRedo);
  320. })) : u(".js-pagi-bottom").on("DOMSubtreeModified", debounce(200, function() {
  321. window.requestAnimationFrame(EnstylerRedo);
  322. }));
  323. }
  324.  
  325. function WaitForBody() {
  326. if (!enAmazonMobileRedirect()) if (u("#messages-list").length || u("#footer").length) {
  327. if (enEarlyInit(), enLocParser.pathname.match(enDisableScript)) return;
  328. WaitForDOM();
  329. } else window.requestAnimationFrame(WaitForBody);
  330. }
  331.  
  332. function WaitForDOM() {
  333. var e = getStyle(u(".nav, #navigation").first(), "background-color").replace(/[^\(]*/, "");
  334. u(".vwo-deal-button, #footer").length && "" != e ? MAIN() : window.requestAnimationFrame(function() {
  335. setTimeout(WaitForDOM, 80);
  336. });
  337. }
  338.  
  339. function enEarlyInit() {
  340. addStyleString(GM_getValue("Enstyler2_CSS", ""), 'domain("' + enLocParser.hostname), enCCMail = GM_config.get("enCCMail"), myDealAction = GM_config.get("enCDealA"), myTouch = GM_config.get("enCTouch"),
  341. myCompact = GM_config.get("enCCompact"), myPrice = GM_config.get("enCPrice"), myFixHtml = GM_config.get("enCFixHtml"), myVotescale = GM_config.get("enCDealVbar"), myVotebar = myVotescale != enValOff,
  342. myDealTime = GM_config.get("enCDealT"), myPrice && (extraCSS += ".threadGrid-title .flex, .threadGrid-title .overflow--fade {display: none;}"), myCompact && (extraCSS += ".threadGrid {padding: .3em !important;} .threadGrid-headerMeta, .threadGrid-title {height: 2.8em;}.thread-title {white-space: nowrap;} .threadGrid-headerMeta {height: 2.3em;} .thread--compact .threadGrid-image {display: none}.space--mt-2, .space--mv-2 {margin-top: .25em;} .vote-box {height: 2.1em} .votebar {top: 0;} .threadTempBadge-icon {font-size: 1.3em !important;}",
  343. myPrice && (enCSS += ".threadGrid-headerMeta, .threadGrid-title {height: 2em !important;}")), myTouch && (extraCSS += "article .footerMeta-actionSlot .ico::before, article .threadItem-footerMeta .ico::before, article .threadCardLayout--row--small .ico::before, .thread-userOptionLink.ico:before {-webkit-transform: scale(1.7); transform: scale(1.7); width: 1.5em; left: .4em;}.ico--reduce3 {left: .5em;} #emergency {transform: scale(1.5); margin-left: .7em;}article a.btn--ctrl--fixed {-webkit-transform: scale(1.2); transform: scale(1.2); left: 0; margin-left: 3em; min-width: 4em;}.vote-down, .vote-up {padding-top: 0.25em; padding-bottom: 0.25em} .thread-avatar { width: 2.3em; height: 2.3em;}"),
  344. myVotebar || (extraCSS += ".threadTempBadge { display: unset; }"), myDealAction && (extraCSS += "button.meta-ribbon-btn.hide--fromW3 {display: none}"), addStyleString(enCSS + extraCSS + enNavCSS);
  345. }
  346.  
  347. function MAIN() {
  348. EnstylerInit(), enCheckUpdates(), document.body.appendChild(enGMFrame), addStyleString(".bg--off {background-color: " + shadeRGBColor(getStyle(u(".bg--main").first(), "background-color"), -.08) + "!important;}"),
  349. EnstylerStart(), setTimeout(EnstylerDelayedInit, 300);
  350. }
  351.  
  352. function enUserstyleDo() {
  353. u("#EnstylerButton").length || (document.body.appendChild(enGMFrame), addStyleString(enCSS + "#buttons {visibility: hidden;} #ownedButtons {visibility: visible; border: 1px solid red;}"), addStyleString(GM_getValue("Enstyler2_CSS", ""), "url(https://userstyles.org"),
  354. setTimeout(createEnstylerButton, 1e3));
  355. }
  356.  
  357. function createEnstylerButton() {
  358. u("#advancedsettings_area").attr("class", "advancedsettings_shown"), u(".advanced_button").remove(), input.setAttribute("style", "font-size: 1.3em; padding: 0.7em; background-color: #69be28; color: white; border-radius: 8px; border: 1px solid grey; margin-top: 1em; font-weight: bold;"),
  359. u("#style-settings").before(input), window.scrollTo(100, 400), enSetOptions();
  360. }
  361.  
  362. function saveEnstylerCSS() {
  363. enSaveOptions(), setTimeout(window.close, 1e3);
  364. }
  365.  
  366. function enSaveOptions() {
  367. var e, t, n, a = "";
  368. u("#style-settings select").each(function(o) {
  369. e = u(o).attr(enID), t = o.value, n = u("option[value=" + t + "]").text(), a += "#" + e + ":" + t + ":" + n + ";\n";
  370. }), u("#style-settings input[type=text]").each(function(o) {
  371. e = u(o).attr(enID), t = o.value, a += "#" + e + ":" + t + ":" + (n = "RGB-Clolor") + ";\n";
  372. }), u("#style-settings input:checked").each(function(o) {
  373. e = u(o).attr(enID), t = o.value, n = u("label[for=" + e + "]").text(), a += "#" + e + ":" + t + ":" + n + ";\n";
  374. }), GM_config.set("saveOpt", a), GM_setValue(enCssOpt, a);
  375. }
  376.  
  377. function enSetOptions() {
  378. input.value = confLang("options");
  379. var e = GM_getValue(enCssOpt, ""), t = (e = e.replace(/\n/g, "")).split(";");
  380. if ("" != e && e.startsWith("#")) {
  381. for (var n = 0; n < t.length; n++) {
  382. var a = t[n].split(":");
  383. a[0].startsWith("#setting") ? (u(a[0]).first().selectedIndex = "-1", u(a[0]).first().value = a[1]) : a[0].startsWith("#option") ? u(a[0]).first().checked = !0 : "" != a[0] && enDebugLog('ignoring unkown option: "' + a + '"');
  384. }
  385. addStyleString("#button { display: none; }");
  386. }
  387. }
  388.  
  389. function enComposeCSS() {
  390. var e = GM_getValue(enCssOpt, "");
  391. if ("" == e || !e.startsWith("#")) return "";
  392. var t = (e = e.replace(/\n/g, "")).split(";");
  393. e = "";
  394. for (var n = 0; n < t.length; n++) if ("" != t[n]) {
  395. var a = t[n].split(":");
  396. 2 > a.length || (e += "&" + a[0] + "=" + a[1]);
  397. }
  398. return e = "?" + e.slice(1).replace(/#/g, ""), enDebugLog(e), e;
  399. }
  400.  
  401. //var isIE = /*@cc_on!@*/false || !!document.documentMode;
  402. function mobileLog(e) {
  403. GM_setValue(saveLog, GM_getValue(saveLog, "") + e + "\n");
  404. }
  405.  
  406. function mobileShowLog() {
  407. GM_getValue(saveLog, "");
  408. }
  409.  
  410. function mobileClearLog() {
  411. GM_setValue(saveLog, "Enstyler Log\n");
  412. }
  413.  
  414. function EnstylerSiteConfig(e) {
  415. return enGetSiteConfig(enInterName, e);
  416. }
  417.  
  418. function enGetSiteConfig(e, t) {
  419. return enSiteConfig.hasOwnProperty(e) && enSiteConfig[e].hasOwnProperty(t) ? enSiteConfig[e][t] : "";
  420. }
  421.  
  422. function enLangLocalize(e, t, n) {
  423. return enDealLang.hasOwnProperty(n) && void 0 !== t[n] || (n = "en"), (e = e.replace(enLangPat, function(e, a) {
  424. return t.hasOwnProperty(n) && t[n].hasOwnProperty(a) ? t[n][a] : a;
  425. })).match(enLangPat) ? enLangLocalize(e, t, n) : e;
  426. }
  427.  
  428. function addStyleString(e, t) {
  429. // check if style contains @-moz-document rules
  430. if (void 0 === t && (t = ""), e.match(enUserScript.detect)) {
  431. "" == t && (t = enLocParser.hostname);
  432. var n = e.split(t);
  433. e = "";
  434. for (var a = 1; a < n.length; a++) -1 != n[a].indexOf("{") && (e += n[a].replace(enUserScript.split, "").replace(enUserScript.next, ""));
  435. }
  436. for (var o, i = 0, r = enCSSmax; e.length > r && (o = e.substring(r).indexOf("}.")) > 0; ) addStyleString(e.slice(i, r += o + 1)), i = r, r += enCSSmax;
  437. var l = document.createElement("style");
  438. l.innerHTML = e.slice(i), document.body.appendChild(l);
  439. }
  440.  
  441. function capitalizeFirstLetter(e) {
  442. return e[0].toUpperCase() + e.slice(1);
  443. }
  444.  
  445. function truncStringWord(e, t, n) {
  446. return void 0 === n && (n = " "), e.length > t ? (e = e.substr(0, t - 1)).substr(0, e.lastIndexOf(n)) + "..." : e;
  447. }
  448.  
  449. function shadeRGBColor(e, t) {
  450. if (void 0 === t && (t = .1), void 0 === e) return "rgba(0,0,0,0)";
  451. var n = e.split(","), a = 0 > t ? 0 : 255, o = 0 > t ? -1 * t : t, i = parseInt(n[0].slice(4)), r = parseInt(n[1]), l = parseInt(n[2]);
  452. return "rgb(" + (Math.round((a - i) * o) + i) + "," + (Math.round((a - r) * o) + r) + "," + (Math.round((a - l) * o) + l) + ")";
  453. }
  454.  
  455. function medainRGBColor(e) {
  456. var t = e.split(","), n = parseInt(t[0].slice(4)), a = parseInt(t[1]), o = parseInt(t[2]);
  457. return Math.round((n + a + o) / 3);
  458. }
  459.  
  460. function debounce(e, t) {
  461. var n = null;
  462. return function() {
  463. clearTimeout(n), n = setTimeout(function() {
  464. t.call(this);
  465. }, e);
  466. };
  467. }
  468.  
  469. /* curreently we assume its a CSS or JS File, so we strip comments and @namespace @moz-document... */ function enCacheExternalResource(e, t) {
  470. GM_xmlhttpRequest({
  471. method: "GET",
  472. url: e,
  473. onload: function(e) {
  474. var n = e.responseText.replace(/\r\n/g, " ").replace(/\/\*.*?\*\/| *|\t/g, "").replace(/([:;]) /g, "$1").replace(/1111.11%/g, "100%");
  475. n.length > 60 && (GM_setValue(t, n), addStyleString(n));
  476. },
  477. onerror: function() {
  478. alert(confMess("cssfailed"));
  479. }
  480. });
  481. }
  482.  
  483. function enTranslateGoogle(thisObj) {
  484. if (enLANG != enSiteLANG && thisObj.length) {
  485. var text = thisObj.html().replace(/[#\(\)]|\n|\r|\t/g, ""), html = "", transTags = [], count, match, buff = "", last = 0, regex = /<.*?>/gi;
  486. for (count = 0; match = regex.exec(text); count++) {
  487. if (count > enTransTags || buff.length + (match.index - last) > enMaxTrans) {
  488. var space = text.lastIndexOf(" ", last + (enMaxTrans - buff.length));
  489. buff += text.slice(last, last + space), html = text.slice(last + space);
  490. break;
  491. }
  492. transTags[count] = match[0], buff += text.slice(last, match.index) + '<a href="' + count + '">', last = regex.lastIndex;
  493. }
  494. if (buff.length || (buff = text, buff.length <= enMaxTrans)) var query = enGoogleTransURL.replace(/<ENSTYLER-LANG-HERE>/, enLANG).replace(/<ENSTYLER-HTML-HERE>/, encodeURI(buff)), ret = GM_xmlhttpRequest({
  495. method: "GET",
  496. url: query,
  497. onload: function(res) {
  498. text = eval("(" + res.responseText + ")")[0][0][0];
  499. try {
  500. for (x = 1; 5 > x; x++) text += eval("(" + res.responseText + ")")[0][x][0];
  501. } catch (e) {}
  502. for (count--; count >= 0; count--) text = text.replace(RegExp('< *a href *= *"' + count + '" *>'), transTags[count]);
  503. thisObj.html(text + " " + html);
  504. }
  505. });
  506. }
  507. }
  508.  
  509. function EnSaveValue(e, t, n) {
  510. if ("" != enUserName && enSyncKey != enValOff) {
  511. if (void 0 === n && (n = !0), e + t == enSaveUrlLast) return;
  512. enSaveUrlLast = e + t;
  513. var a = n ? enEncrypt(t) : LZString.compressToEncodedURIComponent(t), o = enSaveURL + "ID=" + enUserKey(e) + "&value=" + a;
  514. GM_xmlhttpRequest({
  515. method: "GET",
  516. url: o
  517. });
  518. }
  519. }
  520.  
  521. function EnGetValue(e, t, n) {
  522. if ("" == enUserName && (enUserName = GM_getValue("enCSyncUser", "")), "" != enUserName && enSyncKey != enValOff) {
  523. void 0 === n && (n = !0);
  524. var a = "https://dealz.rrr.de/enstyler/load.php?ID=" + enUserKey(e);
  525. GM_xmlhttpRequest({
  526. method: "GET",
  527. url: a,
  528. onload: function(a) {
  529. 200 === a.status && a.responseText.length > 30 && t(e, n ? enDecrypt(a.responseText) : LZString.decompressFromEncodedURIComponent(a.responseText));
  530. }
  531. });
  532. }
  533. }
  534.  
  535. function enSetValue(e, t) {
  536. GM_setValue(e + "", t + "");
  537. }
  538.  
  539. function enEncrypt(e) {
  540. return btoa(sjcl.encrypt(enUserKey(""), e));
  541. }
  542.  
  543. function enDecrypt(e) {
  544. return sjcl.decrypt(enUserKey(""), atob(e));
  545. }
  546.  
  547. function enUserKey(e) {
  548. return enShortKey(enUserName + enSyncKey + e);
  549. }
  550.  
  551. function enShortKey(e) {
  552. return ShortURL.encode(parseInt(e.toLowerCase().split("").map(function(e) {
  553. return "eariotnslcudpmhgbfywkvxzjq".indexOf(e) + 1 || "9876543210".indexOf(e) + 1 || "";
  554. }).join("")));
  555. }
  556.  
  557. function getStyle(e, t) {
  558. if (window.getComputedStyle) try {
  559. return getComputedStyle(e).getPropertyValue(t);
  560. } catch (e) {} else if (e.currentStyle) try {
  561. return e.currentStyle[t];
  562. } catch (e) {}
  563. return "";
  564. }
  565.  
  566. var DEBUG = !1, DEBUGXX = !0, DEBUGXXX = !1, DEBUGINT = !1, enLocParser = location, enInterSite = enLocParser.hostname.replace("www.", ""), enInterName = capitalizeFirstLetter(enInterSite.replace(/^\.|\..*/g, "")), enInter = "Mydealz" != enInterName, enUpdInt = 1440, enMs2Min = 6e4, enTime2Min = enMs2Min, enUserLogin = !1, enUserName = "", enSection = enLocParser.pathname.replace(/\/([^\/]+\/*).*/, "/$1"), enValOff = "off", enSyncKey = enValOff, enAutoSync = !1, isFirefox = "undefined" != typeof InstallTrigger, isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
  567.  
  568. /Linux/i.test(navigator.userAgent) && void 0 !== GM_info.scriptHandler && GM_info.scriptHandler.startsWith("USI") && (isMobile = !0);
  569.  
  570. var saveLog = "enMobileLog", enDebugLog = console.error, enInitTime;
  571.  
  572. mobileClearLog();
  573.  
  574. var enDisableScript = /settings$/, enLangPat = /<EN-LANG:(.*?)>/g, enSiteLANG = void 0 === enSiteConfig[enInterName] ? "en" : enSiteConfig[enInterName].lang, enLANG = enSiteLANG, enHostpath = enLocParser.protocol + "//" + enLocParser.host + enLocParser.pathname, enDealAction = [ '<a title="<EN-LANG:post>" class="space--h-1" style="font-size: xx-large"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;}">+</a>', '<a title="<EN-LANG:remove>"class="space--h-1" style="font-size: x-large"data-handler="track replace" data-replace="{&quot;endpoint&quot;:&quot;https://www.mydealz.de/threads/<ENSTYLER-ID-HERE>/remove&quot;,&quot;method&quot;:&quot;post&quot;}" data-track="{&quot;action&quot;:&quot;save_thread&quot;,&quot;label&quot;:&quot;engagement&quot;}">-</a>', '<a title="<EN-LANG:edit>" class="space--h-1" style="font-size: x-large"href="<ENSTYLER-HREF-HERE>/edit" data-handler="track" data-track="{&quot;action&quot;:&quot;goto_Update startededit_form&quot;,&quot;beacon&quot;:true}"><span>E</a>', '<a title="<EN-LANG:mail>" class="space--h-1" style="font-size: x-large"href="mailto:?subject=<ENSTYLER-TEXT-HERE>" <span class="hide--toW3"><span>M</a>', '<a title="<EN-LANG:mail>" class="btn btn--messenger btn--mail 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><svg width="22px" height="22px" class="icon icon--mail icon-u--1"><use xlink:href="/assets/img/ico_39d8b.svg#mail"></use></svg><span class="space--ml-2"><EN-LANG:mail></span></a>' ], enDealFlame = '<span class="vote-tempIco ico ico--type-flame2-red threadTempBadge-icon" style="position: absolute; display: block; margin-left: .3em; font-size: 2em;"></span>', enDealIce = '<span class="vote-tempIco ico ico--type-snowflake-blueTint threadTempBadge-icon" style="position: absolute; display: block; margin-left: .3em; font-size: 2em;"></span>', enDealMarker = "#thread_", enDealAdd = "", enSocialAdd, enDealFooter = "", enCCMail, enMyCSSID, myDealAction, myTouch, myFixHtml, myVotebar, myVotescale, myCompact, myPrice, myDealTime, enClassHidden = "enClassHidden", enClassBlackDone = "enClassBlackDone", enBlacklisted = 0, unwantedRegex = [ /[\[\]\(\)\{\}\?\:\;\!\"\*\+\ ]/g, /[\[\]\(\)\{\}\?\.\:\;\!\"\*\+\,\n\r\t]+/g ], enBlack, enBlackTrue, enWhite, enWhiteTrue, enBlackTemp, enPEnum = "enPageEnum", selectList = document.createElement("select");
  575.  
  576. selectList.id = enPEnum, selectList.setAttribute("class", enPEnum), selectList.onchange = EnstylerPageAction;
  577.  
  578. var myFixedCSS = {
  579. every: ".enFixedNav { display: block; position: fixed; width: 100%; z-index: 120;} .listingProfile {margin-bottom: -55px}.listingProfile, .subNav, .profileHeader, .tabbedInterface, .splitPage-wrapper {margin-top: 55px}",
  580. subnav: ".subNav {margin-top: 0 !important;} .nav-subheadline {margin-top: 55px}",
  581. discus: ".tGrid.page2-center.height--all-full {margin-top: calc(55px + 10px);} #footer .page-content { padding-top: calc(55px + 10px);}"
  582. }, DealDate = new Date(), TodayStart = new Date(), EnstylerTimeSeen = "enTimeSeen", today = "", oclock = "", yesterday = "", enNewestBase = "enNewest" + enInterSite, enSec = enNewestBase + "-" + enSection.replace(/\//, ""), LastSeenOnce = !0, enSeArt = "", enLaArt = "", 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 = {
  583. href: /<ENSTYLER-HREF-HERE>/g,
  584. id: /<ENSTYLER-ID-HERE>/g,
  585. text: /<ENSTYLER-TEXT-HERE>/g
  586. }, enNavEntry = "enNavEntry", enMenuItemCode = {
  587. Main: '<a class="space--h-2 lbox--v-4 enNavEntry navMenu-link" id="<ENSTYLER-ID-HERE>" href="<ENSTYLER-HREF-HERE>" data-handler="track" data-track="{&quot;action&quot;:&quot;goto_main_target&quot;,&quot;beacon&quot;:true}"><span class="lbox--h-4"><svg width="24px" height="20px" class="icon icon--comments"></span><ENSTYLER-TEXT-HERE></a>',
  588. 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-ID-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>',
  589. MainButton: '<a class="space--h-2 lbox--v-4 enNavEntry navMenu-link" id="<ENSTYLER-ID-HERE>"><span class="lbox--h-4"><svg width="24px" height="20px" class="icon icon--comments"></span><ENSTYLER-TEXT-HERE></a>'
  590. }, enNavGrid = '<div id="enButt"><a title="Grid Layout" id="enGrid" href="' + enHostpath + '?layout=grid"><img src="https://dealz.rrr.de/enstyler/grid.png"></a><a title="List Layout" id="enList" href="' + enHostpath + '?layout=horizontal"><img src="https://dealz.rrr.de/enstyler/list.png"></a><a title="Text Layout" id="enText" href="' + enHostpath + '?layout=text"><img src="https://dealz.rrr.de/enstyler/text.png"></a></div>', enNavCSS = "#enGrid, #enList, #enText { padding: 0.5em; } #enButt {left: 3em; top: 1em; padding-left: 4em; display: inline-block;}", enMenuItemLength = enMenuItemCode.length, EnstylerButton = "EnstylerButton", enMenuButton = document.createElement("input");
  591.  
  592. enMenuButton.type = "button", enMenuButton.setAttribute(enID, "emergency"), enMenuButton.onclick = showEnstylerConfig, enMenuButton.value = " ", enMenuButton.setAttribute("style", "background-position: -.00071em -176.85em; width: .85786em; display: inline-block; height: 1.42929em; background-image: url(https://assets.mydealz.de/assets/img/icons_5a065.svg); background-repeat: no-repeat; background-size: 5.50071em 590.57214em; cursor: pointer;");
  593.  
  594. var enNavIconPat = "#discussion", enAddMain = "", enAddMainFunc = [], enAddMainCount = 0, enAddMainDone = !1, enUpdateWindow, enUnblackText = enLangLocalize("<EN-LANG:unblack> <ENSTYLER-TEXT-HERE> Dealz", enConfigLang, enLANG), enConfDefs = [];
  595.  
  596. enConfDefs.default = {
  597. enCSS: {
  598. label: confLang("configcss"),
  599. title: confMess("configcss"),
  600. type: "button",
  601. click: function() {
  602. enUpdateWindow = window.open("https://userstyles.org/styles/128262", "UserCSS", "left=0,top=0"), GM_setValue("enLastUpdateCheck", 0);
  603. }
  604. },
  605. enJS: {
  606. label: confLang("userscript"),
  607. title: confMess("userscript"),
  608. type: "button",
  609. click: function() {
  610. enUpdateWindow = window.open("https://greasyfork.org/scripts/24243-enstylerjs/code/EnstylerJS.user.js", "UserScript", "width=210,height=210,left=0,top=0"), setTimeout(enUpdateWindow.close, 5e3);
  611. }
  612. },
  613. enCNavF: {
  614. label: confLang("navfixed"),
  615. title: confMess("navfixed"),
  616. type: "checkbox",
  617. default: !0,
  618. section: [ confLang("config"), "" ]
  619. },
  620. enCMax: {
  621. label: confLang("max"),
  622. title: confMess("max"),
  623. type: "select",
  624. options: enSiteConfig.width,
  625. default: "1450"
  626. },
  627. enCDealA: {
  628. label: confLang("dealaction"),
  629. title: confMess("dealaction"),
  630. type: "checkbox",
  631. default: !0
  632. },
  633. enCDealVbar: {
  634. label: confLang("dealvotebar"),
  635. title: confMess("dealvotebar"),
  636. type: "select",
  637. options: enSiteConfig.votescale,
  638. default: "500"
  639. },
  640. enCTouch: {
  641. label: confLang("touch"),
  642. title: confMess("touch"),
  643. type: "checkbox",
  644. default: !0
  645. },
  646. enCWidth: {
  647. label: confLang("width"),
  648. title: confMess("width"),
  649. type: "select",
  650. options: enSiteConfig.width,
  651. default: enValOff
  652. },
  653. enCPrice: {
  654. label: confLang("price"),
  655. title: confMess("price"),
  656. type: "checkbox",
  657. default: !1
  658. },
  659. enCCompact: {
  660. label: confLang("compact"),
  661. title: confMess("compact"),
  662. type: "checkbox",
  663. default: !1
  664. },
  665. enCCMail: {
  666. label: confLang("cssdealz"),
  667. title: confMess("cssdealz"),
  668. type: "checkbox",
  669. default: !1
  670. },
  671. enCRedirect: {
  672. label: confLang("redir"),
  673. title: confMess("redir"),
  674. type: "checkbox",
  675. default: !0
  676. },
  677. enCPageP: {
  678. label: confLang("picker"),
  679. title: confMess("picker"),
  680. type: "checkbox",
  681. default: !0
  682. },
  683. enCDealT: {
  684. label: confLang("dealtime"),
  685. title: confMess("dealtime"),
  686. type: "checkbox",
  687. default: !0
  688. },
  689. enCFixHtml: {
  690. label: confLang("fixhtml"),
  691. title: confMess("fixhtml"),
  692. type: "checkbox",
  693. default: !0
  694. },
  695. enCBlackC: {
  696. label: confLang("blacklist"),
  697. title: confMess("blacklist"),
  698. type: "select",
  699. options: enSiteConfig.blackcold,
  700. default: "-20"
  701. },
  702. enConfBlacklist: {
  703. label: confLang("black"),
  704. title: confMess("black"),
  705. type: "text",
  706. size: 70,
  707. default: ""
  708. },
  709. enConfWhitelist: {
  710. label: confLang("white"),
  711. title: confMess("white"),
  712. type: "text",
  713. size: 70,
  714. default: ""
  715. },
  716. enCUnblackL: {
  717. label: confLang("unblack"),
  718. title: confMess("unblack"),
  719. type: "button",
  720. click: EnstylerBlacklistUnhide
  721. },
  722. enCLang: {
  723. label: confLang("lang"),
  724. title: confMess("lang"),
  725. type: "select",
  726. options: enSiteConfig.languages,
  727. default: "auto"
  728. }
  729. }, enConfDefs.sync = {
  730. enCAutoS: {
  731. label: confLang("autosync"),
  732. title: confMess("autosync"),
  733. type: "checkbox",
  734. section: [ confLang("syncconf"), "" ],
  735. default: !0
  736. },
  737. enCSyncKey: {
  738. label: confLang("synckey"),
  739. title: confMess("synckey"),
  740. type: "text",
  741. size: 10,
  742. default: enValOff
  743. },
  744. enCSync: {
  745. label: confLang("sync"),
  746. title: confMess("sync"),
  747. type: "button",
  748. click: function() {
  749. SyncSettings();
  750. }
  751. }
  752. };
  753.  
  754. var enSaveSettings = [ "enCNavF", "enCDealA", "enCDealVbar", "enCTouch", "enCRedirect", "enCPageP", "enCFixHtml", "enCDealT", "enCBlackC", "enConfBlacklist", "enConfWhitelist", "enCAutoS" ], enGMFrame = document.createElement("div");
  755.  
  756. enGMFrame.setAttribute("class", "GM_config");
  757.  
  758. var enGMConfigOpen = !1, enRemConf = [ {
  759. val: enValOff,
  760. field: "enCBlackC",
  761. rem: "enConfWhitelist"
  762. }, {
  763. val: enValOff,
  764. field: "enCBlackC",
  765. rem: "enConfBlacklist"
  766. }, {
  767. val: enValOff,
  768. field: "enCBlackC",
  769. rem: "enCUnblackL"
  770. }, {
  771. val: enValOff,
  772. field: "enCSyncKey",
  773. rem: "enCSync"
  774. }, {
  775. val: enValOff,
  776. field: "enCSyncKey",
  777. rem: "enCAutoS"
  778. } ], enSettings = "enSettings", enShowDate = new Date().toLocaleString("de-DE", {
  779. hour: "numeric",
  780. minute: "numeric"
  781. }), enCSS = [ ".card-inner::after {display: none !important} .GM_config {color: white !important; opacity: 0.92 !important; left: 5% !important; height: auto !important; padding-bottom: 10px !important; top: 1.4em !important; box-shadow: 10px 10px 20px black; min-width: 21em; max-width: 40em !important; border-radius: 10px} #enOverDim {background-color: black; z-index: 999; position: fixed; top: 0; right: 0; bottom: 0; left: 0; opacity: 0.5} .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 .config_header {font-size: 14pt !important; border: none !important; padding: 0.2em; font-weight: bold; text-align: center;} .GM_config .section_header { border: none !important; background-color:#005293 !important; !important; text-align: center; margin-top: 1em;} .GM_config .field_label:hover {color: gray;} .GM_config a:hover {text-decoration: underline; color: darkgray;} .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, .voteBar-- { display: none !important; } .votebar {display: inline-block; position: relative; top: .3em; height: .5em; margin-left: 2.5em; max-width: 80% } .voteBar--warm { background-color: #ffb612 } .voteBar--hot { background-color: #e00034 } .voteBar--burn { background-color: #e00034 } .voteBar--cold, .voteBar--colder { background-color:: #00a9e0 } .voteBar--cold, .voteBar--colder { background-color: #5bc6e8 } .threadTempBadge { display: none; } .flex--justify-space-between { justify-content: unset !important; }", ".gridLayout { width: unset; max-width: " + GM_getValue("enMax", "") + "px !important;}", ".page2-center, .thread-list--type-list--sideAds, .thread-list--type-list, .listLayout { max-width: " + GM_getValue("enMax", "") + "px !important;}" ].join(" "), extraCSS = "", EnstylerStartTime = Date.now(), input = document.createElement("input");
  782.  
  783. input.type = "button", input.setAttribute(enID, EnstylerButton), input.onclick = saveEnstylerCSS, input.value = confLang("options");
  784.  
  785. var enWidth = GM_getValue("enWidth", enValOff);
  786.  
  787. isMobile && enWidth != enValOff && u("meta[name=viewport]").attr("content", "width=" + enWidth + "px, initial-scale=1");
  788.  
  789. var enUserScript = {
  790. detect: /.*?@-moz-document .*?\{\s*/,
  791. split: /^.*?\{/,
  792. next: /}\s*@-moz-document.*/
  793. }, enCSSmax = 16100, enGoogleTransURL = "https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=<ENSTYLER-LANG-HERE>&dt=t&q=<ENSTYLER-HTML-HERE>", enMaxTrans = 300, enTransTags = 5, enSaveURL = "https://dealz.rrr.de/enstyler/save.php?", enSaveUrlLast = "", enGMSave = !1;
  794.  
  795. if (window.location.hostname.endsWith("userstyles.org")) return GM_config.init({
  796. id: "GM_config",
  797. fields: {
  798. saveOpt: {
  799. type: "textarea"
  800. }
  801. },
  802. frame: enGMFrame
  803. }), setTimeout(enUserstyleDo, 5e3), void ("complete" === document.readyState || "loading" !== document.readyState ? enUserstyleDo() : document.addEventListener("DOMContentLoaded", enUserstyleDo));
  804.  
  805. var enFixedNavLast = !1;
  806.  
  807. GM_config.init({
  808. id: enInter ? "GM_config" + enInterSite : "GM_config",
  809. title: confLang("headline"),
  810. fields: Object.assign(enConfDefs.default, enConfDefs.sync, enConfDefs.debug),
  811. events: {
  812. init: function() {},
  813. open: function() {
  814. enFixedNavLast = GM_config.get("enCNavF"), confLangOpen(), EnstylerSyncIDShow(), u('.GM_config [id$="_enJS_var"]').after(enNavGrid);
  815. for (var e = 0; e < enRemConf.length; e++) GM_config.get(enRemConf[e].field) == enRemConf[e].val && GM_config.fields[enRemConf[e].rem].remove();
  816. isMobile || GM_config.fields.enCWidth.remove();
  817. },
  818. save: function() {
  819. SaveSettings(), GM_setValue("enWidth", GM_config.get("enCWidth")), GM_setValue("enMax", GM_config.get("enCMax")), enSyncKey = GM_config.get("enCSyncKey"), enAutoSync = GM_config.get("enCAutoS"), GM_config.close(),
  820. showEnstylerConfig(), enGMSave ? window.location.reload() : enGMSave = !0;
  821. },
  822. close: function() {
  823. closeEnstylerConfig(), enCheckUpdates();
  824. }
  825. },
  826. frame: enGMFrame
  827. }), enSyncKey = GM_config.get("enCSyncKey"), enAutoSync = GM_config.get("enCAutoS"), "auto" != GM_config.get("enCLang") && (enLANG = GM_config.get("enCLang")), window.eval("window['ga-disable-UA-2467049-1'] = true;"),
  828. WaitForBody();