Fossil SCM

Add a configuration option under the Admin/Timeline setup menu to set the dwellTimeout for tooltips.

drh 2019-05-21 02:15 UTC tooltip-experiments
Commit 5fc142df073760f35f8f4ecb1a1c69170d8cd3c545fd28a27aa60395df0b62b9
--- src/configure.c
+++ src/configure.c
@@ -94,12 +94,16 @@
9494
{ "logo-mimetype", CONFIGSET_SKIN },
9595
{ "logo-image", CONFIGSET_SKIN },
9696
{ "background-mimetype", CONFIGSET_SKIN },
9797
{ "background-image", CONFIGSET_SKIN },
9898
{ "timeline-block-markup", CONFIGSET_SKIN },
99
+ { "timeline-date-format", CONFIGSET_SKIN },
100
+ { "timeline-dwelltime", CONFIGSET_SKIN },
99101
{ "timeline-max-comment", CONFIGSET_SKIN },
100102
{ "timeline-plaintext", CONFIGSET_SKIN },
103
+ { "timeline-truncate-at-blank", CONFIGSET_SKIN },
104
+ { "timeline-utc", CONFIGSET_SKIN },
101105
{ "adunit", CONFIGSET_SKIN },
102106
{ "adunit-omit-if-admin", CONFIGSET_SKIN },
103107
{ "adunit-omit-if-user", CONFIGSET_SKIN },
104108
{ "sitemap-docidx", CONFIGSET_SKIN },
105109
{ "sitemap-download", CONFIGSET_SKIN },
106110
--- src/configure.c
+++ src/configure.c
@@ -94,12 +94,16 @@
94 { "logo-mimetype", CONFIGSET_SKIN },
95 { "logo-image", CONFIGSET_SKIN },
96 { "background-mimetype", CONFIGSET_SKIN },
97 { "background-image", CONFIGSET_SKIN },
98 { "timeline-block-markup", CONFIGSET_SKIN },
 
 
99 { "timeline-max-comment", CONFIGSET_SKIN },
100 { "timeline-plaintext", CONFIGSET_SKIN },
 
 
101 { "adunit", CONFIGSET_SKIN },
102 { "adunit-omit-if-admin", CONFIGSET_SKIN },
103 { "adunit-omit-if-user", CONFIGSET_SKIN },
104 { "sitemap-docidx", CONFIGSET_SKIN },
105 { "sitemap-download", CONFIGSET_SKIN },
106
--- src/configure.c
+++ src/configure.c
@@ -94,12 +94,16 @@
94 { "logo-mimetype", CONFIGSET_SKIN },
95 { "logo-image", CONFIGSET_SKIN },
96 { "background-mimetype", CONFIGSET_SKIN },
97 { "background-image", CONFIGSET_SKIN },
98 { "timeline-block-markup", CONFIGSET_SKIN },
99 { "timeline-date-format", CONFIGSET_SKIN },
100 { "timeline-dwelltime", CONFIGSET_SKIN },
101 { "timeline-max-comment", CONFIGSET_SKIN },
102 { "timeline-plaintext", CONFIGSET_SKIN },
103 { "timeline-truncate-at-blank", CONFIGSET_SKIN },
104 { "timeline-utc", CONFIGSET_SKIN },
105 { "adunit", CONFIGSET_SKIN },
106 { "adunit-omit-if-admin", CONFIGSET_SKIN },
107 { "adunit-omit-if-user", CONFIGSET_SKIN },
108 { "sitemap-docidx", CONFIGSET_SKIN },
109 { "sitemap-download", CONFIGSET_SKIN },
110
+11 -7
--- src/graph.js
+++ src/graph.js
@@ -14,10 +14,11 @@
1414
** "omitDescenders": BOOLEAN, // Omit ancestor lines off bottom of screen
1515
** "fileDiff": BOOLEAN, // True for file diff. False for check-in
1616
** "scrollToSelect": BOOLEAN, // Scroll to selection on first render
1717
** "nrail": INTEGER, // Number of vertical "rails"
1818
** "baseUrl": TEXT, // Top-level URL
19
+** "dwellTimeout": INTEGER, // Tooltip delay in milliseconds
1920
** "rowinfo": ROWINFO-ARRAY }
2021
**
2122
** The rowinfo field is an array of structures, one per entry in the timeline,
2223
** where each structure has the following fields:
2324
**
@@ -89,10 +90,11 @@
8990
9091
/* Construct that graph corresponding to the timeline-data-N object */
9192
function TimelineGraph(tx){
9293
var topObj = document.getElementById("timelineTable"+tx.iTableId);
9394
amendCss(tx.circleNodes, tx.showArrowheads);
95
+ tooltipInfo.dwellTimeout = tx.dwellTimeout
9496
topObj.onclick = clickOnGraph
9597
topObj.ondblclick = dblclickOnGraph
9698
topObj.onmousemove = function(e) {
9799
var ix = findTxIndex(e);
98100
var cursor = (ix<0) ? "" : "pointer"; /* Or: cursor = "help"? */
@@ -113,17 +115,19 @@
113115
** the dwell timer again. */
114116
tooltipObj.style.display = "none";
115117
tooltipInfo.ixElement = ix;
116118
tooltipInfo.posX = e.x;
117119
tooltipInfo.posY = e.y;
118
- tooltipInfo.idTimer = setTimeout(function() {
119
- this.tooltipInfo.idTimer = 0;
120
- showGraphTooltip(
121
- this.tooltipInfo.ixElement,
122
- this.tooltipInfo.posX,
123
- this.tooltipInfo.posY);
124
- }.bind(window),tooltipInfo.dwellTimeout);
120
+ if( tooltipInfo.dwellTimeout>0 ){
121
+ tooltipInfo.idTimer = setTimeout(function() {
122
+ this.tooltipInfo.idTimer = 0;
123
+ showGraphTooltip(
124
+ this.tooltipInfo.ixElement,
125
+ this.tooltipInfo.posX,
126
+ this.tooltipInfo.posY);
127
+ }.bind(window),tooltipInfo.dwellTimeout);
128
+ }
125129
}
126130
else
127131
tooltipInfo.ixElement = -1;
128132
};
129133
topObj.onmouseleave = function(e) {
130134
--- src/graph.js
+++ src/graph.js
@@ -14,10 +14,11 @@
14 ** "omitDescenders": BOOLEAN, // Omit ancestor lines off bottom of screen
15 ** "fileDiff": BOOLEAN, // True for file diff. False for check-in
16 ** "scrollToSelect": BOOLEAN, // Scroll to selection on first render
17 ** "nrail": INTEGER, // Number of vertical "rails"
18 ** "baseUrl": TEXT, // Top-level URL
 
19 ** "rowinfo": ROWINFO-ARRAY }
20 **
21 ** The rowinfo field is an array of structures, one per entry in the timeline,
22 ** where each structure has the following fields:
23 **
@@ -89,10 +90,11 @@
89
90 /* Construct that graph corresponding to the timeline-data-N object */
91 function TimelineGraph(tx){
92 var topObj = document.getElementById("timelineTable"+tx.iTableId);
93 amendCss(tx.circleNodes, tx.showArrowheads);
 
94 topObj.onclick = clickOnGraph
95 topObj.ondblclick = dblclickOnGraph
96 topObj.onmousemove = function(e) {
97 var ix = findTxIndex(e);
98 var cursor = (ix<0) ? "" : "pointer"; /* Or: cursor = "help"? */
@@ -113,17 +115,19 @@
113 ** the dwell timer again. */
114 tooltipObj.style.display = "none";
115 tooltipInfo.ixElement = ix;
116 tooltipInfo.posX = e.x;
117 tooltipInfo.posY = e.y;
118 tooltipInfo.idTimer = setTimeout(function() {
119 this.tooltipInfo.idTimer = 0;
120 showGraphTooltip(
121 this.tooltipInfo.ixElement,
122 this.tooltipInfo.posX,
123 this.tooltipInfo.posY);
124 }.bind(window),tooltipInfo.dwellTimeout);
 
 
125 }
126 else
127 tooltipInfo.ixElement = -1;
128 };
129 topObj.onmouseleave = function(e) {
130
--- src/graph.js
+++ src/graph.js
@@ -14,10 +14,11 @@
14 ** "omitDescenders": BOOLEAN, // Omit ancestor lines off bottom of screen
15 ** "fileDiff": BOOLEAN, // True for file diff. False for check-in
16 ** "scrollToSelect": BOOLEAN, // Scroll to selection on first render
17 ** "nrail": INTEGER, // Number of vertical "rails"
18 ** "baseUrl": TEXT, // Top-level URL
19 ** "dwellTimeout": INTEGER, // Tooltip delay in milliseconds
20 ** "rowinfo": ROWINFO-ARRAY }
21 **
22 ** The rowinfo field is an array of structures, one per entry in the timeline,
23 ** where each structure has the following fields:
24 **
@@ -89,10 +90,11 @@
90
91 /* Construct that graph corresponding to the timeline-data-N object */
92 function TimelineGraph(tx){
93 var topObj = document.getElementById("timelineTable"+tx.iTableId);
94 amendCss(tx.circleNodes, tx.showArrowheads);
95 tooltipInfo.dwellTimeout = tx.dwellTimeout
96 topObj.onclick = clickOnGraph
97 topObj.ondblclick = dblclickOnGraph
98 topObj.onmousemove = function(e) {
99 var ix = findTxIndex(e);
100 var cursor = (ix<0) ? "" : "pointer"; /* Or: cursor = "help"? */
@@ -113,17 +115,19 @@
115 ** the dwell timer again. */
116 tooltipObj.style.display = "none";
117 tooltipInfo.ixElement = ix;
118 tooltipInfo.posX = e.x;
119 tooltipInfo.posY = e.y;
120 if( tooltipInfo.dwellTimeout>0 ){
121 tooltipInfo.idTimer = setTimeout(function() {
122 this.tooltipInfo.idTimer = 0;
123 showGraphTooltip(
124 this.tooltipInfo.ixElement,
125 this.tooltipInfo.posX,
126 this.tooltipInfo.posY);
127 }.bind(window),tooltipInfo.dwellTimeout);
128 }
129 }
130 else
131 tooltipInfo.ixElement = -1;
132 };
133 topObj.onmouseleave = function(e) {
134
--- src/setup.c
+++ src/setup.c
@@ -749,10 +749,18 @@
749749
"timeline-max-comment", "tmc", "0", 0);
750750
@ <p>The maximum length of a comment to be displayed in a timeline.
751751
@ "0" there is no length limit.
752752
@ (Property: "timeline-max-comment")</p>
753753
754
+ @ <hr />
755
+ entry_attribute("Tooltip dwell time", 6,
756
+ "timeline-dwelltime", "tdt", "250", 0);
757
+ @ <p>The time (in milliseconds) that the mouse pointer should be
758
+ @ stationary above a object of the graph before a tooltip appears.
759
+ @ Set this to "0" to disable tooltips.
760
+ @ (Property: "timeline-dwelltime")</p>
761
+
754762
@ <hr />
755763
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
756764
@ </div></form>
757765
db_end_transaction(0);
758766
style_footer();
759767
--- src/setup.c
+++ src/setup.c
@@ -749,10 +749,18 @@
749 "timeline-max-comment", "tmc", "0", 0);
750 @ <p>The maximum length of a comment to be displayed in a timeline.
751 @ "0" there is no length limit.
752 @ (Property: "timeline-max-comment")</p>
753
 
 
 
 
 
 
 
 
754 @ <hr />
755 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
756 @ </div></form>
757 db_end_transaction(0);
758 style_footer();
759
--- src/setup.c
+++ src/setup.c
@@ -749,10 +749,18 @@
749 "timeline-max-comment", "tmc", "0", 0);
750 @ <p>The maximum length of a comment to be displayed in a timeline.
751 @ "0" there is no length limit.
752 @ (Property: "timeline-max-comment")</p>
753
754 @ <hr />
755 entry_attribute("Tooltip dwell time", 6,
756 "timeline-dwelltime", "tdt", "250", 0);
757 @ <p>The time (in milliseconds) that the mouse pointer should be
758 @ stationary above a object of the graph before a tooltip appears.
759 @ Set this to "0" to disable tooltips.
760 @ (Property: "timeline-dwelltime")</p>
761
762 @ <hr />
763 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
764 @ </div></form>
765 db_end_transaction(0);
766 style_footer();
767
--- src/timeline.c
+++ src/timeline.c
@@ -830,10 +830,11 @@
830830
int colorGraph; /* Use colors for graph lines */
831831
int iTopRow; /* Index of the top row of the graph */
832832
int fileDiff; /* True for file diff. False for check-in diff */
833833
int omitDescenders; /* True to omit descenders */
834834
int scrollToSelect; /* True to scroll to the selection */
835
+ int dwellTimeout; /* Milliseconds to wait for tooltips */
835836
u8 *aiMap; /* The rail map */
836837
837838
iRailPitch = atoi(PD("railpitch","0"));
838839
showArrowheads = skin_detail_boolean("timeline-arrowheads");
839840
circleNodes = skin_detail_boolean("timeline-circle-nodes");
@@ -840,10 +841,11 @@
840841
colorGraph = skin_detail_boolean("timeline-color-graph-lines");
841842
iTopRow = pGraph->pFirst ? pGraph->pFirst->idx : 0;
842843
omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
843844
fileDiff = (tmFlags & TIMELINE_FILEDIFF)!=0;
844845
scrollToSelect = (tmFlags & TIMELINE_NOSCROLL)==0;
846
+ dwellTimeout = atoi(db_get("timeline-dwelltime","250"));
845847
@ <script id='timeline-data-%d(iTableId)' type='application/json'>{
846848
@ "iTableId": %d(iTableId),
847849
@ "circleNodes": %d(circleNodes),
848850
@ "showArrowheads": %d(showArrowheads),
849851
@ "iRailPitch": %d(iRailPitch),
@@ -853,10 +855,11 @@
853855
@ "omitDescenders": %d(omitDescenders),
854856
@ "fileDiff": %d(fileDiff),
855857
@ "scrollToSelect": %d(scrollToSelect),
856858
@ "nrail": %d(pGraph->mxRail+1),
857859
@ "baseUrl": "%R",
860
+ @ "dwellTimeout": %d(dwellTimeout),
858861
@ "bottomRowId": "btm-%d(iTableId)",
859862
if( pGraph->nRow==0 ){
860863
@ "rowinfo": null
861864
}else{
862865
@ "rowinfo": [
863866
--- src/timeline.c
+++ src/timeline.c
@@ -830,10 +830,11 @@
830 int colorGraph; /* Use colors for graph lines */
831 int iTopRow; /* Index of the top row of the graph */
832 int fileDiff; /* True for file diff. False for check-in diff */
833 int omitDescenders; /* True to omit descenders */
834 int scrollToSelect; /* True to scroll to the selection */
 
835 u8 *aiMap; /* The rail map */
836
837 iRailPitch = atoi(PD("railpitch","0"));
838 showArrowheads = skin_detail_boolean("timeline-arrowheads");
839 circleNodes = skin_detail_boolean("timeline-circle-nodes");
@@ -840,10 +841,11 @@
840 colorGraph = skin_detail_boolean("timeline-color-graph-lines");
841 iTopRow = pGraph->pFirst ? pGraph->pFirst->idx : 0;
842 omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
843 fileDiff = (tmFlags & TIMELINE_FILEDIFF)!=0;
844 scrollToSelect = (tmFlags & TIMELINE_NOSCROLL)==0;
 
845 @ <script id='timeline-data-%d(iTableId)' type='application/json'>{
846 @ "iTableId": %d(iTableId),
847 @ "circleNodes": %d(circleNodes),
848 @ "showArrowheads": %d(showArrowheads),
849 @ "iRailPitch": %d(iRailPitch),
@@ -853,10 +855,11 @@
853 @ "omitDescenders": %d(omitDescenders),
854 @ "fileDiff": %d(fileDiff),
855 @ "scrollToSelect": %d(scrollToSelect),
856 @ "nrail": %d(pGraph->mxRail+1),
857 @ "baseUrl": "%R",
 
858 @ "bottomRowId": "btm-%d(iTableId)",
859 if( pGraph->nRow==0 ){
860 @ "rowinfo": null
861 }else{
862 @ "rowinfo": [
863
--- src/timeline.c
+++ src/timeline.c
@@ -830,10 +830,11 @@
830 int colorGraph; /* Use colors for graph lines */
831 int iTopRow; /* Index of the top row of the graph */
832 int fileDiff; /* True for file diff. False for check-in diff */
833 int omitDescenders; /* True to omit descenders */
834 int scrollToSelect; /* True to scroll to the selection */
835 int dwellTimeout; /* Milliseconds to wait for tooltips */
836 u8 *aiMap; /* The rail map */
837
838 iRailPitch = atoi(PD("railpitch","0"));
839 showArrowheads = skin_detail_boolean("timeline-arrowheads");
840 circleNodes = skin_detail_boolean("timeline-circle-nodes");
@@ -840,10 +841,11 @@
841 colorGraph = skin_detail_boolean("timeline-color-graph-lines");
842 iTopRow = pGraph->pFirst ? pGraph->pFirst->idx : 0;
843 omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
844 fileDiff = (tmFlags & TIMELINE_FILEDIFF)!=0;
845 scrollToSelect = (tmFlags & TIMELINE_NOSCROLL)==0;
846 dwellTimeout = atoi(db_get("timeline-dwelltime","250"));
847 @ <script id='timeline-data-%d(iTableId)' type='application/json'>{
848 @ "iTableId": %d(iTableId),
849 @ "circleNodes": %d(circleNodes),
850 @ "showArrowheads": %d(showArrowheads),
851 @ "iRailPitch": %d(iRailPitch),
@@ -853,10 +855,11 @@
855 @ "omitDescenders": %d(omitDescenders),
856 @ "fileDiff": %d(fileDiff),
857 @ "scrollToSelect": %d(scrollToSelect),
858 @ "nrail": %d(pGraph->mxRail+1),
859 @ "baseUrl": "%R",
860 @ "dwellTimeout": %d(dwellTimeout),
861 @ "bottomRowId": "btm-%d(iTableId)",
862 if( pGraph->nRow==0 ){
863 @ "rowinfo": null
864 }else{
865 @ "rowinfo": [
866

Keyboard Shortcuts

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