mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 13:21:41 -05:00
Update creator-17.js
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//URL Params
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
const debugging = params.get('debug') != null;
|
||||
if (debugging) {alert('debugging - 2.4');}
|
||||
if (debugging) {alert('debugging - 2.5');}
|
||||
|
||||
//To save the server from being overloaded? Maybe?
|
||||
function fixUri(input) {
|
||||
@@ -1296,16 +1296,13 @@ async function downloadCard() {
|
||||
imageName += '.png';
|
||||
downloadElement.download = imageName;
|
||||
downloadElement.href = cardCanvas.toDataURL();
|
||||
if (debugging) {
|
||||
console.log(imageName);
|
||||
console.log(downloadElement.href.split(';')[0]);
|
||||
downloadElement.href = downloadElement.href.replace(/^data:image\/png/, `data:application/octet-stream;headers=Content-Disposition%3A%20attachment%3B%20filename=${imageName}`);
|
||||
console.log(downloadElement.href.split(';')[0]);
|
||||
console.log(downloadElement.href.split(';')[1]);
|
||||
console.log(downloadElement);
|
||||
downloadElement.target = '_blank';
|
||||
if (!debugging) {downloadElement.style.display = 'none';} else {
|
||||
downloadElement.innerHTML = 'Try clicking me :)'
|
||||
}
|
||||
document.body.appendChild(downloadElement);
|
||||
await downloadElement.click();
|
||||
if (debugging) {return}
|
||||
downloadElement.remove();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user