From d51ea1429d698c7ffd77a438a8907c0ffd00addc Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Jul 2021 09:35:03 +0200 Subject: [PATCH] Online editor: check the url to load from a branch --- tools/online_editor/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/online_editor/index.ts b/tools/online_editor/index.ts index 12c5241af..d6c41c3f0 100644 --- a/tools/online_editor/index.ts +++ b/tools/online_editor/index.ts @@ -61,7 +61,12 @@ export Demo := Window { let select = (document.getElementById("select_combo")); function select_combo_changed() { if (select.value) { - load_from_url("https://raw.githubusercontent.com/sixtyfpsui/sixtyfps/master/" + select.value); + let tag = "master"; + var found; + if (found = window.location.pathname.match(/releases\/([^\/]*)\/editor/)) { + tag = "v" + found[1]; + } + load_from_url(`https://raw.githubusercontent.com/sixtyfpsui/sixtyfps/${tag}/${select.value}`); } else { clearTabs(); base_url = "";