First pass at loading characters and a readable roster

This commit is contained in:
Eric Fredricksen
2010-07-02 21:07:49 -07:00
parent ca2f9b30c3
commit 1c6a681880
5 changed files with 92 additions and 80 deletions
+10 -36
View File
@@ -1,43 +1,17 @@
<html>
<head>
<title>Progress Quest X/web - Roster</title>
<script src="jquery.js"></script>
<script src="config.js"></script>
<script src="roster.js"></script>
</head>
<body>
<dl id=roster>
Here it goes
</dl>
<script>
$(document).ready(function () {
var roster = $("#roster");
roster.text("Loading...");
var games = loadRoster()
if (!games) {
roster.text("No local storage");
return;
}
$.each(games, function (index, element) {
var p = $("<dt/>");
p.appendTo(roster);
p.text(element.name);
p = $("<dd/>");
p.appendTo(roster);
p.text(JSON.stringify(element));
});
var b = $("<button>Test</button>");
b.appendTo(roster);
b.click(function () {
games.push({testy: "betsy"});
storeRoster(games);
});
var b = $("<button>Clear</button>");
b.appendTo(roster);
b.click(function () {
games = [];
storeRoster();
});
});
</script>
<button id=test>Test</button>
<button id=clear>Clear</button>
</body>
</html>