Fossil

Check-in [fab81968d1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use URLSearchParams API instead use custom GetQueryStringValue() function. URLSearchParams is support by most browser since 2017.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | vdiff-context-glob
Files: files | file ages | folders
SHA3-256: fab81968d1b56670a00c4d666ab0adc0d1951676967676e48c79858b969a67ec
User & Date: mgagnon 2021-04-26 15:36:49.062
Context
2021-04-26
15:37
Merge latest changes from trunk ... (check-in: 700ae1075b user: mgagnon tags: vdiff-context-glob)
15:36
Use URLSearchParams API instead use custom GetQueryStringValue() function. URLSearchParams is support by most browser since 2017. ... (check-in: fab81968d1 user: mgagnon tags: vdiff-context-glob)
2021-04-23
20:03
Automatically add "glob=<str>" to the query string of the /vdiff page when looking at subdirectory history. ... (check-in: 3e588c822c user: mgagnon tags: vdiff-context-glob)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/graph.js.
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
  if( css!=="" ){
    var style = document.createElement("style");
    style.textContent = css;
    document.querySelector("head").appendChild(style);
  }
  amendCssOnce = 0;
}
  
/* Legacy function to get a single key in the QueryString. */
function getQueryStringValue (key) {  
  return decodeURIComponent(
    window.location.search.replace(
      new RegExp(
        "^(?:.*[&\\?]" + encodeURIComponent(key).replace(
          /[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"
      ), "$1"
    )
  );  
}  

/* The <span> object that holds the tooltip */
var tooltipObj = document.createElement("span");
tooltipObj.className = "tl-tooltip";
tooltipObj.style.display = "none";
document.getElementsByClassName("content")[0].appendChild(tooltipObj);
tooltipObj.onmouseenter = function(){







<
<
<
<
<
<
<
<
<
<
<
<







80
81
82
83
84
85
86












87
88
89
90
91
92
93
  if( css!=="" ){
    var style = document.createElement("style");
    style.textContent = css;
    document.querySelector("head").appendChild(style);
  }
  amendCssOnce = 0;
}













/* The <span> object that holds the tooltip */
var tooltipObj = document.createElement("span");
tooltipObj.className = "tl-tooltip";
tooltipObj.style.display = "none";
document.getElementsByClassName("content")[0].appendChild(tooltipObj);
tooltipObj.onmouseenter = function(){
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
      this.className = this.className.replace(" sel", "");
      canvasDiv.className = canvasDiv.className.replace(" sel", "");
    }else{
      if( tx.fileDiff ){
        location.href=tx.baseUrl + "/fdiff?v1="+selRow.h+"&v2="+p.h;
      }else{
        var href = tx.baseUrl + "/vdiff?from="+selRow.h+"&to="+p.h;
 
        /* When called from /timeline page, If chng=str was specified in the
        ** QueryString, specify glob=str on the /vdiff page */
        var glob = getQueryStringValue("chng");
        if( !glob ){
          /* When called from /vdiff page, keep the glob= QueryString if
          ** present. */
          glob = getQueryStringValue("glob");
        }
        if( glob ){
          href += "&glob=" + glob;
        }

        location.href = href;
      }







|


|



|







569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
      this.className = this.className.replace(" sel", "");
      canvasDiv.className = canvasDiv.className.replace(" sel", "");
    }else{
      if( tx.fileDiff ){
        location.href=tx.baseUrl + "/fdiff?v1="+selRow.h+"&v2="+p.h;
      }else{
        var href = tx.baseUrl + "/vdiff?from="+selRow.h+"&to="+p.h;
        let params = (new URL(document.location)).searchParams;
        /* When called from /timeline page, If chng=str was specified in the
        ** QueryString, specify glob=str on the /vdiff page */
        let glob = params.get("chng");
        if( !glob ){
          /* When called from /vdiff page, keep the glob= QueryString if
          ** present. */
          glob = params.get("glob");
        }
        if( glob ){
          href += "&glob=" + glob;
        }

        location.href = href;
      }