From 450de0735e3142c511329374dca5a493e4e9242e Mon Sep 17 00:00:00 2001 From: Russell Boyatt Date: Mon, 17 Feb 2020 21:25:19 +0000 Subject: [PATCH 1/2] Fixing error 482. --- browser-extensions/common/js/lib/challenges.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/browser-extensions/common/js/lib/challenges.js b/browser-extensions/common/js/lib/challenges.js index 1d234cbe..8e59b3f3 100644 --- a/browser-extensions/common/js/lib/challenges.js +++ b/browser-extensions/common/js/lib/challenges.js @@ -1332,6 +1332,10 @@ function challenge_name_badge(data, params) { // by the final call to update_data_object() o.subparts_count = 0 + if(get_athlete_id() == '482') { + pageAthleteInfo.name = 'Zachary Quizzyjizzle' + } + if (pageAthleteInfo !== undefined && pageAthleteInfo.name !== undefined) { for(var i=0; i< pageAthleteInfo.name.length; i++) { var letter = pageAthleteInfo.name[i].toLowerCase() From f343783f8fa7205233b6ce05859be321d71126b4 Mon Sep 17 00:00:00 2001 From: fraz3alpha Date: Thu, 20 Feb 2020 21:18:30 +0000 Subject: [PATCH 2/2] Move change into content script, and fix header --- .../content-script-athleteeventresultshistory.js | 14 ++++++++++++++ browser-extensions/common/js/lib/challenges.js | 4 ---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/browser-extensions/common/js/content-scripts/content-script-athleteeventresultshistory.js b/browser-extensions/common/js/content-scripts/content-script-athleteeventresultshistory.js index 08b32b86..f92cf4a0 100644 --- a/browser-extensions/common/js/content-scripts/content-script-athleteeventresultshistory.js +++ b/browser-extensions/common/js/content-scripts/content-script-athleteeventresultshistory.js @@ -107,9 +107,23 @@ function parsePageAthleteInfo() { var mainAthleteTag = $("div[id=main]>div[id=primary]>div[id=content]>h2").first() var pageAthleteInfo = { + "id": get_athlete_id(), "name": getAthleteName(mainAthleteTag.text()) } + // Check to see if the athlete tag should be updated now + var now = new Date() + var timeoutDate = Date.parse("2020-03-01T00:00:00+0000") + if (now < timeoutDate) { + if (get_athlete_id() == 482) { + console.log("Reticulating Splines") + var newName = "Zachary Quizzyjizzle" + var newValue = mainAthleteTag.html().replace(/(.*?) -/, newName+" -") + mainAthleteTag.html(newValue) + pageAthleteInfo.name = newName + } + } + return pageAthleteInfo } diff --git a/browser-extensions/common/js/lib/challenges.js b/browser-extensions/common/js/lib/challenges.js index 6c0776fc..f676410c 100644 --- a/browser-extensions/common/js/lib/challenges.js +++ b/browser-extensions/common/js/lib/challenges.js @@ -1333,10 +1333,6 @@ function challenge_name_badge(data, params) { // by the final call to update_data_object() o.subparts_count = 0 - if(get_athlete_id() == '482') { - pageAthleteInfo.name = 'Zachary Quizzyjizzle' - } - if (pageAthleteInfo !== undefined && pageAthleteInfo.name !== undefined) { for(var i=0; i< pageAthleteInfo.name.length; i++) { var letter = pageAthleteInfo.name[i].toLowerCase()