diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-11-14 16:10:09 -0500 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-11-14 16:10:09 -0500 |
| commit | a7240a7cbcdddacbd7d865d9ba10042a0acb886b (patch) | |
| tree | d2d53967b5e377321d6ba97e64698cbdfb0fb09b /www | |
| parent | c652eda24f3caa446815194f32b78d049fa99076 (diff) | |
#83 - data structures in place and being stored correctly
Former-commit-id: 06d92c1af747a8481c2f374a28c5af8a3e59078b
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/DataModel.js | 16 | ||||
| -rw-r--r-- | www/js/LoginCtrl.js | 27 |
2 files changed, 39 insertions, 4 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 9f6b6451..024d5b55 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -107,10 +107,11 @@ angular.module('zmApp.controllers') zmLog("Saving all parameters to storage"); zmDebug ("DataModel/setLogin: writing " + JSON.stringify(newLogin)); - $localstorage.setObject($rootScope.currentServerGroup, loginData); + //$localstorage.setObject($rootScope.currentServerGroup, loginData); serverGroupList[loginData.serverName]=loginData; console.log (JSON.stringify(serverGroupList)); - $localstorage.setObject("serverlist", serverGroupList); + $localstorage.setObject("serverGroupList", serverGroupList); + $localstorage.set("defaultServerName",loginData.serverName); } @@ -178,11 +179,18 @@ angular.module('zmApp.controllers') // FIXME: Move all of this into a neat JSON object init: function () { - console.log("****** DATAMODEL INIT SERVICE CALLED ********"); + // console.log("****** DATAMODEL INIT SERVICE CALLED ********"); zmLog("ZMData init: checking for stored variables & setting up log file"); - var loadedData = $localstorage.getObject($rootScope.currentServerGroup); + serverGroupList = $localstorage.getObject("serverGroupList"); + + console.log ("!!!!!!!!!!!!!!!!!serverGroupList is " + JSON.stringify(serverGroupList)); + var sname = + $localstorage.get("defaultServerName"); + console.log ("!!!!!!!!!!!!!!!!!!default server name is " + sname); + + var loadedData = serverGroupList[sname]; if (!isEmpty(loadedData)) { loginData = loadedData; diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index 27673c54..c5ba53c9 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -37,6 +37,33 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r { text: 'New Group...' }, + { + text: 'New Group...' + }, + { + text: 'New Group...' + }, + { + text: 'New Group...' + }, + { + text: 'New Group...' + }, + { + text: 'New Group...' + }, + { + text: 'New Group...' + }, + { + text: 'New Group...' + }, + { + text: 'New Group...' + }, + { + text: 'New Group...' + }, { text: 'Rename' |
