User:Stumblean/common.js: Difference between revisions

Stumblean (talk | contribs)
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
Stumblean (talk | contribs)
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 89: Line 89:
     display: "none",
     display: "none",
     cursor: "pointer",
     cursor: "pointer",
     borderRadius: "6px",
     borderRadius: "6px", // rounded square
     width: settings.minimizedSize + "px",
     width: settings.minimizedSize + "px",
     height: settings.minimizedSize + "px"
     height: settings.minimizedSize + "px"
Line 163: Line 163:
     saveSettings();
     saveSettings();
     alert("Changes saved! Refresh to apply.");
     alert("Changes saved! Refresh to apply.");
  });
  const btnReset = makeButton("Undo Changes", () => {
    const confirmReset = confirm("Are you sure you want to undo all customizations?");
    if (!confirmReset) return;
    localStorage.removeItem("mahitoMenuSettings");
    alert("Customizations reset! Reloading...");
    location.reload();
   });
   });


Line 195: Line 204:
   menu.appendChild(btnYujify);
   menu.appendChild(btnYujify);
   menu.appendChild(btnCustomize);
   menu.appendChild(btnCustomize);
  menu.appendChild(btnReset);
   document.body.appendChild(menu);
   document.body.appendChild(menu);
   document.body.appendChild(minimizedIcon);
   document.body.appendChild(minimizedIcon);
   document.body.appendChild(ytContainer);
   document.body.appendChild(ytContainer);
})();
})();