add app notice

This commit is contained in:
Gabriele Cirulli
2014-04-27 13:04:48 +02:00
parent b56159b5da
commit 3793755010
6 changed files with 224 additions and 3 deletions
+9
View File
@@ -21,6 +21,7 @@ window.fakeStorage = {
function LocalStorageManager() {
this.bestScoreKey = "bestScore";
this.gameStateKey = "gameState";
this.noticeClosedKey = "noticeClosed";
var supported = this.localStorageSupported();
this.storage = supported ? window.localStorage : window.fakeStorage;
@@ -61,3 +62,11 @@ LocalStorageManager.prototype.setGameState = function (gameState) {
LocalStorageManager.prototype.clearGameState = function () {
this.storage.removeItem(this.gameStateKey);
};
LocalStorageManager.prototype.setNoticeClosed = function (noticeClosed) {
this.storage.setItem(this.noticeClosedKey, JSON.stringify(noticeClosed));
};
LocalStorageManager.prototype.getNoticeClosed = function () {
return JSON.parse(this.storage.getItem(this.noticeClosedKey) || "false");
};