author | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
commit | 07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (unidiff) | |
tree | f7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/beta/js/Clipperz/PM/DataModel/Record.js | |
parent | 767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff) | |
download | clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.zip clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.gz clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.bz2 |
Updated Copyright claims
- updated reference dates;
- removed reference to Community Edition;
- normalized logging using Clipperz.log[Warn|Error|Debug]
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/DataModel/Record.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/DataModel/Record.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/Record.js b/frontend/beta/js/Clipperz/PM/DataModel/Record.js index f89f79c..7b06f29 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/Record.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/Record.js | |||
@@ -1,118 +1,116 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.Record = function(args) { | 31 | Clipperz.PM.DataModel.Record = function(args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | this._user = args['user'] || null; | 34 | this._user = args['user'] || null; |
37 | this._reference = args['reference'] || Clipperz.PM.Crypto.randomKey(); | 35 | this._reference = args['reference'] || Clipperz.PM.Crypto.randomKey(); |
38 | this._version = args['version'] || Clipperz.PM.Crypto.encryptingFunctions.currentVersion; | 36 | this._version = args['version'] || Clipperz.PM.Crypto.encryptingFunctions.currentVersion; |
39 | this._key = args['key'] || Clipperz.PM.Crypto.randomKey(); | 37 | this._key = args['key'] || Clipperz.PM.Crypto.randomKey(); |
40 | 38 | ||
41 | this.setLabel(args['label'] || Clipperz.PM.Strings['newRecordTitleLabel']); | 39 | this.setLabel(args['label'] || Clipperz.PM.Strings['newRecordTitleLabel']); |
42 | 40 | ||
43 | this.setHeaderNotes(args['headerNotes'] || null); | 41 | this.setHeaderNotes(args['headerNotes'] || null); |
44 | this.setNotes(args['notes'] || args['headerNotes'] || ""); | 42 | this.setNotes(args['notes'] || args['headerNotes'] || ""); |
45 | //MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _headerNotes: '" + this._headerNotes + "'"); | 43 | //MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _headerNotes: '" + this._headerNotes + "'"); |
46 | //MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _notes: '" + this._notes + "'"); | 44 | //MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _notes: '" + this._notes + "'"); |
47 | //this._notes = args.notes || ""; | 45 | //this._notes = args.notes || ""; |
48 | 46 | ||
49 | this._versions = {}; | 47 | this._versions = {}; |
50 | this._directLogins = {}; | 48 | this._directLogins = {}; |
51 | this._removedDirectLogins = []; | 49 | this._removedDirectLogins = []; |
52 | 50 | ||
53 | this.setIsBrandNew(args['reference'] == null); | 51 | this.setIsBrandNew(args['reference'] == null); |
54 | 52 | ||
55 | this.setShouldLoadData(this.isBrandNew() ? false: true); | 53 | this.setShouldLoadData(this.isBrandNew() ? false: true); |
56 | this.setShouldDecryptData(this.isBrandNew() ? false: true); | 54 | this.setShouldDecryptData(this.isBrandNew() ? false: true); |
57 | this.setShouldProcessData(this.isBrandNew() ? false: true); | 55 | this.setShouldProcessData(this.isBrandNew() ? false: true); |
58 | 56 | ||
59 | this.setCurrentVersion(this.isBrandNew() ? new Clipperz.PM.DataModel.RecordVersion(this, null): null); | 57 | this.setCurrentVersion(this.isBrandNew() ? new Clipperz.PM.DataModel.RecordVersion(this, null): null); |
60 | this.setCurrentVersionKey(null); | 58 | this.setCurrentVersionKey(null); |
61 | 59 | ||
62 | this._serverData = null; | 60 | this._serverData = null; |
63 | this._decryptedData = null; | 61 | this._decryptedData = null; |
64 | this._cachedData = null; | 62 | this._cachedData = null; |
65 | 63 | ||
66 | return this; | 64 | return this; |
67 | } | 65 | } |
68 | 66 | ||
69 | Clipperz.PM.DataModel.Record.prototype = MochiKit.Base.update(null, { | 67 | Clipperz.PM.DataModel.Record.prototype = MochiKit.Base.update(null, { |
70 | 68 | ||
71 | 'toString': function() { | 69 | 'toString': function() { |
72 | return "Record (" + this.label() + ")"; | 70 | return "Record (" + this.label() + ")"; |
73 | }, | 71 | }, |
74 | 72 | ||
75 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
76 | 74 | ||
77 | 'isBrandNew': function() { | 75 | 'isBrandNew': function() { |
78 | return this._isBrandNew; | 76 | return this._isBrandNew; |
79 | }, | 77 | }, |
80 | 78 | ||
81 | 'setIsBrandNew': function(aValue) { | 79 | 'setIsBrandNew': function(aValue) { |
82 | this._isBrandNew = aValue; | 80 | this._isBrandNew = aValue; |
83 | }, | 81 | }, |
84 | 82 | ||
85 | //------------------------------------------------------------------------- | 83 | //------------------------------------------------------------------------- |
86 | /* | 84 | /* |
87 | 'shouldRunTheRecordCreationWizard': function() { | 85 | 'shouldRunTheRecordCreationWizard': function() { |
88 | return (this.isBrandNew() && (MochiKit.Base.keys(this.currentVersion().fields()).length == 0)); | 86 | return (this.isBrandNew() && (MochiKit.Base.keys(this.currentVersion().fields()).length == 0)); |
89 | }, | 87 | }, |
90 | */ | 88 | */ |
91 | //------------------------------------------------------------------------- | 89 | //------------------------------------------------------------------------- |
92 | 90 | ||
93 | 'user': function() { | 91 | 'user': function() { |
94 | return this._user; | 92 | return this._user; |
95 | }, | 93 | }, |
96 | 94 | ||
97 | //------------------------------------------------------------------------- | 95 | //------------------------------------------------------------------------- |
98 | 96 | ||
99 | 'reference': function() { | 97 | 'reference': function() { |
100 | return this._reference; | 98 | return this._reference; |
101 | }, | 99 | }, |
102 | 100 | ||
103 | //------------------------------------------------------------------------- | 101 | //------------------------------------------------------------------------- |
104 | 102 | ||
105 | 'key': function() { | 103 | 'key': function() { |
106 | return this._key; | 104 | return this._key; |
107 | }, | 105 | }, |
108 | 106 | ||
109 | 'updateKey': function() { | 107 | 'updateKey': function() { |
110 | this._key = Clipperz.PM.Crypto.randomKey(); | 108 | this._key = Clipperz.PM.Crypto.randomKey(); |
111 | }, | 109 | }, |
112 | 110 | ||
113 | //------------------------------------------------------------------------- | 111 | //------------------------------------------------------------------------- |
114 | 112 | ||
115 | 'label': function() { | 113 | 'label': function() { |
116 | return this._label; | 114 | return this._label; |
117 | }, | 115 | }, |
118 | 116 | ||