From 7ddb8290b0bc22ab1fe8bf7ba0c32ec58e09e09b Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 12 Oct 2017 03:16:10 -0400 Subject: [PATCH] Playfield: Allow decks with spaces in name --- js/playfield.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/playfield.js b/js/playfield.js index 5f8c652..6a657c4 100644 --- a/js/playfield.js +++ b/js/playfield.js @@ -230,7 +230,8 @@ function makeCard(cardNum) { -(cardNum % deckWidth) * parseInt(style.getPropertyValue("width")) + "px"; card.style.backgroundPositionY = -Math.floor(cardNum/deckWidth) * parseInt(style.getPropertyValue("height")) + "px"; - card.style.backgroundImage = `url(${deckJSON.CustomDeck[deckNum].FaceURL})`; + let faceURI = encodeURI(deckJSON.CustomDeck[deckNum].FaceURL); + card.style.backgroundImage = `url(${faceURI})`; card.style.backgroundSize = `${deckWidth * 100}% ${deckHeight * 100}%`; document.body.removeChild(card);