Fossil SCM

Add a non-linked "type" name in front of all tooltips. Style the foreground color and border color based on the default font color.

drh 2019-05-22 23:24 tooltip-experiments
Commit 2bfa69a3013dde35432933a0ba863eaecf0f9674e333cd14a3a6f928e211c16f
1 file changed +7 -7
+7 -7
--- src/graph.js
+++ src/graph.js
@@ -594,13 +594,13 @@
594594
if( tooltipInfo.ixHover==-2 ){
595595
ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow
596596
var h = tx.rowinfo[ix].h
597597
var dest = tx.baseUrl + "/info/" + h
598598
if( tx.fileDiff ){
599
- html = "<a href=\""+dest+"\">artifact "+h+"</a>"
599
+ html = "artifact <a href=\""+dest+"\">"+h+"</a>"
600600
}else{
601
- html = "<a href=\""+dest+"\">check-in "+h+"</a>"
601
+ html = "check-in <a href=\""+dest+"\">"+h+"</a>"
602602
}
603603
}else if( tooltipInfo.ixHover>=0 ){
604604
ix = tooltipInfo.ixHover
605605
var br = tx.rowinfo[ix].br
606606
var dest = branchHyperlink(ix)
@@ -607,23 +607,23 @@
607607
var hbr = br.replace(/&/g, "&amp;")
608608
.replace(/</g, "&lt;")
609609
.replace(/>/g, "&gt;")
610610
.replace(/"/g, "&quot;")
611611
.replace(/'/g, "&#039;");
612
- html = "<a href=\""+dest+"\">"+hbr+"</a>"
612
+ html = "branch <a href=\""+dest+"\">"+hbr+"</a>"
613613
tooltipInfo.ixActive = ix;
614614
}
615615
if( html ){
616616
/* Setup while hidden, to ensure proper dimensions. */
617
+ var s = getComputedStyle(document.body)
617618
if( tx.rowinfo[ix].bg.length ){
618619
tooltipObj.style.backgroundColor = tx.rowinfo[ix].bg
619620
}else{
620
- tooltipObj.style.backgroundColor =
621
- getComputedStyle(document.body).getPropertyValue('background-color')
621
+ tooltipObj.style.backgroundColor = s.getPropertyValue('background-color')
622622
}
623
- tooltipObj.style.color = tx.rowinfo[ix].fg
624
-
623
+ tooltipObj.style.borderColor =
624
+ tooltipObj.style.color = s.getPropertyValue('color')
625625
tooltipObj.style.visibility = "hidden"
626626
tooltipObj.innerHTML = html
627627
tooltipObj.style.display = "inline"
628628
tooltipObj.style.position = "absolute"
629629
var x = tooltipInfo.posX + 4 + window.pageXOffset
630630
--- src/graph.js
+++ src/graph.js
@@ -594,13 +594,13 @@
594 if( tooltipInfo.ixHover==-2 ){
595 ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow
596 var h = tx.rowinfo[ix].h
597 var dest = tx.baseUrl + "/info/" + h
598 if( tx.fileDiff ){
599 html = "<a href=\""+dest+"\">artifact "+h+"</a>"
600 }else{
601 html = "<a href=\""+dest+"\">check-in "+h+"</a>"
602 }
603 }else if( tooltipInfo.ixHover>=0 ){
604 ix = tooltipInfo.ixHover
605 var br = tx.rowinfo[ix].br
606 var dest = branchHyperlink(ix)
@@ -607,23 +607,23 @@
607 var hbr = br.replace(/&/g, "&amp;")
608 .replace(/</g, "&lt;")
609 .replace(/>/g, "&gt;")
610 .replace(/"/g, "&quot;")
611 .replace(/'/g, "&#039;");
612 html = "<a href=\""+dest+"\">"+hbr+"</a>"
613 tooltipInfo.ixActive = ix;
614 }
615 if( html ){
616 /* Setup while hidden, to ensure proper dimensions. */
 
617 if( tx.rowinfo[ix].bg.length ){
618 tooltipObj.style.backgroundColor = tx.rowinfo[ix].bg
619 }else{
620 tooltipObj.style.backgroundColor =
621 getComputedStyle(document.body).getPropertyValue('background-color')
622 }
623 tooltipObj.style.color = tx.rowinfo[ix].fg
624
625 tooltipObj.style.visibility = "hidden"
626 tooltipObj.innerHTML = html
627 tooltipObj.style.display = "inline"
628 tooltipObj.style.position = "absolute"
629 var x = tooltipInfo.posX + 4 + window.pageXOffset
630
--- src/graph.js
+++ src/graph.js
@@ -594,13 +594,13 @@
594 if( tooltipInfo.ixHover==-2 ){
595 ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow
596 var h = tx.rowinfo[ix].h
597 var dest = tx.baseUrl + "/info/" + h
598 if( tx.fileDiff ){
599 html = "artifact <a href=\""+dest+"\">"+h+"</a>"
600 }else{
601 html = "check-in <a href=\""+dest+"\">"+h+"</a>"
602 }
603 }else if( tooltipInfo.ixHover>=0 ){
604 ix = tooltipInfo.ixHover
605 var br = tx.rowinfo[ix].br
606 var dest = branchHyperlink(ix)
@@ -607,23 +607,23 @@
607 var hbr = br.replace(/&/g, "&amp;")
608 .replace(/</g, "&lt;")
609 .replace(/>/g, "&gt;")
610 .replace(/"/g, "&quot;")
611 .replace(/'/g, "&#039;");
612 html = "branch <a href=\""+dest+"\">"+hbr+"</a>"
613 tooltipInfo.ixActive = ix;
614 }
615 if( html ){
616 /* Setup while hidden, to ensure proper dimensions. */
617 var s = getComputedStyle(document.body)
618 if( tx.rowinfo[ix].bg.length ){
619 tooltipObj.style.backgroundColor = tx.rowinfo[ix].bg
620 }else{
621 tooltipObj.style.backgroundColor = s.getPropertyValue('background-color')
 
622 }
623 tooltipObj.style.borderColor =
624 tooltipObj.style.color = s.getPropertyValue('color')
625 tooltipObj.style.visibility = "hidden"
626 tooltipObj.innerHTML = html
627 tooltipObj.style.display = "inline"
628 tooltipObj.style.position = "absolute"
629 var x = tooltipInfo.posX + 4 + window.pageXOffset
630

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button