-
Notifications
You must be signed in to change notification settings - Fork 4
/
options.html
402 lines (386 loc) · 18 KB
/
options.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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Detrumpify Config</title>
<style>
td.disabled {
color: rgb(175,175,174);
}
textarea.disabled {
background-color: rgb(236,236,236);
color: rgb(175,175,174);
}
.tooltip {
/*
position: relative;
display: inline-block;
*/
}
.tooltiptext {
opacity: 0;
width: 200px;
background-color: #ffffcc;
color: black;
padding: 5px 0;
border-radius: 3px;
position: absolute;
z-index: 1;
border: 1px solid black;
line-height: 100%;
}
.tooltip:not(:hover) + .tooltiptext {
transition: opacity 0.3s linear;
transition: visibility 0.3s step-end;
opacity: 0.00;
visibility: hidden;
}
.tooltip:hover + .tooltiptext {
transition: opacity 0.3s linear;
visibility: visible;
opacity: 1.00;
}
</style>
</head>
<body style="font-family: Arial, sans-serif; font-size: 11px; background-color: #e0e0e0; width: 430px;">
<!-- <div id="wrapperdir" style="overflow-y: scroll;"> -->
<div id="wrapperdir" style="width: 420px;">
<table width="100%">
<tr style="padding: 0px;">
<td width="10%" valign="top">
<div style="font-size:120%; font-weight:bold;">Detrumpify Configuration</div>
</td>
</tr>
<tr>
<td colspan="2">
<div>Choose a configuration from the drop-down below, or you can provide your own configuration by hosting a config file somewhere and entering the URL below.</div>
</td>
</tr>
</table>
<hr>
<!-- <div>Choose configurations from <a href="http://toolsofourtools.org/detrumpify2">toolsofourtools.org</a>, or enter own URL:</div> -->
<div id="confselectdiv" style="background-color: #f0f0f0;">
<div id="buttonsdiv"></div>
<table style="width:100%;">
<tr>
<td style="width: 10%;"><b>Insult Config</b></td>
<td colspan="2">
<select id="confselect" name="confselect" class="tooltip"></select>
<p style="" class="tooltiptext">ToolsOfOurTools has carefully curated numerous
insults, sorted them by tastefulness, and assembled them into the "canned"
configurations you can choose above.</p>
</td>
</tr>
<tr>
<td style="width: 10%;"><b>URL</b></td>
<td style="width: 90%;">
<div class="tooltip">
<input type="text" id="configsrc" size="45">
<input type="button" value="Save" id="config_save_button">
</div>
<p class="tooltiptext">
This URL is the location from which the
insults and other configuration data will be loaded. It is set
automatically if you use the dropdown selector above, but you
can also type in your own url here if you want to host a
completely custom configuration file.</p>
</td>
</tr>
</table>
</div>
<!-- <hr> -->
<div id="imgreplseldiv" style="background-color: #e0e0e0;">
<div id="buttonsdiv2"></div>
<table style="width:100%;">
<tr>
<td style="width: 10%;"><b>Image Config</b></td>
<td colspan="2">
<select id="imgreplselect" name="imgreplselect" class="tooltip"></select>
<p style="" class="tooltiptext">ToolsOfOurTools has some groups of
pictures you can use to replace more offensive pictures you might
find in your newsfeed. The Kittens pictures from placekittens.com.
The rest come from Google Image Search for noncommercial resuse licensed
images.</p>
</td>
</tr>
<tr>
<td style="width: 10%;"><b>URL</b></td>
<td style="width: 90%;">
<div class="tooltip">
<input type="text" id="imgreplsrcinput" size="45">
<input type="button" value="Save" id="imgrepl_save_button">
</div>
<p class="tooltiptext">
This URL is the location from which the replacement
image metadata will be loaded. It is set automatically,
from the drop down above, but you can also type here to
use a completely custom config file.</p>
</td>
</tr>
</table>
</div>
<!-- <span>You may also specify custom <a href="http://toolsofourtools.org/detrumpify-about#styles" target="_blank">styles</a> to be applied to the insults:</span> -->
<div id="inputstylediv" style="background-color: #f0f0f0;">
<table style="width: 100%;">
<tr>
<td style="width: 10%;"><b>Style</b></td>
<td style="width: 90%;">
<div class="tooltip">
<input type="text" class="tooltip" id="styleinput" size="45">
<input type="button" value="Save" id="style_save_button">
</div>
<p class="tooltiptext">You can enter a CSS style here
to make the insult stand out fromt the surrounding
text, or leave it blank to leave the formatting just
like the source page.</p>
</td>
</tr>
</table>
</div>
<!-- <hr> -->
<div id="brevitydiv" style="background-color: #e0e0e0;">
<table style="width: 100%;">
<tr>
<td style="width: 15%;"><b>Brevity</b></td>
<td style="width: 35%;">
<select id="brevityinput" class="tooltip">
<option value="0">Any length</option>
<option value="6">Six or fewer words</option>
<option value="5">Five or fewer words</option>
<option value="4">Four or fewer words</option>
<option value="3">Three or fewer words</option>
<option value="2">One or Two words</option>
<option value="1">Just one word</option>
</select>
<p class="tooltiptext">Only insults of the number
of words shown or shorter will be used. This may
improve readability for you, at the expense of
you not seeing some of the funnier insults.</p>
</td>
<td style="width: 15%;"><b>Quote</b></td>
<td style="width: 35%;">
<select id="quoteinput" class="tooltip">
<option value="none">No quoting</option>
<option value="curly">“Curly scares”</option>
<option value="square">[Brackets]</option>
</select>
<p class="tooltiptext" style="width: 150px;">Controls
whether the insults have some visual cue, such as
quotation marks or brackets around them.</p>
</td>
</tr>
</table>
</div>
<!-- <hr> -->
<!-- <span>Do you want most Trump images replaced with kittens?</span> -->
<div id="kittensenablediv" style="background-color: #f0f0f0;">
<table style="width: 100%;">
<tr>
<td style="width: 15%;"><b>Frequency</b></td>
<td style="width: 35%;">
<select id="randmodeinput" class="tooltip">
<option value="always">Always</option>
<option value="1min">one minute</option>
<option value="15min">15 minutes</option>
<option value="hourly">Hourly</option>
<option value="daily">Daily</option>
<option value="weekly">Weekly</option>
<option value="monthly">Monthly</option>
<option value="yearly">Annually</option>
</select>
<p class="tooltiptext">This controls how often the
insults change. Some people prefer to see the same
insult used all day, or every time on a given page.
Set to "always", you will get a new insult Every.
Single. Mention.
</p>
</td>
</tr>
</table>
</div>
<!-- <hr> -->
<!-- <span>You may also choose which actions from this config to enable:</span> -->
<div id="actionsenablediv" style="background-color: #e0e0e0;">
<table width="100%">
<tr>
<td width="25%"><b>Enabled Actions</b></td>
<td width="75%">
<div id="actionstd" class="tooltip"></div>
<p class="tooltiptext" style="left: 0px; width: 350px;">
Some configurations contain more than one set of search strings and
replacements. Choose which available replacements you want to run.</p>
</td>
</tr>
</table>
</div>
<div id="replfractdiv" style="background-color: #f0f0f0;">
<table width="100%">
<tr>
<td width="50%">
<div class="tooltip">
<b>Mock-O-Matic</b>
<select id="use_matic" class="tooltip">
<option value="off">Disabled</option>
<option value="a_b">AB Pattern</option>
<option value="a_a_b">AAB Pattern</option>
<option value="shka_shkb_shkc">Bard Mode</option>
</select>
</div>
<p class="tooltiptext" style="left: 0px; width: 350px;">
Mock-O-Matic mode breaks down insults into their atomic
elements and reassembles them to generate thousands of
fresh, new insults. (Overrides Brevity)</p>
</td>
<td width="50%">
<div class="tooltip">
<b>Scan on Change</b>
<input class="tooltip" type="checkbox" id="track_mutations" name="track_mutations" value="bloop">
</div>
<p class="tooltiptext" style="left: 0px; width: 350px;">
Add insults <i>whenever</i> page changes, not only at
first load and periodically afterwards. This is good
for pages like Twitter and Facebook that show a
constant feed, but it's a bit more CPU intensive.</p>
</td>
</tr>
</table>
</div>
<div id="breakctrldiv" style="background-color: #e0e0e0;">
<table width="100%">
<tr>
<td width="50%">
<div class="tooltip">
<b>Breaking!</b>
<select id="breaking_fract" class="tooltip">
<option value="0">Never</option>
<option value="1">1% of the time</option>
<option value="5">5% of the time</option>
<option value="10">10% of the time</option>
<option value="25">25% of the time</option>
<option value="50">half the time</option>
<option value="100">Always</option>
</select>
</div>
<p class="tooltiptext" style="left: 0px; width: 350px;">
Your life isn't exciting enough without constant
"breaking" news. Turn this on to get more!</p>
</td>
<td width="50%">
<div class="tooltip">
<b>Replace Fraction</b>
<select id="replace_fraction" class="tooltip">
<option value="100">100%</option>
<option value="50">50%</option>
<option value="25">25%</option>
<option value="10">10%</option>
<option value="5">5%</option>
<option value="3">3%</option>
<option value="2">2%</option>
<option value="1">1%</option>
<option value="0.5">0.5%</option>
<option value="0.1">0.1%</option>
</select>
</div>
<p class="tooltiptext" style="left: 0px; width: 350px;">
Will every mention be replaced? 100% means yes, lower
numbers mean the target will only be replaced some of
the time.</p>
</td>
</tr>
</table>
</div>
<div id="sitescontroldiv" style="background-color: #f0f0f0;">
<div id="whitelistdiv"></div>
<table style="width:100%;">
<tr>
<td width="100%" colspan="2">
<div class="tooltip">
<b>Site permissions</b>
<select id="site_filter" class="tooltip">
<option value="use_whitelist">Run <em>only</em> on "Sites Enabled"</option>
<option value="use_blacklist">Run on all sites <em>except</em> "Sites Disabled"</option>
</select>
</div>
<p class="tooltiptext" style="left: 0px; width: 350px;">
You can control which sites this plugin runs on.
Choose "Sites Enabled" to explicity specify the sites you
want Detrumpify to run on. Choose "Sites Disabled" to run
on all sites <em>except</em> those listed.
</p>
</td>
</tr>
<tr>
<td id="wl_td" style="width: 10%;"><b>Sites Enabled</b></td>
<td style="width: 90%;">
<div class="tooltip" style="display: flex;">
<div>
<textarea type="text" id="user_whitelist" cols="35" rows="4"></textarea>
</div>
<div style="flex-grow: 1;">
<input type="button" value="Save" id="whitelist_save_button">
<input type="button" value="Add Current" id="whitelist_add_button">
<input type="button" value="Set From Config" id="whitelist_addconfig_button">
</div>
</div>
<p style="" class="tooltiptext">Enter a space-separate list of website
hosts that you want to be Detrumpified. Detrumpify will run on these sites
<em>only</em>.</p>
</td>
</tr>
<tr>
<td id="bl_td" style="width: 10%;"><b>Sites Disabled</b></td>
<td style="width: 90%;">
<div class="tooltip" style="display: flex;">
<div>
<textarea type="text" id="user_blacklist" cols="35" rows="4"></textarea>
</div>
<div style="flex-grow: 1;">
<input type="button" value="Save" id="blacklist_save_button">
<input type="button" value="Add Current" id="blacklist_add_button">
</div>
</div>
<p style="" class="tooltiptext">Enter a space-separate list of website
hosts that you do <em>not</em> want to be Detrumpified. All other sites will
be detrumpified.</p>
</td>
</tr>
</table>
</div>
<div id="configdetaildiv" style="background-color: #e0e0e0;">
<input type="checkbox" id="showconfigcheck" name="showconfigcheck" value="bloop">Show configuration details.<br>
<div id="configdiv" style="background-color: lightblue; display: none;">
<b>Currently loaded configuration:</b>
<textarea id="configjson" rows="10" style="width: 100%"></textarea>
<input type="button" id="save_edited_config" name="save_edited_config" value="Save Config Edits">
<div></div>
<div id="zapdiv" style="text-align: right">
<input style="font-size: 75%; background-color: pink;" type="button" name="reset_storage" id="reset_storage" value="Reset All Stored Preferences">
</div>
</div>
</div>
<div id="boilerplatediv">
<hr>
<table width="100%">
<tr>
<td valign="top">
<a target="_blank" href="http://toolsofourtools.org/detrumpify-about">About</a> |
<a target="_blank" href="https://github.com/djacobow/detrumpify">Browse code</a> |
<a target="_blank" href="https://docs.google.com/forms/d/e/1FAIpQLSdgff7aEdLtu7luZcV7zLbgVLbBkCyvd7P6FFGWRoRa9BhUOw/viewform?entry.1908802217=Trump&entry.2110744980">Suggest Insult</a> |
<!-- goo.gl/2izY88 -->
<a target="_blank" href="mailto:[email protected]">Feedback</a> |
<a target="_blank" href="https://www.facebook.com/detrumpify/">Like us on FB!</a>
</td>
</tr>
</table>
</div>
<div id="statusdiv_container" style="display: none;">
<b>Debug Messages</b>
<div id="statusdiv" style="background-color: lightyellow; width:100%; height:30px; overflow-y:scroll">
</div>
</div>
<script src="defaults.js"></script>
<script src="shared.js"></script>
<script src="options.js"></script>
</div>
</body>
</html>