modified: script.js
This commit is contained in:
14
script.js
14
script.js
@@ -548,25 +548,19 @@ class MinecraftChatParser {
|
||||
}
|
||||
|
||||
const mapInfo = this.currentChatInfo.mapDownload;
|
||||
const mapUrl = `./maps/${mapInfo.filename}`;
|
||||
// Nutze mapInfo.url, falls vorhanden, sonst lokalen Pfad
|
||||
const mapUrl = mapInfo.url ? mapInfo.url : `./maps/${mapInfo.filename}`;
|
||||
const downloadName = mapInfo.url ? mapInfo.url.split('/').pop() : mapInfo.filename;
|
||||
|
||||
// Create temporary download link
|
||||
const downloadLink = document.createElement('a');
|
||||
downloadLink.href = mapUrl;
|
||||
downloadLink.download = mapInfo.filename;
|
||||
downloadLink.download = downloadName;
|
||||
downloadLink.style.display = 'none';
|
||||
|
||||
document.body.appendChild(downloadLink);
|
||||
downloadLink.click();
|
||||
document.body.removeChild(downloadLink);
|
||||
|
||||
// Show feedback
|
||||
const originalText = this.downloadMap.innerHTML;
|
||||
this.downloadMap.innerHTML = '⬇️ Downloading...';
|
||||
|
||||
setTimeout(() => {
|
||||
this.downloadMap.innerHTML = originalText;
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user