From 70319aefd6f7d585c481bc3307594324e22f0284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Tue, 20 Jul 2010 10:54:56 +0000 Subject: [PATCH] Added some docu and checks for console.log being defined --- phpgwapi/js/egw_json.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/phpgwapi/js/egw_json.js b/phpgwapi/js/egw_json.js index d2950a27f7..5cb2677f28 100644 --- a/phpgwapi/js/egw_json.js +++ b/phpgwapi/js/egw_json.js @@ -416,7 +416,7 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe //Increment the includedJSFiles count this.loadedJSFiles[res.data] = false; - if (typeof console != 'undefined') + if (typeof console != 'undefined' && typeof console.log != 'undefined') console.log("Requested JS file '%s' from server", [res.data]); var self = this; @@ -424,7 +424,7 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe //FF, Opera, Chrome scriptnode.onload = function(e) { var file = e.target._originalSrc; - if (typeof console != 'undefined') + if (typeof console != 'undefined' && typeof console.log != 'undefined') console.log("Retrieved JS file '%s' from server", [file]); self.loadedJSFiles[file] = true; @@ -436,7 +436,7 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe var node = window.event.srcElement; if (node.readyState == 'complete') { var file = node._originalSrc; - if (typeof console != 'undefined') + if (typeof console != 'undefined' && typeof console.log != 'undefined') console.log("Retrieved JS file '%s' from server", [file]); self.loadedJSFiles[file] = true; @@ -477,6 +477,10 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe } } +/** + * The "onLoadFinish" handler gets called after all JS-files have been loaded + * successfully + */ egw_json_request.prototype.checkLoadFinish = function() { var complete = true; @@ -485,7 +489,6 @@ egw_json_request.prototype.checkLoadFinish = function() if (complete && this.onLoadFinish && this.handleResponseDone) { - console.log("Call onLoadFinish"); this.onLoadFinish.call(this.sender); } }