minor: KDR great divide user stats tooltip

This commit is contained in:
Index 2024-06-28 10:41:09 -05:00
parent 0f7aea03b2
commit 57e4130ede
2 changed files with 92 additions and 85 deletions

View file

@ -160,7 +160,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
Kill Death Ratio
</b>
<span class="float-end">
${KDR}
${KDR} <i class="fa-solid fa-circle-info" data-bs-toggle="tooltip" data-bs-title="KDR is a user's kills divided by the amount of times they have died. If their KDR is above 1, they are making a positive contribution. If their KDR is less than 1, that means they die more than they kill."></i>
</span>
</div>
<div class="mb-1">
@ -204,6 +204,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
document.getElementById('p+greatdivide_stats').innerHTML = "<div class=\"mb-3\">This user hasn't participated in The Great Divide.</div>"
}
}
return true
}
});

View file

@ -1,3 +1,7 @@
(async () => {
Utilities = await import(chrome.runtime.getURL('resources/utils.js'))
.default
chrome.storage.sync.get(['PolyPlus_Settings'], function(result) {
Settings = result.PolyPlus_Settings || {};
@ -83,8 +87,10 @@ async function UserStatsTab() {
</small>
<lottie-player id="avatar-loading" src="https://c0.ptacdn.com/static/images/lottie/poly-brick-loading.2b51aa85.json" background="transparent" speed="1" style="width: 20%;height: auto;margin: -16px auto 50px;margin-top: 0px;" loop="" autoplay=""></lottie-player>
`
chrome.runtime.sendMessage({
await chrome.runtime.sendMessage({
action: "greatdivide_stats",
userID: document.querySelector('.dropdown-item.text-danger[href^="/report"]').getAttribute('href').split('?')[0].split('/')[3]
});
Utilities.InjectResource("registerTooltips")
}
})();