Revelav3/static/resources/options.js
2022-06-07 01:54:29 -04:00

52 lines
1.3 KiB
JavaScript

// Set the option
var option = localStorage.getItem('nogg')
function toggleNoGG() {
if (option === 'on') {
option = 'off';
localStorage.setItem('nogg', 'off');
} else {
option = 'on';
localStorage.setItem('nogg', 'on');
}
}
console.log(localStorage.getItem('nogg'))
// Notification Banner
function saveIc() {
console.log("Checked")
var notification = `
<div class="notification-container" id="notification-container">
<div class="notification notification-success">
<strong>Success:</strong> Your settings have been saved!
</div>
</div>
`;
document.getElementById('navbar').innerHTML = notification
setTimeout(() => {
var NotificationOBJ = document.getElementById('notif')
}, 2000);
};
// Update the CheckBox to match the settings
window.onload = function() {
console.log("Current Settings: ")
console.log("NoGG = ", localStorage.getItem('nogg'))
if (localStorage.getItem('nogg') == 'on') {
setTimeout(() => {
var item = document.getElementById("undefined");
document.getElementById("undefined").checked = true;}, 600);
}};