From 5a725fd6f4dc5ba22df5138ed5af3df0206d6aab Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Wed, 25 Dec 2019 11:16:56 -0800 Subject: [PATCH] Update main.js --- data/scripts/main.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/data/scripts/main.js b/data/scripts/main.js index 367e6f49..46263491 100644 --- a/data/scripts/main.js +++ b/data/scripts/main.js @@ -976,6 +976,19 @@ function inputCardNameNumberTextImport(index) { } else { importText("", "Power Toughness"); } + if (importCardTextResponse.includes('"loyalty":"')) { + importText(beforeAfter(importCardTextResponse, '"loyalty":"', '",'), "Loyalty"); + var abilityList = beforeAfter(importCardTextResponse, '"oracle_text":"', '",').replace(/ \\"/g, ' \u201C').replace(/\\"/g, '\u201D').split(/\\n/g); + abilityList.push("", "", "", ""); + importText(abilityList[0].split(/: (.+)?/)[1], "First Ability"); + document.getElementById("inputPlaneswalker1Icon").value = abilityList[0].split(/: (.+)?/)[0]; + importText(abilityList[1].split(/: (.+)?/)[1], "Second Ability"); + document.getElementById("inputPlaneswalker2Icon").value = abilityList[1].split(/: (.+)?/)[0]; + importText(abilityList[2].split(/: (.+)?/)[1], "Third Ability"); + document.getElementById("inputPlaneswalker3Icon").value = abilityList[2].split(/: (.+)?/)[0]; + importText(abilityList[3].split(/: (.+)?/)[1], "Fourth Ability"); + document.getElementById("inputPlaneswalker4Icon").value = abilityList[3].split(/: (.+)?/)[0]; + } document.getElementById("inputManaCost").value = beforeAfter(importCardTextResponse, '"mana_cost":"', '",'); document.getElementById("inputCardArtName").value = beforeAfter(importCardTextResponse, '"name":"', '",'); document.getElementById("inputSetCode").value = beforeAfter(importCardTextResponse, '"set":"', '",');