implemented cache fixed #89

This commit is contained in:
Jeena Paradies 2012-12-18 23:03:19 +01:00
parent 448cb24ca3
commit fff75df0df
8 changed files with 119 additions and 84 deletions

View file

@ -16,13 +16,13 @@ function() {
};
CacheStorage.prototype.getItem = function(key) {
return localStorage.getItem(this.mkPath(key));
return JSON.parse(localStorage.getItem(this.mkPath(key)));
}
CacheStorage.prototype.setItem = function(key, value) {
var item = this.getItem(key);
localStorage.setItem(this.mkPath(key), value);
localStorage.setItem(this.mkPath(key), JSON.stringify(value));
if (!item) {
var length_path = this.mkInternalPath("_length");