Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Polyarus committed Mar 5, 2024
1 parent 495874a commit 3d20d09
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 13 deletions.
2 changes: 1 addition & 1 deletion assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstra


/* Github Calendar - https://github.com/IonicaBizau/github-calendar */
new GitHubCalendar("#github-graph", "icreated", { responsive: true });
GitHubCalendar("#github-graph", "icreated", { responsive: true });


/* Github Activity Feed - https://github.com/caseyscarborough/github-activity */
Expand Down
13 changes: 10 additions & 3 deletions assets/plugins/github-calendar/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function addTooltips(container) {
container.appendChild(tooltip)

// Add mouse event listener to show & hide tooltip
const days = container.querySelectorAll("rect.day")
const days = container.querySelectorAll(".js-calendar-graph-svg rect.ContributionCalendar-day")
days.forEach(day => {
day.addEventListener("mouseenter", (e) => {
let contribCount = e.target.getAttribute("data-count")
Expand Down Expand Up @@ -114,13 +114,20 @@ module.exports = function GitHubCalendar (container, username, options) {
$(".position-relative h2", cal).remove()
//cal.querySelector(".float-left.text-gray").innerHTML = options.summary_text

// Remove 3d visualiser div
for (const a of div.querySelectorAll("a")) {
if (a.textContent.includes("View your contributions in 3D, VR and IRL!")) {
a.parentElement.remove()
}
}

// If 'include-fragment' with spinner img loads instead of the svg, fetchCalendar again
if (cal.querySelector("include-fragment")) {
setTimeout(fetchCalendar, 500)
} else {
// If options includes responsive, SVG element has to be manipulated to be made responsive
if (options.responsive === true) {
let svg = cal.querySelector("svg.js-calendar-graph-svg")
let svg = cal.querySelector("table.js-calendar-graph-table")
// Get the width/height properties and use them to create the viewBox
let width = svg.getAttribute("width")
let height = svg.getAttribute("height")
Expand All @@ -133,7 +140,7 @@ module.exports = function GitHubCalendar (container, username, options) {
}

if (options.global_stats !== false) {
let parsed = parse($("svg", cal).outerHTML)
let parsed = parse(cal.innerHTML)
, currentStreakInfo = parsed.current_streak
? `${formatoid(parsed.current_streak_range[0], DATE_FORMAT2)} – ${formatoid(parsed.current_streak_range[1], DATE_FORMAT2)}`
: parsed.last_contributed
Expand Down
105 changes: 100 additions & 5 deletions assets/plugins/github-calendar/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions assets/plugins/github-calendar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "github-calendar",
"version": "2.2.7",
"version": "2.3.3",
"description": "Embed your GitHub contributions calendar anywhere.",
"main": "lib/index.js",
"directories": {
Expand All @@ -26,7 +26,8 @@
"Francesco Tonini <francescoantoniotonini@gmail.com> (https://francescotonini.it)",
"Miroslav Vidovic <miroslav-vidovic@hotmail.com>",
"Mike Roibu <mike@codingden.net>",
"Rohit Rathi <rathirohitg1997@gmail.com> (https://rathirohit.github.io)"
"Rohit Rathi <rathirohitg1997@gmail.com> (https://rathirohit.github.io)",
"Wang Pengfei <pengfeixc@sina.com> (https://pengfeixc.com)"
],
"license": "MIT",
"bugs": {
Expand All @@ -37,7 +38,7 @@
"add-subtract-date": "^1.0.15",
"elly": "^1.1.11",
"formatoid": "^1.2.4",
"github-calendar-parser": "^1.1.13"
"github-calendar-parser": "^1.2.2"
},
"blah": {
"example": [
Expand Down Expand Up @@ -139,4 +140,4 @@
"bloggify.json",
"bloggify/"
]
}
}

0 comments on commit 3d20d09

Please sign in to comment.