Skip to content

Commit

Permalink
Merge pull request #298 from jasonlong/tooltip-fetching
Browse files Browse the repository at this point in the history
Add support for new `<tool-tip>` markup
  • Loading branch information
jasonlong authored Nov 18, 2023
2 parents 5818ec0 + e03fa2d commit 1b7c47a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
26 changes: 21 additions & 5 deletions src/iso.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,28 @@ const loadStats = () => {
let currentStreakStart = null
let currentStreakEnd = null

const data = [...document.querySelectorAll('.js-calendar-graph-table tbody td.ContributionCalendar-day')].map((d) => {
const dayNodes = [...document.querySelectorAll('.js-calendar-graph-table tbody td.ContributionCalendar-day')].map(
(d) => {
return {
date: new Date(d.dataset.date),
week: d.dataset.ix,
color: getSquareColor(d),
tid: d.getAttribute('aria-labelledby')
}
}
)

const tooltipNodes = [...document.querySelectorAll('.js-calendar-graph tool-tip')].map((t) => {
return {
tid: t.id,
count: getCountFromNode(t)
}
})

const data = dayNodes.map((d) => {
return {
count: getCountFromNode(d),
date: new Date(d.dataset.date),
week: d.dataset.ix,
color: getSquareColor(d)
...d,
...tooltipNodes.find((t) => t.tid === d.tid)
}
})

Expand Down
2 changes: 1 addition & 1 deletion src/manifest-v2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "GitHub Isometric Contributions",
"version": "1.1.27",
"version": "1.1.28",
"description": "Renders an isometric pixel view of GitHub contribution graphs.",
"content_scripts": [
{
Expand Down
7 changes: 1 addition & 6 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "GitHub Isometric Contributions",
"version": "1.1.27",
"version": "1.1.28",
"description": "Renders an isometric pixel view of GitHub contribution graphs.",
"content_scripts": [
{
Expand All @@ -15,10 +15,5 @@
"icons": {
"48": "icon-48.png",
"128": "icon-128.png"
},
"browser_specific_settings": {
"gecko": {
"id": "isometric-contributions@jasonlong.me"
}
}
}

0 comments on commit 1b7c47a

Please sign in to comment.