|
|
@ -1,6 +1,8 @@ |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
// synchronously set clone button states and urls here to avoid flickering |
|
|
|
// synchronously set clone button states and urls here to avoid flickering |
|
|
|
// on page load. initRepoCloneLink calls this when proto changes. |
|
|
|
// on page load. initRepoCloneLink calls this when proto changes. |
|
|
|
|
|
|
|
// this applies the protocol-dependant clone url to all elements with the |
|
|
|
|
|
|
|
// `js-clone-url` and `js-clone-url-vsc` classes. |
|
|
|
// TODO: This localStorage setting should be moved to backend user config |
|
|
|
// TODO: This localStorage setting should be moved to backend user config |
|
|
|
// so it's available during rendering, then this inline script can be removed. |
|
|
|
// so it's available during rendering, then this inline script can be removed. |
|
|
|
(window.updateCloneStates = function() { |
|
|
|
(window.updateCloneStates = function() { |
|
|
@ -19,5 +21,8 @@ |
|
|
|
for (const el of document.getElementsByClassName('js-clone-url')) { |
|
|
|
for (const el of document.getElementsByClassName('js-clone-url')) { |
|
|
|
el[el.nodeName === 'INPUT' ? 'value' : 'textContent'] = link; |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
})(); |
|
|
|
})(); |
|
|
|
</script> |
|
|
|
</script> |
|
|
|