Skip to content

Commit 1b7c47a

Browse files
authored
Merge pull request #298 from jasonlong/tooltip-fetching
Add support for new `<tool-tip>` markup
2 parents 5818ec0 + e03fa2d commit 1b7c47a

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

src/iso.js

+21-5
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,28 @@ const loadStats = () => {
167167
let currentStreakStart = null
168168
let currentStreakEnd = null
169169

170-
const data = [...document.querySelectorAll('.js-calendar-graph-table tbody td.ContributionCalendar-day')].map((d) => {
170+
const dayNodes = [...document.querySelectorAll('.js-calendar-graph-table tbody td.ContributionCalendar-day')].map(
171+
(d) => {
172+
return {
173+
date: new Date(d.dataset.date),
174+
week: d.dataset.ix,
175+
color: getSquareColor(d),
176+
tid: d.getAttribute('aria-labelledby')
177+
}
178+
}
179+
)
180+
181+
const tooltipNodes = [...document.querySelectorAll('.js-calendar-graph tool-tip')].map((t) => {
182+
return {
183+
tid: t.id,
184+
count: getCountFromNode(t)
185+
}
186+
})
187+
188+
const data = dayNodes.map((d) => {
171189
return {
172-
count: getCountFromNode(d),
173-
date: new Date(d.dataset.date),
174-
week: d.dataset.ix,
175-
color: getSquareColor(d)
190+
...d,
191+
...tooltipNodes.find((t) => t.tid === d.tid)
176192
}
177193
})
178194

src/manifest-v2.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "GitHub Isometric Contributions",
4-
"version": "1.1.27",
4+
"version": "1.1.28",
55
"description": "Renders an isometric pixel view of GitHub contribution graphs.",
66
"content_scripts": [
77
{

src/manifest.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "GitHub Isometric Contributions",
4-
"version": "1.1.27",
4+
"version": "1.1.28",
55
"description": "Renders an isometric pixel view of GitHub contribution graphs.",
66
"content_scripts": [
77
{
@@ -15,10 +15,5 @@
1515
"icons": {
1616
"48": "icon-48.png",
1717
"128": "icon-128.png"
18-
},
19-
"browser_specific_settings": {
20-
"gecko": {
21-
22-
}
2318
}
2419
}

0 commit comments

Comments
 (0)