diff --git a/assets/js/main.js b/assets/js/main.js index 309b47af..cf414305 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -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 */ diff --git a/assets/plugins/github-calendar/lib/index.js b/assets/plugins/github-calendar/lib/index.js index b2274c59..b1235beb 100644 --- a/assets/plugins/github-calendar/lib/index.js +++ b/assets/plugins/github-calendar/lib/index.js @@ -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") @@ -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") @@ -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 diff --git a/assets/plugins/github-calendar/package-lock.json b/assets/plugins/github-calendar/package-lock.json index 1bbfe3e7..63d573d4 100644 --- a/assets/plugins/github-calendar/package-lock.json +++ b/assets/plugins/github-calendar/package-lock.json @@ -1,8 +1,103 @@ { "name": "github-calendar", - "version": "2.2.7", - "lockfileVersion": 1, + "version": "2.3.3", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "github-calendar", + "version": "2.3.3", + "license": "MIT", + "dependencies": { + "add-subtract-date": "^1.0.15", + "elly": "^1.1.11", + "formatoid": "^1.2.4", + "github-calendar-parser": "^1.2.2" + } + }, + "node_modules/add-subtract-date": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/add-subtract-date/-/add-subtract-date-1.0.15.tgz", + "integrity": "sha512-MiL4wnMyM999meyCrSA3LME9uZ/b5ptSd0ACDVUoTfutFwvkMyIN7nG7gjrU56WEk5RlFLBghabcgdYwY8s+nQ==" + }, + "node_modules/days": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/days/-/days-1.1.1.tgz", + "integrity": "sha512-vzeIwVsEIyA35GH4+mPd4hjVDNI87wYANyZFs0BHjBr5kIBH5zEl7LfD6Wr4SFZca4D3CU9IH1w4DuZLlXzKRw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/elly": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/elly/-/elly-1.1.11.tgz", + "integrity": "sha512-WFKVcEKEOjdSOhNYFKWQoJDk0Sb0re6v0fIsGkePn97dmPpKM/YoOKRdYIb34T1R13KPRNzDBDmT/Flb/54NXg==", + "dependencies": { + "iterate-object": "^1.3.2", + "sliced": "^1.0.1" + } + }, + "node_modules/fillo": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/fillo/-/fillo-1.0.13.tgz", + "integrity": "sha512-9LYJ0ww96DUYETd2Bia5NS1b8rj42nEE5zsfcUwDErMopTs6BRBe4dRIVjrZGXSiK4vNSL/Q3u0dyqbmkA2Zdg==" + }, + "node_modules/formatoid": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/formatoid/-/formatoid-1.2.4.tgz", + "integrity": "sha512-9wWHOPJvbIheSpiHGl0xaBwdszlzPaeh2KqHVexGQnKpO85xrMoKvuf6M3q0B4uC3I9lkXjH6+8ipQC8PQ/7Gw==", + "dependencies": { + "days": "^1.0.1", + "fillo": "^1.0.0", + "months": "^1.0.0", + "parse-it": "^1.0.0" + } + }, + "node_modules/github-calendar-legend": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/github-calendar-legend/-/github-calendar-legend-1.0.11.tgz", + "integrity": "sha512-V7AkszKw2fMeU+g6W5dQ7vDGzJ3giSaukdOUEdUqhcHhQDVYcQf7c0Q3korbQzJsh+Wh3MqyPtN+ZSAuEnHP2A==" + }, + "node_modules/github-calendar-parser": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/github-calendar-parser/-/github-calendar-parser-1.2.2.tgz", + "integrity": "sha512-lA47NHVu5lTH0kZf71W+NXhqr3hvsHLwMRqUxTNsopLDQNCQTAgyhzHwi5iJegq2cTTn4p1ZeqmHyt8RbbhPOw==", + "dependencies": { + "github-calendar-legend": "^1.0.11" + } + }, + "node_modules/iterate-object": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/iterate-object/-/iterate-object-1.3.4.tgz", + "integrity": "sha512-4dG1D1x/7g8PwHS9aK6QV5V94+ZvyP4+d19qDv43EzImmrndysIl4prmJ1hWWIGCqrZHyaHBm6BSEWHOLnpoNw==" + }, + "node_modules/months": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/months/-/months-1.2.0.tgz", + "integrity": "sha512-zFM7hUpziSYGk2DNObYGWgHdRRxAOgjl8CC1Rbl50p/q0rGDsREfk0nbxxmSIquVi/lEAuUY8nwbwkZ8biNCOQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parse-it": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/parse-it/-/parse-it-1.0.10.tgz", + "integrity": "sha512-VAG4EuoNd2TT2wSRUuKyLEkZR3MhdWc+3UPp5CDQzqSt/FiniG+yJ5RXyJYiuzVAMEKL4d97gx6O3LR5jEB3uQ==", + "dependencies": { + "regex-escape": "^3.4.0" + } + }, + "node_modules/regex-escape": { + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/regex-escape/-/regex-escape-3.4.10.tgz", + "integrity": "sha512-qEqf7uzW+iYcKNLMDFnMkghhQBnGdivT6KqVQyKsyjSWnoFyooXVnxrw9dtv3AFLnD6VBGXxtZGAQNFGFTnCqA==" + }, + "node_modules/sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" + } + }, "dependencies": { "add-subtract-date": { "version": "1.0.15", @@ -45,9 +140,9 @@ "integrity": "sha512-V7AkszKw2fMeU+g6W5dQ7vDGzJ3giSaukdOUEdUqhcHhQDVYcQf7c0Q3korbQzJsh+Wh3MqyPtN+ZSAuEnHP2A==" }, "github-calendar-parser": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/github-calendar-parser/-/github-calendar-parser-1.1.13.tgz", - "integrity": "sha512-zZZATmg54pX9Qyqc3I7FQ1M4Nfg0/+XshlGinf41tI8tZk96VWCMCIW52pzicwepdP/Ny5LZaBGE/NtprKevdw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/github-calendar-parser/-/github-calendar-parser-1.2.2.tgz", + "integrity": "sha512-lA47NHVu5lTH0kZf71W+NXhqr3hvsHLwMRqUxTNsopLDQNCQTAgyhzHwi5iJegq2cTTn4p1ZeqmHyt8RbbhPOw==", "requires": { "github-calendar-legend": "^1.0.11" } diff --git a/assets/plugins/github-calendar/package.json b/assets/plugins/github-calendar/package.json index 357dcf99..1ea13978 100644 --- a/assets/plugins/github-calendar/package.json +++ b/assets/plugins/github-calendar/package.json @@ -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": { @@ -26,7 +26,8 @@ "Francesco Tonini (https://francescotonini.it)", "Miroslav Vidovic ", "Mike Roibu ", - "Rohit Rathi (https://rathirohit.github.io)" + "Rohit Rathi (https://rathirohit.github.io)", + "Wang Pengfei (https://pengfeixc.com)" ], "license": "MIT", "bugs": { @@ -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": [ @@ -139,4 +140,4 @@ "bloggify.json", "bloggify/" ] -} +} \ No newline at end of file