ToasterProject/main.js

71 lines
2.1 KiB
JavaScript
Raw Normal View History

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';
}