Add flushing namespace
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user