From bbbcf70225879d97abdaae412e434e876181c5e1 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 2 Jun 2025 11:02:36 +0200 Subject: [PATCH] Really avoid any jQuery construct In https://github.com/git-for-windows/git-for-windows.github.io/pull/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 --- layouts/_default/baseof.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 943c25c..472ef96 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -34,8 +34,9 @@ {{ if eq "home" .Kind -}} /* Replace the download link if a Windows browser was detected */ try { - var href = $('.version > a')[0].href.match(/^(.*\/)tag(\/.*)$/); - var version = $('.version > a')[0].title.match(/^Version ([0-9.]*)(\(([0-9]*)?\))?/); + var a = document.querySelector('.version > a') + var href = a?.href.match(/^(.*\/)tag(\/.*)$/); + var version = a?.title.match(/^Version ([0-9.]*)(\(([0-9]*)?\))?/); if (!href || !version || !navigator.userAgentData) throw 0;