Fossil SCM

Automatically add "glob=<str>" to the query string of the /vdiff page when looking at subdirectory history.

mgagnon 2021-04-26 17:57 trunk merge
Commit d96982fba6989ab2c59e87738170dab86df69b99eb3f04f964cb4415512deab1
1 file changed +16 -2
+16 -2
--- src/graph.js
+++ src/graph.js
@@ -568,13 +568,27 @@
568568
selRow = null;
569569
this.className = this.className.replace(" sel", "");
570570
canvasDiv.className = canvasDiv.className.replace(" sel", "");
571571
}else{
572572
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;
574574
}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;
576590
}
577591
}
578592
e.stopPropagation()
579593
}
580594
function dblclickOnNode(e){
581595
--- 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

Keyboard Shortcuts

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