summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/Async.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Clipperz/Async.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/Async.js50
1 files changed, 20 insertions, 30 deletions
diff --git a/frontend/gamma/js/Clipperz/Async.js b/frontend/gamma/js/Clipperz/Async.js
index f7a9517..d525453 100644
--- a/frontend/gamma/js/Clipperz/Async.js
+++ b/frontend/gamma/js/Clipperz/Async.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
@@ -62,8 +60,7 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
62 60
63 'callback': function (aValue) { 61 'callback': function (aValue) {
64 if (this._shouldTrace) { 62 if (this._shouldTrace) {
65 //Clipperz.log("CALLBACK " + this._name, aValue); 63 Clipperz.log("CALLBACK " + this._name, aValue);
66 console.log("CALLBACK " + this._name, aValue);
67 } 64 }
68 65
69 if (this.chained == false) { 66 if (this.chained == false) {
@@ -83,9 +80,7 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
83 resultMessage = "RESULT " + this._name + " <=="; 80 resultMessage = "RESULT " + this._name + " <==";
84 // this.addCallback(function(aResult) { 81 // this.addCallback(function(aResult) {
85 Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) { 82 Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) {
86 //Clipperz.log(resultMessage, aResult); 83 Clipperz.log(resultMessage, aResult);
87 console.log(resultMessage, aResult);
88
89 return aResult; 84 return aResult;
90 }); 85 });
91 } 86 }
@@ -108,10 +103,8 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
108 message = "[" + this._count + "] " + this._name + " "; 103 message = "[" + this._count + "] " + this._name + " ";
109 // this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;}); 104 // this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;});
110 this.addCallbacks( 105 this.addCallbacks(
111 //function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;}, 106 function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
112 function(aResult) {console.log("-OK- " + message + "-->"/*, aResult*/); return aResult;}, 107 function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
113 //function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
114 function(aResult) {console.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
115 ); 108 );
116 } 109 }
117 110
@@ -120,10 +113,8 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
120 if (this._shouldTrace) { 113 if (this._shouldTrace) {
121 // this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;}); 114 // this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;});
122 this.addCallbacks( 115 this.addCallbacks(
123 //function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;}, 116 function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
124 function(aResult) {console.log("-OK- " + message + "<--", aResult); return aResult;}, 117 function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
125 //function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
126 function(aResult) {console.log("FAIL " + message + "<--", aResult); return aResult;}
127 ); 118 );
128 } 119 }
129 }, 120 },
@@ -212,7 +203,6 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
212 'addLog': function (aLog) { 203 'addLog': function (aLog) {
213 if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) { 204 if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) {
214 this.addBothPass(function(res) {Clipperz.log(aLog + " ", res);}); 205 this.addBothPass(function(res) {Clipperz.log(aLog + " ", res);});
215 // this.addBothPass(function(res) {console.log(aLog + " ", res);});
216 } 206 }
217 }, 207 },
218 208
@@ -237,7 +227,7 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
237 // ], {trace:false}); 227 // ], {trace:false});
238 // }); 228 // });
239 // this.addErrback(function (aResult) { 229 // this.addErrback(function (aResult) {
240///console.log("releaseLock.addErrback:", aResult); 230///Clipperz.log("releaseLock.addErrback:", aResult);
241 // return Clipperz.Async.callbacks("Clipperz.Async.release <fail>", [ 231 // return Clipperz.Async.callbacks("Clipperz.Async.release <fail>", [
242 // MochiKit.Base.method(aLock, 'release'), 232 // MochiKit.Base.method(aLock, 'release'),
243 // MochiKit.Base.partial(MochiKit.Async.fail, aResult) 233 // MochiKit.Base.partial(MochiKit.Async.fail, aResult)
@@ -377,7 +367,7 @@ MochiKit.Base.update(Clipperz.Async.DeferredSynchronizer.prototype, {
377 varmethodCalls; 367 varmethodCalls;
378 var ii, cc; 368 var ii, cc;
379 369
380//console.log("TYPEOF", typeof(this.methods()[i])); 370//Clipperz.log("TYPEOF", typeof(this.methods()[i]));
381 if (typeof(this.methods()[i]) == 'function') { 371 if (typeof(this.methods()[i]) == 'function') {
382 methodCalls = [ this.methods()[i] ]; 372 methodCalls = [ this.methods()[i] ];
383 } else { 373 } else {
@@ -637,7 +627,7 @@ MochiKit.Base.update(Clipperz.Async, {
637 for (i=0; i<c; i++) { 627 for (i=0; i<c; i++) {
638 deferredResult.addCallback(Clipperz.Async.insertIntoSortedArray, someObjects[i], aDeferredComparator); 628 deferredResult.addCallback(Clipperz.Async.insertIntoSortedArray, someObjects[i], aDeferredComparator);
639 if ((i % 50) == 0) { 629 if ((i % 50) == 0) {
640 //console.log("######### sort wait ##########"); 630 //Clipperz.log("######### sort wait ##########");
641 deferredResult.addCallback(MochiKit.Async.wait, 0.5); 631 deferredResult.addCallback(MochiKit.Async.wait, 0.5);
642 } 632 }
643 } 633 }
@@ -688,7 +678,7 @@ MochiKit.Base.update(Clipperz.Async, {
688 return Clipperz.Async.callbacks("Clipperz.Async.or", [ 678 return Clipperz.Async.callbacks("Clipperz.Async.or", [
689 MochiKit.Base.values, 679 MochiKit.Base.values,
690 MochiKit.Base.flattenArguments, 680 MochiKit.Base.flattenArguments,
691//function (aValue) { console.log("Record.hasAnyCleanTextData - flatten", aValue); return aValue; }, 681//function (aValue) { Clipperz.log("Record.hasAnyCleanTextData - flatten", aValue); return aValue; },
692 function(someInnerValues) { 682 function(someInnerValues) {
693 return MochiKit.Iter.some(someInnerValues, MochiKit.Base.operator.identity); 683 return MochiKit.Iter.some(someInnerValues, MochiKit.Base.operator.identity);
694 } 684 }