');
$('body').append(cp, select);
var colours = {
'black': '#393939',
'blue': '#619ECB',
'green': '#0A8C0E',
'orange': '#D29C2D',
'purple': '#724FAD',
'red': '#CB6161',
'darkblue': '#00528f',
'darkgreen': '#0A8C0E',
'darkorange': '#9A782E',
'darkpurple': '#4D2D5E',
'darkred': '#641C1C'
};
if (!localStorage.getItem('theme'))
localStorage.setItem('theme', 'cl-' + Object.keys(colours) [0]);
$('body').addClass(localStorage.getItem('theme') ? localStorage.getItem('theme') : 'cl-' + Object.keys(colours) [0]);
$('.cp').css('background', colours[$('body').attr('class').split(' ') [0].substring(3, $('body').attr('class').split(' ') [0].length)]);
$.each(colours, function (key, value) {
select.append($('
'));
});
$('.cp').click(function () {
$('.select').toggleClass('show');
});
$('.part').click(function () {
var cl = 'cl-' + $(this).attr('cid');
$('.cp').css('background', colours[$(this).attr('cid')]);
$('body').alterClass('cl-*', cl);
localStorage.setItem('theme', cl);
});
});
/** START SETTINGS PANEL **/
// TBA
/** END SETTINGS PANEL **/
/** Custom Functions **/
$('code').each(function(i, block) { // Highlight Syntax
hljs.highlightBlock(block);
});
/*
* Modifications (jQuery/jS for multi-browser support)
*/
$(document).ready(function () {
$('div.menu > ul').attr('style','text-align:center !important;');
$('img[src$="hackforums.net/images/modern_bl/starstaff.png"]').attr('style', 'filter: hue-rotate(5deg) saturate(8); -webkit-filter: hue-rotate(5deg) saturate(8)'); // Staff Stars Color Change
$('img[src$="hackforums.net/images/modern_bl/dismiss_notice.gif"]').attr('src', 'http://i.imgur.com/uxvQQDI.png'); // PM Notif Dismiss Icon
$('img[src$="hackforums.net/images/modern_bl/add_buddy.gif"]').attr('src', 'http://i.imgur.com/3d5FKNX.png'); // Add Buddy Icon
$('img[src$="hackforums.net/images/modern_bl/remove_buddy.gif"]').attr('src', 'http://i.imgur.com/zDwBkq5.png'); // Remove Buddy Icon
$('img[src$="hackforums.net/images/modern_bl/add_ignore.gif"]').attr('src', 'http://i.imgur.com/u3NZbDu.png'); // Add Ignore Icon
$('img[src$="hackforums.net/images/modern_bl/remove_ignore.gif"]').attr('src', 'http://i.imgur.com/zDwBkq5.png'); // Remove Ignore Icon
$('img[src$="/img/disable.png"]').attr('src', 'http://i.imgur.com/LXGekE9.png'); // Disable icon for multi-page loader userscript(not included)
$('img[src$="/img/enable.png"]').attr('src', 'http://i.imgur.com/YHDATSF.png'); // Enable icon for multi-page loader userscript(not included)
$('img[src$="hackforums.net/images/modern_bl/minioff.gif"]').attr('src', 'http://i.imgur.com/AP6vLRo.png').attr('style', 'padding-bottom: 2px;'); // No Posts SF Icon
$('img[src$="hackforums.net/images/modern_bl/miniofflock.gif"]').attr('src', 'http://i.imgur.com/AP6vLRo.png').attr('style', 'padding-bottom: 2px;'); // No Posts SF Icon Locked
$('img[src$="hackforums.net/images/modern_bl/minion.gif"]').attr('src', 'http://i.imgur.com/Wsl1Gfc.png').attr('style', 'padding-bottom: 3px;'); // New Posts SF icon
$('img[src$="http://hackforums.net/images/modern_bl/spinner_big.gif"]').attr('src', 'http://i.imgur.com/y3wDcUA.gif'); // Quick Reply Spinner Change
$('span:contains("Moderated")').addClass('sevenpad'); // Padding fix
$('link[href*="star_ratings"]').remove(); // Star Ratings Change
$('#pm_notice').removeClass('pm_alert').addClass('pm_alert2'); // Group vs. PM Alert
$('code[class="hljs markdown"]').dblclick(function() {
$(this).select();
var text = this,
range, selection;
if (document.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
}
});
if($("img[id*='multiquote_']").attr("src") === "http://hackforums.net/images/modern_bl/english/postbit_multiquote_on.gif") { // Multiquote IMG to CSS - By Snorlax
$("img[id*='multiquote_']").hide().after("
MQ- ");
} else {
$("img[id*='multiquote_']").hide().after("
MQ+ ");
}
$(".trow1 .button").on("click", function() {
var postId = $(this).parent().attr("id").match(/multiquote_link_([0-9]*)/)[1];
if($(this).text() == "MQ-") {
quotedPosts.splice(quotedPosts.indexOf(postId), 1);
} else {
quotedPosts.push(postId);
console.log(quotedPosts);
}
GM_setValue("quotedPosts", quotedPosts);
$(this).text($(this).text() == "MQ+" ? "MQ-" : "MQ+");
});
$(".trow1 .button").each(function() {
var postId = $(this).parent().attr("id").match(/multiquote_link_([0-9]*)/)[1];
if(GM_getValue("quotedPosts").indexOf(postId) >= 0) {
$(this).text("MQ-");
console.log(postId);
}
});
$("body").on("click", "#quickreply_multiquote", function() {
console.log("Clicked");
quotedPosts = [];
GM_setValue("quotedPosts", quotedPosts);
$(".button").each(function() {
$(this).text("MQ+");
console.log("SET TO MQ+");
});
});
$('.button2[name="previewpost"]').attr('accesskey',previewKey); // Preview Key Hotkey Shortcut
if(window.location.href == "http://hackforums.net/misc.php?action=buddypopup"){ // Buddy List Online Status Fix
$('img[src$="hackforums.net/images/modern_bl/buddy_away.gif"]').attr('src', 'http://i.imgur.com/x7dAaGE.png').attr('style', ''); // Away Status
$('img[src$="hackforums.net/images/modern_bl/buddy_online.gif"]').attr('src', 'http://i.imgur.com/lpKaTIB.png').attr('style', ''); // Online Status
$('img[src$="hackforums.net/images/modern_bl/buddy_offline.gif"]').attr('src', 'http://i.imgur.com/EKt4fXk.png').attr('style', ''); // Offline Status
}else if(window.location.href == "http://hackforums.net/usercp.php?action=editlists"){
$('img[src$="hackforums.net/images/modern_bl/buddy_away.gif"]').attr('src', 'http://i.imgur.com/x7dAaGE.png').attr('style', 'vertical-align: top;'); // Away Status
$('img[src$="hackforums.net/images/modern_bl/buddy_online.gif"]').attr('src', 'http://i.imgur.com/lpKaTIB.png').attr('style', 'vertical-align: top;'); // Online Status
$('img[src$="hackforums.net/images/modern_bl/buddy_offline.gif"]').attr('src', 'http://i.imgur.com/EKt4fXk.png').attr('style', 'vertical-align: top;'); // Offline Status
}else{
$('img[src$="hackforums.net/images/modern_bl/buddy_away.gif"]').attr('src', 'http://i.imgur.com/x7dAaGE.png').attr('style', 'position: absolute; padding-top: 4px;'); // Away Status
$('img[src$="hackforums.net/images/modern_bl/buddy_online.gif"]').attr('src', 'http://i.imgur.com/lpKaTIB.png').attr('style', 'position: absolute; padding-top: 4px;'); // Online Status
$('img[src$="hackforums.net/images/modern_bl/buddy_offline.gif"]').attr('src', 'http://i.imgur.com/EKt4fXk.png').attr('style', 'position: absolute; padding-top: 4px;'); // Offline Status
}
$("td[class*='trow'] input:checkbox").on("click", function() { // Mods & Staf Only - Highlight checkboxed rows - Conflicts with HFES for me, please test and report back
console.log("something");
var selector = $(this).closest("tr").find("td");
if($(this).is(":checked")) {
selector.css("background", "#242424");
} else {
selector.css("background", "");
}
});
if(window.location.pathname == "/gauth.php"){
$('span[class="float_right smalltext"]').attr('style','display: block !important'); // Gauth Reset Link Reveal
}
if(window.location.pathname == "/reputation.php"){
$('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("
"); // Positive Rep Box
$('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("
"); // Neutral Rep Box
$('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
$('strong[class="reputation_positive"]:contains("Positives")').remove(); // Legend Text Remove
$('strong[class="reputation_neutral"]:contains("Neutrals")').remove(); // Legend Text Remove
$('strong[class="reputation_negative"]:contains("Negatives")').remove(); // Legend Text Remove
$('span[class="smalltext"]:contains("Total Reputation:")').find("br").remove(); // Received Rep Boxes Layout
$('strong:contains("Total Reputation:")').before("
"); // Received Rep Boxes Layout
$('span[class^="repbox"]').after("
"); // Received Rep Boxes Layout
}
if(showLogo === true){ // Show Logo
$('img[src$="http://hackforums.net/images/modern_bl/logo_bl.gif"]').attr('src', 'http://i.imgur.com/fAzkq6w.png');
$('div[class="logo"]').removeClass("logo").attr('style','text-align:center');
}
if(enableSFW === true) { // Enable Safe-For-Work
$('div[style="overflow:hidden; max-height:200px;"]').attr('class','sigArea');
$('div[style="overflow:hidden; max-height:200px;"] img').attr('class','sigImage');
$('td[class="post_avatar"]').attr('style','display:none;');
var sigShow = $('
');
$("table[id*='post_']").each(function() {
src = $(this).find("tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(3) img").attr("src");
if (src != null) {
$(this).find("tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(3) img").attr('style','display:none;');
$(this).find("tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(3)").prepend('
');
}
});
$('.sigButton').click(function() {
$(this).parent().find('.sigImage').toggleClass("sigReveal");
$(this).parent().toggleClass("sigResize");
});
}
if(window.location.pathname != "/private.php") {
var userName = $('strong > a[href^="http://hackforums.net/member.php?action=profile&uid="]').text();
$('blockquote > cite:contains(' + userName + ')').css({'color': quotedColor, 'font-weight': 'bold','border-bottom': '1px dotted' + quotedColor});
}
if(window.location.pathname == "/showstaff.php" || window.location.pathname == "/showmods.php") {
$('head').append('')
$('td[class="trow1"]').attr("style","background: none; border: 0px !important;");
$('div[style="width: 48%; min-height: 120px;float: left; border: 1px #4F3A6B solid; margin: 4px; padding: 2px;"]').attr("style","").addClass("staffCard");
$('div[style="width: 48%; float: left; border: 1px #4F3A6B solid; margin: 4px; padding: 2px;"]').attr("style","").addClass("staffCard");
$('td[class="trow1"][width="75%"]').attr("width","90%").attr("style","border: 0px !important").removeClass('trow1').addClass('staffCardParts').addClass('trow2');
$('td[width="25%"]').attr("style","").addClass('staffCardParts');
}
if(window.location.pathname == "/showgroups.php") {
$('head').append('')
$('td[class="trow1"]').attr("style","background: none; border: 0px !important;");
$('div[style="width: 46%; min-height:168px;float: left; border: 1px #4F3A6B solid; margin: 4px; padding: 2px;"]').attr("style","").addClass("groupsCard");
$('td[class="trow1"][width="75%"]').attr("width","90%").attr("style","border: 0px !important").removeClass('trow1').addClass('groupsCardParts').addClass('trow2');
$('td[width="25%"]').attr("style","").attr("valign","middle").addClass('groupsCardParts');
$('td[valign="bottom"]').attr("style","background-color: #333; border-radius: 0px; vertical-align: baseline; font-size: 12px;");
$('table[width="100%"]').attr("height","100%").attr("cellpadding","10");
}
if(hideMenu === true) {
$("div[class='menu']").hide();
}
if(badges === true) {
// BADGES - LIST OF UIDs
var adminList = [1]; // Omniscient
var staffList = [1292605,1093501,370510,1570078,992020,1450348]; // Skorp, Roger Waters, Alone Vampire, Sam Winchester, King of Hearts, Walt Disney
var mentorList = [4066,330676,1320406]; // Judge Dredd, Diabolic, Froggy
var groupLeadersList = []; //
for(var I = 0; I < staffList.length; I++) {
$("a[href='http://hackforums.net/member.php?action=profile&uid=" + staffList[I] + "']").append('
');
}
for(var I = 0; I < mentorList.length; I++) {
$("a[href='http://hackforums.net/member.php?action=profile&uid=" + mentorList[I] + "']").append('
');
}
for(var I = 0; I < adminList.length; I++) {
$("a[href='http://hackforums.net/member.php?action=profile&uid=" + adminList[I] + "']").append('
');
}
for(var I = 0; I < groupLeadersList.length; I++) {
$("a[href='http://hackforums.net/member.php?action=profile&uid=" + groupLeadersList[I] + "']").append('
');
}
}
$('img[src$="hackforums.net/images/modern_bl/groupimages/english/ub3r.png"]').attr('style', '-webkit-filter: hue-rotate(15deg); filter: hue-rotate(15deg);'); // Uber Userbar Color Change
$('img[src$="hackforums.net/images/modern_bl/starub3r2.png"]').attr('style', '-webkit-filter: hue-rotate(15deg); filter: hue-rotate(15deg);'); // Uber Stars Color Change
$('strong span[style="rgb(56, 56, 56)"]').addClass("closedGroup"); // Changes Closed Usergroup Color
$('strong:contains("Post:") > a[href^="showthread.php?tid="]').attr('id','postLink').attr('style','padding-top: 3px; padding-right: 5px; display: inline-block;'); // Post # Centered
$('span[style="color:#383838"]').attr('style','color:#444444;'); // Closed Account Username Color Change
$('a[href="http://hackforums.net/member.php?action=profile&uid=561239"] > span[class^="group"]').append('
');
$('a[href="http://hackforums.net/member.php?action=profile&uid=2377407"] > span[class^="group"]').append('
');
});