mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 16:54:04 -06:00
Partial support for fast and loose games
This commit is contained in:
@@ -160,14 +160,17 @@ 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
@@ -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>
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user