From 14d9faa484b462519a0e04b3a44f9cfc569b1b3d Mon Sep 17 00:00:00 2001 From: Index Date: Sun, 7 Jul 2024 08:04:23 -0500 Subject: [PATCH] minor: improved "no participation" great divide stats card --- js/background.js | 12 +++++++++--- the-great-divide.js | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/js/background.js b/js/background.js index c0b8a3e..9430042 100755 --- a/js/background.js +++ b/js/background.js @@ -134,7 +134,8 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { }) }) - const LoadStats = function(stats){ + const LoadStats = function(stats){ + const GreatDivideCard = document.getElementById('p+greatdivide_card') if (stats !== null) { let KDR = (stats.Kills / stats.Deaths) if (isNaN(KDR)) { @@ -143,7 +144,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { KDR = KDR.toFixed(4) } - document.getElementById('p+greatdivide_card').innerHTML = ` + GreatDivideCard.innerHTML = `
@@ -255,7 +256,12 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { }); document.body.appendChild(Script); } else { - document.getElementById('p+greatdivide_card').innerText = "This user hasn't participated in The Great Divide." + GreatDivideCard.classList.add('text-center', 'py-5') + GreatDivideCard.innerHTML = ` +

+
Not Drafted
+

This user hasn't participated in The Great Divide.

+ ` } } return true diff --git a/the-great-divide.js b/the-great-divide.js index 84d7026..4075398 100644 --- a/the-great-divide.js +++ b/the-great-divide.js @@ -89,7 +89,7 @@ const PlaceAllowlist = [ GREATEST DIVISION -
+