From 2e36e751837a0351ea9c01e48ea8e7bd7a2b71a2 Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Fri, 26 Oct 2018 20:26:16 -0700 Subject: [PATCH] download --- index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 2d6833b7..7cb0665d 100644 --- a/index.html +++ b/index.html @@ -184,7 +184,7 @@
Frame Rate -
Download
+ Download
@@ -968,15 +968,17 @@ function resizeThings() { //runs the autocrop function for the chosen set symbol function loadSetSymbol() { - imgSetSymbol.crossOrigin = "anonymous" + imgSetSymbol.crossOrigin = "Anonymous" imgSetSymbol.src = "https://raw.githubusercontent.com/ImKyle4815/MTG-Set-Symbols/master/setSymbols/" + document.getElementById("setSymbolCode").value.toUpperCase() + "_" + document.getElementById("setSymbolRarity").value.toUpperCase() + ".png" } //Best for last - downloads the image! -function downloadCardImage(el) { - alert("This may not work because the canvas is 'tainted' - if you know how to avoid this please tell me") +function downloadCardImage(linkElement) { var cardImageData = canvas.toDataURL() - el.href = cardImageData + if (cardImageData == undefined) { + alert("Sorry, it seems that you cannot download your card. Please try using a different browser.") + } + linkElement.href = cardImageData }