summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js
Side-by-side diff
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js b/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js
index fc4a45c..69a7d91 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js
@@ -1,118 +1,116 @@
/*
-Copyright 2008-2011 Clipperz Srl
+Copyright 2008-2013 Clipperz Srl
-This file is part of Clipperz Community Edition.
-Clipperz Community Edition is an online password manager.
+This file is part of Clipperz, the online password manager.
For further information about its features and functionalities please
refer to http://www.clipperz.com.
-* Clipperz Community Edition is free software: you can redistribute
- it and/or modify it under the terms of the GNU Affero General Public
- License as published by the Free Software Foundation, either version
- 3 of the License, or (at your option) any later version.
+* Clipperz is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
-* Clipperz Community Edition is distributed in the hope that it will
- be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* Clipperz is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public
- License along with Clipperz Community Edition. If not, see
- <http://www.gnu.org/licenses/>.
+ License along with Clipperz. If not, see http://www.gnu.org/licenses/.
*/
if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
//#############################################################################
Clipperz.PM.DataModel.RecordVersion = function(aRecord, args) {
args = args || {};
this._record = aRecord;
this._reference = args.reference || Clipperz.PM.Crypto.randomKey();
this._version = args.version || Clipperz.PM.Crypto.encryptingFunctions.currentVersion;
this._key = args.key || Clipperz.PM.Crypto.randomKey();;
this._previousVersion = args.previousVersion || null;
this._previousVersionKey = args.previousVersionKey || null;
this.setIsBrandNew(args.reference == null);
if (this.isBrandNew()) {
this._fields = {};
this.setShouldLoadData(false);
this.setShouldDecryptData(false);
this.setShouldProcessData(false);
} else {
if (typeof(args.fields) != 'undefined') {
this.processFieldData(args.fields);
this.setShouldLoadData(false);
this.setShouldDecryptData(false);
this.setShouldProcessData(false);
} else {
if (typeof(args.data) != 'undefined') {
this.setShouldLoadData(false);
} else {
this.setShouldLoadData(true);
}
this.setShouldDecryptData(true);
this.setShouldProcessData(true);
}
}
this._serverData = args.data;
this._decryptedData = null;
return this;
}
Clipperz.PM.DataModel.RecordVersion.prototype = MochiKit.Base.update(null, {
'toString': function() {
return "RecordVersion";
},
//-------------------------------------------------------------------------
'record': function() {
return this._record;
},
//-------------------------------------------------------------------------
'reference': function() {
return this._reference;
},
'setReference': function(aValue) {
this._reference = aValue;
},
//-------------------------------------------------------------------------
'key': function() {
//MochiKit.Logging.logDebug(">>> RecordVersion.key");
//MochiKit.Logging.logDebug("--- RecordVersion.key - " + this._key);
return this._key;
},
'setKey': function(aValue) {
this._key = aValue;
},
//-------------------------------------------------------------------------
'serverData': function() {
return this._serverData;
},
'setServerData': function(aValue) {
this._serverData = aValue;