mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-26 21:04:58 -05:00
Add ability to easily hide reminder text
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user