summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js39
1 files changed, 11 insertions, 28 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js
index f77ea80..5681f70 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js
@@ -1,25 +1,23 @@
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*/
25 23
@@ -32,7 +30,6 @@ if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.Data
32Clipperz.PM.DataModel.User.Header.RecordIndex = function(args) { 30Clipperz.PM.DataModel.User.Header.RecordIndex = function(args) {
33 Clipperz.PM.DataModel.User.Header.RecordIndex.superclass.constructor.apply(this, arguments); 31 Clipperz.PM.DataModel.User.Header.RecordIndex.superclass.constructor.apply(this, arguments);
34 32
35//console.log("NEW Clipperz.PM.DataModel.User.Header.RecordIndex", args);
36 this._recordsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({ 33 this._recordsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({
37 'name':'recordsData', 34 'name':'recordsData',
38 'retrieveKeyFunction': args.retrieveKeyFunction, 35 'retrieveKeyFunction': args.retrieveKeyFunction,
@@ -118,7 +115,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.RecordIndex, Object, {
118 }, 115 },
119 116
120 'resetTransientState': function (isCommitting) { 117 'resetTransientState': function (isCommitting) {
121//console.log("######## UserHeaderRecordIndex - resetTransientState", Clipperz.Base.deepClone(this._transientState));
122 if (this._transientState != null) { 118 if (this._transientState != null) {
123 this._transientState.removeAllData(); 119 this._transientState.removeAllData();
124 } 120 }
@@ -158,7 +154,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.RecordIndex, Object, {
158 }, 154 },
159 155
160 'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) { 156 'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) {
161//console.log("UserHeaderRecordIndex.setDirectLoginIndexData", aDirectLoginReference, this.directLoginsIndex()[aDirectLoginReference], aKey);
162//if (MochiKit.Base.isUndefinedOrNull(this.directLoginsIndex()[aDirectLoginReference])) { 157//if (MochiKit.Base.isUndefinedOrNull(this.directLoginsIndex()[aDirectLoginReference])) {
163 //throw "PIPPO"; 158 //throw "PIPPO";
164//} 159//}
@@ -166,7 +161,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.RecordIndex, Object, {
166 }, 161 },
167 162
168 'addDirectLoginIndexData': function (aDirectLoginReference) { 163 'addDirectLoginIndexData': function (aDirectLoginReference) {
169//console.log("UserHeaderRecordIndex.addDirectLoginIndexData", aDirectLoginReference, this.directLoginsIndex()[aDirectLoginReference]);
170 return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference], {}); 164 return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference], {});
171 }, 165 },
172 166
@@ -261,12 +255,7 @@ Clipperz.log("SKIPPING record " + reference + " as there are no stas associated
261 'record': record 255 'record': record
262 }); 256 });
263 } else { 257 } else {
264Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!"); 258 Clipperz.logWarning("WARNING: DIRECT LOGIN without a matching RECORD!!");
265//console.log("direct login data", someData['directLogins']);
266//console.log("current direct login data", someData['directLogins'][indexReference])
267//console.log("reference", reference);
268//console.log("record index", this.recordsIndex());
269//console.log("record inverted index", recordsInvertedIndex);
270 } 259 }
271 } 260 }
272 261
@@ -305,7 +294,6 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
305 var deferredResult; 294 var deferredResult;
306 var newRecord; 295 var newRecord;
307 296
308//console.log("#### new Clipperz.PM.DataModel.Record [4]");
309 newRecord = new Clipperz.PM.DataModel.Record({ 297 newRecord = new Clipperz.PM.DataModel.Record({
310 'retrieveKeyFunction': MochiKit.Base.method(this, 'getRecordKey'), 298 'retrieveKeyFunction': MochiKit.Base.method(this, 'getRecordKey'),
311 'retrieveRemoteDataFunction':this.retrieveRecordDetailFunction(), 299 'retrieveRemoteDataFunction':this.retrieveRecordDetailFunction(),
@@ -386,9 +374,7 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
386 374
387 this.transientState().setValue('newDirectLoginReferences' + '.' + newDirectLogin.reference(), newDirectLogin); 375 this.transientState().setValue('newDirectLoginReferences' + '.' + newDirectLogin.reference(), newDirectLogin);
388 376
389//console.log("UserHeaderRecordIndex.createNewDirectLogin [1]", newDirectLogin.reference(), newDirectLoginIndexValue);
390 this.directLoginsIndex()[newDirectLogin.reference()] = newDirectLoginIndexValue; 377 this.directLoginsIndex()[newDirectLogin.reference()] = newDirectLoginIndexValue;
391//console.log("UserHeaderRecordIndex.createNewDirectLogin [2]", newDirectLogin.reference(), this.directLoginsIndex()[newDirectLogin.reference()]);
392 this.directLoginsData().setValue(this.directLoginsIndex()[newDirectLogin.reference()], {'record': this.recordsIndex()[aRecord.reference()]}); 378 this.directLoginsData().setValue(this.directLoginsIndex()[newDirectLogin.reference()], {'record': this.recordsIndex()[aRecord.reference()]});
393 379
394 return newDirectLogin; 380 return newDirectLogin;
@@ -431,7 +417,6 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
431 // Clipperz.Async.collectAll 417 // Clipperz.Async.collectAll
432 // ] 418 // ]
433 }); 419 });
434//deferredResult.addCallback(function (aValue) { console.log("USER.Header.RecordIndex.hasAnyCleanTextData", aValue); return aValue});
435 420
436 // deferredResult.addCallback(MochiKit.Base.values); 421 // deferredResult.addCallback(MochiKit.Base.values);
437 // deferredResult.addCallback(MochiKit.Base.flattenArguments); 422 // deferredResult.addCallback(MochiKit.Base.flattenArguments);
@@ -461,7 +446,6 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
461 MochiKit.Base.methodcaller('hasPendingChanges') 446 MochiKit.Base.methodcaller('hasPendingChanges')
462 ] 447 ]
463 }); 448 });
464//deferredResult.addCallback(function (aValue) { console.log("UserHeaderIndex.hasPendingResults", aValue); return aValue; });
465 deferredResult.addCallback(Clipperz.Async.or); 449 deferredResult.addCallback(Clipperz.Async.or);
466 // deferredResult.addCallback(MochiKit.Base.values); 450 // deferredResult.addCallback(MochiKit.Base.values);
467 // deferredResult.addCallback(MochiKit.Base.flattenArguments); 451 // deferredResult.addCallback(MochiKit.Base.flattenArguments);
@@ -570,7 +554,6 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
570 var deferredResult; 554 var deferredResult;
571 var result; 555 var result;
572 556
573//console.log("recordsIndex", this.recordsIndex());
574 result = {}; 557 result = {};
575 558
576 deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.prepareRemoteDataWithKey", {trace:false}); 559 deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.prepareRemoteDataWithKey", {trace:false});