-
Notifications
You must be signed in to change notification settings - Fork 1
/
skribblr.js
333 lines (325 loc) · 6.68 KB
/
skribblr.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
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
const wordList = getWords();
$('body').append(`<div id="words" style="background:white"></div>`);
function submitWord(word) {
$('#inputChat').val(word);
$('#formChat').submit();
$(`[data-word="${word}"`).remove();
}
$('#currentWord').bind('DOMSubtreeModified', () => {
$('#words').html(``);
const hint = $('#currentWord').text();
const regexHint = hint.replaceAll('_', '\\S');
const regex = new RegExp(`^${regexHint}$`);
const matchesHtml = wordList
.filter(word => regex.test(word))
.map(word => `<a href="javascript:submitWord('${word}')" data-word="${word}" style="color:black">${word}<br></a>`)
.join('');
$('#words').html(matchesHtml);
});
function getWords() {
return [
'Vin Diesel',
'Daffy Duck',
'Batman',
'Patrick',
'Darwin',
'William Wallace',
'Barack Obama',
'Mark Zuckerberg',
'JayZ',
'Dora',
'Ferrari',
'Tweety',
'Donald Duck',
'Pumba',
'Zeus',
'Shrek',
'Steve Jobs',
'Hollywood',
'Elsa',
'Elon Musk',
'Robbie Rotten',
'Flash',
'Grinch',
'Ikea',
'Donald Trump',
'Terminator',
'Sydney Opera House',
'Angry Birds',
'BMW',
'Minion',
'James Bond',
'Australia',
'Antarctica',
'AC/DC',
'Jackie Chan',
'America',
'Mercury',
'Mercedes',
'Amsterdam',
'Peppa Pig',
'Nemo',
'London Eye',
'Christmas',
'Ireland',
'Apple',
'Israel',
'Hulk',
'Africa',
'Kermit',
'Italy',
'Medusa',
'Suez Canal',
'Frankenstein',
'Fanta',
'Tails',
'Morgan Freeman',
'Iron Man',
'Discord',
'Cookie Monster',
'Happy Meal',
'Rick',
'Tooth Fairy',
'Popsicle',
'Bill Gates',
'Scooby Doo',
'Aladdin',
'Facebook',
'Dexter',
'Bambi',
'Xbox',
'Pokemon',
'Skype',
'Google',
'Germany',
'Garfield',
'New Zealand',
'Twitter',
'Great Wall',
'Kirby',
'Easter Bunny',
'Nutella',
'Superman',
'Yoda',
'Zelda',
'India',
'Scotland',
'Zuma',
'iPad',
'Popeye',
'Xerox',
'McDonalds',
'Eminem',
'Wonder Woman',
'The Beatles',
'William Shakespeare',
'Dumbo',
'Playstation',
'Photoshop',
'Bitcoin',
'Star Wars',
'Rome',
'Morse code',
'Nike',
'Sherlock Holmes',
'Egypt',
'Singapore',
'Gru',
'Bart Simpson',
'Gumball',
'Pinocchio',
'Netherlands',
'Picasso',
'Microsoft',
'Creeper',
'Samsung',
'Las Vegas',
'Leonardo DiCaprio',
'Mount Rushmore',
'Mickey Mouse',
'Homer Simpson',
'Abraham Lincoln',
'Hello Kitty',
'Wolverine',
'Minecraft',
'Romania',
'Gandhi',
'Cerberus',
'Angelina Jolie',
'Hawaii',
'W-LAN',
'Adidas',
'Jesus Christ',
'Einstein',
'Porky Pig',
'China',
'Skrillex',
'MTV',
'Canada',
'SpongeBob',
'Spiderman',
'Monday',
'Bomberman',
'Crash Bandicoot',
'Usain Bolt',
'Pink Panther',
'Wall-e',
'Android',
'Cupid',
'Lego',
'Mona Lisa',
'Zorro',
'Teletubby',
'WhatsApp',
'Easter',
'Finn and Jake',
'Robin Hood',
'Mexico',
'Lasagna',
'Kim Jong-un',
'Uranus',
'Chuck Norris',
'Tower Bridge',
'Mr Bean',
'John Cena',
'Lion King',
'Phineas and Ferb',
'Finn',
'Norway',
'Asia',
'Monster',
'Obelix',
'Jimmy Neutron',
'Spartacus',
'Portugal',
'Paypal',
'Thor',
'Chewbacca',
'Olaf',
'Mount Everest',
'Atlantis',
'NASCAR',
'Big Ben',
'Squidward',
'Beethoven',
'Colosseum',
'Kung Fu',
'Youtube',
'France',
'Harry Potter',
'Steam',
'Argentina',
'Iron Giant',
'Pepsi',
'Greece',
'Mozart',
'Saturn',
'Katy Perry',
'London',
'Cuba',
'Earth',
'Vault boy',
'Deadpool',
'Santa',
'Vatican',
'Japan',
'Stone Age',
'Dracula',
'Lady Gaga',
'Audi',
'Neptune',
'Russia',
'Statue of Liberty',
'Europe',
'Home Alone',
'Cat Woman',
'Captain America',
'Intel',
'Eiffel tower',
'Pluto',
'Tarzan',
'God',
'Oreo',
'Nintendo Switch',
'Yoshi',
'BMX',
'North Korea',
'Mummy',
'Jack-o-lantern',
'Sonic',
'Fred Flintstone',
'DNA',
'Croatia',
'Hula Hoop',
'Michael Jackson',
'Black Friday',
'Doritos',
'Minotaur',
'Reddit',
'Pikachu',
'Excalibur',
'Elmo',
'Mars',
'Anubis',
'Asterix',
'Goofy',
'Tower of Pisa',
'Jenga',
'Tetris',
'ABBA',
'iPhone',
'Susan Wojcicki',
'Pac-Man',
'Green Lantern',
'Capricorn',
'Titanic',
'Luigi',
'Winnie the Pooh',
'Gandalf',
'Charlie Chaplin',
'Johnny Bravo',
'Notch',
'Mario',
'KFC',
'Brazil',
'Nasa',
'Bruce Lee',
'Segway',
'Poseidon',
'Skittles',
'Miniclip',
'Leonardo da Vinci',
'Mr. Meeseeks',
'Bible',
'Pringles',
'Northern Lights',
'Mont Blanc',
'Bugs Bunny',
'England',
'Mr. Bean',
'Velociraptor',
'UFO',
'Sudoku',
'King Kong',
'USB',
'Darwin Watterson',
'Madagascar',
'Morty',
'Hercules',
'Solar System',
'Slinky',
'Paris',
'Mr Meeseeks',
'Chinatown',
'Spain',
'Stegosaurus',
'Family Guy',
'T-rex',
'Band-Aid',
'Chrome',
'Yin and Yang',
'Venus',
'Florida',
'Milky Way',
];
}