Add flushing namespace
parent
0d6a6c7a8a
commit
94776831d8
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Reference in New Issue