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:
@@ -276,6 +276,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class='readable-background padding margin-bottom'>
|
||||||
|
<label class='checkbox-container input'>Hide reminder text
|
||||||
|
<input id='hide-reminder-text' type='checkbox' onchange='textEdited();'>
|
||||||
|
<span class='checkmark'></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div class='readable-background padding'>
|
<div class='readable-background padding'>
|
||||||
<h5 class='padding input-description'>Add a textbox to your card</h5>
|
<h5 class='padding input-description'>Add a textbox to your card</h5>
|
||||||
<div class='padding input-grid'>
|
<div class='padding input-grid'>
|
||||||
|
@@ -2687,6 +2687,19 @@ function writeText(textObject, targetContext) {
|
|||||||
//Preps the text string
|
//Preps the text string
|
||||||
var splitString = '6GJt7eL8';
|
var splitString = '6GJt7eL8';
|
||||||
var rawText = textObject.text
|
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) {
|
if (textAllCaps) {
|
||||||
rawText = rawText.toUpperCase();
|
rawText = rawText.toUpperCase();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user