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 | 36102a094de700ee339f6eaeffb8ab16ba4f2f3b (patch) | |
tree | 57676a64905ae0e112cc5d698a5f61b36a88c5b3 /vendors/simile-timeline/timeline_ajax/scripts | |
download | elgg-36102a094de700ee339f6eaeffb8ab16ba4f2f3b.tar.gz elgg-36102a094de700ee339f6eaeffb8ab16ba4f2f3b.tar.bz2 |
Squashed 'mod/graphstats/' content from commit b5d0461
git-subtree-dir: mod/graphstats
git-subtree-split: b5d046138c5841d55b4497618d5678cb8027c245
Diffstat (limited to 'vendors/simile-timeline/timeline_ajax/scripts')
-rw-r--r-- | vendors/simile-timeline/timeline_ajax/scripts/signal.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/vendors/simile-timeline/timeline_ajax/scripts/signal.js b/vendors/simile-timeline/timeline_ajax/scripts/signal.js new file mode 100644 index 000000000..7bfcf2a35 --- /dev/null +++ b/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 |