forked from timeshifter/twitch-filtered-chat
-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
226 lines (221 loc) · 10.5 KB
/
index.html
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE xhtml>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Filtered Chat</title>
<meta charset="utf-8" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Twitch Filtered Chat" />
<meta
property="og:title"
content="Twitch Filtered Chat - Twitch chat client with message filtering" />
<meta
property="og:description"
content="Connect to a Twitch channel to receive the messages you care about while ignoring the uninteresting noise! Embed into OBS to have chat appear on your stream!" />
<link href="assets/settings_white.png" rel="shortcut icon" type="image/png" />
<link href="assets/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="assets/jquery-3.4.0.js"></script>
<script type="text/javascript" src="assets/css.escape.js"></script>
<script type="text/javascript" id="main-inject">
/* NOTE: Everything here must be ES5 compliant for distification to work */
/* Prepend `msg` to the debug span */
function debug(msg) {
$("#debug").html(msg + "<br />" + $("#debug").html());
}
/* Load a script, with an optional onload callback */
function doLoadScript(src, onload) {
var s = document.createElement("script");
s.setAttribute("type", "text/javascript");
s.setAttribute("src", src);
if (typeof(onload) === "function") {
s.onload = onload;
}
document.head.appendChild(s);
}
/* Load Babel ES6 polyfills */
function doLoadPolyfill(cb) {
doLoadScript("dist/polyfill.js", cb);
}
/* Load main.js */
function doLoadMain() {
/* Use either main.js or dist/main.js based on ?usedist */
var dist = window.location.search.match(/\busedist\b/);
var uri = dist ? "dist/main.js" : "main.js";
doLoadScript(uri, new Function("Main(window)"));
}
/* Called by body.onload */
function onLoad() {
/* Show the debug span if debug=2 or debug=trace */
if (window.location.search.match(/\bdebug=(?:2|trace)\b/)) {
document.getElementById("debug").removeAttribute("style");
}
if (window.location.search.match(/\busedist\b/)) {
doLoadPolyfill(doLoadMain);
} else {
doLoadMain();
}
}
</script>
</head>
<body onload="onLoad()" class="dark">
<!-- Debugging -->
<span class="debug" id="debug" style="display: none">Debug active</span>
<!-- Content wrapper -->
<div id="wrapper">
<!-- "Loading..." message after modules have been added -->
<div id="wrapper-loading" class="loading">Loading Panels...</div>
<!-- Module 1 -->
<div class="column left" id="column1" style="display: none">
<div class="module no-chat" id="module1">
<div class="header">
<!-- Menu button (formatted via CSS) -->
<div class="menu"><div></div><div></div><div></div></div>
<!-- Button to clear chat -->
<span class="btnClearWrapper">
<a class="btnClear" title="Clear" alt="Clear">
<img class="btnClearIcon" src="assets/no-entry.svg" />
</a>
</span>
<!-- Module 1 settings panel -->
<div class="settings">
<fieldset>
<legend>Include:</legend>
<ul class="include">
<li><label><input type="checkbox" class="pleb" />Non-subs</label></li>
<li><label><input type="checkbox" class="sub" />Subscribers</label></li>
<li><label><input type="checkbox" class="vip" />VIPs</label></li>
<li><label><input type="checkbox" class="mod" />Moderators</label></li>
<li><label><input type="checkbox" class="event" />Events</label></li>
<li><label><input type="checkbox" class="bits" />Cheers</label></li>
<li><label><input type="checkbox" class="me" />/me</label></li>
<li class="textbox include_user"><label>From user:</label><input type="text" /></li>
<li class="textbox include_keyword"><label>Contains:</label><input type="text" /></li>
</ul>
</fieldset>
<fieldset>
<legend>Limit to:</legend>
<ul class="limit">
<li class="textbox from_channel"><label>Channel:</label><input type="text" /></li>
</ul>
</fieldset>
<fieldset>
<legend>Exclude:</legend>
<ul class="exclude">
<li class="textbox exclude_user"><label>From user:</label><input type="text" /></li>
<li class="textbox exclude_startswith"><label>Starts with:</label><input type="text" /></li>
</ul>
</fieldset>
</div>
<!-- Module 1 display name -->
<label class="name"></label>
<input type="text" class="name"></input>
</div>
<!-- Module 1 content -->
<div class="content"><div class="loading">Loading...</div></div>
</div>
</div>
<!-- Module 2 -->
<div class="column right" id="column2" style="display: none">
<div class="module no-chat" id="module2">
<div class="header">
<!-- Menu button (formatted via CSS) -->
<div class="menu"><div></div><div></div><div></div></div>
<!-- Button to clear chat -->
<span class="btnClearWrapper">
<a class="btnClear" title="Clear" alt="Clear">
<img class="btnClearIcon" src="assets/no-entry.svg" />
</a>
</span>
<!-- Module 2 settings panel -->
<div class="settings">
<fieldset>
<legend>Include:</legend>
<ul class="include">
<li><label><input type="checkbox" class="pleb" />Non-subs</label></li>
<li><label><input type="checkbox" class="sub" />Subscribers</label></li>
<li><label><input type="checkbox" class="vip" />VIPs</label></li>
<li><label><input type="checkbox" class="mod" />Moderators</label></li>
<li><label><input type="checkbox" class="event" />Events</label></li>
<li><label><input type="checkbox" class="bits" />Cheers</label></li>
<li><label><input type="checkbox" class="me" />/me</label></li>
<li class="textbox include_user"><label>From user:</label><input type="text" /></li>
<li class="textbox include_keyword"><label>Contains:</label><input type="text" /></li>
</ul>
</fieldset>
<fieldset>
<legend>Limit to:</legend>
<ul class="limit">
<li class="textbox from_channel"><label>Channel:</label><input type="text" /></li>
</ul>
</fieldset>
<fieldset>
<legend>Exclude:</legend>
<ul class="exclude">
<li class="textbox exclude_user"><label>From user:</label><input type="text" /></li>
<li class="textbox exclude_startswith"><label>Starts with:</label><input type="text" /></li>
</ul>
</fieldset>
</div>
<!-- Module 2 display name -->
<label class="name"></label>
<input type="text" class="name"></input>
</div>
<!-- Module 2 content -->
<div class="content"><div class="loading">Loading...</div></div>
</div>
</div>
</div>
<!-- Global settings -->
<div id="settings">
<header style="display: inline-block; width: 100%">
<span class="fl">Settings<span class="btn" id="btnSettingsHelp">?</span></span>
<span class="fr btn" id="btnSettingsBuilder">Builder</span>
</header>
<!-- General settings section -->
<section>
<ul>
<li><label for="txtChannel">Channels:</label><input type="text" id="txtChannel" /></li>
<li><label for="txtNick">Nick:</label><input type="text" id="txtNick" /></li>
<li><label for="txtPass">OAuth:</label><input type="password" id="txtPass" /><input type="text" id="txtPassDummy" value="Cached" disabled /></li>
<li><label for="txtHistSize">Scrollback:</label><input type="text" id="txtHistSize" class="middle" /></li>
<li><label for="cbScroll">Scrollbars:</label><input type="checkbox" id="cbScroll" class="middle" /></li>
<li><label for="cbTransparent">Transparent:</label><input type="checkbox" id="cbTransparent" class="middle" /></li>
<li><label for="cbClips">Show Clips:</label><input type="checkbox" id="cbClips" class="middle" /></li>
<li><label for="cbForce">Mod Antics:</label><input type="checkbox" id="cbForce" class="middle" /></li>
<li><label for="cbFanfare">Fanfare:</label><input type="checkbox" id="cbFanfare" class="middle" /></li>
<li><label for="selDebug">Debugging:</label><select id="selDebug"><option value="0" selected>Disabled</option><option value="1">Debug</option><option value="2">Trace</option></select></li>
</ul>
</section>
<!-- Advanced settings section -->
<section id="advSettings" style="display: none">
<header style="display: inline-block; width: 100%">
<span class="fl">Advanced Settings</span>
<span class="fr btn" id="btnAdvHide">Hide</span>
</header>
<ul>
<li><label for="cbAnimCheers" style="width: 10em">Animated Cheers:</label><input type="checkbox" id="cbAnimCheers" class="middle" /></label></li>
<li><label for="txtBGStyle">BG Image:</label><input type="text" id="txtBGStyle" /></li>
<li><label for="txtFont">Font:</label><input type="text" id="txtFont" /></li>
<li><label for="txtFontSize">Font Size:</label><input type="text" id="txtFontSize" /></li>
<!-- TODO
<li><label for="txtHighlights">Highlighting:</label><input type="text" id="txtHighlights" /></li>
<li><label for="txtPluginCfg">Plugin Cfg:</label><input type="text" id="txtPluginCfg" /></li>
-->
<li><label for="txtTag">Tag:</label><input type="text" id="txtTag" disabled /></li>
<!-- TODO
<li><label for="selClearStyle">Clear Action:</label><select id="selClearStyle"><option value="remove" selected>Remove</option><option value="strike">Strikeout</option></select></li>
-->
</ul>
</section>
<footer>
<span class="fl btn" id="btnReconnect">Reconnect</span>
<span class="fr btn" id="btnAdvanced">Advanced Settings</span>
</footer>
</div>
<!-- Button to show/hide settings panel -->
<img id="btnSettings" src="assets/settings_white.png" alt="Settings" title="Settings" />
<!-- Username context window -->
<div id="userContext" class="userContext" style="display: none"></div>
<!-- Hover context window -->
<div id="hoverContext" class="hoverContext" style="display: none"></div>
</body>
</html>