Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Apply the "hash-digits" setting to limit the length of hash prefixes displayed on tooltips. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | tooltip-copyhash |
| Files: | files | file ages | folders |
| SHA3-256: |
90e4f5ae9f8f4e455d1650adb3362e9a |
| User & Date: | florian 2019-05-29 14:14:00.000 |
Context
|
2019-05-30
| ||
| 11:04 | Revert the manual edits to the makefiles from [f6fcbf292b], and only keep the changes made by the src/makemake.tcl script. ... (check-in: 2002a50893 user: florian tags: tooltip-copyhash) | |
|
2019-05-29
| ||
| 14:14 | Apply the "hash-digits" setting to limit the length of hash prefixes displayed on tooltips. ... (check-in: 90e4f5ae9f user: florian tags: tooltip-copyhash) | |
| 14:02 | Move the "Copy Button" functionality to a separate Javascript module, to be loaded and used independently from the timeline graph module. ... (check-in: f6fcbf292b user: florian tags: tooltip-copyhash) | |
Changes
Changes to src/graph.js.
| ︙ | ︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ** "omitDescenders": BOOLEAN, // Omit ancestor lines off bottom of screen ** "fileDiff": BOOLEAN, // True for file diff. False for check-in ** "scrollToSelect": BOOLEAN, // Scroll to selection on first render ** "nrail": INTEGER, // Number of vertical "rails" ** "baseUrl": TEXT, // Top-level URL ** "dwellTimeout": INTEGER, // Tooltip show delay in milliseconds ** "closeTimeout": INTEGER, // Tooltip close delay in milliseconds ** "rowinfo": ROWINFO-ARRAY } ** ** The rowinfo field is an array of structures, one per entry in the timeline, ** where each structure has the following fields: ** ** id: The id of the <div> element for the row. This is an integer. ** to get an actual id, prepend "m" to the integer. The top node | > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
** "omitDescenders": BOOLEAN, // Omit ancestor lines off bottom of screen
** "fileDiff": BOOLEAN, // True for file diff. False for check-in
** "scrollToSelect": BOOLEAN, // Scroll to selection on first render
** "nrail": INTEGER, // Number of vertical "rails"
** "baseUrl": TEXT, // Top-level URL
** "dwellTimeout": INTEGER, // Tooltip show delay in milliseconds
** "closeTimeout": INTEGER, // Tooltip close delay in milliseconds
** "digitHuman": INTEGER, // Limit of tooltip hashes ("hash-digits")
** "rowinfo": ROWINFO-ARRAY }
**
** The rowinfo field is an array of structures, one per entry in the timeline,
** where each structure has the following fields:
**
** id: The id of the <div> element for the row. This is an integer.
** to get an actual id, prepend "m" to the integer. The top node
|
| ︙ | ︙ | |||
95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
if (tooltipInfo.ixActive != -1) resumeCloseTimer();
};
/* State information for the tooltip popup and its timers */
window.tooltipInfo = {
dwellTimeout: 250, /* The tooltip dwell timeout. */
closeTimeout: 3000, /* The tooltip close timeout. */
idTimer: 0, /* The tooltip dwell timer id. */
idTimerClose: 0, /* The tooltip close timer id. */
ixHover: -1, /* The id of the element with the mouse. */
ixActive: -1, /* The id of the element with the tooltip. */
nodeHover: null, /* Graph node under mouse when ixHover==-2 */
posX: 0, posY: 0 /* The last mouse position. */
};
| > | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
if (tooltipInfo.ixActive != -1) resumeCloseTimer();
};
/* State information for the tooltip popup and its timers */
window.tooltipInfo = {
dwellTimeout: 250, /* The tooltip dwell timeout. */
closeTimeout: 3000, /* The tooltip close timeout. */
digitHuman: 10, /* Limit of tooltip hashes ("hash-digits"). */
idTimer: 0, /* The tooltip dwell timer id. */
idTimerClose: 0, /* The tooltip close timer id. */
ixHover: -1, /* The id of the element with the mouse. */
ixActive: -1, /* The id of the element with the tooltip. */
nodeHover: null, /* Graph node under mouse when ixHover==-2 */
posX: 0, posY: 0 /* The last mouse position. */
};
|
| ︙ | ︙ | |||
139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
/* Construct that graph corresponding to the timeline-data-N object that
** is passed in by the tx parameter */
function TimelineGraph(tx){
var topObj = document.getElementById("timelineTable"+tx.iTableId);
amendCss(tx.circleNodes, tx.showArrowheads);
tooltipInfo.dwellTimeout = tx.dwellTimeout
tooltipInfo.closeTimeout = tx.closeTimeout
topObj.onclick = clickOnGraph
topObj.ondblclick = dblclickOnGraph
topObj.onmousemove = function(e) {
var ix = findTxIndex(e);
topObj.style.cursor = (ix<0) ? "" : "pointer"
/* Keep the already visible tooltip at a constant position, as long as the
** mouse is over the same element. */
| > | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
/* Construct that graph corresponding to the timeline-data-N object that
** is passed in by the tx parameter */
function TimelineGraph(tx){
var topObj = document.getElementById("timelineTable"+tx.iTableId);
amendCss(tx.circleNodes, tx.showArrowheads);
tooltipInfo.dwellTimeout = tx.dwellTimeout
tooltipInfo.closeTimeout = tx.closeTimeout
tooltipInfo.digitHuman = tx.digitHuman
topObj.onclick = clickOnGraph
topObj.ondblclick = dblclickOnGraph
topObj.onmousemove = function(e) {
var ix = findTxIndex(e);
topObj.style.cursor = (ix<0) ? "" : "pointer"
/* Keep the already visible tooltip at a constant position, as long as the
** mouse is over the same element. */
|
| ︙ | ︙ | |||
592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
function showGraphTooltip(){
var html = null
var ix = -1
if( tooltipInfo.ixHover==-2 ){
ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow
var h = tx.rowinfo[ix].h
var dest = tx.baseUrl + "/info/" + h
if( tx.fileDiff ){
html = "artifact <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>"
}else{
html = "check-in <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>"
}
tooltipInfo.ixActive = -2;
}else if( tooltipInfo.ixHover>=0 ){
| > | 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 |
function showGraphTooltip(){
var html = null
var ix = -1
if( tooltipInfo.ixHover==-2 ){
ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow
var h = tx.rowinfo[ix].h
var dest = tx.baseUrl + "/info/" + h
h = h.slice(0,tooltipInfo.digitHuman); // Assume single-byte characters.
if( tx.fileDiff ){
html = "artifact <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>"
}else{
html = "check-in <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>"
}
tooltipInfo.ixActive = -2;
}else if( tooltipInfo.ixHover>=0 ){
|
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 |
int colorGraph; /* Use colors for graph lines */
int iTopRow; /* Index of the top row of the graph */
int fileDiff; /* True for file diff. False for check-in diff */
int omitDescenders; /* True to omit descenders */
int scrollToSelect; /* True to scroll to the selection */
int dwellTimeout; /* Milliseconds to wait for tooltips to show */
int closeTimeout; /* Milliseconds to wait for tooltips to close */
u8 *aiMap; /* The rail map */
iRailPitch = atoi(PD("railpitch","0"));
showArrowheads = skin_detail_boolean("timeline-arrowheads");
circleNodes = skin_detail_boolean("timeline-circle-nodes");
colorGraph = skin_detail_boolean("timeline-color-graph-lines");
iTopRow = pGraph->pFirst ? pGraph->pFirst->idx : 0;
omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
fileDiff = (tmFlags & TIMELINE_FILEDIFF)!=0;
scrollToSelect = (tmFlags & TIMELINE_NOSCROLL)==0;
dwellTimeout = atoi(db_get("timeline-dwelltime","100"));
closeTimeout = atoi(db_get("timeline-closetime","250"));
@ <script id='timeline-data-%d(iTableId)' type='application/json'>{
@ "iTableId": %d(iTableId),
@ "circleNodes": %d(circleNodes),
@ "showArrowheads": %d(showArrowheads),
@ "iRailPitch": %d(iRailPitch),
@ "colorGraph": %d(colorGraph),
@ "nomo": %d(PB("nomo")),
@ "iTopRow": %d(iTopRow),
@ "omitDescenders": %d(omitDescenders),
@ "fileDiff": %d(fileDiff),
@ "scrollToSelect": %d(scrollToSelect),
@ "nrail": %d(pGraph->mxRail+1),
@ "baseUrl": "%R",
@ "dwellTimeout": %d(dwellTimeout),
@ "closeTimeout": %d(closeTimeout),
@ "bottomRowId": "btm-%d(iTableId)",
if( pGraph->nRow==0 ){
@ "rowinfo": null
}else{
@ "rowinfo": [
}
| > > > > > > > | 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 |
int colorGraph; /* Use colors for graph lines */
int iTopRow; /* Index of the top row of the graph */
int fileDiff; /* True for file diff. False for check-in diff */
int omitDescenders; /* True to omit descenders */
int scrollToSelect; /* True to scroll to the selection */
int dwellTimeout; /* Milliseconds to wait for tooltips to show */
int closeTimeout; /* Milliseconds to wait for tooltips to close */
int nDigitHuman; /* The "hash-digits" limit for tooltip hash prefixes */
u8 *aiMap; /* The rail map */
iRailPitch = atoi(PD("railpitch","0"));
showArrowheads = skin_detail_boolean("timeline-arrowheads");
circleNodes = skin_detail_boolean("timeline-circle-nodes");
colorGraph = skin_detail_boolean("timeline-color-graph-lines");
iTopRow = pGraph->pFirst ? pGraph->pFirst->idx : 0;
omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
fileDiff = (tmFlags & TIMELINE_FILEDIFF)!=0;
scrollToSelect = (tmFlags & TIMELINE_NOSCROLL)==0;
dwellTimeout = atoi(db_get("timeline-dwelltime","100"));
closeTimeout = atoi(db_get("timeline-closetime","250"));
/* Preprocessor definitions copied from src\printf.c. */
#ifndef FOSSIL_HASH_DIGITS
# define FOSSIL_HASH_DIGITS 10
#endif
nDigitHuman = db_get_int("hash-digits", FOSSIL_HASH_DIGITS);
@ <script id='timeline-data-%d(iTableId)' type='application/json'>{
@ "iTableId": %d(iTableId),
@ "circleNodes": %d(circleNodes),
@ "showArrowheads": %d(showArrowheads),
@ "iRailPitch": %d(iRailPitch),
@ "colorGraph": %d(colorGraph),
@ "nomo": %d(PB("nomo")),
@ "iTopRow": %d(iTopRow),
@ "omitDescenders": %d(omitDescenders),
@ "fileDiff": %d(fileDiff),
@ "scrollToSelect": %d(scrollToSelect),
@ "nrail": %d(pGraph->mxRail+1),
@ "baseUrl": "%R",
@ "dwellTimeout": %d(dwellTimeout),
@ "closeTimeout": %d(closeTimeout),
@ "digitHuman": %d(nDigitHuman),
@ "bottomRowId": "btm-%d(iTableId)",
if( pGraph->nRow==0 ){
@ "rowinfo": null
}else{
@ "rowinfo": [
}
|
| ︙ | ︙ |