url-switcher.js

 1document.addEventListener('DOMContentLoaded', function() {
 2  const urlTypeSwitch = document.querySelector('input[name="url-type"]');
 3  if (!urlTypeSwitch) return;
 4
 5  urlTypeSwitch.addEventListener('change', function() {
 6    const sshUrl = document.getElementById('ssh-url');
 7    const httpUrl = document.getElementById('http-url');
 8    
 9    if (this.checked) {
10      sshUrl.style.display = 'none';
11      httpUrl.style.display = 'block';
12    } else {
13      sshUrl.style.display = 'block';
14      httpUrl.style.display = 'none';
15    }
16  });
17});