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:
@@ -0,0 +1,40 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
var games;
|
||||
|
||||
function load() {
|
||||
var roster = $("#roster");
|
||||
roster.empty();
|
||||
roster.text("Loading...");
|
||||
|
||||
games = loadRoster()
|
||||
if (!games) {
|
||||
roster.text("Err...no local storage");
|
||||
return;
|
||||
}
|
||||
$.each(games, function (index, c) {
|
||||
var p = $("<dt/>");
|
||||
p.appendTo(roster);
|
||||
p.text(c.name);
|
||||
var a = $("<a/>", {href: "main.html#" + c.name})
|
||||
a.text(c.name);
|
||||
a.appendTo(p);
|
||||
p = $("<dd/>");
|
||||
p.appendTo(roster);
|
||||
p.text("Level " + (c.level || 1) + " " + c.race + " " + c['class']);
|
||||
});
|
||||
}
|
||||
|
||||
load();
|
||||
|
||||
$("#test").click(function () {
|
||||
games.push({testy:"cul", "name":"betsy"});
|
||||
storeRoster(games);
|
||||
load();
|
||||
});
|
||||
|
||||
$("#clear").click(function () {
|
||||
storeRoster([]);
|
||||
load();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user