aboutsummaryrefslogtreecommitdiff
path: root/mod/graphstats/vendors/simile-timeline/timeline_ajax/scripts/signal.js
diff options
context:
space:
mode:
Diffstat (limited to 'mod/graphstats/vendors/simile-timeline/timeline_ajax/scripts/signal.js')
-rw-r--r--mod/graphstats/vendors/simile-timeline/timeline_ajax/scripts/signal.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/mod/graphstats/vendors/simile-timeline/timeline_ajax/scripts/signal.js b/mod/graphstats/vendors/simile-timeline/timeline_ajax/scripts/signal.js
new file mode 100644
index 000000000..7bfcf2a35
--- /dev/null
+++ b/mod/graphstats/vendors/simile-timeline/timeline_ajax/scripts/signal.js
@@ -0,0 +1,44 @@
+/*==================================================
+ * This file is used to detect that all outstanding
+ * javascript files have been loaded. You can put
+ * a function reference into SimileAjax_onLoad
+ * to have it executed once all javascript files
+ * have loaded.
+ *==================================================
+ */
+(function() {
+ var substring = SimileAjax.urlPrefix + "scripts/signal.js";
+ var heads = document.documentElement.getElementsByTagName("head");
+ for (var h = 0; h < heads.length; h++) {
+ var node = heads[h].firstChild;
+ while (node != null) {
+ if (node.nodeType == 1 && node.tagName.toLowerCase() == "script") {
+ var url = node.src;
+ var i = url.indexOf(substring);
+ if (i >= 0) {
+ heads[h].removeChild(node); // remove it so we won't hit it again
+
+ var count = parseInt(url.substr(substring.length + 1));
+ SimileAjax.loadingScriptsCount -= count;
+
+ if (SimileAjax.loadingScriptsCount == 0) {
+ var f = null;
+ if (typeof SimileAjax_onLoad == "string") {
+ f = eval(SimileAjax_onLoad);
+ SimileAjax_onLoad = null;
+ } else if (typeof SimileAjax_onLoad == "function") {
+ f = SimileAjax_onLoad;
+ SimileAjax_onLoad = null;
+ }
+
+ if (f != null) {
+ f();
+ }
+ }
+ return;
+ }
+ }
+ node = node.nextSibling;
+ }
+ }
+})(); \ No newline at end of file