1
0
mirror of http://git.whoc.org.uk/git/password-manager.git synced 2025-10-25 17:47:34 +02:00

Added a few feature based on actual subscription options

This commit is contained in:
Giulio Cesare Solaroli
2015-01-21 18:29:08 +01:00
parent 334affd36d
commit 43b0239ab8
8 changed files with 173 additions and 36 deletions

View File

@@ -33,6 +33,41 @@ Clipperz.PM.DataModel.User.AccountInfo = function(args) {
Clipperz.Base.extend(Clipperz.PM.DataModel.User.AccountInfo, Object, {
'status': function () {
return this._attributes['currentSubscriptionType'];
},
'level': function () {
var result;
// -1.00 -> EARLY_ADOPTER
// 2.00 -> FRIEND
// 5.00 -> FAN
// 10.00 -> DEVOTEE
// 15.00 -> PATRON
if (this.status() == 'FRIEND') {
result = 1;
} else if (this.status() == 'FAN') {
result = 2;
} else if (this.status() == 'DEVOTEE') {
result = 3;
} else if (this.status() == 'PATRON') {
result = 4;
} else {
result = 0;
};
return result;
// return this._attributes['latestActiveThreshold'];
},
'isExpiring': function () {
return this._attributes['isExpiring'];
},
//............................................................................
'features': function () {
return this._attributes['features'];
},
@@ -47,6 +82,12 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User.AccountInfo, Object, {
'to': this._attributes['expirationDate']
};
},
'isExpired': function () {
return this._attributes['isExpired'];
},
//=========================================================================
__syntaxFix__: "syntax fix"