2020-10-06 16:07:39 -04:00
|
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
let nsfwOk = 'nsfw-ok';
|
|
|
|
|
|
|
|
function alreadyYes() {
|
2021-03-12 23:30:45 -05:00
|
|
|
return localStorage.getItem(nsfwOk);
|
2020-10-06 16:07:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
function dismiss() {
|
|
|
|
let dialog = document.getElementById('nsfw-dialog');
|
|
|
|
dialog.parentElement.removeChild(dialog);
|
|
|
|
}
|
|
|
|
|
|
|
|
function yes() {
|
2021-03-12 23:30:45 -05:00
|
|
|
localStorage.setItem(nsfwOk, 1);
|
2020-10-06 16:07:39 -04:00
|
|
|
dismiss();
|
|
|
|
}
|
|
|
|
|
2023-07-19 17:07:18 -04:00
|
|
|
// now just a normal link
|
|
|
|
/*
|
2020-10-06 16:07:39 -04:00
|
|
|
function no() {
|
2023-07-19 17:07:18 -04:00
|
|
|
document.location = '//crouton.net';
|
2020-10-06 16:07:39 -04:00
|
|
|
}
|
2023-07-19 17:07:18 -04:00
|
|
|
*/
|
2020-10-06 16:07:39 -04:00
|
|
|
|
|
|
|
function setup() {
|
|
|
|
if (alreadyYes()) {
|
|
|
|
dismiss();
|
|
|
|
} else {
|
|
|
|
document.getElementById('nsfw-yes').onclick = yes;
|
2023-07-19 17:07:18 -04:00
|
|
|
// document.getElementById('nsfw-no').onclick = no;
|
2020-10-06 16:07:39 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', setup);
|
|
|
|
|
|
|
|
})();
|