summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/Async.js
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js/Clipperz/Async.js') (more/less context) (show 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,28 +1,26 @@
/*
-Copyright 2008-2011 Clipperz Srl
+Copyright 2008-2013 Clipperz Srl
-This file is part of Clipperz Community Edition.
-Clipperz Community Edition is an online password manager.
+This file is part of Clipperz, the online password manager.
For further information about its features and functionalities please
refer to http://www.clipperz.com.
-* Clipperz Community Edition is free software: you can redistribute
- it and/or modify it under the terms of the GNU Affero General Public
- License as published by the Free Software Foundation, either version
- 3 of the License, or (at your option) any later version.
+* Clipperz is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
-* Clipperz Community Edition is distributed in the hope that it will
- be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* Clipperz is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public
- License along with Clipperz Community Edition. If not, see
- <http://www.gnu.org/licenses/>.
+ License along with Clipperz. If not, see http://www.gnu.org/licenses/.
*/
//Clipperz.Async = MochiKit.Async;
@@ -59,14 +57,13 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
},
//-----------------------------------------------------------------------------
'callback': function (aValue) {
if (this._shouldTrace) {
- // Clipperz.log("CALLBACK " + this._name, aValue);
- console.log("CALLBACK " + this._name, aValue);
+ Clipperz.log("CALLBACK " + this._name, aValue);
}
if (this.chained == false) {
var message;
message = "ERROR [" + this._name + "]";
@@ -80,15 +77,13 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
if (this._shouldTrace) {
var resultMessage;
resultMessage = "RESULT " + this._name + " <==";
// this.addCallback(function(aResult) {
Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) {
- // Clipperz.log(resultMessage, aResult);
- console.log(resultMessage, aResult);
-
+ Clipperz.log(resultMessage, aResult);
return aResult;
});
}
}
if (CLIPPERZ_DEFERRED_CALL_LOGGING_ENABLED === true) {
@@ -105,28 +100,24 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
if (this._shouldTrace) {
this._count ++;
message = "[" + this._count + "] " + this._name + " ";
// this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;});
this.addCallbacks(
- // function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
- function(aResult) {console.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
- // function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
- function(aResult) {console.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
+ function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
+ function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
);
}
Clipperz.Async.Deferred.superclass.addCallback.apply(this, arguments);
if (this._shouldTrace) {
// this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;});
this.addCallbacks(
- // function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
- function(aResult) {console.log("-OK- " + message + "<--", aResult); return aResult;},
- // function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
- function(aResult) {console.log("FAIL " + message + "<--", aResult); return aResult;}
+ function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
+ function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
);
}
},
//=============================================================================
@@ -209,13 +200,12 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
//=============================================================================
'addLog': function (aLog) {
if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) {
this.addBothPass(function(res) {Clipperz.log(aLog + " ", res);});
-// this.addBothPass(function(res) {console.log(aLog + " ", res);});
}
},
//=============================================================================
'acquireLock': function (aLock) {
@@ -234,13 +224,13 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
// return Clipperz.Async.callbacks("Clipperz.Async.release <ok>", [
// MochiKit.Base.method(aLock, 'release'),
// MochiKit.Base.partial(MochiKit.Async.succeed, aResult)
// ], {trace:false});
// });
// this.addErrback(function (aResult) {
-///console.log("releaseLock.addErrback:", aResult);
+///Clipperz.log("releaseLock.addErrback:", aResult);
// return Clipperz.Async.callbacks("Clipperz.Async.release <fail>", [
// MochiKit.Base.method(aLock, 'release'),
// MochiKit.Base.partial(MochiKit.Async.fail, aResult)
// ], {trace:false});
// });
@@ -374,13 +364,13 @@ MochiKit.Base.update(Clipperz.Async.DeferredSynchronizer.prototype, {
c = this.methods().length;
for (i=0; i<c; i++) {
var deferredResult;
var methodCalls;
var ii, cc;
-//console.log("TYPEOF", typeof(this.methods()[i]));
+//Clipperz.log("TYPEOF", typeof(this.methods()[i]));
if (typeof(this.methods()[i]) == 'function') {
methodCalls = [ this.methods()[i] ];
} else {
methodCalls = this.methods()[i];
}
@@ -634,13 +624,13 @@ MochiKit.Base.update(Clipperz.Async, {
deferredResult = new Clipperz.Async.Deferred("Clipperz.Async.deferredSort", {trace:false});
c = someObjects.length;
for (i=0; i<c; i++) {
deferredResult.addCallback(Clipperz.Async.insertIntoSortedArray, someObjects[i], aDeferredComparator);
if ((i % 50) == 0) {
-// console.log("######### sort wait ##########");
+// Clipperz.log("######### sort wait ##########");
deferredResult.addCallback(MochiKit.Async.wait, 0.5);
}
}
deferredResult.callback([]);
return deferredResult;
@@ -685,13 +675,13 @@ MochiKit.Base.update(Clipperz.Async, {
//=========================================================================
'or': function (someValues) {
return Clipperz.Async.callbacks("Clipperz.Async.or", [
MochiKit.Base.values,
MochiKit.Base.flattenArguments,
-//function (aValue) { console.log("Record.hasAnyCleanTextData - flatten", aValue); return aValue; },
+//function (aValue) { Clipperz.log("Record.hasAnyCleanTextData - flatten", aValue); return aValue; },
function(someInnerValues) {
return MochiKit.Iter.some(someInnerValues, MochiKit.Base.operator.identity);
}
], {trace:false}, someValues);
},