Flat Darkness - Stable

Custom theme for Hack Forums.

当前为 2017-03-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Flat Darkness - Stable
  3. // @namespace https://github.com/iHydra
  4. // @version 1.5.7.1
  5. // @description Custom theme for Hack Forums.
  6. // @include http*://www.hackforums.net/*
  7. // @include http*://hackforums.net/*
  8. // @author iHydra
  9. // @contributor Hash G.
  10. // @contributor Kondax
  11. // @contributor Sasori
  12. // @contributor Yani
  13. // @require https://code.jquery.com/jquery-2.1.4.min.js
  14. // @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.8.0/highlight.min.js
  15. // @resource MainCSS https://raw.githubusercontent.com/iHydra/flatdarkness/master/userscript/stylesheet_1.5.7.css
  16. // @resource HLCSS https://raw.githubusercontent.com/isagalaev/highlight.js/master/src/styles/monokai-sublime.css
  17. // @grant GM_addStyle
  18. // @grant GM_setValue
  19. // @grant GM_getValue
  20. // @grant GM_getResourceText
  21. // @run-at document-start
  22. // ==/UserScript==
  23.  
  24. var quotedPosts = GM_getValue("quotedPosts") === undefined ? [] : GM_getValue("quotedPosts");
  25. console.log(quotedPosts);
  26.  
  27. /* INFORMATION - READ */
  28. // You can change Highlighter Theme: https://github.com/isagalaev/highlight.js/tree/master/src/styles || Demo of Themes: https://highlightjs.org/static/demo/
  29. // You can change the preview button shortcut key if you scroll down to USER EDITING.
  30.  
  31. // Copyright (c) 2011 Pete Boere (the-echoplex.net) Free under terms of the MIT license: https://www.opensource.org/licenses/mit-license.php
  32. !function(s){s.fn.alterClass=function(a,e){var r=this;if(-1===a.indexOf("*"))return r.removeClass(a),e?r.addClass(e):r;var n=new RegExp("\\s"+a.replace(/\*/g,"[A-Za-z0-9-_]+").split(" ").join("\\s|\\s")+"\\s","g");return r.each(function(a,e){for(var r=" "+e.className+" ";n.test(r);)r=r.replace(n," ");e.className=s.trim(r)}),e?r.addClass(e):r}}(jQuery);
  33.  
  34. var MainCSS = GM_getResourceText('MainCSS');
  35. GM_addStyle(MainCSS);
  36. var HLCSS = GM_getResourceText('HLCSS');
  37. GM_addStyle(HLCSS);
  38.  
  39. /* Default settings */
  40. if (!GM_getValue("quotedColor"))
  41. GM_setValue("quotedColor", "#00ffd2");
  42. if (!GM_getValue("showLogo"))
  43. GM_setValue("showLogo", "false");
  44. if (!GM_getValue("enableSFW"))
  45. GM_setValue("enableSFW", "false");
  46. if (!GM_getValue("previewKey"))
  47. GM_setValue("previewKey", "w");
  48. if (!GM_getValue("hideMenu"))
  49. GM_setValue("hideMenu", "false");
  50. if (!GM_getValue("showTime"))
  51. GM_setValue("showTime", "false");
  52. if (!GM_getValue("badges"))
  53. GM_setValue("badges", "false");
  54.  
  55. /* Retrieve custom settings */
  56.  
  57. var quotedColor = GM_getValue("quotedColor"); // Color for when quoted by someone - Keep inside quotes - if you enter hex code, put # as prefix. Ex: "#282828" vs. "teal"
  58. var showLogo = (GM_getValue("showLogo") === "true"); // true to show logo, false to hide logo
  59. var enableSFW = (GM_getValue("enableSFW") === "true"); // true to enable SFW, false to disable SFW (Safe For Work)
  60. var previewKey = GM_getValue("previewKey"); // ALT + {KEY} for Chrome || ALT + SHIFT + {KEY} for Firefox - More Info: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey
  61. var hideMenu = (GM_getValue("hideMenu") === "true"); // true to remove menu nav links, false to show.
  62. var showTime = (GM_getValue("showTime") === "true"); // Show HF MyBB Time (timezone set in User CP)
  63. var badges = (GM_getValue("badges") === "true"); // Badges Feature - false to disable feature. || **NOT DONE**
  64.  
  65. /* End */
  66.  
  67. $(window).load(function () { // Theme Color Scheme Changer
  68. var cp = $('<div class=\'cp\'/>');
  69. var select = $('<div class=\'select\'/>');
  70. var scrollTop = $('<a href=\"#\"/ title=\"Scroll to Top\"/ class=\"scrollToTop\"/></a>'); // Scroll To Top
  71. $('body').append(scrollTop, cp, select);
  72. var colours = {
  73. 'black': '#393939',
  74. 'blue': '#619ECB',
  75. 'green': '#7ECB61',
  76. 'orange': '#D29C2D',
  77. 'purple': '#724FAD',
  78. 'red': '#CB6161',
  79. 'darkblue': '#00528f',
  80. 'darkgreen': '#35713F',
  81. 'darkorange': '#9A782E',
  82. 'darkpurple': '#4D2D5E',
  83. 'darkred': '#641C1C'
  84. };
  85. if (!localStorage.getItem('theme'))
  86. localStorage.setItem('theme', 'cl-' + Object.keys(colours) [0]);
  87. $('body').addClass(localStorage.getItem('theme') ? localStorage.getItem('theme') : 'cl-' + Object.keys(colours) [0]);
  88. $('.cp').css('background', colours[$('body').attr('class').split(' ') [0].substring(3, $('body').attr('class').split(' ') [0].length)]);
  89.  
  90. /* BEGIN SETTINGS MODAL */
  91. var css = "<style>.part { width: 25px; height: 25px; margin: 10px; border-radius: 50%; display: inline-block; } .link { cursor: pointer; color #fff; }</style>";
  92.  
  93. // Modal in itself
  94. var settings = $('<div class=\'settings_flatdarkness\'/>');
  95. settings.attr("style", "background-color: rgb(51, 51, 51); bottom: auto; border: 1px solid rgb(0, 0, 0); height: 50%; left: 182px; margin: 0px; max-height: 95%; max-width: 95%; opacity: 1; overflow: auto; padding: 0px; position: fixed; right: auto; top: 128px; width: 75%; z-index: 999; display: none;'><span style='float: right; margin-right: 1%; margin-top: 0.5%;");
  96. settings.append("<h4>Flat Darkness Settings</h4>");
  97.  
  98. // Color picker
  99. settings.append("<div>Colors:<div class='colors'></div>");
  100. $.each(colours, function (key, value) {
  101. settings.find(".colors").append($('<div class=\'part\' style=\'background: ' + value + ' !important;\' cid=\'' + key + '\'/>'));
  102. });
  103. settings.find(".colors").append("</div>");
  104.  
  105. // Quoted color picker
  106. settings.append("<div>Quoted color:<div class='quotedColor'><input type='color' value='" + quotedColor + "'</div></div><br>");
  107. $("body").on("change", "input[type='color']", function() {
  108. GM_setValue("quotedColor", $("input[type='color']").val());
  109. });
  110.  
  111. // Show logo settings
  112. settings.append("<div>Show Logo? <span class='link' id='showLogo'>" + showLogo + "</span></div>");
  113. $("body").on("click", "#showLogo", function() {
  114. $("#showLogo").html("" + !showLogo + "");
  115. GM_setValue("showLogo", "" + !showLogo + "");
  116. });
  117.  
  118. // Enable SFW
  119. settings.append("<div>Enable SFW? <span class='link' id='enableSFW'>" + enableSFW + "</span></div>");
  120. $("body").on("click", "#enableSFW", function() {
  121. $("#enableSFW").html("" + !enableSFW + "");
  122. GM_setValue("enableSFW", "" + !enableSFW + "");
  123. });
  124.  
  125. // Hide menu
  126. settings.append("<div>Hide Menu? <span class='link' id='hideMenu'>" + hideMenu + "</span></div>");
  127. $("body").on("click", "#hideMenu", function() {
  128. $("#hideMenu").html("" + !hideMenu + "");
  129. GM_setValue("hideMenu", "" + !hideMenu + "");
  130. });
  131.  
  132. // Show time
  133. settings.append("<div>Show time? <span class='link' id='showTime'>" + showTime + "</span></div>");
  134. $("body").on("click", "#showTime", function() {
  135. $("#showTime").html("" + !showTime + "");
  136. GM_setValue("showTime", "" + !showTime + "");
  137. });
  138.  
  139. // Badges
  140. settings.append("<div>Show badges? <span class='link' id='badges'>" + badges + "</span></div>");
  141. $("body").on("click", "#badges ", function() {
  142. $("#badges").html("" + !badges + "");
  143. GM_setValue("badges", "" + !badges + "");
  144. });
  145.  
  146. $("body").append(css);
  147. $("body").append(settings);
  148. /* END SETTINGS MODAL */
  149.  
  150. $('.cp').click(function () {
  151. $('.settings_flatdarkness').show();
  152. });
  153. $('.part').click(function () {
  154. var cl = 'cl-' + $(this).attr('cid');
  155. $('.cp').css('background', colours[$(this).attr('cid')]);
  156. $('body').alterClass('cl-*', cl);
  157. localStorage.setItem('theme', cl);
  158. });
  159. });
  160.  
  161. /** Custom Functions **/
  162.  
  163. $('code').each(function(i, block) { // Highlight Syntax
  164. hljs.highlightBlock(block);
  165. });
  166.  
  167. $(window).scroll(function(){ // Scroll to Top
  168. if ($(this).scrollTop() > 100) {
  169. $('.scrollToTop').fadeIn();
  170. } else {
  171. $('.scrollToTop').fadeOut();
  172. }
  173. });
  174. $('.scrollToTop').click(function(){
  175. $('html, body').animate({scrollTop: 0},800);
  176. return false;
  177. });
  178.  
  179. $.fn.textWidth = function(text, font) { // AUTO GROW INPUT
  180. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
  181. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
  182. return $.fn.textWidth.fakeEl.width();
  183. };
  184.  
  185. $('.width-dynamic').on('input', function() {
  186. var inputWidth = $(this).textWidth();
  187. $(this).css({
  188. width: inputWidth
  189. });
  190. }).trigger('input');
  191.  
  192.  
  193. function inputWidth(elem, minW, maxW) {
  194. elem = $(this);
  195. console.log(elem);
  196. }
  197.  
  198. var targetElem = $('.width-dynamic');
  199.  
  200. inputWidth(targetElem); // AutoGrowInput
  201.  
  202. /** Public Vars **/
  203.  
  204. //var profileLink = $('#panel > strong:nth-child(1) > a:nth-child(1)').attr("href");
  205. //var UserID = profileLink.split("=")[2];
  206. //console.log(UserID);
  207.  
  208. /*function getBadgeList() {
  209. GM_xmlhttpRequest({
  210. method: "GET",
  211. url: "https://ihydra.net/hf/flatdark/adminList.txt"+ "?t=" + Math.random(),
  212. onload: function(response){
  213. var reslines, templine, i, j, donorMap = {};
  214. reslines = response.responseText.split('\n');
  215. }
  216. });
  217. } */
  218.  
  219. /*
  220. * Modifications (jQuery/jS for multi-browser support)
  221. */
  222.  
  223. $(document).ready(function () {
  224. if(1 == 1) { // window.location.pathname.indexOf("/newreply.php") == 0
  225. console.log("bbLive");
  226. var bbLiveButton = $('<button class="bitButton md-trigger" data-modal="modal-5">Newspaper</button>');
  227. $('div[class*="messageEditor"]').addClass("test");
  228. console.log("worked?");
  229. }
  230. $('div.menu > ul').attr('style','text-align:center !important;');
  231. $('img[src="' + imagepath + '/starstaff.png"]').attr('style', 'filter: hue-rotate(5deg) saturate(8); -webkit-filter: hue-rotate(5deg) saturate(8)'); // Staff Stars Color Change
  232. $('img[src="' + imagepath + '/dismiss_notice.gif"]').attr('src', 'https://i.imgur.com/uxvQQDI.png'); // PM Notif Dismiss Icon
  233. $('img[src="' + imagepath + '/add_buddy.gif"]').attr('src', 'https://i.imgur.com/3d5FKNX.png'); // Add Buddy Icon
  234. $('img[src="' + imagepath + '/remove_buddy.gif"]').attr('src', 'https://i.imgur.com/zDwBkq5.png'); // Remove Buddy Icon
  235. $('img[src="' + imagepath + '/add_ignore.gif"]').attr('src', 'https://i.imgur.com/u3NZbDu.png'); // Add Ignore Icon
  236. $('img[src="' + imagepath + '/remove_ignore.gif"]').attr('src', 'https://i.imgur.com/zDwBkq5.png'); // Remove Ignore Icon
  237. $('img[src$="/img/disable.png"]').attr('src', 'https://i.imgur.com/LXGekE9.png'); // Disable icon for multi-page loader userscript(not included)
  238. $('img[src$="/img/enable.png"]').attr('src', 'https://i.imgur.com/YHDATSF.png'); // Enable icon for multi-page loader userscript(not included)
  239. $('img[src="' + imagepath + '/minioff.gif"]').attr('src', 'https://i.imgur.com/AP6vLRo.png').attr('style', 'padding-bottom: 2px;'); // No Posts SF Icon
  240. $('img[src="' + imagepath + '/miniofflock.gif"]').attr('src', 'https://i.imgur.com/AP6vLRo.png').attr('style', 'padding-bottom: 2px;'); // No Posts SF Icon Locked
  241. $('img[src="' + imagepath + '/minion.gif"]').attr('src', 'https://i.imgur.com/Wsl1Gfc.png').attr('style', 'padding-bottom: 3px;'); // New Posts SF icon
  242. $('img[src="' + imagepath + '/spinner_big.gif"]').attr('src', 'https://i.imgur.com/y3wDcUA.gif'); // Quick Reply Spinner Change
  243. $('span:contains("Moderated")').addClass('sevenpad'); // Padding fix
  244. $('link[href*="star_ratings"]').remove(); // Star Ratings Change
  245. $('#pm_notice').removeClass('pm_alert').addClass('pm_alert2'); // Group vs. PM Alert
  246. $('div > code').dblclick(function() {
  247. $(this).select();
  248. var text = this,
  249. range, selection;
  250. if (document.body.createTextRange) {
  251. range = document.body.createTextRange();
  252. range.moveToElementText(text);
  253. range.select();
  254. } else if (window.getSelection) {
  255. selection = window.getSelection();
  256. range = document.createRange();
  257. range.selectNodeContents(text);
  258. selection.removeAllRanges();
  259. selection.addRange(range);
  260. }
  261. });
  262. if($("img[id*='multiquote_']").attr("src") === imagepath + "/english/postbit_multiquote_on.gif") { // Multiquote IMG to CSS - By Snorlax
  263. $("img[id*='multiquote_']").hide().after("<button class='button' style='bottom: 7px;position: relative;cursor: pointer;outline: none;'>MQ-</button>");
  264. } else {
  265. $("img[id*='multiquote_']").hide().after("<button class='button' style='bottom: 7px;position: relative;cursor: pointer;outline: none;'>MQ+</button>");
  266. }
  267. $(".trow1 .button").on("click", function() {
  268. var postId = $(this).parent().attr("id").match(/multiquote_link_([0-9]*)/)[1];
  269. if($(this).text() == "MQ-") {
  270. quotedPosts.splice(quotedPosts.indexOf(postId), 1);
  271. } else {
  272. quotedPosts.push(postId);
  273. console.log(quotedPosts);
  274. }
  275. GM_setValue("quotedPosts", quotedPosts);
  276. $(this).text($(this).text() == "MQ+" ? "MQ-" : "MQ+");
  277. });
  278. $(".trow1 .button").each(function() {
  279. var postId = $(this).parent().attr("id").match(/multiquote_link_([0-9]*)/)[1];
  280. if(GM_getValue("quotedPosts").indexOf(postId) >= 0) {
  281. $(this).text("MQ-");
  282. console.log(postId);
  283. }
  284. });
  285. $("body").on("click", "#quickreply_multiquote", function() {
  286. console.log("Clicked");
  287. quotedPosts = [];
  288. GM_setValue("quotedPosts", quotedPosts);
  289. $(".button").each(function() {
  290. $(this).text("MQ+");
  291. console.log("SET TO MQ+");
  292. });
  293. });
  294. $('.button2[name="previewpost"]').attr('accesskey',previewKey); // Preview Key Hotkey Shortcut
  295. if(window.location.href == "https://hackforums.net/misc.php?action=buddypopup"){ // Buddy List Online Status Fix
  296. console.log('buddypopup');
  297. $('img[src="' + imagepath + '/buddy_away.gif"]').attr('src', 'https://i.imgur.com/x7dAaGE.png').attr('style', ''); // Away Status
  298. $('img[src="' + imagepath + '/buddy_online.gif"]').attr('src', 'https://i.imgur.com/lpKaTIB.png').attr('style', ''); // Online Status
  299. $('img[src="' + imagepath + '/buddy_offline.gif"]').attr('src', 'https://i.imgur.com/EKt4fXk.png').attr('style', ''); // Offline Status
  300. }else if(window.location.href == "https://hackforums.net/usercp.php?action=editlists"){
  301. $('img[src="' + imagepath + '/buddy_away.gif"]').attr('src', 'https://i.imgur.com/x7dAaGE.png').attr('style', 'vertical-align: top;'); // Away Status
  302. $('img[src="' + imagepath + '/buddy_online.gif"]').attr('src', 'https://i.imgur.com/lpKaTIB.png').attr('style', 'vertical-align: top;'); // Online Status
  303. $('img[src="' + imagepath + '/buddy_offline.gif"]').attr('src', 'https://i.imgur.com/EKt4fXk.png').attr('style', 'vertical-align: top;'); // Offline Status
  304. }else{
  305. $('img[src="' + imagepath + '/buddy_away.gif"]').attr('src', 'https://i.imgur.com/x7dAaGE.png').attr('style', 'position: absolute; padding-top: 4px;'); // Away Status
  306. $('img[src="' + imagepath + '/buddy_online.gif"]').attr('src', 'https://i.imgur.com/lpKaTIB.png').attr('style', 'position: absolute; padding-top: 4px;'); // Online Status
  307. $('img[src="' + imagepath + '/buddy_offline.gif"]').attr('src', 'https://i.imgur.com/EKt4fXk.png').attr('style', 'position: absolute; padding-top: 4px;'); // Offline Status
  308. }
  309. $("td[class*='trow'] input:checkbox").on("click", function() { // Mods & Staf Only - Highlight checkboxed rows - Conflicts with HFES for me, please test and report back
  310. console.log("something");
  311. var selector = $(this).closest("tr").find("td");
  312. if($(this).is(":checked")) {
  313. selector.css("background", "#242424");
  314. } else {
  315. selector.css("background", "");
  316. }
  317. });
  318. if(window.location.pathname == "/gauth.php"){
  319. $('span[class="float_right smalltext"]').attr('style','display: block !important'); // Gauth Reset Link Reveal
  320. }
  321. if(window.location.pathname == "/reputation.php"){
  322. $('a[href$="&show=positive"]').attr('style','font-size: 14px; background-color: #2DA546; border: 1px solid #2CC330; padding: 5px 10px 5px 10px; font-weight: bold; color: white;').after("<br/>"); // Positive Rep Box
  323. $('a[href$="&show=neutral"]').attr('style','font-size: 14px; background-color: #777777; border: 1px solid #949494; padding: 5px 10px 5px 10px; font-weight: bold; color: white;').after("<br/>"); // Neutral Rep Box
  324. $('a[href$="&show=negative"]').attr('style','font-size: 14px; background-color: #CC4444; border: 1px solid #FF5656; padding: 5px 10px 5px 10px; font-weight: bold; color: white;'); // Negative Rep Box
  325. $('strong[class="reputation_positive"]:contains("Positives")').remove(); // Legend Text Remove
  326. $('strong[class="reputation_neutral"]:contains("Neutrals")').remove(); // Legend Text Remove
  327. $('strong[class="reputation_negative"]:contains("Negatives")').remove(); // Legend Text Remove
  328. $('span[class="smalltext"]:contains("Total Reputation:")').find("br").remove(); // Received Rep Boxes Layout
  329. $('strong:contains("Total Reputation:")').before("<br/><br/>"); // Received Rep Boxes Layout
  330. $('span[class^="repbox"]').after("<br/><br/>"); // Received Rep Boxes Layout
  331. }
  332. if(showLogo === true){ // Show Logo
  333. $('img[src="https://hackforums.net/images/modern_bl/logo_bl.gif"]').attr('src', 'https://i.imgur.com/fAzkq6w.png');
  334. $('img[src="https://hackforums.net/images/modern_pl/logo_pl.gif"]').attr('src', 'https://i.imgur.com/fAzkq6w.png');
  335. $('div[class="logo"]').removeClass("logo").attr('style','text-align:center');
  336. }
  337. if(enableSFW === true) { // Enable Safe-For-Work
  338. $('div[style="overflow:hidden; max-height:200px;"]').attr('class','sigArea');
  339. $('div[style="overflow:hidden; max-height:200px;"] img').attr('class','sigImage');
  340. $('td[class="post_avatar"]').attr('style','display:none;');
  341. var sigShow = $('<input type="button" class="button sigButton" value="toggle" style="position:relative; float:right;" />');
  342. $("table[id*='post_']").each(function() {
  343. src = $(this).find("tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(3) img").attr("src");
  344. if (src !== null) {
  345. $(this).find("tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(3) img").attr('style','display:none;');
  346. $(this).find("tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(3)").prepend('<input type="button" class="bitButton sigButton" value="toggle" style="position:relative; float:right; outline:none;" />');
  347. }
  348. });
  349. $('.sigButton').click(function() {
  350. $(this).parent().find('.sigImage').toggleClass("sigReveal");
  351. $(this).parent().toggleClass("sigResize");
  352.  
  353. });
  354. }
  355. if(window.location.pathname != "/private.php") {
  356. var userName = $('div#panel > strong > a[href^="https://hackforums.net/member.php?action=profile&uid="]').text();
  357. if(!userName) userName = NULL;
  358. $('blockquote > cite:contains(' + userName + ')').css({'color': quotedColor, 'font-weight': 'bold','border-bottom': '1px dotted' + quotedColor});
  359. }
  360. if(window.location.pathname == "/private.php") {
  361. $('.quick_keys > form:nth-child(1) > table:nth-child(2) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(5) > td:nth-child(1) > div:nth-child(2) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1)').attr("style","border-bottom:0px !important;");
  362. $('#content > div.quick_keys > form > table > tbody > tr > td:nth-child(2) > table:nth-child(1) > tbody > tr > td > table > tbody > tr > td').attr("style","border-bottom:0px !important;");
  363. //$('input.textbox').addClass('width-dynamic').css('max-width','1020px').css('min-width','250px'); // Input Textbox Auto-Scale to Text Entered
  364. }
  365. if(window.location.pathname == "/showstaff.php" || window.location.pathname == "/showmods.php") {
  366. $('head').append('<style>td.trow1:hover {background: none !important;}</style>');
  367. $('td[class="trow1"]').attr("style","background: none; border: 0px !important;");
  368. $('div[style="width: 48%; min-height: 120px;float: left; border: 1px #4F3A6B solid; margin: 4px; padding: 2px;"]').attr("style","").addClass("staffCard");
  369. $('div[style="width: 48%; float: left; border: 1px #4F3A6B solid; margin: 4px; padding: 2px;"]').attr("style","").addClass("staffCard");
  370. $('td[class="trow1"][width="75%"]').attr("width","90%").attr("style","border: 0px !important").removeClass('trow1').addClass('staffCardParts').addClass('trow2');
  371. $('td[width="25%"]').attr("style","").addClass('staffCardParts');
  372. }
  373. if(window.location.pathname == "/showgroups.php") {
  374. $('head').append('<style>td.trow1:hover {background: none !important;}</style>');
  375. $('td[class="trow1"]').attr("style","background: none; border: 0px !important;");
  376. $('div[style="width: 46%; min-height:168px;float: left; border: 1px #4F3A6B solid; margin: 4px; padding: 2px;"]').attr("style","").addClass("groupsCard");
  377. $('td[class="trow1"][width="75%"]').attr("width","90%").attr("style","border: 0px !important").removeClass('trow1').addClass('groupsCardParts').addClass('trow2');
  378. $('td[width="25%"]').attr("style","").attr("valign","middle").addClass('groupsCardParts');
  379. $('td[valign="bottom"]').attr("style","background-color: #333; border-radius: 0px; vertical-align: baseline; font-size: 12px;");
  380. $('table[width="100%"]').attr("height","100%").attr("cellpadding","10");
  381. }
  382. if(window.location.pathname == "/newreply.php" || window.location.pathname == "/newthread.php") {
  383. $('table.tborder:nth-child(1) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1)').attr("style","border-bottom:0px !important;");
  384. }
  385. if(window.location.pathname == "/search.php") {
  386. $('#content > div.quick_keys > form > table > tbody > tr:nth-child(3) > td:nth-child(2) > table > tbody > tr > td:nth-child(1)').attr("style","border-bottom:0px !important;");
  387. }
  388. if (window.location.pathname == "/member.php") {
  389. $('.quick_keys > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1)').attr("style","border-bottom:0px !important;");
  390. $('.quick_keys > table:nth-child(3) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(3) > br:nth-child(1)').remove();
  391. var sendToUID = $('.quick_keys > table:nth-child(3) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > table:nth-child(3) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2) > a:nth-child(1)').attr("href");
  392. $('span.largetext').append("<a class='bitButton' style='margin-left: 15px;' title='Send Private Message' href='" + sendToUID + "'>Send PM</a>");
  393. }
  394. if(hideMenu === true) {
  395. $("div[class='menu']").hide();
  396. }
  397. if(showTime === false) {
  398. $("div[class='largetext']").hide();
  399. }
  400. if(badges === true) { // Badge System >> Displays an icon as an identfier
  401. var adminList = [1]; // Omniscient
  402. var staffList = [992020,1292605,1570078]; // King of Hearts, Skorp, Sam Winchester
  403. var mentorList = [4066,330676,1320406,23809]; // Judge Dredd, Diabolic, Froggy, Viral Dragon
  404. var groupLeadersList = [992067,1642244,1406453,1121882,1191229,1066501,2052441,431105,80618,370510,55709,1148878,1961000,1469364,1812679,664032,1843672,2110841,561239]; // Nobility, Dubitus, Escrow, Avunit, Arrow, Moeseph, Billie Joe, The Grim, nokia2mon2, Alone Vampire, Glitch, Clique, Zexo, Prada, Ninetales, Water Aura, Infamy, Night Fury
  405. var devList = [561239, 2577525]; // iHydra, Hash G.
  406. for(var I = 0; I < devList.length; I++) {
  407. $("a[href='https://hackforums.net/member.php?action=profile&uid=" + devList[I] + "']").append('<img title="Developer of Flat Darkness" src="https://i.imgur.com/oH5ci89.png" style="position: relative;top: 3px; left: 2px; padding-left: 2px;">');
  408. }
  409. for(var I = 0; I < adminList.length; I++) {
  410. $("a[href='https://hackforums.net/member.php?action=profile&uid=" + adminList[I] + "']").append('<img title="Omniscient" src="https://i.imgur.com/xsUlRrE.png" style="position: relative;top: 3px;left: 2px; padding-left: 2px;">');
  411. }
  412. for(var I = 0; I < staffList.length; I++) {
  413. $("a[href='https://hackforums.net/member.php?action=profile&uid=" + staffList[I] + "']").append('<img title="HF Staff" src="https://i.imgur.com/UP5TYS4.png" style="position: relative;top: 3px;left: 2px; padding-left: 2px;">');
  414. }
  415. for(var I = 0; I < mentorList.length; I++) {
  416. $("a[href='https://hackforums.net/member.php?action=profile&uid=" + mentorList[I] + "']").append('<img title="HF Mentor" src="https://i.imgur.com/Tu5taXM.png" style="position: relative;top: 3px;left: 2px; padding-left: 2px;">');
  417. }
  418. for(var I = 0; I < groupLeadersList.length; I++) {
  419. $("a[href='https://hackforums.net/member.php?action=profile&uid=" + groupLeadersList[I] + "']").append('<img title="HF Group Leader" src="https://i.imgur.com/DvGiZJk.png" style="position: relative;top: 3px; left: 2px; padding-left: 2px;">');
  420. }
  421. }
  422. $('img[src="' + imagepath + '/groupimages/english/ub3r.png"]').attr('style', '-webkit-filter: hue-rotate(15deg); filter: hue-rotate(15deg);'); // Uber Userbar Color Change
  423. $('img[src="' + imagepath + '/starub3r2.png"]').attr('style', '-webkit-filter: hue-rotate(15deg); filter: hue-rotate(15deg);'); // Uber Stars Color Change
  424. $('strong span[style="rgb(56, 56, 56)"]').addClass("closedGroup"); // Changes Closed Usergroup Color
  425. $('strong:contains("Post:") > a[href^="showthread.php?tid="]').attr('id','postLink').attr('style','padding-top: 3px; padding-right: 5px; display: inline-block;'); // Post # Centered
  426. $('span[style="color:#383838"]').attr('style','color:#444444;'); // Closed Account Username Color Change
  427. });
  428.  
  429. function BBVideoColorReplace(){ //BB Video and Color Icon Replace Delayer
  430. $('img[src="https://hackforums.net/jscripts/editor_themes/default/images/television.gif"]').attr('src','https://i.imgur.com/nhHILRQ.png'); // BB Editor - Video Embed
  431. $('img[src$="hackforums.net/jscripts/editor_themes/default/images/color.gif"]').attr('src', 'https://i.imgur.com/ZjMmUit.png'); // BB Editor - Color Picker
  432. };
  433. setTimeout(BBVideoColorReplace, 800);