From 6cbce6f5b9e83c688bcdd84744feca3559a0a14e Mon Sep 17 00:00:00 2001 From: Joey Wunderlich Date: Fri, 20 Sep 2024 10:57:22 -0700 Subject: [PATCH] add option to pin offline-app page to a specific version (#10195) --- docfiles/offline-app-head.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docfiles/offline-app-head.html b/docfiles/offline-app-head.html index 8d8e532ad065..cb6f22a12fd9 100644 --- a/docfiles/offline-app-head.html +++ b/docfiles/offline-app-head.html @@ -449,6 +449,20 @@ window.pxtTickEvent("offlineapp.download", { "target": "@targetid@", "platform": "mac64" }); } $(function () { + try { + const urlParams = new URLSearchParams(window.location.search); + const versionOverride = urlParams.get("version") || urlParams.get("v"); + + if (versionOverride && /^v\d+\.\d+\.\d+$/i.test(versionOverride)) { + updateDownloadLinks(versionOverride); + showAgree(); + hideLoader(); + return; + } + } catch (e) { + console.warn("Could not parse search string", e); + } + $.getJSON("https://makecode.com/api/config/@targetid@/targetconfig") .then(function (data) { hideLoader();