Skip to content

Commit

Permalink
Clearer instruction due to iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
dave9123 committed May 11, 2024
1 parent fa0dbcb commit e31e10b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions static/worksheets/api/newloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const form = document.getElementById('settings-form');
const faviconSelect = form.elements['favicon'];
const siteNameInput = form.elements['site-name'];
const button = form.querySelector('button');

// Get the saved settings, or set default values
const savedSettings = JSON.parse(localStorage.getItem('site-settings')) || {};
Expand Down Expand Up @@ -29,6 +30,12 @@ siteNameInput.addEventListener('input', () => {
saveSettings();
});

button.addEventListener('click', (event) => {
event.preventDefault();
saveSettings();
alert('Settings saved, please refresh to apply changes.');
});

// Save the settings to localStorage
function saveSettings() {
const settings = {
Expand Down

0 comments on commit e31e10b

Please sign in to comment.