Remove Storage and Profile, Move folders, add EncryptedInsightStorage
This commit is contained in:
parent
de90f3eec2
commit
61b677498b
20 changed files with 374 additions and 1067 deletions
42
js/plugins/LocalStorage.js
Normal file
42
js/plugins/LocalStorage.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
'use strict';
|
||||
|
||||
function LocalStorage() {
|
||||
this.type = 'DB';
|
||||
};
|
||||
|
||||
LocalStorage.prototype.init = function() {
|
||||
};
|
||||
|
||||
LocalStorage.prototype.setCredentials = function(email, password, opts) {
|
||||
};
|
||||
|
||||
LocalStorage.prototype.getItem = function(k,cb) {
|
||||
return cb(localStorage.getItem(k));
|
||||
};
|
||||
|
||||
LocalStorage.prototype.setItem = function(k,v,cb) {
|
||||
localStorage.setItem(k,v);
|
||||
return cb();
|
||||
};
|
||||
|
||||
LocalStorage.prototype.removeItem = function(k,cb) {
|
||||
localStorage.removeItem(k);
|
||||
return cb();
|
||||
};
|
||||
|
||||
LocalStorage.prototype.clear = function(cb) {
|
||||
localStorage.clear();
|
||||
return cb();
|
||||
};
|
||||
|
||||
LocalStorage.prototype.allKeys = function(cb) {
|
||||
var l = localStorage.length;
|
||||
var ret = [];
|
||||
|
||||
for(var i=0; i<l; i++)
|
||||
ret.push(localStorage.key(i));
|
||||
|
||||
return cb(ret);
|
||||
};
|
||||
|
||||
module.exports = LocalStorage;
|
||||
Loading…
Add table
Add a link
Reference in a new issue