summary refs log tree commit diff
path: root/lib/test-driver/treebits.js
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2011-01-09 17:58:52 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2011-01-09 17:58:52 +0000
commite4c1fb3ea72417cf0e253556eefba926905e80b7 (patch)
treec4dba4e88daa664e98e7202b63eaad6832ceb94f /lib/test-driver/treebits.js
parent405e4dd42e60719b8835e21f8e8c2bb37bf7bacf (diff)
downloadnixpkgs-e4c1fb3ea72417cf0e253556eefba926905e80b7.tar
nixpkgs-e4c1fb3ea72417cf0e253556eefba926905e80b7.tar.gz
nixpkgs-e4c1fb3ea72417cf0e253556eefba926905e80b7.tar.bz2
nixpkgs-e4c1fb3ea72417cf0e253556eefba926905e80b7.tar.lz
nixpkgs-e4c1fb3ea72417cf0e253556eefba926905e80b7.tar.xz
nixpkgs-e4c1fb3ea72417cf0e253556eefba926905e80b7.tar.zst
nixpkgs-e4c1fb3ea72417cf0e253556eefba926905e80b7.zip
* Pretty-print the VM build log and publish it as a build product.
svn path=/nixos/trunk/; revision=25468
Diffstat (limited to 'lib/test-driver/treebits.js')
-rw-r--r--lib/test-driver/treebits.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/test-driver/treebits.js b/lib/test-driver/treebits.js
new file mode 100644
index 00000000000..d88ac075fd9
--- /dev/null
+++ b/lib/test-driver/treebits.js
@@ -0,0 +1,40 @@
+$(document).ready(function() {
+
+    /* Set the appearance of the toggle depending on whether the
+       corresponding subtree is initially shown or hidden. */
+    $(".logTreeToggle").map(function() {
+        if ($(this).siblings("ul:hidden").length == 0) {
+            $(this).text("-");
+        } else {
+            $(this).text("+");
+        }
+    });
+
+    /* When a toggle is clicked, show or hide the subtree. */
+    $(".logTreeToggle").click(function() {
+        if ($(this).siblings("ul:hidden").length != 0) {
+            $(this).siblings("ul").show();
+            $(this).text("-");
+        } else {
+            $(this).siblings("ul").hide();
+            $(this).text("+");
+        }
+    });
+
+    /* Implementation of the expand all link. */
+    $(".logTreeExpandAll").click(function() {
+        $(".logTreeToggle", $(this).siblings(".toplevel")).map(function() {
+            $(this).siblings("ul").show();
+            $(this).text("-");
+        });
+    });
+
+    /* Implementation of the collapse all link. */
+    $(".logTreeCollapseAll").click(function() {
+        $(".logTreeToggle", $(this).siblings(".toplevel")).map(function() {
+            $(this).siblings("ul").hide();
+            $(this).text("+");
+        });
+    });
+
+});