settings: Reset-Button
authorMalte Bublitz <malte@rolltreppe3.de>
Tue, 29 Apr 2025 13:58:49 +0000 (15:58 +0200)
committerMalte Bublitz <malte@rolltreppe3.de>
Tue, 29 Apr 2025 13:58:49 +0000 (15:58 +0200)
css/dialog.css
js/whoami.js
template.inc.php

index b5b2f130bc2453a8df83253d82cf30bdceeca6a4..5f61878028b5c5195ebdc4e9337ce317a2341821 100644 (file)
@@ -18,7 +18,7 @@ dialog {
        width:                18em;
        max-width:            100%;
        
-       height:               12em;
+       height:               14em;
        max-height:           100%;
        
        position:             fixed;
@@ -108,4 +108,4 @@ dialog:not([open]) {
 
 #settings_form div {
        margin: 0 0 .6em;
-}
\ No newline at end of file
+}
index 7ade2b62ff3368bfaac6a8caedf45a7f93e05d96..949d881595c9ad6ae3307dc06c42619e00f57164 100644 (file)
@@ -13,6 +13,7 @@ var whoami = {
        settings_host:           document.getElementById("whoami_host"),
        settings_format_unix:    document.getElementById("whoami_format_unix"),
        settings_format_windows: document.getElementById("whoami_format_windows"),
+       settings_reset:          document.getElementById("whoami_reset"),
        
     init: function() {
         console.debug("whoami.init()");
@@ -132,6 +133,12 @@ var whoami = {
                        //whoami.whoami_format = event.target.value;
                });
                whoami.settings_format_windows.addEventListener('change', whoami_format_on_change);
+               whoami.settings_reset.addEventListener('click', (event) => {
+                       // Reset settings
+
+                       whoami.deinit();
+                       whoami.init();
+               });
 
        },
        settings2: () => {
index fb677ce880c8b26757c078681ccd809407bbf18b..396a758f0fd91d778bdd3fa26e55727fb174b1d4 100644 (file)
@@ -81,6 +81,10 @@ unset($i);
                                        <input type="radio" id="whoami_format_windows" name="whoami_format" value="windows">
                                        <label for="whoami_format_windows">Windows-Format</label>
                                </div>
+
+                               <div>
+                                       <button id="whoami_reset" type="button">Zurücksetzen</button>
+                               </div>
                        </form>
                </dialog>