Skip to content

Commit f343783

Browse files
committed
Move change into content script, and fix header
1 parent 6c6e567 commit f343783

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

browser-extensions/common/js/content-scripts/content-script-athleteeventresultshistory.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,23 @@ function parsePageAthleteInfo() {
107107
var mainAthleteTag = $("div[id=main]>div[id=primary]>div[id=content]>h2").first()
108108

109109
var pageAthleteInfo = {
110+
"id": get_athlete_id(),
110111
"name": getAthleteName(mainAthleteTag.text())
111112
}
112113

114+
// Check to see if the athlete tag should be updated now
115+
var now = new Date()
116+
var timeoutDate = Date.parse("2020-03-01T00:00:00+0000")
117+
if (now < timeoutDate) {
118+
if (get_athlete_id() == 482) {
119+
console.log("Reticulating Splines")
120+
var newName = "Zachary Quizzyjizzle"
121+
var newValue = mainAthleteTag.html().replace(/(.*?) -/, newName+" -")
122+
mainAthleteTag.html(newValue)
123+
pageAthleteInfo.name = newName
124+
}
125+
}
126+
113127
return pageAthleteInfo
114128

115129
}

browser-extensions/common/js/lib/challenges.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,10 +1333,6 @@ function challenge_name_badge(data, params) {
13331333
// by the final call to update_data_object()
13341334
o.subparts_count = 0
13351335

1336-
if(get_athlete_id() == '482') {
1337-
pageAthleteInfo.name = 'Zachary Quizzyjizzle'
1338-
}
1339-
13401336
if (pageAthleteInfo !== undefined && pageAthleteInfo.name !== undefined) {
13411337
for(var i=0; i< pageAthleteInfo.name.length; i++) {
13421338
var letter = pageAthleteInfo.name[i].toLowerCase()

0 commit comments

Comments
 (0)