mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-26 21:04:58 -05:00
Add collector info toggle
This commit is contained in:
@@ -569,6 +569,13 @@
|
|||||||
<span class='checkmark'></span>
|
<span class='checkmark'></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class='readable-background padding margin-bottom'>
|
||||||
|
<h5 class='input-description margin-bottom'>Show collector info</h5>
|
||||||
|
<label class='checkbox-container input margin-bottom'>Show collector info (uncheck to hide)
|
||||||
|
<input id='enableCollectorInfo' type='checkbox' onchange='enableCollectorInfo();'>
|
||||||
|
<span class='checkmark'></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div class='readable-background padding margin-bottom'>
|
<div class='readable-background padding margin-bottom'>
|
||||||
<h5 class='input-description padding margin-bottom'>Toggle between star (seen on foils) and dot (seen on regular cards)</h5>
|
<h5 class='input-description padding margin-bottom'>Toggle between star (seen on foils) and dot (seen on regular cards)</h5>
|
||||||
<div class='padding'>
|
<div class='padding'>
|
||||||
|
@@ -3279,14 +3279,18 @@ async function bottomInfoEdited() {
|
|||||||
card.infoArtist = document.querySelector('#info-artist').value;
|
card.infoArtist = document.querySelector('#info-artist').value;
|
||||||
card.infoYear = document.querySelector('#info-year').value;
|
card.infoYear = document.querySelector('#info-year').value;
|
||||||
card.infoNote = document.querySelector('#info-note').value;
|
card.infoNote = document.querySelector('#info-note').value;
|
||||||
for (var textObject of Object.entries(card.bottomInfo)) {
|
|
||||||
if (["NOT FOR SALE", "Wizards of the Coast", "CardConjurer.com", "cardconjurer.com"].some(v => textObject[1].text.includes(v))) {
|
if (document.querySelector('#enableCollectorInfo').checked) {
|
||||||
|
for (var textObject of Object.entries(card.bottomInfo)) {
|
||||||
|
if (["NOT FOR SALE", "Wizards of the Coast", "CardConjurer.com", "cardconjurer.com"].some(v => textObject[1].text.includes(v))) {
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
await writeText(textObject[1], bottomInfoContext);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
} else {
|
|
||||||
await writeText(textObject[1], bottomInfoContext);
|
|
||||||
}
|
}
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
drawCard();
|
drawCard();
|
||||||
}
|
}
|
||||||
function artistEdited(value) {
|
function artistEdited(value) {
|
||||||
@@ -3311,6 +3315,9 @@ function enableNewCollectorInfoStyle() {
|
|||||||
setBottomInfoStyle();
|
setBottomInfoStyle();
|
||||||
bottomInfoEdited();
|
bottomInfoEdited();
|
||||||
}
|
}
|
||||||
|
function enableCollectorInfo() {
|
||||||
|
localStorage.setItem('enableCollectorInfo', document.querySelector('#enableCollectorInfo').checked);
|
||||||
|
bottomInfoEdited();
|
||||||
function enableImportCollectorInfo() {
|
function enableImportCollectorInfo() {
|
||||||
localStorage.setItem('enableImportCollectorInfo', document.querySelector('#enableImportCollectorInfo').checked);
|
localStorage.setItem('enableImportCollectorInfo', document.querySelector('#enableImportCollectorInfo').checked);
|
||||||
}
|
}
|
||||||
@@ -4135,6 +4142,9 @@ if (!localStorage.getItem('enableNewCollectorStyle')) {
|
|||||||
} else {
|
} else {
|
||||||
document.querySelector('#enableNewCollectorStyle').checked = (localStorage.getItem('enableNewCollectorStyle') == 'true');
|
document.querySelector('#enableNewCollectorStyle').checked = (localStorage.getItem('enableNewCollectorStyle') == 'true');
|
||||||
}
|
}
|
||||||
|
if (!localStorage.getItem('enableCollectorInfo')) {
|
||||||
|
localStorage.setItem('enableCollectorInfo', 'true');
|
||||||
|
} else {
|
||||||
if (!localStorage.getItem('autoFrame')) {
|
if (!localStorage.getItem('autoFrame')) {
|
||||||
localStorage.setItem('autoFrame', 'false');
|
localStorage.setItem('autoFrame', 'false');
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user