This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/rule34/script.js

40 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-12-30 14:20:31 +00:00
let tnc_div = document.createElement('div');
tnc_div.innerHTML = `
<div class='tnc_bg'></div>
<div class='tnc'>
<p>Cookies may be used. Please read our <a href='https://rule34.paheal.net/wiki/Privacy%20policy'>privacy policy</a> for more information.
<p>By accepting to enter you agree to our <a href='https://rule34.paheal.net/wiki/rules'>rules</a> and <a href='https://rule34.paheal.net/wiki/Terms%20of%20use'>terms of service</a>.
<p><a onclick='tnc_agree();'>Agree</a> / <a href='https://google.com'>Disagree</a>
</div>
`;
2020-03-02 17:12:43 +00:00
document.addEventListener('DOMContentLoaded', () => {
if(shm_cookie_get("ui-tnc-agreed") !== "true" && window.location.href.indexOf("/wiki/") == -1) {
2023-12-30 14:20:31 +00:00
document.body.classList.add('censored');
document.body.appendChild(tnc_div);
2018-07-19 18:55:28 +00:00
}
});
2019-04-26 09:14:46 +00:00
function tnc_agree() {
shm_cookie_set("ui-tnc-agreed", "true");
2023-12-30 14:20:31 +00:00
document.body.classList.remove('censored');
tnc_div.remove();
2019-04-26 09:14:46 +00:00
}
2018-07-19 18:55:28 +00:00
function image_hash_ban(id) {
var reason = prompt("WHY?", "DNP");
if(reason) {
$.post(
"/image_hash_ban/add",
{
"image_id": id,
"reason": reason,
},
function() {
$("#thumb_" + id).parent().parent().hide();
2018-07-19 19:09:36 +00:00
}
2018-07-19 18:55:28 +00:00
);
}
}