<blocksapp="Snap! 6, https://snap.berkeley.edu"version="1"><block-definitions="store key: %'key' value: %'value' in browser"type="command"category="other"><header></header><code></code><translations></translations><inputs><inputtype="%s"></input><inputtype="%s"></input></inputs><script><blocks="doRun"><blocks="reportJSFunction"><list><l>key</l><l>value</l><l>proc</l></list><l>proc.assertType(key, ['text', 'number']);
proc.assertType(value, ['text', 'number']);
window.localStorage.setItem('-snap-project-' + key, '' + value);</l></block><list><blockvar="key"/><blockvar="value"/></list></block></script></block-definition><block-definitions="stored data in browser"type="reporter"category="other"><header></header><code></code><translations></translations><inputs></inputs><script><blocks="doReport"><blocks="evaluate"><blocks="reportJSFunction"><list></list><l>var str = window.localStorage,
 len = str.length,
 result = [],
 key,
 i;
for (i = 0; i < len; i += 1) {
 key = str.key(i);
 if (key.startsWith('-snap-project-')) {
 result.push(new List([key.slice(14), str.getItem(key)]));
 }
}
return new List(result);</l></block><list></list></block></block></script></block-definition><block-definitions="remove key: %'key' in browser"type="command"category="other"><header></header><code></code><translations></translations><inputs><inputtype="%s"></input></inputs><script><blocks="doRun"><blocks="reportJSFunction"><list><l>key</l><l>proc</l></list><l>proc.assertType(key, ['text', 'number']);
window.localStorage.removeItem('-snap-project-' + key);</l></block><list><blockvar="key"/></list></block></script></block-definition><block-definitions="clear data in browser"type="command"category="other"><header></header><code></code><translations></translations><inputs></inputs><script><blocks="doWarp"><script><blocks="doForEach"><l>item</l><custom-blocks="stored data in browser"></custom-block><script><custom-blocks="remove key: %s in browser"><blocks="reportListItem"><l>1</l><blockvar="item"/></block></custom-block></script></block></script></block></script></block-definition><block-definitions="get value from key: %'key' in browser"type="reporter"category="other"><commentw="199.33333333333334"collapsed="false">Reports the value previously stored under
the input key in the browser's local storage.
Reports False if the key is not found.</comment><header></header><code></code><translations></translations><inputs><inputtype="%s"></input></inputs><script><blocks="doReport"><blocks="evaluate"><blocks="reportJSFunction"><list><l>key</l></list><l>var str = window.localStorage,
 result = str.getItem('-snap-project-'+key);
if (!result) {
 return false;
}
return result;</l></block><list><blockvar="key"/></list></block></block></script></block-definition></blocks>