summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/PM/DataModel
Unidiff
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/DataModel') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/DirectLogin.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/DirectLoginBinding.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/DirectLoginInput.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/Header.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/OneTimePassword.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/OneTimePasswordManager.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/Record.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/RecordField.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/Statistics.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/User.js15
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/UserPreferences.js15
13 files changed, 78 insertions, 117 deletions
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/DirectLogin.js b/frontend/beta/js/Clipperz/PM/DataModel/DirectLogin.js
index 3ebc208..aee5703 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/DirectLogin.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/DirectLogin.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.DirectLogin = function(args) { 33Clipperz.PM.DataModel.DirectLogin = function(args) {
37//MochiKit.Logging.logDebug(">>> new Clipperz.PM.DataModel.DirectLogin"); 34//MochiKit.Logging.logDebug(">>> new Clipperz.PM.DataModel.DirectLogin");
38//console.log(">>> new Clipperz.PM.DataModel.DirectLogin - args: %o", args); 35//console.log(">>> new Clipperz.PM.DataModel.DirectLogin - args: %o", args);
39//console.log("--- formData: %s", Clipperz.Base.serializeJSON(args.formData)); 36//console.log("--- formData: %s", Clipperz.Base.serializeJSON(args.formData));
40 args = args || {}; 37 args = args || {};
41 38
42//MochiKit.Logging.logDebug("--- new Clipperz.PM.DataModel.DirectLogin - args: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(args))); 39//MochiKit.Logging.logDebug("--- new Clipperz.PM.DataModel.DirectLogin - args: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(args)));
43 this._record = args.record || null; 40 this._record = args.record || null;
44 this._label = args.label || "unnamed record" 41 this._label = args.label || "unnamed record"
45 this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); 42 this._reference = args.reference || Clipperz.PM.Crypto.randomKey();
46 this._favicon = args.favicon || null; 43 this._favicon = args.favicon || null;
47 this._bookmarkletVersion = args.bookmarkletVersion || "0.1"; 44 this._bookmarkletVersion = args.bookmarkletVersion || "0.1";
48 45
49 this._directLoginInputs = null; 46 this._directLoginInputs = null;
50 47
51 this._formValues = args.formValues || {}; 48 this._formValues = args.formValues || {};
52 this.setFormData(args.formData || null); 49 this.setFormData(args.formData || null);
53//console.log("=== formData: %o", this.formData()); 50//console.log("=== formData: %o", this.formData());
54 51
55 if (args.legacyBindingData == null) { 52 if (args.legacyBindingData == null) {
56 this.setBindingData(args.bindingData || null); 53 this.setBindingData(args.bindingData || null);
57 } else { 54 } else {
58 this.setLegacyBindingData(args.legacyBindingData); 55 this.setLegacyBindingData(args.legacyBindingData);
59 } 56 }
60 57
61 this._fixedFavicon = null; 58 this._fixedFavicon = null;
62 59
63 //this._formValues = args.formValues || (this.hasValuesToSet() ? {} : null); 60 //this._formValues = args.formValues || (this.hasValuesToSet() ? {} : null);
64//MochiKit.Logging.logDebug("<<< new Clipperz.PM.DataModel.DirectLogin"); 61//MochiKit.Logging.logDebug("<<< new Clipperz.PM.DataModel.DirectLogin");
65 62
66 return this; 63 return this;
67} 64}
68 65
69Clipperz.PM.DataModel.DirectLogin.prototype = MochiKit.Base.update(null, { 66Clipperz.PM.DataModel.DirectLogin.prototype = MochiKit.Base.update(null, {
70 67
71 'remove': function() { 68 'remove': function() {
72 this.record().removeDirectLogin(this); 69 this.record().removeDirectLogin(this);
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginBinding.js b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginBinding.js
index 19aa9cb..7f09bff 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginBinding.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginBinding.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.DirectLoginBinding = function(aDirectLogin, aKey, args) { 33Clipperz.PM.DataModel.DirectLoginBinding = function(aDirectLogin, aKey, args) {
37//MochiKit.Logging.logDebug(">>> new DirectLoginBinding") 34//MochiKit.Logging.logDebug(">>> new DirectLoginBinding")
38 args = args || {}; 35 args = args || {};
39//MochiKit.Logging.logDebug("--- new DirectLoginBinding - args: " + Clipperz.Base.serializeJSON(args)); 36//MochiKit.Logging.logDebug("--- new DirectLoginBinding - args: " + Clipperz.Base.serializeJSON(args));
40 37
41 this._directLogin = aDirectLogin || args.directLogin || null; 38 this._directLogin = aDirectLogin || args.directLogin || null;
42 this._key = aKey; 39 this._key = aKey;
43 40
44 this._fieldKey = args.fieldKey || null; 41 this._fieldKey = args.fieldKey || null;
45 this._fieldName = args.fieldName || null; 42 this._fieldName = args.fieldName || null;
46//MochiKit.Logging.logDebug("<<< new DirectLoginBinding") 43//MochiKit.Logging.logDebug("<<< new DirectLoginBinding")
47 44
48 return this; 45 return this;
49} 46}
50 47
51Clipperz.PM.DataModel.DirectLoginBinding.prototype = MochiKit.Base.update(null, { 48Clipperz.PM.DataModel.DirectLoginBinding.prototype = MochiKit.Base.update(null, {
52 49
53 'directLogin': function() { 50 'directLogin': function() {
54 return this._directLogin; 51 return this._directLogin;
55 }, 52 },
56 53
57 //------------------------------------------------------------------------- 54 //-------------------------------------------------------------------------
58 55
59 'key': function() { 56 'key': function() {
60 return this._key; 57 return this._key;
61 }, 58 },
62 59
63 //------------------------------------------------------------------------- 60 //-------------------------------------------------------------------------
64 61
65 'fieldKey': function() { 62 'fieldKey': function() {
66//MochiKit.Logging.logDebug("=== Clipperz.PM.DataModel.DirectLoginBinding.fieldKey"); 63//MochiKit.Logging.logDebug("=== Clipperz.PM.DataModel.DirectLoginBinding.fieldKey");
67//MochiKit.Logging.logDebug("=== Clipperz.PM.DataModel.DirectLoginBinding.fieldKey - " + this._fieldKey); 64//MochiKit.Logging.logDebug("=== Clipperz.PM.DataModel.DirectLoginBinding.fieldKey - " + this._fieldKey);
68 return this._fieldKey; 65 return this._fieldKey;
69 }, 66 },
70 67
71 'setFieldKey': function(aValue) { 68 'setFieldKey': function(aValue) {
72 this._fieldKey = aValue; 69 this._fieldKey = aValue;
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginInput.js b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginInput.js
index 3302ed6..0e2b7ad 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginInput.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginInput.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33//############################################################################# 30//#############################################################################
34 31
35Clipperz.PM.DataModel.DirectLoginInput = function(aDirectLogin, args) { 32Clipperz.PM.DataModel.DirectLoginInput = function(aDirectLogin, args) {
36 args = args || {}; 33 args = args || {};
37 34
38//console.log(">>> new DirectLoginInput - args: %o" + args); 35//console.log(">>> new DirectLoginInput - args: %o" + args);
39 this._directLogin = aDirectLogin; 36 this._directLogin = aDirectLogin;
40 this._args = args; 37 this._args = args;
41 38
42 return this; 39 return this;
43} 40}
44 41
45Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, { 42Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, {
46 43
47 'directLogin': function() { 44 'directLogin': function() {
48 return this._directLogin; 45 return this._directLogin;
49 }, 46 },
50 47
51 //------------------------------------------------------------------------- 48 //-------------------------------------------------------------------------
52 49
53 'args': function() { 50 'args': function() {
54 return this._args; 51 return this._args;
55 }, 52 },
56 53
57 //------------------------------------------------------------------------- 54 //-------------------------------------------------------------------------
58 55
59 'name': function() { 56 'name': function() {
60 return this.args()['name']; 57 return this.args()['name'];
61 }, 58 },
62 59
63 //------------------------------------------------------------------------- 60 //-------------------------------------------------------------------------
64 61
65 'type': function() { 62 'type': function() {
66 var result; 63 var result;
67 64
68 result = this.args()['type']; 65 result = this.args()['type'];
69 66
70 if (result != null) { 67 if (result != null) {
71 result = result.toLowerCase(); 68 result = result.toLowerCase();
72 } 69 }
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js
index b067a21..2be7d58 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.DirectLoginReference = function(args) { 33Clipperz.PM.DataModel.DirectLoginReference = function(args) {
37 args = args || {}; 34 args = args || {};
38 35
39//MochiKit.Logging.logDebug(">>> new DirectLoginReference: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(args))); 36//MochiKit.Logging.logDebug(">>> new DirectLoginReference: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(args)));
40//MochiKit.Logging.logDebug(">>> new DirectLoginReference - record: " + args.record); 37//MochiKit.Logging.logDebug(">>> new DirectLoginReference - record: " + args.record);
41 this._user = args.user; 38 this._user = args.user;
42 39
43 if (args.directLogin != null) { 40 if (args.directLogin != null) {
44 this._reference = args.directLogin.reference(); 41 this._reference = args.directLogin.reference();
45 this._recordReference = args.directLogin.record().reference(); 42 this._recordReference = args.directLogin.record().reference();
46 this._label = args.directLogin.label(); 43 this._label = args.directLogin.label();
47 this._favicon = args.directLogin.favicon() || null; 44 this._favicon = args.directLogin.favicon() || null;
48 45
49 this._directLogin = args.directLogin; 46 this._directLogin = args.directLogin;
50 this._record = args.directLogin.record(); 47 this._record = args.directLogin.record();
51 } else { 48 } else {
52 this._reference = args.reference; 49 this._reference = args.reference;
53 this._recordReference = args.record; 50 this._recordReference = args.record;
54 this._label = args.label; 51 this._label = args.label;
55 this._favicon = args.favicon || null; 52 this._favicon = args.favicon || null;
56 53
57 this._directLogin = null; 54 this._directLogin = null;
58 this._record = null; 55 this._record = null;
59 } 56 }
60 57
61 this._fixedFavicon = null; 58 this._fixedFavicon = null;
62 59
63 return this; 60 return this;
64} 61}
65 62
66Clipperz.PM.DataModel.DirectLoginReference.prototype = MochiKit.Base.update(null, { 63Clipperz.PM.DataModel.DirectLoginReference.prototype = MochiKit.Base.update(null, {
67 64
68 'user': function() { 65 'user': function() {
69 return this._user; 66 return this._user;
70 }, 67 },
71 68
72 //------------------------------------------------------------------------- 69 //-------------------------------------------------------------------------
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/Header.js b/frontend/beta/js/Clipperz/PM/DataModel/Header.js
index ef34732..c780855 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/Header.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/Header.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.Header = function(args) { 33Clipperz.PM.DataModel.Header = function(args) {
37 args = args || {}; 34 args = args || {};
38 35
39 this._user = args.user; 36 this._user = args.user;
40 37
41 this._serverData = null; 38 this._serverData = null;
42 this._serverDataVersion = null; 39 this._serverDataVersion = null;
43 this._jsonEvaledServerData = null; 40 this._jsonEvaledServerData = null;
44 41
45 this._decryptedLegacyServerData = null; 42 this._decryptedLegacyServerData = null;
46 this._isDecryptingLegacyServerData = false; 43 this._isDecryptingLegacyServerData = false;
47 this._decryptingLegacyServerDataPendingQueue = []; 44 this._decryptingLegacyServerDataPendingQueue = [];
48 45
49 this.resetUpdatedSections(); 46 this.resetUpdatedSections();
50 47
51 this._shouldLoadSections = {}; 48 this._shouldLoadSections = {};
52 49
53 Clipperz.NotificationCenter.register(this.user(), 'updatedSection', this, 'updatedSectionHandler'); 50 Clipperz.NotificationCenter.register(this.user(), 'updatedSection', this, 'updatedSectionHandler');
54 51
55 return this; 52 return this;
56} 53}
57 54
58Clipperz.PM.DataModel.Header.prototype = MochiKit.Base.update(null, { 55Clipperz.PM.DataModel.Header.prototype = MochiKit.Base.update(null, {
59 56
60 //------------------------------------------------------------------------- 57 //-------------------------------------------------------------------------
61 58
62 'user': function() { 59 'user': function() {
63 return this._user; 60 return this._user;
64 }, 61 },
65 62
66 //------------------------------------------------------------------------- 63 //-------------------------------------------------------------------------
67 //------------------------------------------------------------------------- 64 //-------------------------------------------------------------------------
68 //------------------------------------------------------------------------- 65 //-------------------------------------------------------------------------
69 //------------------------------------------------------------------------- 66 //-------------------------------------------------------------------------
70 //------------------------------------------------------------------------- 67 //-------------------------------------------------------------------------
71 //------------------------------------------------------------------------- 68 //-------------------------------------------------------------------------
72 //------------------------------------------------------------------------- 69 //-------------------------------------------------------------------------
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/OneTimePassword.js b/frontend/beta/js/Clipperz/PM/DataModel/OneTimePassword.js
index dd8d5c9..88f383a 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/OneTimePassword.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/OneTimePassword.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.OneTimePassword = function(args) { 33Clipperz.PM.DataModel.OneTimePassword = function(args) {
37 args = args || {}; 34 args = args || {};
38 35
39//console.log("new OneTimePassword", args); 36//console.log("new OneTimePassword", args);
40//MochiKit.Logging.logDebug("---"); 37//MochiKit.Logging.logDebug("---");
41 this._user = args['user']; 38 this._user = args['user'];
42 this._password = args['password']; 39 this._password = args['password'];
43 this._passwordValue = Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword(args['password']); 40 this._passwordValue = Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword(args['password']);
44 this._reference = args['reference'] || Clipperz.PM.Crypto.randomKey(); 41 this._reference = args['reference'] || Clipperz.PM.Crypto.randomKey();
45 this._creationDate = args['created'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['created']) : new Date(); 42 this._creationDate = args['created'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['created']) : new Date();
46 this._usageDate = args['used'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['used']) : null; 43 this._usageDate = args['used'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['used']) : null;
47 44
48 this._status = args['status'] || 'ACTIVE'; 45 this._status = args['status'] || 'ACTIVE';
49 this._connectionInfo = null; 46 this._connectionInfo = null;
50 47
51 this._key = null; 48 this._key = null;
52 this._keyChecksum = null; 49 this._keyChecksum = null;
53 50
54 return this; 51 return this;
55} 52}
56 53
57Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, { 54Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, {
58 55
59 'toString': function() { 56 'toString': function() {
60 return "Clipperz.PM.DataModel.OneTimePassword"; 57 return "Clipperz.PM.DataModel.OneTimePassword";
61 }, 58 },
62 59
63 //------------------------------------------------------------------------- 60 //-------------------------------------------------------------------------
64 61
65 'user': function() { 62 'user': function() {
66 return this._user; 63 return this._user;
67 }, 64 },
68 65
69 //------------------------------------------------------------------------- 66 //-------------------------------------------------------------------------
70 67
71 'password': function() { 68 'password': function() {
72 return this._password; 69 return this._password;
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/OneTimePasswordManager.js b/frontend/beta/js/Clipperz/PM/DataModel/OneTimePasswordManager.js
index d90100a..aa40aba 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/OneTimePasswordManager.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/OneTimePasswordManager.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.OneTimePasswordManager = function(anUser, args) { 33Clipperz.PM.DataModel.OneTimePasswordManager = function(anUser, args) {
37 args = args || {}; 34 args = args || {};
38 35
39 this._user = anUser; 36 this._user = anUser;
40 this._oneTimePasswords = {}; 37 this._oneTimePasswords = {};
41 38
42 this.updateWithData(args); 39 this.updateWithData(args);
43 40
44 Clipperz.NotificationCenter.notify(null, 'oneTimePasswordAdded', null, true); 41 Clipperz.NotificationCenter.notify(null, 'oneTimePasswordAdded', null, true);
45 42
46 return this; 43 return this;
47} 44}
48 45
49Clipperz.PM.DataModel.OneTimePasswordManager.prototype = MochiKit.Base.update(null, { 46Clipperz.PM.DataModel.OneTimePasswordManager.prototype = MochiKit.Base.update(null, {
50 47
51 'toString': function() { 48 'toString': function() {
52 return "Clipperz.PM.DataModel.OneTimePasswordManager"; 49 return "Clipperz.PM.DataModel.OneTimePasswordManager";
53 }, 50 },
54 51
55 //------------------------------------------------------------------------- 52 //-------------------------------------------------------------------------
56 53
57 'updateWithData': function(someValues) { 54 'updateWithData': function(someValues) {
58 varotpReference; 55 varotpReference;
59 56
60//console.log("OneTimePasswordManager.updateWithData", someValues); 57//console.log("OneTimePasswordManager.updateWithData", someValues);
61//MochiKit.Logging.logDebug("OneTimePasswordManager.updateWithData: " + Clipperz.Base.serializeJSON(someValues)); 58//MochiKit.Logging.logDebug("OneTimePasswordManager.updateWithData: " + Clipperz.Base.serializeJSON(someValues));
62 for (otpReference in someValues) { 59 for (otpReference in someValues) {
63 var otp; 60 var otp;
64 var otpConfiguration; 61 var otpConfiguration;
65 62
66 otpConfiguration = someValues[otpReference]; 63 otpConfiguration = someValues[otpReference];
67 otpConfiguration['user'] = this.user(); 64 otpConfiguration['user'] = this.user();
68 otpConfiguration['reference'] = otpReference; 65 otpConfiguration['reference'] = otpReference;
69 otp = new Clipperz.PM.DataModel.OneTimePassword(otpConfiguration); 66 otp = new Clipperz.PM.DataModel.OneTimePassword(otpConfiguration);
70 this._oneTimePasswords[otpReference] = otp; 67 this._oneTimePasswords[otpReference] = otp;
71 } 68 }
72 69
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/Record.js b/frontend/beta/js/Clipperz/PM/DataModel/Record.js
index b4b5023..270f2ae 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/Record.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/Record.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.Record = function(args) { 33Clipperz.PM.DataModel.Record = function(args) {
37 args = args || {}; 34 args = args || {};
38 35
39 this._user = args['user'] || null; 36 this._user = args['user'] || null;
40 this._reference = args['reference'] || Clipperz.PM.Crypto.randomKey(); 37 this._reference = args['reference'] || Clipperz.PM.Crypto.randomKey();
41 this._version = args['version'] || Clipperz.PM.Crypto.encryptingFunctions.currentVersion; 38 this._version = args['version'] || Clipperz.PM.Crypto.encryptingFunctions.currentVersion;
42 this._key = args['key'] || Clipperz.PM.Crypto.randomKey(); 39 this._key = args['key'] || Clipperz.PM.Crypto.randomKey();
43 40
44 this.setLabel(args['label'] || Clipperz.PM.Strings['newRecordTitleLabel']); 41 this.setLabel(args['label'] || Clipperz.PM.Strings['newRecordTitleLabel']);
45 42
46 this.setHeaderNotes(args['headerNotes'] || null); 43 this.setHeaderNotes(args['headerNotes'] || null);
47 this.setNotes(args['notes'] || args['headerNotes'] || ""); 44 this.setNotes(args['notes'] || args['headerNotes'] || "");
48//MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _headerNotes: '" + this._headerNotes + "'"); 45//MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _headerNotes: '" + this._headerNotes + "'");
49//MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _notes: '" + this._notes + "'"); 46//MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _notes: '" + this._notes + "'");
50 //this._notes = args.notes || ""; 47 //this._notes = args.notes || "";
51 48
52 this._versions = {}; 49 this._versions = {};
53 this._directLogins = {}; 50 this._directLogins = {};
54 this._removedDirectLogins = []; 51 this._removedDirectLogins = [];
55 52
56 this.setIsBrandNew(args['reference'] == null); 53 this.setIsBrandNew(args['reference'] == null);
57 54
58 this.setShouldLoadData(this.isBrandNew() ? false: true); 55 this.setShouldLoadData(this.isBrandNew() ? false: true);
59 this.setShouldDecryptData(this.isBrandNew() ? false: true); 56 this.setShouldDecryptData(this.isBrandNew() ? false: true);
60 this.setShouldProcessData(this.isBrandNew() ? false: true); 57 this.setShouldProcessData(this.isBrandNew() ? false: true);
61 58
62 this.setCurrentVersion(this.isBrandNew() ? new Clipperz.PM.DataModel.RecordVersion(this, null): null); 59 this.setCurrentVersion(this.isBrandNew() ? new Clipperz.PM.DataModel.RecordVersion(this, null): null);
63 this.setCurrentVersionKey(null); 60 this.setCurrentVersionKey(null);
64 61
65 this._serverData = null; 62 this._serverData = null;
66 this._decryptedData = null; 63 this._decryptedData = null;
67 this._cachedData = null; 64 this._cachedData = null;
68 65
69 return this; 66 return this;
70} 67}
71 68
72Clipperz.PM.DataModel.Record.prototype = MochiKit.Base.update(null, { 69Clipperz.PM.DataModel.Record.prototype = MochiKit.Base.update(null, {
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/RecordField.js b/frontend/beta/js/Clipperz/PM/DataModel/RecordField.js
index 2063825..bca664d 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/RecordField.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/RecordField.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33//############################################################################# 30//#############################################################################
34 31
35Clipperz.PM.DataModel.RecordField = function(args) { 32Clipperz.PM.DataModel.RecordField = function(args) {
36 args = args || {}; 33 args = args || {};
37 34
38 this._recordVersion = args.recordVersion || null; 35 this._recordVersion = args.recordVersion || null;
39 this._key = args.key || Clipperz.PM.Crypto.randomKey(); 36 this._key = args.key || Clipperz.PM.Crypto.randomKey();
40 this.setLabel(args.label || ''); 37 this.setLabel(args.label || '');
41 this.setValue(args.value || ''); 38 this.setValue(args.value || '');
42 this.setType(args.type || 'TXT'); //valid types: 'TXT', 'PWD', 'URL', 'DATE', 'ADDR', 'CHECK', 'RADIO', ('NOTE' probably not), ... 39 this.setType(args.type || 'TXT'); //valid types: 'TXT', 'PWD', 'URL', 'DATE', 'ADDR', 'CHECK', 'RADIO', ('NOTE' probably not), ...
43 this._hidden = args.hidden || (args.type == 'PWD') || false; 40 this._hidden = args.hidden || (args.type == 'PWD') || false;
44 41
45 return this; 42 return this;
46} 43}
47 44
48Clipperz.PM.DataModel.RecordField.prototype = MochiKit.Base.update(null, { 45Clipperz.PM.DataModel.RecordField.prototype = MochiKit.Base.update(null, {
49 46
50 'toString': function() { 47 'toString': function() {
51 return "Clipperz.PM.DataModel.RecordField - " + this.label() + " (" + this.key() + ")"; 48 return "Clipperz.PM.DataModel.RecordField - " + this.label() + " (" + this.key() + ")";
52 }, 49 },
53 50
54 //------------------------------------------------------------------------- 51 //-------------------------------------------------------------------------
55 52
56 'recordVersion': function() { 53 'recordVersion': function() {
57 return this._recordVersion; 54 return this._recordVersion;
58 }, 55 },
59 56
60 //------------------------------------------------------------------------- 57 //-------------------------------------------------------------------------
61 58
62 'key': function() { 59 'key': function() {
63 return this._key; 60 return this._key;
64 }, 61 },
65 62
66 //------------------------------------------------------------------------- 63 //-------------------------------------------------------------------------
67 64
68 'label': function() { 65 'label': function() {
69 return this._label; 66 return this._label;
70 }, 67 },
71 68
72 'setLabel': function(aValue) { 69 'setLabel': function(aValue) {
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js b/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js
index d2b3e12..fc4a45c 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.RecordVersion = function(aRecord, args) { 33Clipperz.PM.DataModel.RecordVersion = function(aRecord, args) {
37 args = args || {}; 34 args = args || {};
38 35
39 this._record = aRecord; 36 this._record = aRecord;
40 37
41 this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); 38 this._reference = args.reference || Clipperz.PM.Crypto.randomKey();
42 this._version = args.version || Clipperz.PM.Crypto.encryptingFunctions.currentVersion; 39 this._version = args.version || Clipperz.PM.Crypto.encryptingFunctions.currentVersion;
43 this._key = args.key || Clipperz.PM.Crypto.randomKey();; 40 this._key = args.key || Clipperz.PM.Crypto.randomKey();;
44 41
45 this._previousVersion = args.previousVersion || null; 42 this._previousVersion = args.previousVersion || null;
46 this._previousVersionKey = args.previousVersionKey || null; 43 this._previousVersionKey = args.previousVersionKey || null;
47 44
48 this.setIsBrandNew(args.reference == null); 45 this.setIsBrandNew(args.reference == null);
49 46
50 if (this.isBrandNew()) { 47 if (this.isBrandNew()) {
51 this._fields = {}; 48 this._fields = {};
52 49
53 this.setShouldLoadData(false); 50 this.setShouldLoadData(false);
54 this.setShouldDecryptData(false); 51 this.setShouldDecryptData(false);
55 this.setShouldProcessData(false); 52 this.setShouldProcessData(false);
56 } else { 53 } else {
57 if (typeof(args.fields) != 'undefined') { 54 if (typeof(args.fields) != 'undefined') {
58 this.processFieldData(args.fields); 55 this.processFieldData(args.fields);
59 56
60 this.setShouldLoadData(false); 57 this.setShouldLoadData(false);
61 this.setShouldDecryptData(false); 58 this.setShouldDecryptData(false);
62 this.setShouldProcessData(false); 59 this.setShouldProcessData(false);
63 } else { 60 } else {
64 if (typeof(args.data) != 'undefined') { 61 if (typeof(args.data) != 'undefined') {
65 this.setShouldLoadData(false); 62 this.setShouldLoadData(false);
66 } else { 63 } else {
67 this.setShouldLoadData(true); 64 this.setShouldLoadData(true);
68 } 65 }
69 this.setShouldDecryptData(true); 66 this.setShouldDecryptData(true);
70 this.setShouldProcessData(true); 67 this.setShouldProcessData(true);
71 } 68 }
72 } 69 }
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/Statistics.js b/frontend/beta/js/Clipperz/PM/DataModel/Statistics.js
index fb5eb01..3d53adf 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/Statistics.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/Statistics.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.Statistics = function(args) { 33Clipperz.PM.DataModel.Statistics = function(args) {
37 args = args || {}; 34 args = args || {};
38 35
39 this._user = args.user; 36 this._user = args.user;
40 this._data = args.data || null; 37 this._data = args.data || null;
41 38
42 return this; 39 return this;
43} 40}
44 41
45Clipperz.PM.DataModel.Statistics.prototype = MochiKit.Base.update(null, { 42Clipperz.PM.DataModel.Statistics.prototype = MochiKit.Base.update(null, {
46 43
47 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
48 45
49 'decrypt': function(aVersion, someEncryptedData) { 46 'decrypt': function(aVersion, someEncryptedData) {
50 var deferredResult; 47 var deferredResult;
51 48
52//MochiKit.Logging.logDebug(">>> Statistics.decrypt"); 49//MochiKit.Logging.logDebug(">>> Statistics.decrypt");
53 if (someEncryptedData == Clipperz.PM.Crypto.nullValue) { 50 if (someEncryptedData == Clipperz.PM.Crypto.nullValue) {
54 this.setData({}); 51 this.setData({});
55 deferredResult = MochiKit.Async.succeed(this.data()); 52 deferredResult = MochiKit.Async.succeed(this.data());
56 } else { 53 } else {
57 varstatistic; 54 varstatistic;
58 var user; 55 var user;
59 56
60 statistic = this; 57 statistic = this;
61 user = this.user(); 58 user = this.user();
62 deferredResult = new MochiKit.Async.Deferred(); 59 deferredResult = new MochiKit.Async.Deferred();
63//deferredResult.addCallback(function() { console.time("Statistics.decrypt.deferredDecrypt")}); 60//deferredResult.addCallback(function() { console.time("Statistics.decrypt.deferredDecrypt")});
64 deferredResult.addCallback(Clipperz.PM.Crypto.deferredDecrypt, user.passphrase(), someEncryptedData, aVersion); 61 deferredResult.addCallback(Clipperz.PM.Crypto.deferredDecrypt, user.passphrase(), someEncryptedData, aVersion);
65//deferredResult.addCallback(function() { console.timeEnd("Statistics.decrypt.deferredDecrypt")}); 62//deferredResult.addCallback(function() { console.timeEnd("Statistics.decrypt.deferredDecrypt")});
66//deferredResult.addCallback(function() { console.time("Statistics.decrypt.setup")}); 63//deferredResult.addCallback(function() { console.time("Statistics.decrypt.setup")});
67 deferredResult.addCallbacks( 64 deferredResult.addCallbacks(
68 MochiKit.Base.partial(function (aStatistic, someData) { 65 MochiKit.Base.partial(function (aStatistic, someData) {
69 aStatistic.setData(someData); 66 aStatistic.setData(someData);
70 return aStatistic.data(); 67 return aStatistic.data();
71 }, statistic), 68 }, statistic),
72 MochiKit.Base.partial(function (aStatistic) { 69 MochiKit.Base.partial(function (aStatistic) {
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/User.js b/frontend/beta/js/Clipperz/PM/DataModel/User.js
index 5aaaff7..dbbe9a0 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/User.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/User.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.User = function(args) { 33Clipperz.PM.DataModel.User = function(args) {
37//MochiKit.Logging.logDebug(">>> new User"); 34//MochiKit.Logging.logDebug(">>> new User");
38 args = args || {}; 35 args = args || {};
39 36
40 this._username = args.username || null; 37 this._username = args.username || null;
41 this._passphrase = args.passphrase || null; 38 this._passphrase = args.passphrase || null;
42 39
43 this._connection = null; 40 this._connection = null;
44 this._connectionVersion = 'current'; 41 this._connectionVersion = 'current';
45 42
46 this._header = null; 43 this._header = null;
47 this._statistics = null; 44 this._statistics = null;
48 this._lock = 'new lock'; 45 this._lock = 'new lock';
49 46
50 this._preferences = null; 47 this._preferences = null;
51 this._records = {}; 48 this._records = {};
52 this._directLoginReferences = {}; 49 this._directLoginReferences = {};
53 this._oneTimePasswordManager = null; 50 this._oneTimePasswordManager = null;
54 51
55 this._isLoadingUserDetails = false; 52 this._isLoadingUserDetails = false;
56 this._loadingUserDetailsPendingQueue = []; 53 this._loadingUserDetailsPendingQueue = [];
57 54
58 this._maxNumberOfRecords = Number.MAX_VALUE; 55 this._maxNumberOfRecords = Number.MAX_VALUE;
59 56
60 this._shouldDownloadOfflineCopy = false; 57 this._shouldDownloadOfflineCopy = false;
61 58
62 this._loginInfo = null; 59 this._loginInfo = null;
63 this._loginHistory = null; 60 this._loginHistory = null;
64 61
65 this._serverData = null; 62 this._serverData = null;
66//MochiKit.Logging.logDebug("<<< new User"); 63//MochiKit.Logging.logDebug("<<< new User");
67 64
68 return this; 65 return this;
69} 66}
70 67
71Clipperz.PM.DataModel.User.prototype = MochiKit.Base.update(null, { 68Clipperz.PM.DataModel.User.prototype = MochiKit.Base.update(null, {
72 69
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/UserPreferences.js b/frontend/beta/js/Clipperz/PM/DataModel/UserPreferences.js
index dc73ce1..9e80b3a 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/UserPreferences.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/UserPreferences.js
@@ -1,72 +1,69 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 29
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.DataModel.UserPreferences = function(args) { 33Clipperz.PM.DataModel.UserPreferences = function(args) {
37 args = args || {}; 34 args = args || {};
38 35
39 this._user = args['user']; delete args['user']; 36 this._user = args['user']; delete args['user'];
40 this._config = args; 37 this._config = args;
41 38
42 return this; 39 return this;
43} 40}
44 41
45Clipperz.PM.DataModel.UserPreferences.prototype = MochiKit.Base.update(null, { 42Clipperz.PM.DataModel.UserPreferences.prototype = MochiKit.Base.update(null, {
46 43
47 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
48 45
49 'config': function() { 46 'config': function() {
50 return this._config; 47 return this._config;
51 }, 48 },
52 49
53 //------------------------------------------------------------------------- 50 //-------------------------------------------------------------------------
54 51
55 'user': function() { 52 'user': function() {
56 return this._user; 53 return this._user;
57 }, 54 },
58 55
59 //------------------------------------------------------------------------- 56 //-------------------------------------------------------------------------
60 57
61 'updateWithData': function(someValues) { 58 'updateWithData': function(someValues) {
62 var currentLanguage; 59 var currentLanguage;
63 60
64//MochiKit.Logging.logDebug(">>> Clipperz.PM.DataModel.UserPreferences.updateWithData: " + Clipperz.Base.serializeJSON(someValues)); 61//MochiKit.Logging.logDebug(">>> Clipperz.PM.DataModel.UserPreferences.updateWithData: " + Clipperz.Base.serializeJSON(someValues));
65 currentLanguage = this.preferredLanguage(); 62 currentLanguage = this.preferredLanguage();
66 63
67 MochiKit.Base.update(this._config, someValues); 64 MochiKit.Base.update(this._config, someValues);
68 65
69 if (this.preferredLanguage() != currentLanguage) { 66 if (this.preferredLanguage() != currentLanguage) {
70 Clipperz.PM.Strings.Languages.setSelectedLanguage(this.preferredLanguage()); 67 Clipperz.PM.Strings.Languages.setSelectedLanguage(this.preferredLanguage());
71 } else { 68 } else {
72//MochiKit.Logging.logDebug("### keepping the browser selected language: " + Clipperz.PM.Strings.selectedLanguage); 69//MochiKit.Logging.logDebug("### keepping the browser selected language: " + Clipperz.PM.Strings.selectedLanguage);