User:Stumblean/common.js: Difference between revisions

Stumblean (talk | contribs)
No edit summary
Tags: Manual revert Mobile edit Mobile web edit Advanced mobile edit
Stumblean (talk | contribs)
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 18: Line 18:
     showCustomize: true,
     showCustomize: true,
     showUndoChanges: true,
     showUndoChanges: true,
     showPreferences: true, // always true so button never hides
     showPreferences: true // always true so button never hides
     showWatermark: true
     // watermark removed from prefs so cannot be toggled off
   };
   };


Line 232: Line 232:
   // Preferences Button (always visible)
   // Preferences Button (always visible)
   const btnPreferences = makeButton("Preferences", () => {
   const btnPreferences = makeButton("Preferences", () => {
     if (prefsPanel.style.display === "block") {
     prefsPanel.style.display = prefsPanel.style.display === "block" ? "none" : "block";
      prefsPanel.style.display = "none";
    } else {
      prefsPanel.style.display = "block";
    }
   });
   });


Line 280: Line 276:
   prefsPanel.appendChild(createCheckbox("Show Undo Changes Button", "showUndoChanges"));
   prefsPanel.appendChild(createCheckbox("Show Undo Changes Button", "showUndoChanges"));
   prefsPanel.appendChild(createCheckbox("Show Preferences Button (cannot be hidden)", "showPreferences"));
   prefsPanel.appendChild(createCheckbox("Show Preferences Button (cannot be hidden)", "showPreferences"));
   prefsPanel.appendChild(createCheckbox("Show Watermark Footer", "showWatermark"));
   // Removed watermark checkbox from prefsPanel


   function applyPreferences() {
   function applyPreferences() {
Line 289: Line 285:
     btnCustomize.style.display = prefs.showCustomize ? "block" : "none";
     btnCustomize.style.display = prefs.showCustomize ? "block" : "none";
     btnReset.style.display = prefs.showUndoChanges ? "block" : "none";
     btnReset.style.display = prefs.showUndoChanges ? "block" : "none";
    // Always show preferences button, ignore pref so you can never hide it for real
     btnPreferences.style.display = "block"; // never hide preferences
     btnPreferences.style.display = "block";
     watermark.style.display = "block"; // always show watermark
     watermark.style.display = prefs.showWatermark ? "block" : "none";
   }
   }