Partial support for fast and loose games

This commit is contained in:
Eric Fredricksen
2010-07-07 11:20:31 -07:00
parent b42ae65fa2
commit a6a29c78ab
3 changed files with 10 additions and 10 deletions
+3
View File
@@ -160,13 +160,16 @@ function loadRoster() {
} }
function storeRoster(roster) { function storeRoster(roster) {
if (window.localStorage)
window.localStorage.setItem("roster", JSON.stringify(roster)); window.localStorage.setItem("roster", JSON.stringify(roster));
} }
function addToRoster(newguy) { function addToRoster(newguy) {
if (window.localStorage) {
var r = loadRoster(); var r = loadRoster();
r[newguy.name] = newguy; r[newguy.name] = newguy;
storeRoster(r); storeRoster(r);
}
} }
var K = {}; var K = {};
+2 -5
View File
@@ -58,8 +58,6 @@ a.x, a.sheet {
blockquote { blockquote {
margin: 0 10% 0 10%; margin: 0 10% 0 10%;
background-color: #ffd;
border: solid 1px #fdb;
padding: 1ex; padding: 1ex;
font-size: 11pt; font-size: 11pt;
} }
@@ -78,9 +76,8 @@ blockquote {
In the olden times you'd <a href="download.php">download</a> Progress In the olden times you'd <a href="download.php">download</a> Progress
Quest to your computer; now you may instead play Progress Quest Quest to your computer; now you may instead play Progress Quest
directly in your browser. Most modern browsers will save your game(s) directly in your browser. Most modern browsers will save your game(s)
on this page <i>in just this browser</i>; if not, you can play fast and loose: the game will last on this page, in this browser. Online leader boards and server-side
as long as the page stays open. Online leader boards and character game saves are not implemented at this time.
storage are not implemented at this time.
</blockquote> </blockquote>
<p id=roster> <p id=roster>
+1 -1
View File
@@ -8,7 +8,7 @@ $(document).ready(function () {
games = loadRoster(); games = loadRoster();
if (!games) { if (!games) {
roster.text("Err...no local storage"); roster.html("<b>This browser does not support local storage. You may still play fast and loose: the game will last only as long as the page stays open in your browser.");
return; return;
} }
$.each(games, function (key, c) { $.each(games, function (key, c) {