Commit 3ca20abe authored by Siddhant Sanyam's avatar Siddhant Sanyam

added load method to User and JSONDocument using tools.js

parent 4ae73e5a
...@@ -126,13 +126,15 @@ setCurrentPage = function(page) { ...@@ -126,13 +126,15 @@ setCurrentPage = function(page) {
/* /*
* user class * user class
*/ */
var User = function() { var User = function(details) {
this.name = "unknown"; this.name = "unknown";
this.language = "en"; this.language = "en";
this.storage = "http://www.unhosted-dav.com"; this.storage = "http://www.unhosted-dav.com";
this.identityProvider = "http://www.webfinger.com"; this.identityProvider = "http://www.webfinger.com";
} }
User.prototype = { User.prototype = {
load: UngObject.prototype.load,
getName: function() {return this.name;}, getName: function() {return this.name;},
setName: function(newName) {this.name = newName;}, setName: function(newName) {this.name = newName;},
getLanguage: function() {return this.language;}, getLanguage: function() {return this.language;},
...@@ -151,7 +153,7 @@ User.prototype = { ...@@ -151,7 +153,7 @@ User.prototype = {
getCurrentUser = function() { getCurrentUser = function() {
var user = new User(); var user = new User();
user.load(JSON.parse(localStorage.getItem("currentUser"))) user.load(JSON.parse(localStorage.getItem("currentUser")));
return user; return user;
} }
setCurrentUser = function(user) {localStorage.setItem("currentUser", JSON.stringify(user));} setCurrentUser = function(user) {localStorage.setItem("currentUser", JSON.stringify(user));}
...@@ -176,6 +178,7 @@ var JSONDocument = function() { ...@@ -176,6 +178,7 @@ var JSONDocument = function() {
this.state=Document.states.draft; this.state=Document.states.draft;
} }
JSONDocument.prototype = { JSONDocument.prototype = {
load: UngObject.prototype.load,
//type //type
getType: function() {return this.type;}, getType: function() {return this.type;},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment