ToasterProject/main.js
mctaylors 7bede22927
finally, first commit
Signed-off-by: mctaylors <mctaylxrs@outlook.com>
2024-03-12 00:16:05 +03:00

71 lines
No EOL
2.1 KiB
JavaScript

function onLoadSensitive() {
if (docCookies.getItem("showSensitive") == "true") {
showSensitive();
} else {
hideSensitive();
}
document.onkeydown = function (e) {
e = e || window.event;
var key = e.which || e.keyCode;
if (key === 8) {
if (document.getElementById('censored').style.filter == 'none') {
hideSensitive();
} else {
showSensitive();
}
}
}
statusSensitive();
}
function toggleSensitive() {
if (docCookies.getItem("showSensitive") == "true") {
hideSensitive();
docCookies.setItem("showSensitive", "false", "7");
} else {
showSensitive();
docCookies.setItem("showSensitive", "true", "7");
}
statusSensitive();
}
function statusSensitive() {
if (docCookies.getItem("showSensitive") == "true") {
document.getElementById('warningSeparator').style.display = 'none';
document.getElementById('hideSensitive').style.display = 'none';
document.getElementById('showSensitive').style.display = 'none';
document.getElementById('statusSensitive').innerHTML = "[X]";
} else {
document.getElementById('warningSeparator').style.display = '';
document.getElementById('statusSensitive').innerHTML = "[ ]";
}
}
function toggleNonSensitive() {
if (docCookies.getItem("showSensitive") == "true") {
docCookies.setItem("showSensitive", "false", "7");
} else {
docCookies.setItem("showSensitive", "true", "7");
}
statusNonSensitive();
}
function statusNonSensitive() {
if (docCookies.getItem("showSensitive") == "true") {
document.getElementById('statusSensitive').innerHTML = "[X]";
} else {
document.getElementById('statusSensitive').innerHTML = "[ ]";
}
}
function hideSensitive() {
document.getElementById('hideSensitive').style.display = 'none';
document.getElementById('showSensitive').style.display = '';
document.getElementById('censored').style.filter = '';
}
function showSensitive() {
document.getElementById('hideSensitive').style.display = '';
document.getElementById('showSensitive').style.display = 'none';
document.getElementById('censored').style.filter = 'none';
}