diff options
author | Luck <git@lucko.me> | 2018-05-26 22:52:58 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2018-05-27 00:02:02 +0100 |
commit | 429eeb35876576d861404cd199b6e9763fc4e5b0 (patch) | |
tree | 624e1c05433e8ab5775a0177ecf5d5982de54805 /src/main/resources/www/warmroast.js | |
parent | 3fe5e5517b1c529d95cf9f43fd8420c66db0092a (diff) | |
download | spark-429eeb35876576d861404cd199b6e9763fc4e5b0.tar.gz spark-429eeb35876576d861404cd199b6e9763fc4e5b0.tar.bz2 spark-429eeb35876576d861404cd199b6e9763fc4e5b0.zip |
Initial commit for spark
Diffstat (limited to 'src/main/resources/www/warmroast.js')
-rw-r--r-- | src/main/resources/www/warmroast.js | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/main/resources/www/warmroast.js b/src/main/resources/www/warmroast.js deleted file mode 100644 index c7dd7bc..0000000 --- a/src/main/resources/www/warmroast.js +++ /dev/null @@ -1,43 +0,0 @@ -$(".name").on("click", function(event) { - var $parent = $(this).parent(); - if ($parent.hasClass("collapsed")) { - $parent.removeClass("collapsed"); - $parent.children("ul").slideDown(50); - } else { - $parent.addClass("collapsed"); - $parent.children("ul").slideUp(50); - } -}); - -function extractTime($el) { - var text = $el.children(".name") - .children(".time").text().replace(/[^0-9]/, ""); - return parseInt(text); -} - -var $overlay = $("#overlay"); - -$(".name").on("mouseenter", function(event) { - var $this = $(this); - var thisTime = null; - $overlay.empty(); - $this.parents(".node").each(function(i, parent) { - var $parent = $(parent); - var time = extractTime($parent); - if (thisTime == null) { - thisTime = time; - } else { - var $el = $(document.createElement("span")); - var pos = $parent.position(); - var width = $el.outerWidth(); - $el.text(((thisTime / time) * 100).toFixed(2) + "%"); - $el.css({ - top: pos.top + "px" - }); - $overlay.append($el); - } - }); -}); - -$(".loading").hide(); -$(".stack").show();
\ No newline at end of file |