Fossil SCM

Gracefully degrade to the old behaviour if a user's browser does not support <code>URLSearchParams</code>.

george 2021-04-26 19:45 trunk merge
Commit 262c0fb675bd63308955344349e616405b055517e0a16ea0939c8f6aa54c87a9
1 file changed +13 -12
+13 -12
--- src/graph.js
+++ src/graph.js
@@ -572,22 +572,23 @@
572572
if( tx.fileDiff ){
573573
location.href=tx.baseUrl + "/fdiff?v1="+selRow.h+"&v2="+p.h;
574574
}else{
575575
var href = tx.baseUrl + "/vdiff?from="+selRow.h+"&to="+p.h;
576576
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
-
577
+ if(params && typeof params === "object"){
578
+ /* When called from /timeline page, If chng=str was specified in the
579
+ ** QueryString, specify glob=str on the /vdiff page */
580
+ let glob = params.get("chng");
581
+ if( !glob ){
582
+ /* When called from /vdiff page, keep the glob= QueryString if
583
+ ** present. */
584
+ glob = params.get("glob");
585
+ }
586
+ if( glob ){
587
+ href += "&glob=" + glob;
588
+ }
589
+ }
589590
location.href = href;
590591
}
591592
}
592593
e.stopPropagation()
593594
}
594595
--- src/graph.js
+++ src/graph.js
@@ -572,22 +572,23 @@
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
--- src/graph.js
+++ src/graph.js
@@ -572,22 +572,23 @@
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 if(params && typeof params === "object"){
578 /* When called from /timeline page, If chng=str was specified in the
579 ** QueryString, specify glob=str on the /vdiff page */
580 let glob = params.get("chng");
581 if( !glob ){
582 /* When called from /vdiff page, keep the glob= QueryString if
583 ** present. */
584 glob = params.get("glob");
585 }
586 if( glob ){
587 href += "&glob=" + glob;
588 }
589 }
590 location.href = href;
591 }
592 }
593 e.stopPropagation()
594 }
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