2020-03-02 17:12:43 +00:00
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
2018-07-19 18:55:28 +00:00
|
|
|
if(Cookies.get("ui-tnc-agreed") !== "true") {
|
2019-04-26 09:14:46 +00:00
|
|
|
$("BODY").addClass("censored");
|
|
|
|
$("BODY").append("<div class='tnc_bg'></div>");
|
|
|
|
$("BODY").append(""+
|
|
|
|
"<div class='tnc'>"+
|
2018-07-19 18:55:28 +00:00
|
|
|
"<p>For legal reasons, we need to point out that:"+
|
|
|
|
"<p>A) this site contains material not suitable for minors"+
|
|
|
|
"<br>B) cookies may be used"+
|
2019-04-26 09:14:46 +00:00
|
|
|
"<p><a onclick='tnc_agree();'>Click here if you're an adult, and you're ok with that</a>"+
|
2018-07-19 18:55:28 +00:00
|
|
|
"</div>"+
|
|
|
|
"");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2019-04-26 09:14:46 +00:00
|
|
|
function tnc_agree() {
|
|
|
|
Cookies.set("ui-tnc-agreed", "true", {path: '/', expires: 365});
|
|
|
|
$("BODY").removeClass("censored");
|
|
|
|
$(".tnc_bg").hide();
|
|
|
|
$(".tnc").hide();
|
|
|
|
}
|
|
|
|
|
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
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-25 23:28:08 +00:00
|
|
|
var navHidden = false;
|
2018-07-19 18:55:28 +00:00
|
|
|
function toggleNav() {
|
|
|
|
if(navHidden) {
|
2018-07-25 23:28:08 +00:00
|
|
|
$('BODY').removeClass('navHidden');
|
|
|
|
Cookies.set("ui-shownav", "true");
|
2018-07-19 18:55:28 +00:00
|
|
|
}
|
|
|
|
else {
|
2018-07-25 23:28:08 +00:00
|
|
|
$('BODY').addClass('navHidden');
|
|
|
|
Cookies.set("ui-shownav", "false");
|
2018-07-19 18:55:28 +00:00
|
|
|
}
|
|
|
|
navHidden = !navHidden;
|
|
|
|
}
|
2018-07-25 23:28:08 +00:00
|
|
|
|
|
|
|
$(function() {
|
|
|
|
if(Cookies.get("ui-shownav") === "false") {
|
|
|
|
toggleNav();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var forceDesktop = false;
|
|
|
|
function toggleDesktop() {
|
|
|
|
if(forceDesktop) {
|
2019-05-29 17:23:29 +00:00
|
|
|
let viewport = document.querySelector("meta[name=viewport]");
|
2018-09-09 09:58:18 +00:00
|
|
|
viewport.setAttribute('content', 'width=512');
|
2018-07-25 23:28:08 +00:00
|
|
|
Cookies.set("ui-desktop", "false");
|
|
|
|
}
|
|
|
|
else {
|
2019-05-29 17:23:29 +00:00
|
|
|
let viewport = document.querySelector("meta[name=viewport]");
|
2018-07-25 23:28:08 +00:00
|
|
|
viewport.setAttribute('content', 'width=1024, initial-scale=0.4');
|
|
|
|
Cookies.set("ui-desktop", "true");
|
|
|
|
navHidden = true;
|
|
|
|
toggleNav();
|
|
|
|
}
|
|
|
|
forceDesktop = !forceDesktop;
|
|
|
|
}
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
if(Cookies.get("ui-desktop") === "true") {
|
|
|
|
toggleDesktop();
|
|
|
|
}
|
|
|
|
});
|