diff options
Diffstat (limited to 'html')
-rw-r--r-- | html/css/git-deps.css | 9 | ||||
-rw-r--r-- | html/git-deps.html | 1 | ||||
-rw-r--r-- | html/js/git-deps-graph.coffee | 20 |
3 files changed, 28 insertions, 2 deletions
diff --git a/html/css/git-deps.css b/html/css/git-deps.css index 16261ba..639b8a9 100644 --- a/html/css/git-deps.css +++ b/html/css/git-deps.css @@ -29,10 +29,17 @@ rect.background { g.node rect { stroke: #e5e5e5; stroke-width: 2px; - fill: rgba(242,242, 255, 0.54); cursor: pointer; } +g.node rect.explored { + fill: rgba(167, 224, 196, 0.54); +} + +g.node rect.unexplored { + fill: rgba(242, 242, 255, 0.54); +} + g.node text { /* fill: black; */ fill: #295b8c; diff --git a/html/git-deps.html b/html/git-deps.html index 84da796..62468a4 100644 --- a/html/git-deps.html +++ b/html/git-deps.html @@ -22,6 +22,7 @@ Use mouse-wheel to zoom. Drag background to pan. Hover over a commit for more information. + Double-click a commit to find dependencies of that commit. </p> <form class="commitish" action="#"> diff --git a/html/js/git-deps-graph.coffee b/html/js/git-deps-graph.coffee index 7762745..84bbd83 100644 --- a/html/js/git-deps-graph.coffee +++ b/html/js/git-deps-graph.coffee @@ -180,6 +180,7 @@ draw_graph = (commitish) -> unless new_data gdn.warn "No new commits or dependencies found!" + update_rect_explored() return new_data_notification new_data @@ -255,7 +256,18 @@ draw_nodes = (fg, node) -> hide_tip_on_drag = d3cola.drag().on("dragstart", tip.hide) node.call hide_tip_on_drag - rect = node.append("rect").attr("rx", 5).attr("ry", 5) + rect = node.append("rect") \ + .attr("rx", 5) \ + .attr("ry", 5) + + update_rect_explored() + + rect.on "dblclick", (d) -> + if d.explored + gdn.warn "Commit #{d.name} already explored" + else + add_commitish d.sha1 + label = node.append("text").text((d) -> d.name ).each((d) -> @@ -271,6 +283,7 @@ draw_nodes = (fg, node) -> d.width = d.rect_width + 2 * RECT_MARGIN d.height = d.rect_height + 2 * RECT_MARGIN ) + position_nodes rect, label, tip position_nodes = (rect, label, tip) -> @@ -298,6 +311,11 @@ position_nodes = (rect, label, tip) -> # d3cola.avoidOverlaps true # d3cola.start +update_rect_explored = () -> + d3.selectAll(".node rect").attr "class", (d) -> + console.log "rect #{d.name}: #{d.explored}" + if d.explored then "explored" else "unexplored" + tip_html = (d) -> fragment = $(tip_template).clone() top = fragment.find("#fragment") |