mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 16:54:04 -06:00
First pass at loading characters and a readable roster
This commit is contained in:
+10
-36
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user