Enstyler

MyDealz Enstyler enhanced features

目前为 2018-06-22 提交的版本。查看 最新版本

  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.06.223
  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(p) {
  49. if (u(p).addClass("enClassActionDone"), !u(p).hasClass("threadWidget--type-card--item")) if (null !== (e = u(p).attr(enID))) {
  50. if (n = u(p).find(".thread-title a"), c = "c" != e[0], enBlackTemp != enValOff && (c ? s ? (d = (u(p).find(".thread-title a").text() + " @" + u(p).find("a.user").text()).replace(unwantedRegex[1], " "),
  51. l = null !== (l = u(p).find(".vote-temp")).text() ? parseInt(l.text()) : 9999) : (l = 9999, d = "") : (d = (u(p).find(".userHtml").text() + " @" + u(p).find("a.user").text()).replace(unwantedRegex[1], " "),
  52. l = 0), (!enWhiteTrue || !d.match(enWhite)) && (enBlackTemp >= l || enBlackTrue && d.match(enBlack)))) {
  53. var g = u(p).parent();
  54. g.hasClass("threadCardLayout--card") ? g.addClass(enClassHidden) : u(p).addClass(enClassHidden), enBlacklisted++;
  55. }
  56. myFixHtml && u(p).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(p).find(".thread-price.text--b")).length && ((o = u(p).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(p).find(".cept-tb").html(d.html())), myDealAction && c && (s || (n = u(p).find(".thread-title"), enTransTags = 20), enTranslateGoogle(n), (i = u(p).find(".vote-temp")).length && (i = parseInt(i.text()),
  60. myVotebar && (l = u(p).find(".vote-temp").attr("class").replace(/.*charcoal|.*vote-temp--/i, ""), 0 > (r = i / (myVotescale / 70) + 5) && (r *= -3), f = p, s || (f = u(u(p).find("div").first())), u(f).prepend('<div class="votebar vote-progress voteBar--' + l + '" style="width: ' + r + '%;"></div>'),
  61. u(p).hasClass("thread--type-card") && (i = 0), i > myVotescale / 2.51 ? u(f).prepend(enDealFlame) : -myVotescale / 10.1 > i && u(f).prepend(enDealIce))), s ? (u(p).find("span.meta-ribbon.hide--toW3").removeClass("hide--toW3"),
  62. u(p).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(p), n.text(), a, enDealAdd),
  63. u(p).find(".cept-comment-link").append(o)) : (enCCMail && u(p).find("a.btn--twitter").length && (o = u(p).find("a.btn--twitter").first().outerHTML.replace(/&amp;text=/g, "?ID=" + enMyCSSID + "&amp;text="),
  64. u(p).find("a.btn--twitter").replace(o), o = u(p).find("a.btn--facebook").first().outerHTML.replace(/&amp;title=/g, "?ID=" + enMyCSSID + "&amp;title="), u(p).find("a.btn--facebook").replace(o), o = u(p).find("a.btn--whatsapp").first().outerHTML.replace(/" rel="no/, "?ID=" + enMyCSSID + '" rel="no'),
  65. u(p).find("a.btn--whatsapp").replace(o)), o = enDealComposeAction(u(p), n.text(), enLocParser.toString(), enSocialAdd), u(p).find("a.btn--twitter").parent().append(o))), (t = u(p).find(".userHtml")).length && enTranslateGoogle(t),
  66. c && (o = u(p).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;:.*">/, '">'));
  67. } else u(p).remove();
  68. }), EnstylerBlacklistShow());
  69. }
  70.  
  71. function enDealComposeAction(e, t, n, a) {
  72. 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, "")));
  73. var o = n;
  74. 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);
  75. }
  76.  
  77. function EnstylerBlacklist() {
  78. enUserLogin && !GM_config.get("enConfWhitelist").includes(enUserName) && GM_config.set("enConfWhitelist", "@" + enUserName + "," + GM_config.get("enConfWhitelist"));
  79. var e = GM_config.get("enConfBlacklist").replace(unwantedRegex[0], "");
  80. 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"),
  81. enWhiteTrue = !" ".match(enWhite), enBlackTemp = GM_config.get("enCBlackC"), enBlackTrue = enBlackTrue && enBlackTemp != enValOff;
  82. }
  83.  
  84. function EnstylerBlacklistShow() {
  85. enConfDefs.default.enCUnblackL.label = enUnblackText.replace(enPATTERN[enTEXT], enBlacklisted);
  86. }
  87.  
  88. function EnstylerBlacklistUnhide() {
  89. enBlacklisted = 0, EnstylerBlacklistShow(), u("." + enClassHidden).removeClass(enClassHidden);
  90. }
  91.  
  92. function EnstylerPagePickerCreate() {
  93. if (GM_config.get("enCPageP")) {
  94. var e, t, n, a = 1, o = 1;
  95. u(selectList).empty();
  96. var i = u("nav .cept-last-page");
  97. if (i.length) {
  98. var r = u("nav .pagination-page .hide--fromW2");
  99. isNaN(a = parseInt(r.html())) && (a = 1), isNaN(o = parseInt(i.html())) && (o = a);
  100. } else o = a = enLocParser.search.length ? parseInt(enLocParser.search.replace(/.*=/, "")) : 1;
  101. for (x = 1; x <= o; ) (n = document.createElement("option")).text = x, selectList.add(n), t = x, e = Math.abs(a - x), 10 > x || 5 > e ? x++ : 1e3 > x && e > 600 ? x += e / 3.5 : x += Math.floor(e / 2),
  102. e > 9 && x > 9 && (50 > e || 50 > x ? x = 2 * Math.floor(x / 2) : x = 5 * Math.floor(x / 5));
  103. a > o && (o = a), o > t && ((n = document.createElement("option")).text = o, selectList.add(n)), selectList.value = a;
  104. var l = [ ".js-navDropDown-messages", enPEnum + " js-navDropDown-messages vAlign--all-m" ];
  105. u(".test-loginButton").length && (l[0] = ".test-loginButton"), u(".voteBar").length && (l = [ ".voteBar--sticky-off--hide.hAlign--all-r", enPEnum + " subNavMenu-link subNavMenu-btn voteBar--sticky-off--hide" ]),
  106. selectList.setAttribute("class", l[1]), u(l[0]).before(selectList);
  107. }
  108. }
  109.  
  110. function EnstylerPagePickerDo() {
  111. enLocParser.search.length ? selectList.value = parseInt(location.search.replace(/.*=/, "")) : selectList.value = 1;
  112. }
  113.  
  114. function EnstylerPageAction() {
  115. var e = document.getElementById(enPEnum), t = "page=" + e.options[e.selectedIndex].value, n = enLocParser.toString().replace(/page=.*|#.*/, "");
  116. n.endsWith("?") || n.endsWith("&") ? n += t : n += "?" + t, "/deals/" == enSection && (n += "#thread-comments"), window.location = n;
  117. }
  118.  
  119. function EnstylerFixedNav() {
  120. var e = u(".subNavMenu .subNavMenu-layer").first();
  121. if (GM_config.get("enCNavF")) if ("/deals/" != enSection && "/gutscheine/" != enSection) {
  122. var t = u("header.js-sticky").html();
  123. u("header.forceLayer").replace('<header class="enFixedNav">' + t + "</header>");
  124. var n = myFixedCSS.every;
  125. enSection == EnstylerSiteConfig("discussion") && (n += myFixedCSS.discus), (u(".nav-subheadline").length || "/profile/" == enSection) && (n += myFixedCSS.subnav), addStyleString(n);
  126. } else e = u(".vote-box").first();
  127. e && e.after(enMenuButton);
  128. }
  129.  
  130. function EnstylerDealTime() {
  131. 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),
  132. yesterday = enLangLocalize("<EN-LANG:yesterday> ", enTimeLang, enLANG), EnstylerDealTimeDo();
  133. }
  134.  
  135. function EnstylerDealTimeDo() {
  136. if (myDealTime) {
  137. var e, t, n, a = Date.now();
  138. u(".meta-ribbon, time, .metaRibbon").not("." + EnstylerTimeSeen).each(function(o) {
  139. if (u(o).addClass(EnstylerTimeSeen), !(e = u(o).html()).includes(" am ")) {
  140. 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),
  141. !0) {
  142. case 5 > n.length || 60 > t:
  143. return;
  144.  
  145. case t > 1440:
  146. e += "&nbsp;(" + n + oclock + ")";
  147. break;
  148.  
  149. case TodayStart > DealDate:
  150. e = yesterday + n + oclock;
  151. break;
  152.  
  153. default:
  154. e += "&nbsp;(" + today + n + oclock + ")";
  155. }
  156. u(o).html(e);
  157. }
  158. });
  159. }
  160. }
  161.  
  162. function EnstylerLastSeen() {
  163. if (LastSeenOnce) if (LastSeenOnce = !1, enSection.match(enMainSectionMatch)) {
  164. if (enSeArt = GM_getValue(enSec, ""), SyncLastSeen(), EnstylerLastSeenDo(), "" == enLocParser.search) {
  165. var e = !1;
  166. u("article").not(".threadWidget-item").each(function(t) {
  167. e || 0 != u(t).find(".cept-pinned-flag").length || (GM_setValue(enSec, u(t).attr(enID)), GM_setValue(enSec + "Last", enSeArt), SaveLastSeen(), e = !0);
  168. });
  169. }
  170. } else EnstylerLastSeenLast();
  171. }
  172.  
  173. function EnstylerLastSeenDo() {
  174. "" != enSec && (GM_setValue("enLastCheck" + enSec, Date.now() / enMs2Min), enSeArt ? (GM_setValue(enSec + "Last", enSeArt), u("#" + enSeArt).addClass("enClassMarkArticle"), enLaArt.startsWith("thread_") && u("#" + enLaArt).addClass("enClassMarkArticleLoad")) : GM_setValue(enSec, "thread_1"));
  175. }
  176.  
  177. function EnstylerLastSeenLast() {
  178. var e = GM_getValue(enNewestBase + "LastSec", "");
  179. GM_setValue(e, GM_getValue(e + "Last", ""));
  180. }
  181.  
  182. function enCheckUpdates() {
  183. var e = Date.now() / enMs2Min - GM_getValue("enLastUpdateCheck", "0");
  184. (e > enUpdInt || 0 > e) && enUpdateCSS();
  185. }
  186.  
  187. function enUpdateCSS() {
  188. var e = parseInt(Date.now() / enMs2Min), t = enComposeUpdateOpt();
  189. enCacheExternalResource(enUpdateUrl + t, MyCSS), GM_setValue("enLastUpdateCheck", e), enSaveMyCSS();
  190. }
  191.  
  192. function enComposeUpdateOpt() {
  193. var e = GM_getValue(enCssOpt, "");
  194. if ("" == e || !e.startsWith("#")) return "";
  195. var t = (e = e.replace(/\n/g, "")).split(";");
  196. e = "";
  197. for (var n = 0; n < t.length; n++) if ("" != t[n]) {
  198. var a = t[n].split(":");
  199. 2 > a.length || (e += "&" + a[1].slice(0, -1) + "=" + a[1]);
  200. }
  201. return "?" + e.slice(1);
  202. }
  203.  
  204. function EnstylerMenuActions() {
  205. enInter || EnstylerAddNav("Main", "<EN-LANG:discussion>", EnstylerSiteConfig("discussion"), "enMainDiscussion"), EnstylerAddNav("Main", "<EN-LANG:enstyler>", '<EN-LANG:enhref>" target="_blank', "enMainHomepage", "home"),
  206. 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"),
  207. EnstylerAddNav("MainButton", "<EN-LANG:settings>", showEnstylerConfig, EnstylerButton, "gear-grey");
  208. }
  209.  
  210. function EnstylerAddNav(e, t, n, a, o) {
  211. void 0 !== o && "" != o || (o = enNavIconPat);
  212. var i = !1, r = enMenuItemCode[e].replace(enPATTERN[enID], a).replace(enPATTERN[enTEXT], t);
  213. 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() {
  214. setTimeout(EnstylerMainDo, 200);
  215. }), enAddMain += r, i && (enAddMainFunc[enAddMainCount++] = {
  216. ID: a,
  217. target: n
  218. }));
  219. }
  220.  
  221. function EnstylerMainDo() {
  222. if (!enAddMainDone) {
  223. enAddMainDone = !0, u(".popover-content nav .navMenu-div").first().insertAdjacentHTML("beforebegin", enLangLocalize(enAddMain, enMenuLang, enLANG));
  224. var e = u(".popover--mainNav"), t = 35 * (enAddMain.split(enNavEntry).length - 1) + parseInt(e.attr("style").split("height: ")[1]);
  225. e.attr("style", e.attr("style").replace(/height: [0-9.]*px/, "height: " + t + "px"));
  226. for (var n = 0; enAddMainCount > n; n++) u("section #" + enAddMainFunc[n].ID).on("click", enAddMainFunc[n].target);
  227. }
  228. }
  229.  
  230. function confLang(e) {
  231. return enLangLocalize("<EN-LANG:" + e + ">", enConfigLang, enLANG);
  232. }
  233.  
  234. function confMess(e) {
  235. return enLangLocalize("<EN-LANG:" + e + ">", enMessageLang, enLANG);
  236. }
  237.  
  238. function showEnstylerConfig() {
  239. u("body").prepend('<div id="enOverDim"></div>'), GM_config.open(), document.getElementById("main").click(), enGMConfigOpen = !0;
  240. }
  241.  
  242. function closeEnstylerConfig() {
  243. u("#enOverDim").remove(), enGMConfigOpen = !1;
  244. }
  245.  
  246. function confLangOpen() {
  247. 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"));
  248. }
  249.  
  250. function EnstylerSyncIDShow() {
  251. enSyncKey != enValOff && (u('.GM_config input[id$="_field_enCSync"]').first().value = confLang("sync") + " " + enUserKey(""));
  252. }
  253.  
  254. function SyncSettings() {
  255. EnGetValue("", enSetValue), EnGetValue(enSettings, enSetSettings);
  256. }
  257.  
  258. function SaveSettings() {
  259. EnSaveValue(enCssOpt, GM_getValue(enCssOpt, "")), enSaveMyCSS();
  260. for (var e = "", t = 0; t < enSaveSettings.length; t++) e += enSaveSettings[t] + "=" + GM_config.get(enSaveSettings[t]) + "&";
  261. EnSaveValue(enSettings, e);
  262. }
  263.  
  264. function SaveLastSeen() {
  265. enAutoSync && (Date.now() / enMs2Min - GM_getValue("enLastCheck" + enSec, "0") > 5 && (delay = 500), setTimeout(function() {
  266. EnSaveValue(enSec, GM_getValue(enSec, ""));
  267. }, 1 * enMs2Min / 2));
  268. }
  269.  
  270. function SyncLastSeen() {
  271. if (enAutoSync) {
  272. var e = Date.now() / enMs2Min, t = e - GM_getValue("enLastCheck" + enSec, "0");
  273. (t > 1 || 0 > t) && (GM_setValue("enLastCheck" + enSec, e), EnGetValue(enSec, enSetLastSeen));
  274. }
  275. }
  276.  
  277. function enSetLastSeen(e, t) {
  278. enLaArt = t, EnstylerLastSeenDo(), enLaArt.replace(/thread_/i, "") > enSeArt.replace(/thread_/i, "") && enSetValue(e + "Last", t);
  279. }
  280.  
  281. function enSaveMyCSS() {
  282. EnSaveValue("", extraCSS + GM_getValue(MyCSS, "").replace(/^.*?{/, "").replace(/} *@-moz-document.*/, ""), !1);
  283. }
  284.  
  285. function enSetSettings(e, t) {
  286. for (var n = t.split("&"), a = 0; a < n.length; a++) {
  287. var o = n[a].split("=");
  288. 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());
  289. }
  290. }
  291.  
  292. function enAmazonMobileRedirect() {
  293. var e = enLocParser.href;
  294. 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"),
  295. window.location = enLocParser.protocol + enLocParser.host)), !0);
  296. }
  297.  
  298. function EnstylerStart() {
  299. EnstylerShowPage(), EnstylerFixedNav(), EnstylerLastSeen(), EnstylerDealTime(), EnstylerBlacklist(), EnstylerDealActions();
  300. }
  301.  
  302. function EnstylerRedo() {
  303. EnstylerShowPage(), EnstylerLastSeenDo(), EnstylerPagePickerDo(), EnstylerDealTimeDo(), EnstylerDealActionsDo();
  304. }
  305.  
  306. function EnstylerShowPage() {
  307. if (myDealTime) {
  308. var e = u(".search-input");
  309. 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(/.*=/, "") + "|" : "") + ")");
  310. }
  311. }
  312.  
  313. function EnstylerDelayedInit() {
  314. 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);}";
  315. 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),
  316. EnstylerMenuActions(), EnstylerPagePickerCreate(), isMobile ? u("#main").on("DOMSubtreeModified", debounce(300, function() {
  317. window.requestAnimationFrame(EnstylerRedo);
  318. })) : u(".js-pagi-bottom").on("DOMSubtreeModified", debounce(200, function() {
  319. window.requestAnimationFrame(EnstylerRedo);
  320. }));
  321. }
  322.  
  323. function WaitForBody() {
  324. if (!enAmazonMobileRedirect()) if (u("#messages-list").length || u("#footer").length) {
  325. if (enEarlyInit(), enLocParser.pathname.match(enDisableScript)) return;
  326. WaitForDOM();
  327. } else window.requestAnimationFrame(WaitForBody);
  328. }
  329.  
  330. function WaitForDOM() {
  331. var e = getStyle(u(".nav, #navigation").first(), "background-color").replace(/[^\(]*/, "");
  332. u(".vwo-deal-button, #footer").length && "" != e ? MAIN() : window.requestAnimationFrame(function() {
  333. setTimeout(WaitForDOM, 80);
  334. });
  335. }
  336.  
  337. function enEarlyInit() {
  338. addStyleString(GM_getValue("Enstyler2_CSS", ""), 'domain("' + enLocParser.hostname), enCCMail = GM_config.get("enCCMail"), myDealAction = GM_config.get("enCDealA"), myTouch = GM_config.get("enCTouch"),
  339. myCompact = GM_config.get("enCCompact"), myPrice = GM_config.get("enCPrice"), myFixHtml = GM_config.get("enCFixHtml"), myVotescale = GM_config.get("enCDealVbar"), myVotebar = myVotescale != enValOff,
  340. 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;}",
  341. 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;}"),
  342. myVotebar || (extraCSS += ".threadTempBadge { display: unset; }"), myDealAction && (extraCSS += "button.meta-ribbon-btn.hide--fromW3 {display: none}"), addStyleString(enCSS + extraCSS + enNavCSS);
  343. }
  344.  
  345. function MAIN() {
  346. EnstylerInit(), enCheckUpdates(), document.body.appendChild(enGMFrame), addStyleString(".bg--off {background-color: " + shadeRGBColor(getStyle(u(".bg--main").first(), "background-color"), -.08) + "!important;}"),
  347. EnstylerStart(), setTimeout(EnstylerDelayedInit, 300);
  348. }
  349.  
  350. function enUserstyleDo() {
  351. 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"),
  352. setTimeout(createEnstylerButton, 1e3));
  353. }
  354.  
  355. function createEnstylerButton() {
  356. 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;"),
  357. u("#style-settings").before(input), window.scrollTo(100, 400), enSetOptions();
  358. }
  359.  
  360. function saveEnstylerCSS() {
  361. enSaveOptions(), setTimeout(window.close, 1e3);
  362. }
  363.  
  364. function enSaveOptions() {
  365. var e, t, n, a = "";
  366. u("#style-settings select").each(function(o) {
  367. e = u(o).attr(enID), t = o.value, n = u("option[value=" + t + "]").text(), a += "#" + e + ":" + t + ":" + n + ";\n";
  368. }), u("#style-settings input[type=text]").each(function(o) {
  369. e = u(o).attr(enID), t = o.value, a += "#" + e + ":" + t + ":" + (n = "RGB-Clolor") + ";\n";
  370. }), u("#style-settings input:checked").each(function(o) {
  371. e = u(o).attr(enID), t = o.value, n = u("label[for=" + e + "]").text(), a += "#" + e + ":" + t + ":" + n + ";\n";
  372. }), GM_config.set("saveOpt", a), GM_setValue(enCssOpt, a);
  373. }
  374.  
  375. function enSetOptions() {
  376. input.value = confLang("options");
  377. var e = GM_getValue(enCssOpt, ""), t = (e = e.replace(/\n/g, "")).split(";");
  378. if ("" != e && e.startsWith("#")) {
  379. for (var n = 0; n < t.length; n++) {
  380. var a = t[n].split(":");
  381. 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 + '"');
  382. }
  383. addStyleString("#button { display: none; }");
  384. }
  385. }
  386.  
  387. function enComposeCSS() {
  388. var e = GM_getValue(enCssOpt, "");
  389. if ("" == e || !e.startsWith("#")) return "";
  390. var t = (e = e.replace(/\n/g, "")).split(";");
  391. e = "";
  392. for (var n = 0; n < t.length; n++) if ("" != t[n]) {
  393. var a = t[n].split(":");
  394. 2 > a.length || (e += "&" + a[0] + "=" + a[1]);
  395. }
  396. return e = "?" + e.slice(1).replace(/#/g, ""), enDebugLog(e), e;
  397. }
  398.  
  399. //var isIE = /*@cc_on!@*/false || !!document.documentMode;
  400. function mobileLog(e) {
  401. GM_setValue(saveLog, GM_getValue(saveLog, "") + e + "\n");
  402. }
  403.  
  404. function mobileShowLog() {
  405. GM_getValue(saveLog, "");
  406. }
  407.  
  408. function mobileClearLog() {
  409. GM_setValue(saveLog, "Enstyler Log\n");
  410. }
  411.  
  412. function EnstylerSiteConfig(e) {
  413. return enGetSiteConfig(enInterName, e);
  414. }
  415.  
  416. function enGetSiteConfig(e, t) {
  417. return enSiteConfig.hasOwnProperty(e) && enSiteConfig[e].hasOwnProperty(t) ? enSiteConfig[e][t] : "";
  418. }
  419.  
  420. function enLangLocalize(e, t, n) {
  421. return enDealLang.hasOwnProperty(n) && void 0 !== t[n] || (n = "en"), (e = e.replace(enLangPat, function(e, a) {
  422. return t.hasOwnProperty(n) && t[n].hasOwnProperty(a) ? t[n][a] : a;
  423. })).match(enLangPat) ? enLangLocalize(e, t, n) : e;
  424. }
  425.  
  426. function addStyleString(e, t) {
  427. // check if style contains @-moz-document rules
  428. if (void 0 === t && (t = ""), e.match(enUserScript.detect)) {
  429. "" == t && (t = enLocParser.hostname);
  430. var n = e.split(t);
  431. e = "";
  432. for (var a = 1; a < n.length; a++) -1 != n[a].indexOf("{") && (e += n[a].replace(enUserScript.split, "").replace(enUserScript.next, ""));
  433. }
  434. 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;
  435. var l = document.createElement("style");
  436. l.innerHTML = e.slice(i), document.body.appendChild(l);
  437. }
  438.  
  439. function capitalizeFirstLetter(e) {
  440. return e[0].toUpperCase() + e.slice(1);
  441. }
  442.  
  443. function truncStringWord(e, t, n) {
  444. return void 0 === n && (n = " "), e.length > t ? (e = e.substr(0, t - 1)).substr(0, e.lastIndexOf(n)) + "..." : e;
  445. }
  446.  
  447. function shadeRGBColor(e, t) {
  448. if (void 0 === t && (t = .1), void 0 === e) return "rgba(0,0,0,0)";
  449. 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]);
  450. return "rgb(" + (Math.round((a - i) * o) + i) + "," + (Math.round((a - r) * o) + r) + "," + (Math.round((a - l) * o) + l) + ")";
  451. }
  452.  
  453. function medainRGBColor(e) {
  454. var t = e.split(","), n = parseInt(t[0].slice(4)), a = parseInt(t[1]), o = parseInt(t[2]);
  455. return Math.round((n + a + o) / 3);
  456. }
  457.  
  458. function debounce(e, t) {
  459. var n = null;
  460. return function() {
  461. clearTimeout(n), n = setTimeout(function() {
  462. t.call(this);
  463. }, e);
  464. };
  465. }
  466.  
  467. /* curreently we assume its a CSS or JS File, so we strip comments and @namespace @moz-document... */ function enCacheExternalResource(e, t) {
  468. GM_xmlhttpRequest({
  469. method: "GET",
  470. url: e,
  471. onload: function(e) {
  472. var n = e.responseText.replace(/\r\n/g, " ").replace(/\/\*.*?\*\/| *|\t/g, "").replace(/([:;]) /g, "$1").replace(/1111.11%/g, "100%");
  473. n.length > 60 && (GM_setValue(t, n), addStyleString(n));
  474. },
  475. onerror: function() {
  476. alert(confMess("cssfailed"));
  477. }
  478. });
  479. }
  480.  
  481. function enTranslateGoogle(thisObj) {
  482. if (enLANG != enSiteLANG && thisObj.length) {
  483. var text = thisObj.html().replace(/[#\(\)]|\n|\r|\t/g, ""), html = "", transTags = [], count, match, buff = "", last = 0, regex = /<.*?>/gi;
  484. for (count = 0; match = regex.exec(text); count++) {
  485. if (count > enTransTags || buff.length + (match.index - last) > enMaxTrans) {
  486. var space = text.lastIndexOf(" ", last + (enMaxTrans - buff.length));
  487. buff += text.slice(last, last + space), html = text.slice(last + space);
  488. break;
  489. }
  490. transTags[count] = match[0], buff += text.slice(last, match.index) + '<a href="' + count + '">', last = regex.lastIndex;
  491. }
  492. 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({
  493. method: "GET",
  494. url: query,
  495. onload: function(res) {
  496. text = eval("(" + res.responseText + ")")[0][0][0];
  497. try {
  498. for (x = 1; 5 > x; x++) text += eval("(" + res.responseText + ")")[0][x][0];
  499. } catch (e) {}
  500. for (count--; count >= 0; count--) text = text.replace(RegExp('< *a href *= *"' + count + '" *>'), transTags[count]);
  501. thisObj.html(text + " " + html);
  502. }
  503. });
  504. }
  505. }
  506.  
  507. function EnSaveValue(e, t, n) {
  508. if ("" != enUserName && enSyncKey != enValOff) {
  509. if (void 0 === n && (n = !0), e + t == enSaveUrlLast) return;
  510. enSaveUrlLast = e + t;
  511. var a = n ? enEncrypt(t) : LZString.compressToEncodedURIComponent(t), o = enSaveURL + "ID=" + enUserKey(e) + "&value=" + a;
  512. GM_xmlhttpRequest({
  513. method: "GET",
  514. url: o
  515. });
  516. }
  517. }
  518.  
  519. function EnGetValue(e, t, n) {
  520. if ("" == enUserName && (enUserName = GM_getValue("enCSyncUser", "")), "" != enUserName && enSyncKey != enValOff) {
  521. void 0 === n && (n = !0);
  522. var a = "https://dealz.rrr.de/enstyler/load.php?ID=" + enUserKey(e);
  523. GM_xmlhttpRequest({
  524. method: "GET",
  525. url: a,
  526. onload: function(a) {
  527. 200 === a.status && a.responseText.length > 30 && t(e, n ? enDecrypt(a.responseText) : LZString.decompressFromEncodedURIComponent(a.responseText));
  528. }
  529. });
  530. }
  531. }
  532.  
  533. function enSetValue(e, t) {
  534. GM_setValue(e + "", t + "");
  535. }
  536.  
  537. function enEncrypt(e) {
  538. return btoa(sjcl.encrypt(enUserKey(""), e));
  539. }
  540.  
  541. function enDecrypt(e) {
  542. return sjcl.decrypt(enUserKey(""), atob(e));
  543. }
  544.  
  545. function enUserKey(e) {
  546. return enShortKey(enUserName + enSyncKey + e);
  547. }
  548.  
  549. function enShortKey(e) {
  550. return ShortURL.encode(parseInt(e.toLowerCase().split("").map(function(e) {
  551. return "eariotnslcudpmhgbfywkvxzjq".indexOf(e) + 1 || "9876543210".indexOf(e) + 1 || "";
  552. }).join("")));
  553. }
  554.  
  555. function getStyle(e, t) {
  556. if (window.getComputedStyle) try {
  557. return getComputedStyle(e).getPropertyValue(t);
  558. } catch (e) {} else if (e.currentStyle) try {
  559. return e.currentStyle[t];
  560. } catch (e) {}
  561. return "";
  562. }
  563.  
  564. 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);
  565.  
  566. /Linux/i.test(navigator.userAgent) && void 0 !== GM_info.scriptHandler && GM_info.scriptHandler.startsWith("USI") && (isMobile = !0);
  567.  
  568. var saveLog = "enMobileLog", enDebugLog = console.error, enInitTime;
  569.  
  570. mobileClearLog();
  571.  
  572. 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--ctrl--fixed 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><span class="space--ml-1 hide--toW3"><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");
  573.  
  574. selectList.id = enPEnum, selectList.setAttribute("class", enPEnum), selectList.onchange = EnstylerPageAction;
  575.  
  576. var myFixedCSS = {
  577. every: ".enFixedNav { display: block; position: fixed; width: 100%; z-index: 120;} .listingProfile {margin-bottom: -55px}.listingProfile, .subNav, .profileHeader, .tabbedInterface, .splitPage-wrapper {margin-top: 55px}",
  578. subnav: ".subNav {margin-top: 0 !important;} .nav-subheadline {margin-top: 55px}",
  579. discus: ".tGrid.page2-center.height--all-full {margin-top: calc(55px + 10px);} #footer .page-content { padding-top: calc(55px + 10px);}"
  580. }, 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 = {
  581. href: /<ENSTYLER-HREF-HERE>/g,
  582. id: /<ENSTYLER-ID-HERE>/g,
  583. text: /<ENSTYLER-TEXT-HERE>/g
  584. }, enNavEntry = "enNavEntry", enMenuItemCode = {
  585. 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>',
  586. 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>',
  587. 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>'
  588. }, 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");
  589.  
  590. 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;");
  591.  
  592. var enNavIconPat = "#discussion", enAddMain = "", enAddMainFunc = [], enAddMainCount = 0, enAddMainDone = !1, enUpdateWindow, enUnblackText = enLangLocalize("<EN-LANG:unblack> <ENSTYLER-TEXT-HERE> Dealz", enConfigLang, enLANG), enConfDefs = [];
  593.  
  594. enConfDefs.default = {
  595. enCSS: {
  596. label: confLang("configcss"),
  597. title: confMess("configcss"),
  598. type: "button",
  599. click: function() {
  600. enUpdateWindow = window.open("https://userstyles.org/styles/128262", "UserCSS", "left=0,top=0"), GM_setValue("enLastUpdateCheck", 0);
  601. }
  602. },
  603. enJS: {
  604. label: confLang("userscript"),
  605. title: confMess("userscript"),
  606. type: "button",
  607. click: function() {
  608. 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);
  609. }
  610. },
  611. enCNavF: {
  612. label: confLang("navfixed"),
  613. title: confMess("navfixed"),
  614. type: "checkbox",
  615. default: !0,
  616. section: [ confLang("config"), "" ]
  617. },
  618. enCMax: {
  619. label: confLang("max"),
  620. title: confMess("max"),
  621. type: "select",
  622. options: enSiteConfig.width,
  623. default: "1450"
  624. },
  625. enCDealA: {
  626. label: confLang("dealaction"),
  627. title: confMess("dealaction"),
  628. type: "checkbox",
  629. default: !0
  630. },
  631. enCDealVbar: {
  632. label: confLang("dealvotebar"),
  633. title: confMess("dealvotebar"),
  634. type: "select",
  635. options: enSiteConfig.votescale,
  636. default: "500"
  637. },
  638. enCTouch: {
  639. label: confLang("touch"),
  640. title: confMess("touch"),
  641. type: "checkbox",
  642. default: !0
  643. },
  644. enCWidth: {
  645. label: confLang("width"),
  646. title: confMess("width"),
  647. type: "select",
  648. options: enSiteConfig.width,
  649. default: enValOff
  650. },
  651. enCPrice: {
  652. label: confLang("price"),
  653. title: confMess("price"),
  654. type: "checkbox",
  655. default: !1
  656. },
  657. enCCompact: {
  658. label: confLang("compact"),
  659. title: confMess("compact"),
  660. type: "checkbox",
  661. default: !1
  662. },
  663. enCCMail: {
  664. label: confLang("cssdealz"),
  665. title: confMess("cssdealz"),
  666. type: "checkbox",
  667. default: !1
  668. },
  669. enCRedirect: {
  670. label: confLang("redir"),
  671. title: confMess("redir"),
  672. type: "checkbox",
  673. default: !0
  674. },
  675. enCPageP: {
  676. label: confLang("picker"),
  677. title: confMess("picker"),
  678. type: "checkbox",
  679. default: !0
  680. },
  681. enCDealT: {
  682. label: confLang("dealtime"),
  683. title: confMess("dealtime"),
  684. type: "checkbox",
  685. default: !0
  686. },
  687. enCFixHtml: {
  688. label: confLang("fixhtml"),
  689. title: confMess("fixhtml"),
  690. type: "checkbox",
  691. default: !0
  692. },
  693. enCBlackC: {
  694. label: confLang("blacklist"),
  695. title: confMess("blacklist"),
  696. type: "select",
  697. options: enSiteConfig.blackcold,
  698. default: "-20"
  699. },
  700. enConfBlacklist: {
  701. label: confLang("black"),
  702. title: confMess("black"),
  703. type: "text",
  704. size: 70,
  705. default: ""
  706. },
  707. enConfWhitelist: {
  708. label: confLang("white"),
  709. title: confMess("white"),
  710. type: "text",
  711. size: 70,
  712. default: ""
  713. },
  714. enCUnblackL: {
  715. label: confLang("unblack"),
  716. title: confMess("unblack"),
  717. type: "button",
  718. click: EnstylerBlacklistUnhide
  719. },
  720. enCLang: {
  721. label: confLang("lang"),
  722. title: confMess("lang"),
  723. type: "select",
  724. options: enSiteConfig.languages,
  725. default: "auto"
  726. }
  727. }, enConfDefs.sync = {
  728. enCAutoS: {
  729. label: confLang("autosync"),
  730. title: confMess("autosync"),
  731. type: "checkbox",
  732. section: [ confLang("syncconf"), "" ],
  733. default: !0
  734. },
  735. enCSyncKey: {
  736. label: confLang("synckey"),
  737. title: confMess("synckey"),
  738. type: "text",
  739. size: 10,
  740. default: enValOff
  741. },
  742. enCSync: {
  743. label: confLang("sync"),
  744. title: confMess("sync"),
  745. type: "button",
  746. click: function() {
  747. SyncSettings();
  748. }
  749. }
  750. };
  751.  
  752. var enSaveSettings = [ "enCNavF", "enCDealA", "enCDealVbar", "enCTouch", "enCRedirect", "enCPageP", "enCFixHtml", "enCDealT", "enCBlackC", "enConfBlacklist", "enConfWhitelist", "enCAutoS" ], enGMFrame = document.createElement("div");
  753.  
  754. enGMFrame.setAttribute("class", "GM_config");
  755.  
  756. var enGMConfigOpen = !1, enRemConf = [ {
  757. val: enValOff,
  758. field: "enCBlackC",
  759. rem: "enConfWhitelist"
  760. }, {
  761. val: enValOff,
  762. field: "enCBlackC",
  763. rem: "enConfBlacklist"
  764. }, {
  765. val: enValOff,
  766. field: "enCBlackC",
  767. rem: "enCUnblackL"
  768. }, {
  769. val: enValOff,
  770. field: "enCSyncKey",
  771. rem: "enCSync"
  772. }, {
  773. val: enValOff,
  774. field: "enCSyncKey",
  775. rem: "enCAutoS"
  776. } ], enSettings = "enSettings", enShowDate = new Date().toLocaleString("de-DE", {
  777. hour: "numeric",
  778. minute: "numeric"
  779. }), 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 { max-width: " + GM_getValue("enMax", "") + "px !important;}" ].join(" "), extraCSS = "", EnstylerStartTime = Date.now(), input = document.createElement("input");
  780.  
  781. input.type = "button", input.setAttribute(enID, EnstylerButton), input.onclick = saveEnstylerCSS, input.value = confLang("options");
  782.  
  783. var enWidth = GM_getValue("enWidth", enValOff);
  784.  
  785. isMobile && enWidth != enValOff && u("meta[name=viewport]").attr("content", "width=" + enWidth + "px, initial-scale=1");
  786.  
  787. var enUserScript = {
  788. detect: /.*?@-moz-document .*?\{\s*/,
  789. split: /^.*?\{/,
  790. next: /}\s*@-moz-document.*/
  791. }, 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;
  792.  
  793. if (window.location.hostname.endsWith("userstyles.org")) return GM_config.init({
  794. id: "GM_config",
  795. fields: {
  796. saveOpt: {
  797. type: "textarea"
  798. }
  799. },
  800. frame: enGMFrame
  801. }), setTimeout(enUserstyleDo, 5e3), void ("complete" === document.readyState || "loading" !== document.readyState ? enUserstyleDo() : document.addEventListener("DOMContentLoaded", enUserstyleDo));
  802.  
  803. var enFixedNavLast = !1;
  804.  
  805. GM_config.init({
  806. id: enInter ? "GM_config" + enInterSite : "GM_config",
  807. title: confLang("headline"),
  808. fields: Object.assign(enConfDefs.default, enConfDefs.sync, enConfDefs.debug),
  809. events: {
  810. init: function() {},
  811. open: function() {
  812. enFixedNavLast = GM_config.get("enCNavF"), confLangOpen(), EnstylerSyncIDShow(), u('.GM_config [id$="_enJS_var"]').after(enNavGrid);
  813. for (var e = 0; e < enRemConf.length; e++) GM_config.get(enRemConf[e].field) == enRemConf[e].val && GM_config.fields[enRemConf[e].rem].remove();
  814. isMobile || GM_config.fields.enCWidth.remove();
  815. },
  816. save: function() {
  817. 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(),
  818. showEnstylerConfig(), enGMSave ? window.location.reload() : enGMSave = !0;
  819. },
  820. close: function() {
  821. closeEnstylerConfig(), enCheckUpdates();
  822. }
  823. },
  824. frame: enGMFrame
  825. }), 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;"),
  826. WaitForBody();