From 61b67674a267e762dda34bb9d9189c6c7fcd8897 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 4 May 2022 18:37:48 +0300 Subject: [PATCH] minor tweak... Signed-off-by: Alex A. Naanou --- pwiki2.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pwiki2.js b/pwiki2.js index 12f4bbc..6db3e6d 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -421,29 +421,30 @@ module.localStorageStore = { : undefined, // XXX key to store data under... // ....if undefined then each page will be stored as a root path... - __path__: undefined, + __key__: 'pWiki-data', __data: undefined, get data(){ - return this.__path__ ? + return this.__key__ ? (this.__data = this.__data - ?? JSON.parse(this.__store__[this.__path__])) + ?? JSON.parse(this.__store__[this.__key__])) : this.__store__ }, //__paths__: function(path){}, //__exists__: function(path){}, __get__: function(path){ - return this.__path__ ? + return this.__key__ ? this.data[path] // XXX CACHE... : JSON.parse(this.data[path]) }, // XXX *time... __set__: function(path, data){ - this.data[path] = this.__path__ ? + this.data[path] = this.__key__ ? data // XXX CACHE... : JSON.stringify(data) }, __update__: function(){ + // XXX }, delete: function(){},