undo filter
This commit is contained in:
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 49 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
@@ -159,7 +159,7 @@ if (location.pathname === '/') {
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
document.querySelector('.featured').src = '/assets/img/wide/99balls.jpg';
|
||||
document.querySelector('.featured').src = '/assets/img/wide/99balls.png';
|
||||
}).catch(e => new PolarisError('Failed to load featured game.'));
|
||||
|
||||
const logHeight = () => {
|
||||
|
||||
@@ -3,8 +3,6 @@ import { createViewPage, isValidURL } from './utils.js';
|
||||
const load = async () => {
|
||||
const form = document.querySelector('#wpf');
|
||||
const query = document.querySelector('#query');
|
||||
const response = await fetch('./assets/JSON/blacklist.json');
|
||||
const blacklist = await response.json();
|
||||
|
||||
form.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
@@ -14,22 +12,13 @@ const load = async () => {
|
||||
document.body.style.opacity = '0.7';
|
||||
|
||||
umami.track('query-' + query.value);
|
||||
|
||||
if (containsBlacklistedTerm(query.value, blacklist)) {
|
||||
alert("You're downright weird.\nThis search contains a blacklisted term.");
|
||||
return;
|
||||
} else {
|
||||
|
||||
setTimeout(() => createViewPage({
|
||||
target: url,
|
||||
proxied: true,
|
||||
title: 'Search Results'
|
||||
}), 500);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const containsBlacklistedTerm = (value, blacklist) => {
|
||||
return blacklist.some(entry => value.includes(entry));
|
||||
}
|
||||
|
||||
export default { load };
|
||||
export default { load };
|
||||
Reference in New Issue
Block a user