Enstyler

MyDealz Enstyler enhanced features

当前为 2017-12-14 提交的版本,查看 最新版本

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