Fossil SCM
Apply the "hash-digits" setting to limit the length of hash prefixes displayed on tooltips.
Commit
90e4f5ae9f8f4e455d1650adb3362e9a372e52ed1117db551cbdcd97e9a615c1
Parent
f6fcbf292b9560d…
2 files changed
+4
+7
+4
| --- src/graph.js | ||
| +++ src/graph.js | ||
| @@ -19,10 +19,11 @@ | ||
| 19 | 19 | ** "scrollToSelect": BOOLEAN, // Scroll to selection on first render |
| 20 | 20 | ** "nrail": INTEGER, // Number of vertical "rails" |
| 21 | 21 | ** "baseUrl": TEXT, // Top-level URL |
| 22 | 22 | ** "dwellTimeout": INTEGER, // Tooltip show delay in milliseconds |
| 23 | 23 | ** "closeTimeout": INTEGER, // Tooltip close delay in milliseconds |
| 24 | +** "digitHuman": INTEGER, // Limit of tooltip hashes ("hash-digits") | |
| 24 | 25 | ** "rowinfo": ROWINFO-ARRAY } |
| 25 | 26 | ** |
| 26 | 27 | ** The rowinfo field is an array of structures, one per entry in the timeline, |
| 27 | 28 | ** where each structure has the following fields: |
| 28 | 29 | ** |
| @@ -97,10 +98,11 @@ | ||
| 97 | 98 | |
| 98 | 99 | /* State information for the tooltip popup and its timers */ |
| 99 | 100 | window.tooltipInfo = { |
| 100 | 101 | dwellTimeout: 250, /* The tooltip dwell timeout. */ |
| 101 | 102 | closeTimeout: 3000, /* The tooltip close timeout. */ |
| 103 | + digitHuman: 10, /* Limit of tooltip hashes ("hash-digits"). */ | |
| 102 | 104 | idTimer: 0, /* The tooltip dwell timer id. */ |
| 103 | 105 | idTimerClose: 0, /* The tooltip close timer id. */ |
| 104 | 106 | ixHover: -1, /* The id of the element with the mouse. */ |
| 105 | 107 | ixActive: -1, /* The id of the element with the tooltip. */ |
| 106 | 108 | nodeHover: null, /* Graph node under mouse when ixHover==-2 */ |
| @@ -141,10 +143,11 @@ | ||
| 141 | 143 | function TimelineGraph(tx){ |
| 142 | 144 | var topObj = document.getElementById("timelineTable"+tx.iTableId); |
| 143 | 145 | amendCss(tx.circleNodes, tx.showArrowheads); |
| 144 | 146 | tooltipInfo.dwellTimeout = tx.dwellTimeout |
| 145 | 147 | tooltipInfo.closeTimeout = tx.closeTimeout |
| 148 | + tooltipInfo.digitHuman = tx.digitHuman | |
| 146 | 149 | topObj.onclick = clickOnGraph |
| 147 | 150 | topObj.ondblclick = dblclickOnGraph |
| 148 | 151 | topObj.onmousemove = function(e) { |
| 149 | 152 | var ix = findTxIndex(e); |
| 150 | 153 | topObj.style.cursor = (ix<0) ? "" : "pointer" |
| @@ -594,10 +597,11 @@ | ||
| 594 | 597 | var ix = -1 |
| 595 | 598 | if( tooltipInfo.ixHover==-2 ){ |
| 596 | 599 | ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow |
| 597 | 600 | var h = tx.rowinfo[ix].h |
| 598 | 601 | var dest = tx.baseUrl + "/info/" + h |
| 602 | + h = h.slice(0,tooltipInfo.digitHuman); // Assume single-byte characters. | |
| 599 | 603 | if( tx.fileDiff ){ |
| 600 | 604 | html = "artifact <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>" |
| 601 | 605 | }else{ |
| 602 | 606 | html = "check-in <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>" |
| 603 | 607 | } |
| 604 | 608 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -19,10 +19,11 @@ | |
| 19 | ** "scrollToSelect": BOOLEAN, // Scroll to selection on first render |
| 20 | ** "nrail": INTEGER, // Number of vertical "rails" |
| 21 | ** "baseUrl": TEXT, // Top-level URL |
| 22 | ** "dwellTimeout": INTEGER, // Tooltip show delay in milliseconds |
| 23 | ** "closeTimeout": INTEGER, // Tooltip close delay in milliseconds |
| 24 | ** "rowinfo": ROWINFO-ARRAY } |
| 25 | ** |
| 26 | ** The rowinfo field is an array of structures, one per entry in the timeline, |
| 27 | ** where each structure has the following fields: |
| 28 | ** |
| @@ -97,10 +98,11 @@ | |
| 97 | |
| 98 | /* State information for the tooltip popup and its timers */ |
| 99 | window.tooltipInfo = { |
| 100 | dwellTimeout: 250, /* The tooltip dwell timeout. */ |
| 101 | closeTimeout: 3000, /* The tooltip close timeout. */ |
| 102 | idTimer: 0, /* The tooltip dwell timer id. */ |
| 103 | idTimerClose: 0, /* The tooltip close timer id. */ |
| 104 | ixHover: -1, /* The id of the element with the mouse. */ |
| 105 | ixActive: -1, /* The id of the element with the tooltip. */ |
| 106 | nodeHover: null, /* Graph node under mouse when ixHover==-2 */ |
| @@ -141,10 +143,11 @@ | |
| 141 | function TimelineGraph(tx){ |
| 142 | var topObj = document.getElementById("timelineTable"+tx.iTableId); |
| 143 | amendCss(tx.circleNodes, tx.showArrowheads); |
| 144 | tooltipInfo.dwellTimeout = tx.dwellTimeout |
| 145 | tooltipInfo.closeTimeout = tx.closeTimeout |
| 146 | topObj.onclick = clickOnGraph |
| 147 | topObj.ondblclick = dblclickOnGraph |
| 148 | topObj.onmousemove = function(e) { |
| 149 | var ix = findTxIndex(e); |
| 150 | topObj.style.cursor = (ix<0) ? "" : "pointer" |
| @@ -594,10 +597,11 @@ | |
| 594 | var ix = -1 |
| 595 | if( tooltipInfo.ixHover==-2 ){ |
| 596 | ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow |
| 597 | var h = tx.rowinfo[ix].h |
| 598 | var dest = tx.baseUrl + "/info/" + h |
| 599 | if( tx.fileDiff ){ |
| 600 | html = "artifact <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>" |
| 601 | }else{ |
| 602 | html = "check-in <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>" |
| 603 | } |
| 604 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -19,10 +19,11 @@ | |
| 19 | ** "scrollToSelect": BOOLEAN, // Scroll to selection on first render |
| 20 | ** "nrail": INTEGER, // Number of vertical "rails" |
| 21 | ** "baseUrl": TEXT, // Top-level URL |
| 22 | ** "dwellTimeout": INTEGER, // Tooltip show delay in milliseconds |
| 23 | ** "closeTimeout": INTEGER, // Tooltip close delay in milliseconds |
| 24 | ** "digitHuman": INTEGER, // Limit of tooltip hashes ("hash-digits") |
| 25 | ** "rowinfo": ROWINFO-ARRAY } |
| 26 | ** |
| 27 | ** The rowinfo field is an array of structures, one per entry in the timeline, |
| 28 | ** where each structure has the following fields: |
| 29 | ** |
| @@ -97,10 +98,11 @@ | |
| 98 | |
| 99 | /* State information for the tooltip popup and its timers */ |
| 100 | window.tooltipInfo = { |
| 101 | dwellTimeout: 250, /* The tooltip dwell timeout. */ |
| 102 | closeTimeout: 3000, /* The tooltip close timeout. */ |
| 103 | digitHuman: 10, /* Limit of tooltip hashes ("hash-digits"). */ |
| 104 | idTimer: 0, /* The tooltip dwell timer id. */ |
| 105 | idTimerClose: 0, /* The tooltip close timer id. */ |
| 106 | ixHover: -1, /* The id of the element with the mouse. */ |
| 107 | ixActive: -1, /* The id of the element with the tooltip. */ |
| 108 | nodeHover: null, /* Graph node under mouse when ixHover==-2 */ |
| @@ -141,10 +143,11 @@ | |
| 143 | function TimelineGraph(tx){ |
| 144 | var topObj = document.getElementById("timelineTable"+tx.iTableId); |
| 145 | amendCss(tx.circleNodes, tx.showArrowheads); |
| 146 | tooltipInfo.dwellTimeout = tx.dwellTimeout |
| 147 | tooltipInfo.closeTimeout = tx.closeTimeout |
| 148 | tooltipInfo.digitHuman = tx.digitHuman |
| 149 | topObj.onclick = clickOnGraph |
| 150 | topObj.ondblclick = dblclickOnGraph |
| 151 | topObj.onmousemove = function(e) { |
| 152 | var ix = findTxIndex(e); |
| 153 | topObj.style.cursor = (ix<0) ? "" : "pointer" |
| @@ -594,10 +597,11 @@ | |
| 597 | var ix = -1 |
| 598 | if( tooltipInfo.ixHover==-2 ){ |
| 599 | ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow |
| 600 | var h = tx.rowinfo[ix].h |
| 601 | var dest = tx.baseUrl + "/info/" + h |
| 602 | h = h.slice(0,tooltipInfo.digitHuman); // Assume single-byte characters. |
| 603 | if( tx.fileDiff ){ |
| 604 | html = "artifact <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>" |
| 605 | }else{ |
| 606 | html = "check-in <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>" |
| 607 | } |
| 608 |
+7
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -832,10 +832,11 @@ | ||
| 832 | 832 | int fileDiff; /* True for file diff. False for check-in diff */ |
| 833 | 833 | int omitDescenders; /* True to omit descenders */ |
| 834 | 834 | int scrollToSelect; /* True to scroll to the selection */ |
| 835 | 835 | int dwellTimeout; /* Milliseconds to wait for tooltips to show */ |
| 836 | 836 | int closeTimeout; /* Milliseconds to wait for tooltips to close */ |
| 837 | + int nDigitHuman; /* The "hash-digits" limit for tooltip hash prefixes */ | |
| 837 | 838 | u8 *aiMap; /* The rail map */ |
| 838 | 839 | |
| 839 | 840 | iRailPitch = atoi(PD("railpitch","0")); |
| 840 | 841 | showArrowheads = skin_detail_boolean("timeline-arrowheads"); |
| 841 | 842 | circleNodes = skin_detail_boolean("timeline-circle-nodes"); |
| @@ -844,10 +845,15 @@ | ||
| 844 | 845 | omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0; |
| 845 | 846 | fileDiff = (tmFlags & TIMELINE_FILEDIFF)!=0; |
| 846 | 847 | scrollToSelect = (tmFlags & TIMELINE_NOSCROLL)==0; |
| 847 | 848 | dwellTimeout = atoi(db_get("timeline-dwelltime","100")); |
| 848 | 849 | closeTimeout = atoi(db_get("timeline-closetime","250")); |
| 850 | +/* Preprocessor definitions copied from src\printf.c. */ | |
| 851 | +#ifndef FOSSIL_HASH_DIGITS | |
| 852 | +# define FOSSIL_HASH_DIGITS 10 | |
| 853 | +#endif | |
| 854 | + nDigitHuman = db_get_int("hash-digits", FOSSIL_HASH_DIGITS); | |
| 849 | 855 | @ <script id='timeline-data-%d(iTableId)' type='application/json'>{ |
| 850 | 856 | @ "iTableId": %d(iTableId), |
| 851 | 857 | @ "circleNodes": %d(circleNodes), |
| 852 | 858 | @ "showArrowheads": %d(showArrowheads), |
| 853 | 859 | @ "iRailPitch": %d(iRailPitch), |
| @@ -859,10 +865,11 @@ | ||
| 859 | 865 | @ "scrollToSelect": %d(scrollToSelect), |
| 860 | 866 | @ "nrail": %d(pGraph->mxRail+1), |
| 861 | 867 | @ "baseUrl": "%R", |
| 862 | 868 | @ "dwellTimeout": %d(dwellTimeout), |
| 863 | 869 | @ "closeTimeout": %d(closeTimeout), |
| 870 | + @ "digitHuman": %d(nDigitHuman), | |
| 864 | 871 | @ "bottomRowId": "btm-%d(iTableId)", |
| 865 | 872 | if( pGraph->nRow==0 ){ |
| 866 | 873 | @ "rowinfo": null |
| 867 | 874 | }else{ |
| 868 | 875 | @ "rowinfo": [ |
| 869 | 876 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -832,10 +832,11 @@ | |
| 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 to show */ |
| 836 | int closeTimeout; /* Milliseconds to wait for tooltips to close */ |
| 837 | u8 *aiMap; /* The rail map */ |
| 838 | |
| 839 | iRailPitch = atoi(PD("railpitch","0")); |
| 840 | showArrowheads = skin_detail_boolean("timeline-arrowheads"); |
| 841 | circleNodes = skin_detail_boolean("timeline-circle-nodes"); |
| @@ -844,10 +845,15 @@ | |
| 844 | omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0; |
| 845 | fileDiff = (tmFlags & TIMELINE_FILEDIFF)!=0; |
| 846 | scrollToSelect = (tmFlags & TIMELINE_NOSCROLL)==0; |
| 847 | dwellTimeout = atoi(db_get("timeline-dwelltime","100")); |
| 848 | closeTimeout = atoi(db_get("timeline-closetime","250")); |
| 849 | @ <script id='timeline-data-%d(iTableId)' type='application/json'>{ |
| 850 | @ "iTableId": %d(iTableId), |
| 851 | @ "circleNodes": %d(circleNodes), |
| 852 | @ "showArrowheads": %d(showArrowheads), |
| 853 | @ "iRailPitch": %d(iRailPitch), |
| @@ -859,10 +865,11 @@ | |
| 859 | @ "scrollToSelect": %d(scrollToSelect), |
| 860 | @ "nrail": %d(pGraph->mxRail+1), |
| 861 | @ "baseUrl": "%R", |
| 862 | @ "dwellTimeout": %d(dwellTimeout), |
| 863 | @ "closeTimeout": %d(closeTimeout), |
| 864 | @ "bottomRowId": "btm-%d(iTableId)", |
| 865 | if( pGraph->nRow==0 ){ |
| 866 | @ "rowinfo": null |
| 867 | }else{ |
| 868 | @ "rowinfo": [ |
| 869 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -832,10 +832,11 @@ | |
| 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 to show */ |
| 836 | int closeTimeout; /* Milliseconds to wait for tooltips to close */ |
| 837 | int nDigitHuman; /* The "hash-digits" limit for tooltip hash prefixes */ |
| 838 | u8 *aiMap; /* The rail map */ |
| 839 | |
| 840 | iRailPitch = atoi(PD("railpitch","0")); |
| 841 | showArrowheads = skin_detail_boolean("timeline-arrowheads"); |
| 842 | circleNodes = skin_detail_boolean("timeline-circle-nodes"); |
| @@ -844,10 +845,15 @@ | |
| 845 | omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0; |
| 846 | fileDiff = (tmFlags & TIMELINE_FILEDIFF)!=0; |
| 847 | scrollToSelect = (tmFlags & TIMELINE_NOSCROLL)==0; |
| 848 | dwellTimeout = atoi(db_get("timeline-dwelltime","100")); |
| 849 | closeTimeout = atoi(db_get("timeline-closetime","250")); |
| 850 | /* Preprocessor definitions copied from src\printf.c. */ |
| 851 | #ifndef FOSSIL_HASH_DIGITS |
| 852 | # define FOSSIL_HASH_DIGITS 10 |
| 853 | #endif |
| 854 | nDigitHuman = db_get_int("hash-digits", FOSSIL_HASH_DIGITS); |
| 855 | @ <script id='timeline-data-%d(iTableId)' type='application/json'>{ |
| 856 | @ "iTableId": %d(iTableId), |
| 857 | @ "circleNodes": %d(circleNodes), |
| 858 | @ "showArrowheads": %d(showArrowheads), |
| 859 | @ "iRailPitch": %d(iRailPitch), |
| @@ -859,10 +865,11 @@ | |
| 865 | @ "scrollToSelect": %d(scrollToSelect), |
| 866 | @ "nrail": %d(pGraph->mxRail+1), |
| 867 | @ "baseUrl": "%R", |
| 868 | @ "dwellTimeout": %d(dwellTimeout), |
| 869 | @ "closeTimeout": %d(closeTimeout), |
| 870 | @ "digitHuman": %d(nDigitHuman), |
| 871 | @ "bottomRowId": "btm-%d(iTableId)", |
| 872 | if( pGraph->nRow==0 ){ |
| 873 | @ "rowinfo": null |
| 874 | }else{ |
| 875 | @ "rowinfo": [ |
| 876 |