summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/DataModel/Record.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/DataModel/Record.js') (more/less context) (show whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/Record.js44
1 files changed, 10 insertions, 34 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/Record.js b/frontend/gamma/js/Clipperz/PM/DataModel/Record.js
index b816f80..3fc1813 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/Record.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/Record.js
@@ -1,24 +1,22 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer 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*/
@@ -30,5 +28,4 @@ if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {};
30 28
31Clipperz.PM.DataModel.Record = function(args) { 29Clipperz.PM.DataModel.Record = function(args) {
32//console.log(">>> new Clipperz.PM.DataModel.Record", args);
33 Clipperz.PM.DataModel.Record.superclass.constructor.apply(this, arguments); 30 Clipperz.PM.DataModel.Record.superclass.constructor.apply(this, arguments);
34 31
@@ -63,6 +60,4 @@ Clipperz.PM.DataModel.Record = function(args) {
63 } 60 }
64 61
65//console.log("<<< new Clipperz.PM.DataModel.Record", args);
66
67 return this; 62 return this;
68} 63}
@@ -211,5 +206,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
211 var deferredResult; 206 var deferredResult;
212 207
213//console.log(">>> searchableContent");
214 deferredResult = new Clipperz.Async.Deferred("Record.searchableContent", {trace:false}); 208 deferredResult = new Clipperz.Async.Deferred("Record.searchableContent", {trace:false});
215 209
@@ -225,5 +219,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
225 }); 219 });
226 deferredResult.callback(); 220 deferredResult.callback();
227//console.log("<<< searchableContent");
228 221
229 return deferredResult; 222 return deferredResult;
@@ -271,5 +264,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
271 if (this.transientState().getValue('directLogins') == null) { 264 if (this.transientState().getValue('directLogins') == null) {
272 // this.transientState().setValue('directLogins', this._directLogins) 265 // this.transientState().setValue('directLogins', this._directLogins)
273//console.log("SET TRANSIENT STATE", Clipperz.Base.serializeJSON(MochiKit.Base.keys(this.transientState().getValue('directLogins'))))
274 MochiKit.Iter.forEach(MochiKit.Base.keys(this._directLogins), MochiKit.Base.bind(function(aKey) { 266 MochiKit.Iter.forEach(MochiKit.Base.keys(this._directLogins), MochiKit.Base.bind(function(aKey) {
275 this.transientState().setValue('directLogins' + '.' + aKey, this._directLogins[aKey]) 267 this.transientState().setValue('directLogins' + '.' + aKey, this._directLogins[aKey])
@@ -330,5 +322,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
330 var result; 322 var result;
331 323
332//console.log("new Clipperz.PM.DataModel.Record.Version [2]");
333/* 324/*
334 this._currentRecordVersion = new Clipperz.PM.DataModel.Record.Version({ 325 this._currentRecordVersion = new Clipperz.PM.DataModel.Record.Version({
@@ -341,5 +332,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
341 332
342 for (versionKey in someData['versions']) { 333 for (versionKey in someData['versions']) {
343//console.log("### versionKey", versionKey);
344 this._versions[versionKey] = new Clipperz.PM.DataModel.Record.Version({ 334 this._versions[versionKey] = new Clipperz.PM.DataModel.Record.Version({
345 'reference': versionKey, 335 'reference': versionKey,
@@ -352,5 +342,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
352 // this._currentVersionReference = someData['currentVersion']['reference']; 342 // this._currentVersionReference = someData['currentVersion']['reference'];
353 this._currentVersionReference = someData['currentVersion']; 343 this._currentVersionReference = someData['currentVersion'];
354//console.log("=== currentVersionReference", this._currentVersionReference, someData);
355 344
356 result = Clipperz.PM.DataModel.Record.superclass.unpackRemoteData.apply(this, arguments); 345 result = Clipperz.PM.DataModel.Record.superclass.unpackRemoteData.apply(this, arguments);
@@ -537,5 +526,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
537 526
538 'currentVersionReference': function () { 527 'currentVersionReference': function () {
539//console.log("currentVersionReference");
540 return this._currentVersionReference; 528 return this._currentVersionReference;
541 }, 529 },
@@ -586,5 +574,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
586 574
587 'getCurrentRecordVersionKey': function () { 575 'getCurrentRecordVersionKey': function () {
588//console.log("getCurrentRecordVersionKey");
589 return Clipperz.Async.callbacks("Record.getCurrentRecordVersionKey", [ 576 return Clipperz.Async.callbacks("Record.getCurrentRecordVersionKey", [
590 MochiKit.Base.method(this, 'getValue', 'currentVersionKey'), 577 MochiKit.Base.method(this, 'getValue', 'currentVersionKey'),
@@ -607,8 +594,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
607 594
608 'invokeCurrentRecordVersionMethod': function (aMethodName, someValues) { 595 'invokeCurrentRecordVersionMethod': function (aMethodName, someValues) {
609//console.log(">>> invokeCurrentRecordVersionMethod", aMethodName);
610 return Clipperz.Async.callbacks("Record.invokeCurrentRecordVersionMethod", [ 596 return Clipperz.Async.callbacks("Record.invokeCurrentRecordVersionMethod", [
611 MochiKit.Base.method(this, 'getCurrentRecordVersion'), 597 MochiKit.Base.method(this, 'getCurrentRecordVersion'),
612//function (aValue) { console.log("=== getCurrentRecordVersion", aValue); return aValue},
613 MochiKit.Base.methodcaller(aMethodName, someValues) 598 MochiKit.Base.methodcaller(aMethodName, someValues)
614 ], {trace:false}); 599 ], {trace:false});
@@ -619,14 +604,9 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
619 return Clipperz.Async.callbacks("Record.lazilyinvokeCurrentRecordVersionMethod", [ 604 return Clipperz.Async.callbacks("Record.lazilyinvokeCurrentRecordVersionMethod", [
620 MochiKit.Base.method(this, 'currentVersionReference'), 605 MochiKit.Base.method(this, 'currentVersionReference'),
621//function (aValue) { console.log("LAZY -> versions", aValue); return aValue; },
622 Clipperz.Async.deferredIf("versions has been loaded", [ 606 Clipperz.Async.deferredIf("versions has been loaded", [
623//function (aValue) { console.log("LAZY -> then"); return aValue; },
624 MochiKit.Base.method(this, 'getCurrentRecordVersion'), 607 MochiKit.Base.method(this, 'getCurrentRecordVersion'),
625 MochiKit.Base.methodcaller(aMethodName, someValues), 608 MochiKit.Base.methodcaller(aMethodName, someValues),
626//function (aValue) { console.log("LAZY <- then"); return aValue; }
627 ], [ 609 ], [
628//function (aValue) { console.log("LAZY -> else"); return aValue; },
629 MochiKit.Base.partial(MochiKit.Async.succeed, defaultResult), 610 MochiKit.Base.partial(MochiKit.Async.succeed, defaultResult),
630//function (aValue) { console.log("LAZY <- else"); return aValue; }
631 ]) 611 ])
632 ], {trace:false}); 612 ], {trace:false});
@@ -649,5 +629,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
649 'directLogins': [ 629 'directLogins': [
650 MochiKit.Base.method(this, 'directLogins'), 630 MochiKit.Base.method(this, 'directLogins'),
651//function (aValue) { console.log("Record.directLogins", aValue); return aValue; },
652 MochiKit.Base.values, 631 MochiKit.Base.values,
653 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('hasPendingChanges')), 632 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('hasPendingChanges')),
@@ -659,5 +638,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
659 ] 638 ]
660 }); 639 });
661//deferredResult.addCallback(function (aValue) { console.log("Record.hasPendingResults", aValue); return aValue; });
662 deferredResult.addCallback(MochiKit.Base.values); 640 deferredResult.addCallback(MochiKit.Base.values);
663 deferredResult.addCallback(MochiKit.Base.bind(function(someValues) { 641 deferredResult.addCallback(MochiKit.Base.bind(function(someValues) {
@@ -777,5 +755,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
777 755
778 MochiKit.Base.method(this, 'directLogins'), 756 MochiKit.Base.method(this, 'directLogins'),
779//function (aValue) { console.log("resetTransientState - directLogins", aValue); return aValue; },
780 MochiKit.Base.values, 757 MochiKit.Base.values,
781 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('resetTransientState')), 758 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('resetTransientState')),
@@ -817,5 +794,4 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
817 794
818 'retrieveDirectLoginIndexDataFunction': function () { 795 'retrieveDirectLoginIndexDataFunction': function () {
819//console.log("Record.retrieveDirectLoginIndexDataFunction", this._retrieveDirectLoginIndexDataFunction);
820 return this._retrieveDirectLoginIndexDataFunction; 796 return this._retrieveDirectLoginIndexDataFunction;
821 }, 797 },