EnstylerJS

MyDealz Enstyler enhanced features incl. Amazon Mobile Redirect

目前為 2017-10-16 提交的版本,檢視 最新版本

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