From d27352af943f928fdccd41c158c90a409c81a4e8 Mon Sep 17 00:00:00 2001 From: Josh birnholz Date: Sun, 23 Jul 2023 16:10:38 -0400 Subject: [PATCH] Add ability to easily hide reminder text --- creator/index.html | 6 ++++++ js/creator-23.js | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/creator/index.html b/creator/index.html index e8e56432..cf41edf2 100644 --- a/creator/index.html +++ b/creator/index.html @@ -276,6 +276,12 @@ +
+ +
Add a textbox to your card
diff --git a/js/creator-23.js b/js/creator-23.js index 3030a7d2..c3df7123 100644 --- a/js/creator-23.js +++ b/js/creator-23.js @@ -2687,6 +2687,19 @@ function writeText(textObject, targetContext) { //Preps the text string var splitString = '6GJt7eL8'; var rawText = textObject.text + if (document.querySelector('#hide-reminder-text').checked && textObject.name && textObject.name != 'Title' && textObject.name != 'Type' && textObject.name != 'Mana Cost' && textObject.name != 'Power/Toughness') { + var rulesText = rawText; + var flavorText = ''; + var flavorIndex = rawText.indexOf('{flavor}') || rawText.indexOf('///'); + if (flavorIndex >= 0) { + flavorText = rawText.substring(flavorIndex); + rulesText = rawText.substring(0, flavorIndex); + } + + rulesText = rulesText.replace(/\([^\)]+\)/, ''); + + rawText = rulesText + flavorText; + } if (textAllCaps) { rawText = rawText.toUpperCase(); }