Update of /var/cvs/contributions/didactor2/src/core/templates/core/js
In directory james.mmbase.org:/tmp/cvs-serv7469
Modified Files:
Didactor.js
Log Message:
details
See also:
http://cvs.mmbase.org/viewcvs/contributions/didactor2/src/core/templates/core/js
Index: Didactor.js
===================================================================
RCS file:
/var/cvs/contributions/didactor2/src/core/templates/core/js/Didactor.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- Didactor.js 28 Aug 2008 15:11:24 -0000 1.2
+++ Didactor.js 28 Aug 2008 16:08:36 -0000 1.3
@@ -5,9 +5,13 @@
this.url = this.getSetting("Didactor-URL");
this.lastCheck = new Date();
var self = this;
- $.timer(2000, function(timer) {
+ $.timer(500, function(timer) {
self.reportOnline();
timer.reset(self.getSetting("Didactor-PageReporter") == "true" ? 5000 :
1000 * 60 * 2);
+ $(window).bind("beforeunload", function() {
+ self.reportOnline(null, false);
+ });
+
});
this.content = $.query.get("learnobject");
$.query.REMOVE("learnobject");
@@ -18,9 +22,7 @@
return $("html head meta[name='" + name + "']").attr("content");
}
-Didactor.prototype.reportOnline = function (timer) {
- console.log(window.location);
-
+Didactor.prototype.reportOnline = function (timer, async) {
var params;
var thisCheck = new Date();
if (this.getSetting("Didactor-PageReporter") == "true") {
@@ -32,7 +34,7 @@
params = {};
}
- $.get(this.onlineReporter, params);
+ $.ajax({async: (async == null ? true : async), url: this.onlineReporter,
type: "GET", data: params});
this.lastCheck = thisCheck;
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs