File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 11<script>
22 // synchronously set clone button states and urls here to avoid flickering
33 // 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.
46 // TODO: This localStorage setting should be moved to backend user config
57 // so it's available during rendering, then this inline script can be removed.
68 (window.updateCloneStates = function() {
1921 for (const el of document.getElementsByClassName('js-clone-url')) {
2022 el[el.nodeName === 'INPUT' ? 'value' : 'textContent'] = link;
2123 }
24+ for (const el of document.getElementsByClassName('js-clone-url-vsc')) {
25+ el['href'] = 'vscode://vscode.git/clone?url=' + encodeURIComponent(link);
26+ }
2227 })();
2328</script>
Original file line number Diff line number Diff line change 126126 <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-3"}}{{.locale.Tr "repo.download_tar"}}</a>
127127 <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "mr-3"}}{{.locale.Tr "repo.download_bundle"}}</a>
128128 {{end}}
129- <a class="item" href="vscode://vscode.git/clone?url={{$.RepoCloneLink .HTTPS}}">{{svg "gitea-vscode" 16 "mr-3"}}{{.locale.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"}}{{.locale.Tr "repo.clone_in_vsc"}}</a>
130130 </div>
131131 </button>
132132 </div>
You can’t perform that action at this time.
0 commit comments