Fossil SCM

Show tooltips in the color scheme of the object that the tooltip refers to.

drh 2019-05-22 18:09 tooltip-experiments
Commit cf1f42435a38fc62a689e6a21069544bbe25bf055047df25d71738ca09439c3a
--- src/default_css.txt
+++ src/default_css.txt
@@ -196,23 +196,17 @@
196196
border-left-width: 2px;
197197
border-left-style: dotted;
198198
background: rgba(255,255,255,0);
199199
}
200200
.tl-tooltip {
201
- background-color: #fecd4b;
202
- color: black;
203201
text-align: center;
204202
padding: 5px 1em;
205203
border: 1px solid black;
206204
border-radius: 6px;
207205
position: absolute;
208206
z-index: 100;
209207
}
210
-.tl-tooltip a {
211
- background-color: #fecd4b;
212
- color: #004080;
213
-}
214208
215209
span.tagDsp {
216210
font-weight: bold;
217211
}
218212
span.wikiError {
219213
--- src/default_css.txt
+++ src/default_css.txt
@@ -196,23 +196,17 @@
196 border-left-width: 2px;
197 border-left-style: dotted;
198 background: rgba(255,255,255,0);
199 }
200 .tl-tooltip {
201 background-color: #fecd4b;
202 color: black;
203 text-align: center;
204 padding: 5px 1em;
205 border: 1px solid black;
206 border-radius: 6px;
207 position: absolute;
208 z-index: 100;
209 }
210 .tl-tooltip a {
211 background-color: #fecd4b;
212 color: #004080;
213 }
214
215 span.tagDsp {
216 font-weight: bold;
217 }
218 span.wikiError {
219
--- src/default_css.txt
+++ src/default_css.txt
@@ -196,23 +196,17 @@
196 border-left-width: 2px;
197 border-left-style: dotted;
198 background: rgba(255,255,255,0);
199 }
200 .tl-tooltip {
 
 
201 text-align: center;
202 padding: 5px 1em;
203 border: 1px solid black;
204 border-radius: 6px;
205 position: absolute;
206 z-index: 100;
207 }
 
 
 
 
208
209 span.tagDsp {
210 font-weight: bold;
211 }
212 span.wikiError {
213
+11 -2
--- src/graph.js
+++ src/graph.js
@@ -588,21 +588,22 @@
588588
tooltipInfo.posY = e.y;
589589
showGraphTooltip();
590590
}
591591
function showGraphTooltip(){
592592
var html = null
593
+ var ix = -1
593594
if( tooltipInfo.ixHover==-2 ){
594
- var ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow
595
+ ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow
595596
var h = tx.rowinfo[ix].h
596597
var dest = tx.baseUrl + "/info/" + h
597598
if( tx.fileDiff ){
598599
html = "<a href=\""+dest+"\">artifact "+h+"</a>"
599600
}else{
600601
html = "<a href=\""+dest+"\">check-in "+h+"</a>"
601602
}
602603
}else if( tooltipInfo.ixHover>=0 ){
603
- var ix = tooltipInfo.ixHover
604
+ ix = tooltipInfo.ixHover
604605
var br = tx.rowinfo[ix].br
605606
var dest = branchHyperlink(ix)
606607
var hbr = br.replace(/&/g, "&amp;")
607608
.replace(/</g, "&lt;")
608609
.replace(/>/g, "&gt;")
@@ -611,10 +612,18 @@
611612
html = "<a href=\""+dest+"\">"+hbr+"</a>"
612613
tooltipInfo.ixActive = ix;
613614
}
614615
if( html ){
615616
/* 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
+
616625
tooltipObj.style.visibility = "hidden"
617626
tooltipObj.innerHTML = html
618627
tooltipObj.style.display = "inline"
619628
tooltipObj.style.position = "absolute"
620629
var x = tooltipInfo.posX + 4 + window.pageXOffset
621630
--- src/graph.js
+++ src/graph.js
@@ -588,21 +588,22 @@
588 tooltipInfo.posY = e.y;
589 showGraphTooltip();
590 }
591 function showGraphTooltip(){
592 var html = null
 
593 if( tooltipInfo.ixHover==-2 ){
594 var ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow
595 var h = tx.rowinfo[ix].h
596 var dest = tx.baseUrl + "/info/" + h
597 if( tx.fileDiff ){
598 html = "<a href=\""+dest+"\">artifact "+h+"</a>"
599 }else{
600 html = "<a href=\""+dest+"\">check-in "+h+"</a>"
601 }
602 }else if( tooltipInfo.ixHover>=0 ){
603 var ix = tooltipInfo.ixHover
604 var br = tx.rowinfo[ix].br
605 var dest = branchHyperlink(ix)
606 var hbr = br.replace(/&/g, "&amp;")
607 .replace(/</g, "&lt;")
608 .replace(/>/g, "&gt;")
@@ -611,10 +612,18 @@
611 html = "<a href=\""+dest+"\">"+hbr+"</a>"
612 tooltipInfo.ixActive = ix;
613 }
614 if( html ){
615 /* Setup while hidden, to ensure proper dimensions. */
 
 
 
 
 
 
 
 
616 tooltipObj.style.visibility = "hidden"
617 tooltipObj.innerHTML = html
618 tooltipObj.style.display = "inline"
619 tooltipObj.style.position = "absolute"
620 var x = tooltipInfo.posX + 4 + window.pageXOffset
621
--- src/graph.js
+++ src/graph.js
@@ -588,21 +588,22 @@
588 tooltipInfo.posY = e.y;
589 showGraphTooltip();
590 }
591 function showGraphTooltip(){
592 var html = null
593 var ix = -1
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 var hbr = br.replace(/&/g, "&amp;")
608 .replace(/</g, "&lt;")
609 .replace(/>/g, "&gt;")
@@ -611,10 +612,18 @@
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

Keyboard Shortcuts

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