Enstyler

MyDealz Enstyler enhanced features

目前为 2017-12-13 提交的版本,查看 最新版本

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