mirror of
https://github.com/wassname/cardsforscience.git
synced 2026-09-09 11:19:16 +08:00
Well I only wanted to implement saving and got carried away.
I cleaned the code up a bit. Everything auto-saves now (every 10s) except for achievements. Maybe we should look at them together.
This commit is contained in:
+6
-2
@@ -12,6 +12,9 @@ var ObjectStorage = (function() {
|
||||
},
|
||||
load: function(key) {
|
||||
return JSON.parse(_s.getItem(key));
|
||||
},
|
||||
clear: function() {
|
||||
_s.clear();
|
||||
}
|
||||
};
|
||||
} catch (e) {
|
||||
@@ -19,7 +22,8 @@ var ObjectStorage = (function() {
|
||||
+ ' If you refresh the page, all progress will be lost');
|
||||
return {
|
||||
save: function(key, item) {},
|
||||
load: function(key) { return null; }
|
||||
load: function(key) { return null; },
|
||||
clear: function() {}
|
||||
};
|
||||
};
|
||||
});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user