diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:42:50 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:42:50 -0300 |
commit | 971b54fe719ed70704fb3bcac4ef1d5f093cb454 (patch) | |
tree | 26e090c444b1e34881bc088a9cd6f3223e26047a /mod/graphstats/vendors/simile-timeline/timeline_ajax/scripts/signal.js | |
parent | 711dab09b5146e74dbeda56679c65e3b6bec71f3 (diff) | |
parent | 36102a094de700ee339f6eaeffb8ab16ba4f2f3b (diff) | |
download | elgg-971b54fe719ed70704fb3bcac4ef1d5f093cb454.tar.gz elgg-971b54fe719ed70704fb3bcac4ef1d5f093cb454.tar.bz2 |
Merge commit '36102a094de700ee339f6eaeffb8ab16ba4f2f3b' as 'mod/graphstats'
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.js | 44 |
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 |