Replace disabled "Déjà téléchargé" with active "Re-télécharger" button (ghost style to distinguish from first download). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+13
-13
@@ -250,18 +250,15 @@ function openModal(concert) {
|
|||||||
|
|
||||||
const btnDl = $('btn-download');
|
const btnDl = $('btn-download');
|
||||||
const alreadyDone = state.downloadedUrls.has(concert.url);
|
const alreadyDone = state.downloadedUrls.has(concert.url);
|
||||||
btnDl.textContent = alreadyDone ? '✓ Déjà téléchargé' : 'Télécharger';
|
btnDl.textContent = alreadyDone ? 'Re-télécharger' : 'Télécharger';
|
||||||
btnDl.prepend((() => {
|
btnDl.classList.toggle('btn-redownload', alreadyDone);
|
||||||
const s = document.createElementNS('http://www.w3.org/2000/svg','svg');
|
const dlIcon = document.createElementNS('http://www.w3.org/2000/svg','svg');
|
||||||
s.setAttribute('viewBox','0 0 20 20'); s.setAttribute('fill','none');
|
dlIcon.setAttribute('viewBox','0 0 20 20'); dlIcon.setAttribute('fill','none');
|
||||||
s.setAttribute('width','16'); s.setAttribute('height','16');
|
dlIcon.setAttribute('width','16'); dlIcon.setAttribute('height','16');
|
||||||
if (!alreadyDone) {
|
dlIcon.innerHTML = `<path d="M10 3v9M7 9l3 3 3-3" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
s.innerHTML = `<path d="M10 3v9M7 9l3 3 3-3" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
<path d="M4 15h12" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>`;
|
||||||
<path d="M4 15h12" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>`;
|
btnDl.prepend(dlIcon);
|
||||||
}
|
btnDl.disabled = false;
|
||||||
return s;
|
|
||||||
})());
|
|
||||||
btnDl.disabled = alreadyDone;
|
|
||||||
|
|
||||||
$('dl-progress-wrap').hidden = true;
|
$('dl-progress-wrap').hidden = true;
|
||||||
$('dl-progress-fill').style.width = '0%';
|
$('dl-progress-fill').style.width = '0%';
|
||||||
@@ -342,7 +339,10 @@ function trackDownload(id, title, url) {
|
|||||||
$('dl-progress-label').textContent = `${Math.round(pct)}%`;
|
$('dl-progress-label').textContent = `${Math.round(pct)}%`;
|
||||||
if (s.state === 'done') {
|
if (s.state === 'done') {
|
||||||
$('dl-progress-label').textContent = '✓ Terminé';
|
$('dl-progress-label').textContent = '✓ Terminé';
|
||||||
$('btn-download').textContent = '✓ Téléchargé';
|
const b = $('btn-download');
|
||||||
|
b.textContent = 'Re-télécharger';
|
||||||
|
b.classList.add('btn-redownload');
|
||||||
|
b.disabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -629,6 +629,8 @@ body {
|
|||||||
.btn-download:hover { opacity: 0.88; transform: translateY(-1px); }
|
.btn-download:hover { opacity: 0.88; transform: translateY(-1px); }
|
||||||
.btn-download:active { transform: none; }
|
.btn-download:active { transform: none; }
|
||||||
.btn-download:disabled { opacity: 0.5; cursor: default; transform: none; }
|
.btn-download:disabled { opacity: 0.5; cursor: default; transform: none; }
|
||||||
|
.btn-download.btn-redownload { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
|
||||||
|
.btn-download.btn-redownload:hover { color: var(--text); border-color: var(--text-muted); opacity: 1; }
|
||||||
|
|
||||||
.btn-watch {
|
.btn-watch {
|
||||||
color: var(--text-dim);
|
color: var(--text-dim);
|
||||||
|
|||||||
Reference in New Issue
Block a user