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

72 lines
1.6 KiB
JavaScript
Raw Normal View History

2018-07-19 18:55:28 +00:00
$(function() {
if(Cookies.get("ui-tnc-agreed") !== "true") {
$("BODY").html(""+
"<div align='center' style='font-size: 2em; position: absolute; z-index: 99999999999999999999999999;'>"+
"<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"+
"<p><a href='/tnc_agreed'>Click here if you're an adult, and you're ok with that</a>"+
"</div>"+
"");
}
});
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) {
var viewport = document.querySelector("meta[name=viewport]");
viewport.setAttribute('content', 'width=512, initial-scale=1.0');
Cookies.set("ui-desktop", "false");
}
else {
var viewport = document.querySelector("meta[name=viewport]");
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();
}
});