From a6a29c78ab7faee12f9ce017016669aa51ed2c84 Mon Sep 17 00:00:00 2001 From: Eric Fredricksen Date: Wed, 7 Jul 2010 11:20:31 -0700 Subject: [PATCH] Partial support for fast and loose games --- config.js | 11 +++++++---- roster.html | 7 ++----- roster.js | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config.js b/config.js index b087119..3e234a9 100644 --- a/config.js +++ b/config.js @@ -160,13 +160,16 @@ function loadRoster() { } function storeRoster(roster) { - window.localStorage.setItem("roster", JSON.stringify(roster)); + if (window.localStorage) + window.localStorage.setItem("roster", JSON.stringify(roster)); } function addToRoster(newguy) { - var r = loadRoster(); - r[newguy.name] = newguy; - storeRoster(r); + if (window.localStorage) { + var r = loadRoster(); + r[newguy.name] = newguy; + storeRoster(r); + } } var K = {}; diff --git a/roster.html b/roster.html index d6d9369..a658499 100644 --- a/roster.html +++ b/roster.html @@ -58,8 +58,6 @@ a.x, a.sheet { blockquote { margin: 0 10% 0 10%; - background-color: #ffd; - border: solid 1px #fdb; padding: 1ex; font-size: 11pt; } @@ -78,9 +76,8 @@ blockquote { In the olden times you'd download Progress Quest to your computer; now you may instead play Progress Quest directly in your browser. Most modern browsers will save your game(s) -on this page in just this browser; if not, you can play fast and loose: the game will last -as long as the page stays open. Online leader boards and character -storage are not implemented at this time. +on this page, in this browser. Online leader boards and server-side +game saves are not implemented at this time.

diff --git a/roster.js b/roster.js index 3857f4c..8a2efa4 100644 --- a/roster.js +++ b/roster.js @@ -8,7 +8,7 @@ $(document).ready(function () { games = loadRoster(); if (!games) { - roster.text("Err...no local storage"); + roster.html("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; } $.each(games, function (key, c) {