| Line | |
|---|
| 1 | let _globalStorage = {} |
|---|
| 2 | |
|---|
| 3 | function save_info_to_local_storage(info){ |
|---|
| 4 | _globalStorage["info"] = info |
|---|
| 5 | save_to_local_storage(JSON.stringify(info), "info") |
|---|
| 6 | } |
|---|
| 7 | |
|---|
| 8 | function save_filelist_to_local_storage(text , num){ |
|---|
| 9 | let num_s = num + '' |
|---|
| 10 | save_to_local_storage(text, key) |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | function save_to_local_storage(str, key) { |
|---|
| 14 | _globalStorage[key] = str |
|---|
| 15 | localStorage.setItem(key , str) |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | function get_filelist(num) { |
|---|
| 19 | let num_s = num + '' |
|---|
| 20 | if( _globalStorage[num_s] === undefined ){ |
|---|
| 21 | oldData = localStorage.getItem(num_s) |
|---|
| 22 | if( oldData ){ |
|---|
| 23 | _globalStorage[num_s] = JSON.parse(oldData) |
|---|
| 24 | } |
|---|
| 25 | } |
|---|
| 26 | return _globalStorage[num_s] |
|---|
| 27 | } |
|---|
| 28 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.