From 001f92db856cb23075ba5ff6fdcf3ca485a7a811 Mon Sep 17 00:00:00 2001 From: Index Date: Sun, 29 Sep 2024 18:58:10 -0500 Subject: [PATCH] minor: updated trade valuation tooltip + added shorthand --- js/account/trade-valuation.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/account/trade-valuation.js b/js/account/trade-valuation.js index ed90290..3a9b01f 100644 --- a/js/account/trade-valuation.js +++ b/js/account/trade-valuation.js @@ -79,7 +79,7 @@ var Utilities; const ValueJSON = ExtractTableJSON(ValueListDocument.getElementsByTagName('table')[0]) for (let card of Array.from(document.querySelectorAll('.card:has(a[href^="/store"])'))) { - const ItemValuations = Array.from(card.querySelectorAll('a[href^="/store"]')).map((item) => ValueJSON.filter((x) => x.id == item.getAttribute('href').split('/')[2])[0]||null).filter((x)=>x!=null&&x.tags[0]!="") + const ItemValuations = Array.from(card.querySelectorAll('a[href^="/store"]')).map((item) => ValueJSON.filter((x) => x.id == item.getAttribute('href').split('/')[2])[0]||null).filter((x)=>x!=null) if (ItemValuations.length > 0) { /* this code is so bad I never want to look at it again */ @@ -88,14 +88,13 @@ var Utilities; QuestionMarkTooltip.classList = 'fa fa-question-circle' QuestionMarkTooltip.setAttribute('data-bs-toggle', 'tooltip') QuestionMarkTooltip.setAttribute('data-bs-html', 'true') - ItemValuations.map((item) => {console.log(item.tags)}) QuestionMarkTooltip.setAttribute('data-bs-title', ItemValuations.map((item, i) => ` + "${item.short}" | ${item.trend}
${item.name}
${ item.tags.map((x) => ` ${x} `).join('')} -
- `).join('')) + `).join('
')) card.getElementsByClassName('card-header')[0].appendChild(QuestionMarkTooltip) } }