mirror of
https://wiilab.wiimart.org/wiimart/wiimart-extension
synced 2025-09-02 19:41:00 +02:00
22 lines
1022 B
JavaScript
22 lines
1022 B
JavaScript
// popup.js
|
|
document.getElementById('clearTrace').addEventListener('click', function() {
|
|
window.localStorage.setItem('thetrace', ''); // Clear the 'thetrace' variable
|
|
document.getElementById('cleared').textContent = 'Cleared: trace';
|
|
});
|
|
|
|
document.getElementById('clearPoints').addEventListener('click', function() {
|
|
window.localStorage.setItem('points', ''); // Clear the 'points' variable
|
|
document.getElementById('cleared').textContent = 'Cleared: points';
|
|
});
|
|
|
|
// Handle the checkbox for enabling/disabling the font
|
|
document.getElementById('toggleFont').addEventListener('change', function() {
|
|
const isChecked = this.checked;
|
|
// Set the font state in the extension's storage
|
|
chrome.storage.local.set({ fontDisabled: !isChecked });
|
|
});
|
|
|
|
// Check the current font state when the popup is opened
|
|
chrome.storage.local.get(['fontDisabled'], function(result) {
|
|
document.getElementById('toggleFont').checked = !result.fontDisabled; // Set checkbox based on stored value
|
|
}); |