From 6e97a6536484bfbbd0c062c147d028e182bf3179 Mon Sep 17 00:00:00 2001 From: ZenithalHourlyRate Date: Fri, 24 Mar 2023 21:35:49 +0800 Subject: [PATCH] help: special url for .git mirror Ref to https://github.com/mirrorz-org/mirrorz-parser/blob/7a6bb5723af8873f04068425e7a9179c18c9ce34/options.js\#L57 Closes https://github.com/tuna/issues/issues/1703 --- static/js/help.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/help.es6 b/static/js/help.es6 index 3a011c3..d0ce906 100644 --- a/static/js/help.es6 +++ b/static/js/help.es6 @@ -14,8 +14,12 @@ $(document).ready(() => { for (const target_selector of target_selectors) { const template_selector = $(target_selector).data("template"); const select_selectors = $(target_selector).data("select").split(","); + let url = "/" + window.mirrorId + if (window.mirrorId.endsWith(".git")) { + url = "/git/" + window.mirrorId + } const template_data = { - "mirror": "{{ site.hostname }}/" + window.mirrorId, + "mirror": "{{ site.hostname }}" + url, }; for (const select_selector of select_selectors) { const opt = $(select_selector).find('option:selected').data();