added new localstorage "Data Base" library

pull/95/head
jmoenig 2020-08-07 13:29:20 +02:00
rodzic 4dcd4b24a6
commit 85c844f9f4
3 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -4,6 +4,7 @@
### 2020-08-07
* new dev version
* added new localstorage library
## 6.1.4:
* fixed "green flag" symbol size for embedded proects (for real ^^)=

Wyświetl plik

@ -12,11 +12,12 @@ variadic-reporters.xml Variadic reporters Versions of +, x, AND, and OR that tak
~ ~
maps_module.xml World Map Add interactive maps to projects
textCostumes_module.xml Text Costumes Generate costumes from letters or words of text.
speech_module.xml Text to speech output text using speech synthesis.
animation_module.xml Animation glide, grow and rotate using easing functions.
pixel_module.xml Pixels manipulate costumes pixel-wise.
audioComp_module.xml Audio Comp analyze, manipulate and generate sound samples.
speech_module.xml Text to Speech Output text using speech synthesis.
animation_module.xml Animation Glide, grow and rotate using easing functions.
pixel_module.xml Pixels Manipulate costumes pixel-wise.
audioComp_module.xml Audio Comp Analyze, manipulate and generate sound samples.
frequency_distribution_module.xml Frequency Distribution Analysis Analyze data for frequency distribution
localstorage_module.xml Data Base Persistent key-value storage across Snap! sessions in the same browser
~ ~
~ ~
~ ~

Wyświetl plik

@ -0,0 +1 @@
<blocks app="Snap! 6, https://snap.berkeley.edu" version="1"><block-definition s="store key: %&apos;key&apos; value: %&apos;value&apos; in browser" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>key</l><l>value</l></list><l>window.localStorage.setItem(&apos;-snap-project-&apos; + key, &apos;&apos; + value);</l></block><list><block var="key"/><block var="value"/></list></block></script></block-definition><block-definition s="stored data in browser" type="reporter" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list></list><l>var str = window.localStorage,&#xD; len = str.length,&#xD; result = [],&#xD; key,&#xD; i;&#xD;for (i = 0; i &lt; len; i += 1) {&#xD; key = str.key(i);&#xD; if (key.startsWith(&apos;-snap-project-&apos;)) {&#xD; result.push(new List([key.slice(14), str.getItem(key)]));&#xD; }&#xD;}&#xD;return new List(result);</l></block><list></list></block></block></script></block-definition><block-definition s="remove key: %&apos;key&apos; in browser" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>key</l></list><l>window.localStorage.removeItem(&apos;-snap-project-&apos; + key);</l></block><list><block var="key"/></list></block></script></block-definition><block-definition s="clear data in browser" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doWarp"><script><block s="doForEach"><l>item</l><custom-block s="stored data in browser"></custom-block><script><custom-block s="remove key: %s in browser"><block s="reportListItem"><l>1</l><block var="item"/></block></custom-block></script></block></script></block></script></block-definition></blocks>