From a3807099533c931addf7a4c401a3a97984301170 Mon Sep 17 00:00:00 2001 From: Norwin Date: Fri, 9 Sep 2022 08:38:51 +0200 Subject: [PATCH 1/3] Make the vscode clone link respect transport protocol (#20557) --- templates/repo/clone_script.tmpl | 5 +++++ templates/repo/home.tmpl | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/repo/clone_script.tmpl b/templates/repo/clone_script.tmpl index 48b7ad3299ca2..afd90040fb4e7 100644 --- a/templates/repo/clone_script.tmpl +++ b/templates/repo/clone_script.tmpl @@ -1,6 +1,8 @@ diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index a2f09e4b8a95a..ec555a406082c 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -126,7 +126,7 @@ {{svg "octicon-file-zip" 16 "mr-3"}}{{.i18n.Tr "repo.download_tar"}} {{svg "octicon-package" 16 "mr-3"}}{{.i18n.Tr "repo.download_bundle"}} {{end}} - {{svg "gitea-vscode" 16 "mr-3"}}{{.i18n.Tr "repo.clone_in_vsc"}} + {{svg "gitea-vscode" 16 "mr-3"}}{{.i18n.Tr "repo.clone_in_vsc"}} From 24aee8b7c2b62e21882ef2542ee4173ac012efd6 Mon Sep 17 00:00:00 2001 From: Munim Munna <6266677+monim67@users.noreply.github.com> Date: Sat, 10 Sep 2022 20:41:11 +0600 Subject: [PATCH 2/3] Use CloneButtonOriginLink to match original PR Co-authored-by: Norwin --- templates/repo/home.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index ec555a406082c..2f9b1f25b734e 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -126,7 +126,7 @@ {{svg "octicon-file-zip" 16 "mr-3"}}{{.i18n.Tr "repo.download_tar"}} {{svg "octicon-package" 16 "mr-3"}}{{.i18n.Tr "repo.download_bundle"}} {{end}} - {{svg "gitea-vscode" 16 "mr-3"}}{{.i18n.Tr "repo.clone_in_vsc"}} + {{svg "gitea-vscode" 16 "mr-3"}}{{.i18n.Tr "repo.clone_in_vsc"}} From 9c2d3d476b9e93b21ef6a91d93c4e345a21d241c Mon Sep 17 00:00:00 2001 From: Munim Munna <6266677+monim67@users.noreply.github.com> Date: Fri, 16 Sep 2022 16:46:59 +0600 Subject: [PATCH 3/3] Use template string to fix lint issue Co-authored-by: Norwin --- templates/repo/clone_script.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/clone_script.tmpl b/templates/repo/clone_script.tmpl index afd90040fb4e7..5c9a545caddf9 100644 --- a/templates/repo/clone_script.tmpl +++ b/templates/repo/clone_script.tmpl @@ -22,7 +22,7 @@ el[el.nodeName === 'INPUT' ? 'value' : 'textContent'] = link; } for (const el of document.getElementsByClassName('js-clone-url-vsc')) { - el['href'] = 'vscode://vscode.git/clone?url=' + encodeURIComponent(link); + el['href'] = `vscode://vscode.git/clone?url=${encodeURIComponent(link)}`; } })();