-
Notifications
You must be signed in to change notification settings - Fork 0
/
themes.js
179 lines (147 loc) · 6.68 KB
/
themes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
function addStyleToPage() {
chrome.runtime.sendMessage({pkthemeno: "hi"}, function(response) {
//console.log(response);
var number = response.pkthemeno;
var disabled = true;
var themes = [{style: "", script: ""}];
themes.push({
})
/*if (number != -1 && number != 0 && !disabled) {
console.log("PKNotificatons: Adding custom theme (No. " + number + ")...");
chrome.runtime.sendMessage({pkthemedata: number}, function(result) {
if (result.style != "") {
var style = document.createElement("style");
document.head.appendChild(style);
style.innerHTML = result.style;
} else {
console.log("Blank style...?");
}
if (result.logourl != "" ) {
$("#logo").children("a").children("img").attr('src', result.logourl);
} else {
console.log("No logo...?");
}
});
}*/
});
/*chrome.runtime.sendMessage({customnewtheme: "hi"}, function(response) {
if (response != "") {
console.log("Adding new custom theme...")
var style = document.createElement("style");
document.head.appendChild(style);
style.innerHTML = response;
}
});*/
}
function addStyle(url_) {
$.ajax({
url: url_,
success: function(data) {
if (data != "") {
console.log("Adding custom theme...4")
var style = document.createElement("style");
document.head.appendChild(style);
style.innerHTML = result.style;
} else {
console.log("Blank style...?");
}
}
});
}
setTimeout(function() {
if (document.location.hostname == "projectkorra.com") {
//addStyleToPage(); //Disabled themeing
if (new Date().getDate() == 1 && new Date().getMonth() == 3) {
console.log("April fools!");
$("li[data-author='" + $("strong.accountUsername").text() + "'").each(function() {
var element = $(this).children("div.messageUserInfo").children("div.messageUserBlock").children("h3.userText");
$(element.children("em").get(1)).attr('style', "background-color: #FF0000; color: #FFFFFF");
$(element.children("em").get(1)).children("strong").text("Banned Member");
});
$("a.username").each(function() {
if ($(this).children("span").text() == "StrangeOne101") {
$(this).children("span").attr("style", "color: #FF0000");
}
});
$("h1.username").each(function() {
if ($(this).children("span").text() == "StrangeOne101") {
$(this).children("span").attr("style", "color: #FF0000");
$(this).parent().children("p.userBlurb").children("span.userTitle").text("Administrator");
$($(this).parent().children("div.userBanners").children("em").get(1)).attr("style", "background-color: #FF0000; color: #FFFFFF");
$($(this).parent().children("div.userBanners").children("em").get(1)).children("strong").text("Administrator");
}
});
$("h4.userTitle").each(function() {
if ($(this).parent().parent().children("h3.username").children("a.username").text() == "StrangeOne101") {
$(this).text("Administrator");
}
});
$("li[data-author='StrangeOne101']").each(function() {
var element = $(this).children("div.messageUserInfo").children("div.messageUserBlock").children("h3.userText");
$(element.children("a.username").children("span")[0]).removeClass("style5");
$(element.children("a.username").children("span")[0]).addClass("style3");
$(element.children("em").get(1)).removeClass("bannerSkyBlue");
$(element.children("em").get(1)).addClass("bannerRed");
$(element.children("em").get(1)).children("strong").text("Administrator");
});
setInterval(function() {
$("a.username").each(function() {
if ($(this).children("span").text() == "StrangeOne101") {
$(this).children("span").attr("style", "color: #FF0000");
}
});
$("h4.userTitle").each(function() {
if ($(this).parent().parent().children("h3.username").children("a.username").text() == "StrangeOne101") {
$(this).text("Administrator");
}
});
$("div.userTitle").each(function() {
if ($(this).parent().children("a.username").children("span").text() == "StrangeOne101") {
$(this).text("Administrator");
}
});
}, 500);
}
}
}, 50);
/*setTimeout(function() {
if (document.location.hostname == "projectkorra.com") {
chrome.runtime.sendMessage({pksecretkeys: "hi"}, function(response) {
console.log(response);
if (response.indexOf("816653305") > -1) {
console.log("PKNotificatons: Blocking ads.");
/*$("iframe").each(function() {
if ($(this)[0].id.startsWith("aswift_")) {
$(this).attr("style", "display: none");
$(this).parent().parent().attr("style", "display: block, height: 0px")
$(this).parent().attr("style", "display: block, height: 0px")
$(this).attr("height", "0px");
$(this).parent().parent().parent().attr("style", "display: block; height: 1px")
}
});*/ //Old ad blocker no longer works
/* $(".adsbygoogle").attr("style", "display: none; height: 0px;");
}
});
}
//var supportBanner = '<span style="float: right; position: relative; display: block; padding: 8px 18px 10px 10px; font-style: italic;" class="crumb">Thanks for using PK Notifications!</span>';
//$("nav").children("fieldset").children("span.crumbs").append(supportBanner); //No longer works
}, 3000);*/
if (document.location.hostname == "projectkorra.com") {
chrome.runtime.sendMessage({pksecretkeys: "hi"}, function (response) {
console.log(response);
if (response.indexOf("816653305") > -1) {
console.log("PKNotificatons: Blocking ads.");
$("html").append("<style id='pk_notifications_no_ads' type='text/css'>.adsbygoogle {display: none !important; height: 0px !important}</style>");
}
});
}
$(document).ready(function() {
//Add text that says "Thanks for using PK Notifications!"
$("div.p-sectionLinks > div.p-sectionLinks-inner > div > ul").append("<li style=\"float: right\">" +
"<p id=\"pk_notifications_text\" style=\"font-size: 12px; margin: 6px 16px 6px 16px; font-style: italic; color: #999999;\">Thanks for using PK Notifications!</p></li>")
//Adds the message/warning to people creating PMs
if (document.location.pathname.startsWith("/forum/conversations/add")) {
$(".p-body-header > .p-title").append("<h1 style='font-size: 40px; margin-bottom: -10px'>Warning: Personal Messages do not work at the moment!</h1>" +
"<h3>The best thing to do is message via discord or write on peoples profiles. This message was brought to you by PK Notifications</h3>");
}
});