| 1 |
function switchSectionTab(btn, panelId) { |
| 2 |
document.querySelectorAll('.section-tab').forEach(function(t) { t.classList.remove('is-selected'); }); |
| 3 |
document.querySelectorAll('.section-panel').forEach(function(p) { p.classList.remove('active'); }); |
| 4 |
btn.classList.add('is-selected'); |
| 5 |
var panel = document.getElementById(panelId); |
| 6 |
if (panel) panel.classList.add('active'); |
| 7 |
history.replaceState(null, '', '#' + panelId); |
| 8 |
} |
| 9 |
|
| 10 |
(function() { |
| 11 |
var hash = window.location.hash.replace('#', ''); |
| 12 |
if (hash) { |
| 13 |
var panel = document.getElementById(hash); |
| 14 |
var tab = document.querySelector('[data-tab="' + hash + '"]'); |
| 15 |
if (panel && tab) switchSectionTab(tab, hash); |
| 16 |
} |
| 17 |
})(); |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
function downloadVersion(versionId) { |
| 23 |
window.location.href = '/api/versions/' + versionId + '/download'; |
| 24 |
} |
| 25 |
|