Fossil SCM
Gracefully degrade to the old behaviour if a user's browser does not support <code>URLSearchParams</code>.
Commit
262c0fb675bd63308955344349e616405b055517e0a16ea0939c8f6aa54c87a9
Parent
d96982fba6989ab…
1 file changed
+13
-12
+13
-12
| --- src/graph.js | ||
| +++ src/graph.js | ||
| @@ -572,22 +572,23 @@ | ||
| 572 | 572 | if( tx.fileDiff ){ |
| 573 | 573 | location.href=tx.baseUrl + "/fdiff?v1="+selRow.h+"&v2="+p.h; |
| 574 | 574 | }else{ |
| 575 | 575 | var href = tx.baseUrl + "/vdiff?from="+selRow.h+"&to="+p.h; |
| 576 | 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 | - | |
| 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 | + } | |
| 589 | 590 | location.href = href; |
| 590 | 591 | } |
| 591 | 592 | } |
| 592 | 593 | e.stopPropagation() |
| 593 | 594 | } |
| 594 | 595 |
| --- 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 |