Skip to content

Commit bbbcf70

Browse files
committed
Really avoid any jQuery construct
In git-for-windows#76, I merged a contribution that purported to fix the problem that the download button no longer pointed to the appropriate installer. The underlying root cause is that that logic relied on jQuery, but we recently got rid of it (because our copy was ridiculously outdated). The problem with that PR is that it had an incomplete solution, still leaving `$(...)` calls in place. This here commit fixes that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent ec275b8 commit bbbcf70

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

layouts/_default/baseof.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
{{ if eq "home" .Kind -}}
3535
/* Replace the download link if a Windows browser was detected */
3636
try {
37-
var href = $('.version > a')[0].href.match(/^(.*\/)tag(\/.*)$/);
38-
var version = $('.version > a')[0].title.match(/^Version ([0-9.]*)(\(([0-9]*)?\))?/);
37+
var a = document.querySelector('.version > a')
38+
var href = a?.href.match(/^(.*\/)tag(\/.*)$/);
39+
var version = a?.title.match(/^Version ([0-9.]*)(\(([0-9]*)?\))?/);
3940
if (!href || !version || !navigator.userAgentData)
4041
throw 0;
4142

0 commit comments

Comments
 (0)