1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-26 10:49:17 +00:00
8bitworkshop/editstorage.html

67 lines
1.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>8bitworkshop</title>
<link rel="stylesheet" href="css/ui.css">
</head>
<body>
<h3>8bitworkshop Local Storage Editor</h3>
<p>
<select id="storageitems" size="20">
</select>
</p><p>
<button id="deleteitem">Delete Selected Item</button>
</p>
<script src="jquery/jquery-2.2.3.min.js"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<script src="bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap-tour.min.css">
<script src="bootstrap/js/bootstrap-tour.min.js"></script>
<script src="codemirror/lib/codemirror.js"></script>
<script src="src/util.js"></script>
<script src="src/ui.js"></script>
<!-- <script src="src/audio/votrax.js"></script> -->
<script>
var storagelist = $("#storageitems");
var items = getBiggestItems(localStorage);
for (var i=items.length-1; i>=0; i--) {
var item = items[i];
var option = new Option(item[1] + " (" + item[0] + " bytes )", item[1]);
storagelist.append(option);
}
$("#deleteitem").click(function(e) {
var key = storagelist.find(":selected").val();
console.log(key);
if (key) {
if (confirm("Delete " + key + " from local storage (make sure you have any edits backed up!)")) {
localStorage.removeItem(key);
window.location = location;
}
} else {
alert("Please select an item first");
}
});
</script>
</body>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-54497476-9', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
</html>