File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
<script>
2
2
// synchronously set clone button states and urls here to avoid flickering
3
3
// on page load. initRepoCloneLink calls this when proto changes.
4
+ // this applies the protocol-dependant clone url to all elements with the
5
+ // `js-clone-url` and `js-clone-url-vsc` classes.
4
6
// TODO: This localStorage setting should be moved to backend user config
5
7
// so it's available during rendering, then this inline script can be removed.
6
8
(window.updateCloneStates = function() {
19
21
for (const el of document.getElementsByClassName('js-clone-url')) {
20
22
el[el.nodeName === 'INPUT' ? 'value' : 'textContent'] = link;
21
23
}
24
+ for (const el of document.getElementsByClassName('js-clone-url-vsc')) {
25
+ el['href'] = `vscode://vscode.git/clone?url=${encodeURIComponent(link)}`;
26
+ }
22
27
})();
23
28
</script>
Original file line number Diff line number Diff line change 126
126
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-3"}}{{.i18n.Tr "repo.download_tar"}}</a>
127
127
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "mr-3"}}{{.i18n.Tr "repo.download_bundle"}}</a>
128
128
{{end}}
129
- <a class="item" href="vscode://vscode.git/clone?url={{$.RepoCloneLink .HTTPS}}">{{svg "gitea-vscode" 16 "mr-3"}}{{.i18n.Tr "repo.clone_in_vsc"}}</a>
129
+ <a class="item js-clone-url-vsc " href="vscode://vscode.git/clone?url={{.CloneButtonOriginLink .HTTPS}}">{{svg "gitea-vscode" 16 "mr-3"}}{{.i18n.Tr "repo.clone_in_vsc"}}</a>
130
130
</div>
131
131
</button>
132
132
</div>
You can’t perform that action at this time.
0 commit comments