JavaScript is required. Please enable it to continue.
Your browser lacks required capabilities. Please upgrade it or switch to another to continue.
Loading…
<center><h1>Local Storage Manager</h1>v1.2.3 - by HiEv</center> <div class="block"><<button '<svg viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg" style="position: relative; top: 1px; width: 14px; height: 14px; padding-left: 1px;"><path d="m215 219c-18 16-41 26-66 26-44 0-82-30-93-71-1-3-3-6-7-6h-32c-4 0-7 4-7 9 12 65 71 115 140 115 38 0 72-15 97-39l21 20c9 9 24 3 24-10v-76c0-7-6-13-13-13h-77c-12 0-18 15-10 23zm-193-91h77c12 0 18-15 10-23l-24-24c18-16 41-26 66-26 44 0 83 30 93 71 1 3 3 6 7 6h32c4 0 7-4 7-9-10-65-69-114-139-114-38 0-72 15-97 39l-20-21c-9-8-24-2-24 11v75c0 10 5 15 12 15z" fill="#fff" /></svg> Refresh Data'>> <<replace "#data">><<include "Data">><</replace>> <</button>> <<button "<span class='disk' style='display: inline-block;'></span> Load Saved Keys">> <<run loadSaveFile()>> <</button>> <<button "Create Test Key">> <<if setup.isProperty(localStorage, "ZZ-Local_Storage_Manager_Test-ZZ")>> <<run alert('Key "ZZ-Local_Storage_Manager_Test-ZZ" already exists.')>> <<else>> <<run localStorage.setItem('ZZ-Local_Storage_Manager_Test-ZZ', 'Test data.')>> <<replace "#data">><<include "Data">><</replace>> <<run alert('Created key "ZZ-Local_Storage_Manager_Test-ZZ".')>> <</if>> <</button>> <<button "Delete Test Key">> <<set _key = "ZZ-Local_Storage_Manager_Test-ZZ">> <<if setup.isProperty(localStorage, _key)>> <<set _len = (localStorage[_key].length + _key.length) * 2>> <<run Dialog.setup("Are you sure?")>> <<run Dialog.wiki(Story.get("Single Verification Dialog").processText())>> <<run Dialog.open()>> <<run setTimeout(function() { $("#defaultButton button").focus(); }, 200)>> <<else>> <<run alert('Key "' + _key + '" does not exist.')>> <</if>> <</button>></div><<if setup.localStorageRemaining(2)>> <div id="data"><<include "Data">></div> <<else>> <div class="block">''Error:'' Local Storage unavailable.</div> <</if>>
<div class="block"><label>''Overall usage of Local Storage:''</label> <<set _used = setup.localStorageUsed(), _left = setup.localStorageRemaining()>><table id="info"> <tr> <th></th> <th class="info-cell">Bytes</th> <th class="info-cell">MB</th> </tr> <tr> <th class="info-cell">Total Local Storage Space</th> <td class="info-cell"><<set _tot = _used + _left>><<= setup.numberWithCommas(_tot)>></td> <td class="info-cell"><<= (_tot / 1048576).toFixed(2)>></td> </tr> <tr> <th class="info-cell">Local Storage Used</th> <td class="info-cell"><<= setup.numberWithCommas(_used)>></td> <td class="info-cell"><<= (_used / 1048576).toFixed(2)>></td> </tr> <tr> <th class="info-cell">Local Storage Remaining</th> <td class="info-cell"><<= setup.numberWithCommas(_left)>></td> <td class="info-cell"><<= (_left / 1048576).toFixed(2)>></td> </tr> </table></div> <br> <span class="tabs"><span id="itemsBtn" @class="$items"><<button "''Items in your Local Storage:''">> <<run $("#games").addClass("inactive")>> <<run $("#gamessBtn").addClass("inactive")>> <<run $("#items").removeClass("inactive")>> <<run $("#itemsBtn").removeClass("inactive")>> <<set $items = "">> <<set $games = " inactive">> <</button>></span> <span id="gamessBtn" @class="$games"><<button "''Local Storage by game:''">> <<run $("#items").addClass("inactive")>> <<run $("#itemsBtn").addClass("inactive")>> <<run $("#games").removeClass("inactive")>> <<run $("#gamessBtn").removeClass("inactive")>> <<set $items = " inactive">> <<set $games = "">> <</button>></span></span> <<silently>> <<set _names = Object.keys(localStorage).sort()>> <<set _keyList = []>> <<set _group = {}>> <<for _i = 0; _i < _names.length; _i++>> <<set _key = _names[_i]>> <<if setup.isProperty(localStorage, _key)>> <<set _len = (localStorage[_key].length + _key.length) * 2>> <<set _keyList.push({ key: _key, len: _len })>> <<set _grpName = setup.findMatches(_key, _names)>> <<if setup.isProperty(_group, _grpName)>> <<set _group[_grpName].len += _len>> <<set _group[_grpName].keys.push(_key)>> <<else>> <<set _group[_grpName] = { len: _len, keys: [_key] }>> <</if>> <</if>> <</for>> <<set _names = Object.keys(_group)>> <<set _groupList = []>> <<for _i = 0; _i < _names.length; _i++>> <<set _key = _names[_i]>> <<set _groupList.push({ key: _key, len: _group[_key].len, keys: _group[_key].keys })>> <</for>> <</silently>> <div id="items" @class="'content' + $items"> <<silently>> <<if $sortSiz === "▼">> <<run _keyList.sort(function(a, b) { return b.len - a.len; })>> <<elseif $sortSiz === "▲">> <<run _keyList.sort(function(a, b) { return a.len - b.len; })>> <<elseif $sortKey === "▼">> <<run _keyList.sort(function(a, b) { var nameA = a.key.toLowerCase(); var nameB = b.key.toLowerCase(); if (nameA < nameB) { return -1; } if (nameA > nameB) { return 1; } return 0; })>> <<elseif $sortKey === "▲">> <<run _keyList.sort(function(a, b) { var nameA = a.key.toLowerCase(); var nameB = b.key.toLowerCase(); if (nameA > nameB) { return -1; } if (nameA < nameB) { return 1; } return 0; })>> <</if>> <<set _table = '<table id="keys"><tr><th class="info-cell"><span class="disk" title="Save Item"></span></th><th class="info-cell"><span class="trash" title="Delete Item"></span></th><th class="info-cell" style="text-align: left;">Key Name<span style="float: right;"><<button $sortKey>> <<if $sortKey === "▼">> <<set $sortKey = "▲">> <<set $sortSiz = "▬">> <<else>> <<set $sortKey = "▼">> <<set $sortSiz = "▬">> <</if>> <<replace "#data">><<include "Data">><</replace>> <</button>></span></th><th class="info-cell"><span style="float: left;"><<button $sortSiz>> <<if $sortSiz === "▼">> <<set $sortSiz = "▲">> <<set $sortKey = "▬">> <<else>> <<set $sortSiz = "▼">> <<set $sortKey = "▬">> <</if>> <<replace "#data">><<include "Data">><</replace>> <</button>></span>Bytes</th><th class="info-cell">MB</th><th class="info-cell" title="Percent of total storage space available">% of Total</th></tr>'>> <<for _i = 0; _i < _keyList.length; _i++>> <<set _len = _keyList[_i].len>> <<set _table += '<tr><td class="info-cell"><<saveBtn ' + _keyList[_i].key + '>></td><td class="info-cell"><<delBtn ' + _keyList[_i].key + '>></td><th class="info-cell"><<raw ' + _keyList[_i].key + '>></th><td class="info-cell">' + setup.numberWithCommas(_len) + '</td><td class="info-cell">' + (_len / 1048576).toFixed(2) + '</td><td class="info-cell">' + ((_len / _tot) * 100).toFixed(2) + '%</td></tr>'>> <</for>> <<set _table += '</table>'>> <</silently>>_table </div> <div id="games" @class="'content' + $games"> <<silently>> <<if $sortSiz === "▼">> <<run _groupList.sort(function(a, b) { return b.len - a.len; })>> <<elseif $sortSiz === "▲">> <<run _groupList.sort(function(a, b) { return a.len - b.len; })>> <<elseif $sortKey === "▼">> <<run _groupList.sort(function(a, b) { var nameA = a.key.toLowerCase(); var nameB = b.key.toLowerCase(); if (nameA < nameB) { return -1; } if (nameA > nameB) { return 1; } return 0; })>> <<elseif $sortKey === "▲">> <<run _groupList.sort(function(a, b) { var nameA = a.key.toLowerCase(); var nameB = b.key.toLowerCase(); if (nameA > nameB) { return -1; } if (nameA < nameB) { return 1; } return 0; })>> <</if>> <<set _table = '<table id="keys"><tr><th class="info-cell"><span class="disk" title="Save Items"></span></th><th class="info-cell"><span class="trash" title="Delete Items"></span></th><th class="info-cell" style="text-align: left;">Key Name<span style="float: right;"><<button $sortKey>> <<if $sortKey === "▼">> <<set $sortKey = "▲">> <<set $sortSiz = "▬">> <<else>> <<set $sortKey = "▼">> <<set $sortSiz = "▬">> <</if>> <<replace "#data">><<include "Data">><</replace>> <</button>></span></th><th class="info-cell"><span style="float: left;"><<button $sortSiz>> <<if $sortSiz === "▼">> <<set $sortSiz = "▲">> <<set $sortKey = "▬">> <<else>> <<set $sortSiz = "▼">> <<set $sortKey = "▬">> <</if>> <<replace "#data">><<include "Data">><</replace>> <</button>></span>Bytes</th><th class="info-cell">MB</th><th class="info-cell" title="Percent of total storage space available">% of Total</th></tr>'>> <<for _i = 0; _i < _groupList.length; _i++>> <<set _len = _groupList[_i].len>> <<set _table += '<tr><td class="info-cell"><<saveGrp ' + _groupList[_i].key + 'X,' + _groupList[_i].keys + '>></td><td class="info-cell"><<delGrp ' + _groupList[_i].keys + '>></td><th class="info-cell">'>> <<if _groupList[_i].keys.length === 1>> <<set _table += '<<raw ' + _groupList[_i].keys[0] + '>>'>> <<else>> <<set _table += '<<raw ' + _groupList[_i].key + '>>* (' + _groupList[_i].keys.length + ' keys)'>> <</if>> <<set _table += '</th><td class="info-cell">' + setup.numberWithCommas(_len) + '</td><td class="info-cell">' + (_len / 1048576).toFixed(2) + '</td><td class="info-cell">' + ((_len / _tot) * 100).toFixed(2) + '%</td></tr>'>> <</for>> <<set _table += '</table>'>> <</silently>>_table </div>
<center>Are you sure you want to delete the following key? "''_key''" (_len bytes) ''Warning:'' Once you delete this key you cannot recover it.</center> <span class="alignRight"><<button "Delete">> <<run localStorage.removeItem(_key)>> <<replace "#data">><<include "Data">><</replace>> <<run Dialog.close()>> <</button>> <span id="defaultButton"><<button "Cancel">> <<run Dialog.close()>> <</button>></span></span>
<<widget "saveBtn">> <span class="saveBtn"> <<button "+">> <<set _key = $args.raw>> <<if setup.isProperty(localStorage, _key)>> <<run writeSaveFile(_key, [_key])>> <<else>> <<run alert('Key "' + _key + '" does not exist.')>> <</if>> <</button>> </span> <</widget>> <<widget "delBtn">> <span class="delBtn"> <<button "X">> <<set _key = $args.raw>> <<if setup.isProperty(localStorage, _key)>> <<set _len = (localStorage[_key].length + _key.length) * 2>> <<run Dialog.setup("Are you sure?")>> <<run Dialog.wiki(Story.get("Single Verification Dialog").processText())>> <<run Dialog.open()>> <<run setTimeout(function() { $("#defaultButton button").focus(); }, 200)>> <<else>> <<run alert('Key "' + _key + '" does not exist.')>> <</if>> <</button>> </span> <</widget>> <<widget "saveGrp">> <span class="saveBtn"> <<button "+">> <<set _keys = $args.raw.split(",")>> <<set _key = _keys.shift()>> <<if _keys.length === 1>> <<set _key = _keys[0]>> <</if>> <<run writeSaveFile(_key, _keys)>> <</button>> </span> <</widget>> <<widget "delGrp">> <span class="delBtn"> <<button "X">> <<set _keys = $args.raw.split(",")>> <<run _keys.sort(function(a, b) { var nameA = a.toLowerCase(); var nameB = b.toLowerCase(); if (nameA < nameB) { return -1; } if (nameA > nameB) { return 1; } return 0; })>> <<run Dialog.setup("Are you sure?")>> <<run Dialog.wiki(Story.get("Group Verification Dialog").processText())>> <<run Dialog.open()>> <<run setTimeout(function() { $("#defaultButton button").focus(); }, 200)>> <</button>> </span> <</widget>>
<<set $sortKey = "▬">> <<set $sortSiz = "▼">> <<set $items = "">> <<set $games = " inactive">>
<<if _keys.length === 1>>\ <center>Are you sure you want to delete the following key? <<set _key = _keys[0]>>\ <<set _len = (localStorage[_key].length + _key.length) * 2>>\ "''_key''" (_len bytes)<br> ''Warning:'' Once you delete this key you cannot recover it.</center> <<else>>\ <center>Are you sure you want to delete the following keys?</center> <<for _ctr = 0; _ctr < _keys.length; _ctr++>>\ * <<set _key = _keys[_ctr]>>\ <<set _len = (localStorage[_key].length + _key.length) * 2>>\ "''_key''" (_len bytes) <</for>> <center>''Warning:'' Once you delete the above keys you cannot recover them.</center> <</if>> <span class="alignRight"><<button "Delete">> <<for _ctr = 0; _ctr < _keys.length; _ctr++>> <<if setup.isProperty(localStorage, _keys[_ctr])>> <<run localStorage.removeItem(_keys[_ctr])>> <</if>> <</for>> <<replace "#data">><<include "Data">><</replace>> <<run Dialog.close()>> <</button>> <span id="defaultButton"><<button "Cancel">> <<run Dialog.close()>> <</button>></span></span>