Enstyler

MyDealz Enstyler enhanced features incl. Amazon Mobile Redirect

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

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