Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js index e675525..d6202ff 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js | |||
@@ -1,120 +1,117 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer 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 | ||
29 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.PM.DataModel.User.Header.Legacy depends on Clipperz.PM.DataModel.User!"; | 27 | throw "Clipperz.PM.DataModel.User.Header.Legacy depends on Clipperz.PM.DataModel.User!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } | 30 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } |
34 | 31 | ||
35 | Clipperz.PM.DataModel.User.Header.Legacy = function(args) { | 32 | Clipperz.PM.DataModel.User.Header.Legacy = function(args) { |
36 | //args = args || {}; | 33 | //args = args || {}; |
37 | Clipperz.PM.DataModel.User.Header.Legacy.superclass.constructor.apply(this, arguments); | 34 | Clipperz.PM.DataModel.User.Header.Legacy.superclass.constructor.apply(this, arguments); |
38 | 35 | ||
39 | this._retrieveRecordDetailFunction = args.retrieveRecordDetailFunction|| Clipperz.Base.exception.raise('MandatoryParameter'); | 36 | this._retrieveRecordDetailFunction = args.retrieveRecordDetailFunction|| Clipperz.Base.exception.raise('MandatoryParameter'); |
40 | this._records = null; | 37 | this._records = null; |
41 | //this._directLogins = null; | 38 | //this._directLogins = null; |
42 | 39 | ||
43 | return this; | 40 | return this; |
44 | } | 41 | } |
45 | 42 | ||
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.Legacy, Clipperz.PM.DataModel.EncryptedRemoteObject, { | 44 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.Legacy, Clipperz.PM.DataModel.EncryptedRemoteObject, { |
48 | 45 | ||
49 | 'toString': function() { | 46 | 'toString': function() { |
50 | return "Clipperz.PM.DataModel.User.Header.Legacy"; | 47 | return "Clipperz.PM.DataModel.User.Header.Legacy"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'retrieveRecordDetailFunction': function () { | 52 | 'retrieveRecordDetailFunction': function () { |
56 | return this._retrieveRecordDetailFunction; | 53 | return this._retrieveRecordDetailFunction; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'getRecordKey': function (aRecordReference) { | 58 | 'getRecordKey': function (aRecordReference) { |
62 | var deferredResult; | 59 | var deferredResult; |
63 | 60 | ||
64 | deferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.getRecordKey", {trace:false}); | 61 | deferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.getRecordKey", {trace:false}); |
65 | deferredResult.addMethod(this, 'getRecordIndexData'); | 62 | deferredResult.addMethod(this, 'getRecordIndexData'); |
66 | deferredResult.addCallback(MochiKit.Base.itemgetter('key')) | 63 | deferredResult.addCallback(MochiKit.Base.itemgetter('key')) |
67 | deferredResult.callback(); | 64 | deferredResult.callback(); |
68 | 65 | ||
69 | return deferredResult; | 66 | return deferredResult; |
70 | }, | 67 | }, |
71 | 68 | ||
72 | //========================================================================= | 69 | //========================================================================= |
73 | 70 | ||
74 | 'getRecordIndexData': function (aRecordReference) { | 71 | 'getRecordIndexData': function (aRecordReference) { |
75 | return this.getValue('records.' + aRecordReference); | 72 | return this.getValue('records.' + aRecordReference); |
76 | }, | 73 | }, |
77 | 74 | ||
78 | 'updateRecordIndexData': function (aRecordReference, aKey, aValue) { | 75 | 'updateRecordIndexData': function (aRecordReference, aKey, aValue) { |
79 | return this.setValue('records.' + aRecordReference + "." + aKey, aValue); | 76 | return this.setValue('records.' + aRecordReference + "." + aKey, aValue); |
80 | }, | 77 | }, |
81 | 78 | ||
82 | //------------------------------------------------------------------------- | 79 | //------------------------------------------------------------------------- |
83 | 80 | ||
84 | 'getDirectLoginIndexData': function (aDirectLoginReference) { | 81 | 'getDirectLoginIndexData': function (aDirectLoginReference) { |
85 | return this.getValue('directLogins.' + aDirectLoginReference); | 82 | return this.getValue('directLogins.' + aDirectLoginReference); |
86 | }, | 83 | }, |
87 | 84 | ||
88 | 'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) { | 85 | 'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) { |
89 | return this.setValue('directLogins.' + aDirectLoginReference + '.' + aKey, aValue); | 86 | return this.setValue('directLogins.' + aDirectLoginReference + '.' + aKey, aValue); |
90 | }, | 87 | }, |
91 | 88 | ||
92 | 'removeDirectLoginIndexData': function (aDirectLoginReference) { | 89 | 'removeDirectLoginIndexData': function (aDirectLoginReference) { |
93 | return this.removeValue('directLogins.' + aDirectLoginReference); | 90 | return this.removeValue('directLogins.' + aDirectLoginReference); |
94 | }, | 91 | }, |
95 | 92 | ||
96 | //========================================================================= | 93 | //========================================================================= |
97 | 94 | ||
98 | 'records': function () { | 95 | 'records': function () { |
99 | vardeferredResult; | 96 | vardeferredResult; |
100 | var deferredLock; | 97 | var deferredLock; |
101 | 98 | ||
102 | deferredLock = this.getDeferredLockForKey('records'); | 99 | deferredLock = this.getDeferredLockForKey('records'); |
103 | 100 | ||
104 | deferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.records", {trace:false}); | 101 | deferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.records", {trace:false}); |
105 | deferredResult.acquireLock(deferredLock); | 102 | deferredResult.acquireLock(deferredLock); |
106 | deferredResult.addCallback(MochiKit.Base.bind(function () { | 103 | deferredResult.addCallback(MochiKit.Base.bind(function () { |
107 | var innerDeferredResult; | 104 | var innerDeferredResult; |
108 | 105 | ||
109 | if (this._records == null) { | 106 | if (this._records == null) { |
110 | innerDeferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.records <inner deferred>", {trace:false}); | 107 | innerDeferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.records <inner deferred>", {trace:false}); |
111 | innerDeferredResult.collectResults({ | 108 | innerDeferredResult.collectResults({ |
112 | 'header': [ | 109 | 'header': [ |
113 | // MochiKit.Base.method(this, 'getObjectDataStore'), | 110 | // MochiKit.Base.method(this, 'getObjectDataStore'), |
114 | // MochiKit.Base.methodcaller('values') | 111 | // MochiKit.Base.methodcaller('values') |
115 | MochiKit.Base.method(this, 'values') | 112 | MochiKit.Base.method(this, 'values') |
116 | ], | 113 | ], |
117 | 'recordsStats': [ | 114 | 'recordsStats': [ |
118 | MochiKit.Base.method(this, 'getRemoteData'), | 115 | MochiKit.Base.method(this, 'getRemoteData'), |
119 | MochiKit.Base.itemgetter('recordsStats') | 116 | MochiKit.Base.itemgetter('recordsStats') |
120 | ] | 117 | ] |