Fossil SCM
Automatically add "glob=<str>" to the query string of the /vdiff page when looking at subdirectory history.
Commit
d96982fba6989ab2c59e87738170dab86df69b99eb3f04f964cb4415512deab1
Parent
ffd0999374d4c3b…
1 file changed
+16
-2
+16
-2
| --- src/graph.js | ||
| +++ src/graph.js | ||
| @@ -568,13 +568,27 @@ | ||
| 568 | 568 | selRow = null; |
| 569 | 569 | this.className = this.className.replace(" sel", ""); |
| 570 | 570 | canvasDiv.className = canvasDiv.className.replace(" sel", ""); |
| 571 | 571 | }else{ |
| 572 | 572 | if( tx.fileDiff ){ |
| 573 | - location.href=tx.baseUrl + "/fdiff?v1="+selRow.h+"&v2="+p.h | |
| 573 | + location.href=tx.baseUrl + "/fdiff?v1="+selRow.h+"&v2="+p.h; | |
| 574 | 574 | }else{ |
| 575 | - location.href=tx.baseUrl + "/vdiff?from="+selRow.h+"&to="+p.h | |
| 575 | + var href = tx.baseUrl + "/vdiff?from="+selRow.h+"&to="+p.h; | |
| 576 | + let params = (new URL(document.location)).searchParams; | |
| 577 | + /* When called from /timeline page, If chng=str was specified in the | |
| 578 | + ** QueryString, specify glob=str on the /vdiff page */ | |
| 579 | + let glob = params.get("chng"); | |
| 580 | + if( !glob ){ | |
| 581 | + /* When called from /vdiff page, keep the glob= QueryString if | |
| 582 | + ** present. */ | |
| 583 | + glob = params.get("glob"); | |
| 584 | + } | |
| 585 | + if( glob ){ | |
| 586 | + href += "&glob=" + glob; | |
| 587 | + } | |
| 588 | + | |
| 589 | + location.href = href; | |
| 576 | 590 | } |
| 577 | 591 | } |
| 578 | 592 | e.stopPropagation() |
| 579 | 593 | } |
| 580 | 594 | function dblclickOnNode(e){ |
| 581 | 595 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -568,13 +568,27 @@ | |
| 568 | selRow = null; |
| 569 | this.className = this.className.replace(" sel", ""); |
| 570 | canvasDiv.className = canvasDiv.className.replace(" sel", ""); |
| 571 | }else{ |
| 572 | if( tx.fileDiff ){ |
| 573 | location.href=tx.baseUrl + "/fdiff?v1="+selRow.h+"&v2="+p.h |
| 574 | }else{ |
| 575 | location.href=tx.baseUrl + "/vdiff?from="+selRow.h+"&to="+p.h |
| 576 | } |
| 577 | } |
| 578 | e.stopPropagation() |
| 579 | } |
| 580 | function dblclickOnNode(e){ |
| 581 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -568,13 +568,27 @@ | |
| 568 | selRow = null; |
| 569 | this.className = this.className.replace(" sel", ""); |
| 570 | canvasDiv.className = canvasDiv.className.replace(" sel", ""); |
| 571 | }else{ |
| 572 | if( tx.fileDiff ){ |
| 573 | location.href=tx.baseUrl + "/fdiff?v1="+selRow.h+"&v2="+p.h; |
| 574 | }else{ |
| 575 | var href = tx.baseUrl + "/vdiff?from="+selRow.h+"&to="+p.h; |
| 576 | let params = (new URL(document.location)).searchParams; |
| 577 | /* When called from /timeline page, If chng=str was specified in the |
| 578 | ** QueryString, specify glob=str on the /vdiff page */ |
| 579 | let glob = params.get("chng"); |
| 580 | if( !glob ){ |
| 581 | /* When called from /vdiff page, keep the glob= QueryString if |
| 582 | ** present. */ |
| 583 | glob = params.get("glob"); |
| 584 | } |
| 585 | if( glob ){ |
| 586 | href += "&glob=" + glob; |
| 587 | } |
| 588 | |
| 589 | location.href = href; |
| 590 | } |
| 591 | } |
| 592 | e.stopPropagation() |
| 593 | } |
| 594 | function dblclickOnNode(e){ |
| 595 |