From 0c5b7460327e1d8786025c55cbaf15ead8adc4d8 Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Wed, 7 Oct 2020 20:38:59 -0700 Subject: [PATCH] Update main.js --- data/scripts/main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/data/scripts/main.js b/data/scripts/main.js index d1ddfc0a..855b72ed 100644 --- a/data/scripts/main.js +++ b/data/scripts/main.js @@ -994,7 +994,14 @@ function toggleTabs(clickedElement, targetId) { function downloadCardImage(linkElement) { if (document.getElementById("inputInfoArtist").value.replace(/ /g, "") != "") { - linkElement.download = cardTextList[0].text.toLowerCase().replace(/ /g, "_") + ".png" + var savedFileName = '' + console.log(cardTextList) + if (cardTextList[0].name == 'Card Nickname') { + savedFileName = cardTextList[1].text + ' (' + cardTextList[0].text + ").png" + } else { + savedFileName = cardTextList[0].text + '.png' + } + linkElement.download = savedFileName if (linkElement.download == ".png") { linkElement.download = "card.png" }