padding-left: 0;
}
+li.ssa-start-block button {
+ padding: 0 1em;
+ margin: 0;
+ border: none;
+ display: inline;
+ font-size: 14px;
+ float: right;
+}
+
+button:hover {
+ background-color: #eee;
+ cursor: pointer;
+}
+
dl.ssa-gen {
padding-left: 0;
}
}
}
+function hideBlock(el) {
+ var es = el.parentNode.parentNode.getElementsByClassName("ssa-value-list");
+ if (es.length===0)
+ return;
+ var e = es[0];
+ if (e.style.display === 'block' || e.style.display === '') {
+ e.style.display = 'none';
+ el.innerHTML = '+';
+ } else {
+ e.style.display = 'block';
+ el.innerHTML = '-';
+ }
+}
+
// TODO: scale the graph with the viewBox attribute.
function graphReduce(id) {
var node = document.getElementById(id);
func (p htmlFuncPrinter) header(f *Func) {}
func (p htmlFuncPrinter) startBlock(b *Block, reachable bool) {
- // TODO: Make blocks collapsable?
var dead string
if !reachable {
dead = "dead-block"
fmt.Fprintf(p.w, " %s", pred.HTML())
}
}
+ if len(b.Values) > 0 {
+ io.WriteString(p.w, `<button onclick="hideBlock(this)">-</button>`)
+ }
io.WriteString(p.w, "</li>")
if len(b.Values) > 0 { // start list of values
io.WriteString(p.w, "<li class=\"ssa-value-list\">")