Enstyler

MyDealz Enstyler enhanced features

目前为 2017-12-18 提交的版本。查看 最新版本

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