Commits

Hideya OHASHI committed dea4242

use localStorage

Comments (0)

Files changed (1)

     return binstr;
   }
 
+  var settingkey = 'jspass-0.1';
+  var settingstr = localStorage.getItem(settingkey);
+  if (settingstr) {
+    var setting = JSON.parse(settingstr);
+    accounts = setting.accounts; // TODO use internal variable instead
+  }
+  else {
+    var setting = { accounts: accounts }; // TODO set default accounts
+    localStorage.setItem(settingkey, JSON.stringify(setting));
+  }
+
   function getlinks() {
     var html = '';
     for (var i = 0; i < accounts.length; i++) {