Add flushing namespace

master
Bel LaPointe 2021-02-28 00:43:02 -06:00
parent 0d6a6c7a8a
commit 94776831d8
1 changed files with 14 additions and 0 deletions

View File

@ -1166,6 +1166,7 @@
<a href=# class=exp-board>Export board...</a>
<a href="#" class="switch-theme">Use <i>light</i><b>dark</b> theme</a>
<a href="#" class="switch-fsize">Use <i>smaller</i><b>larger</b> font</a>
<a href="#" class="flush-namespace">Flush namespace</a>
<a href="#" class="switch-namespace">Set namespace</a>
</div>
</div>
@ -3066,6 +3067,19 @@
return true;
});
$('.config .flush-namespace').click(function() {
var namespace = getCurrentNamespace();
var confirmation = confirm("Are you sure you want to clear " + namespace + "?");
if (! confirmation)
return false;
globalStorage.forEach((k) => {
globalStorage.del(k);
});
popAllNamespaces(namespace);
setGlobalNamespace(getAllNamespaces()[0]);
return false;
});
$('.config .switch-namespace').click(function() {
var namespace = prompt("Namespace", getCurrentNamespace());
if (namespace != getCurrentNamespace())