1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
function toggleBranch() {
document.getElementById('branchWrap').classList.toggle('open');
}
document.addEventListener('click', function (e) {
let w = document.getElementById('branchWrap');
if (w && !w.contains(e.target)) w.classList.remove('open');
});
function copyCmd(btn) {
navigator.clipboard.writeText(btn.dataset.cmd).then(function () {
btn.textContent = 'copied!';
btn.classList.add('copied');
setTimeout(function () {
btn.textContent = 'copy';
btn.classList.remove('copied');
}, 1800);
});
}
|