You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0 lines
12 KiB

  1. "use strict";var _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e){"object"===("undefined"==typeof exports?"undefined":_typeof2(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).GitHubCalendar=e()}(function(){return function r(a,o,u){function s(t,e){if(!o[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(i)return i(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=o[t]={exports:{}},a[t][0].call(n.exports,function(e){return s(a[t][1][e]||e)},n,n.exports,r,a,o,u)}return o[t].exports}for(var i="function"==typeof require&&require,e=0;e<u.length;e++)s(u[e]);return s}({1:[function(e,t,n){var c=e("github-calendar-parser"),l=e("elly"),d=e("add-subtract-date"),f=e("formatoid"),p="MMM D, YYYY",g="MMMM D",b=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(e){return e+" "+(1===e?"day":"days")}t.exports=function(s,e,i){s=l(s),(i=i||{}).summary_text=i.summary_text||'Summary of pull requests, issues opened, and commits made by <a href="https://github.com/'+e+'" target="blank">@'+e+"</a>",i.cache=1e3*(i.cache||86400),!1===i.global_stats&&(s.style.minHeight="175px");var n={content:"gh_calendar_content."+e,expire_at:"gh_calendar_expire."+e};return i.proxy=i.proxy||function(e){return fetch("https://api.bloggify.net/gh-calendar/?username="+e).then(function(e){return e.text()})},i.getCalendar=i.getCalendar||function(e){if(i.cache&&Date.now()<+localStorage.getItem(n.expire_at)){var t=localStorage.getItem(n.content);if(t)return Promise.resolve(t)}return i.proxy(e).then(function(e){return i.cache&&(localStorage.setItem(n.content,e),localStorage.setItem(n.expire_at,Date.now()+i.cache)),e})},function u(){return i.getCalendar(e).then(function(e){var t=document.createElement("div");t.innerHTML=e;var n,r,a,o,e=t.querySelector(".js-yearly-contributions");l(".position-relative h2",e).remove(),e.querySelector(".float-left.text-gray").innerHTML=i.summary_text,e.querySelector("include-fragment")?setTimeout(u,500):(!0===i.responsive&&(r=(a=e.querySelector("svg.js-calendar-graph-svg")).getAttribute("width"),n=a.getAttribute("height"),a.removeAttribute("height"),a.setAttribute("width","100%"),a.setAttribute("viewBox","0 0 "+r+" "+n)),!1!==i.global_stats&&(a=(t=c(l("svg",e).outerHTML)).current_streak?f(t.current_streak_range[0],g)+" &ndash; "+f(t.current_streak_range[1],g):t.last_contributed?"Last contributed in "+f(t.last_contributed,g)+".":"Rock - Hard Place",r=t.longest_streak?f(t.longest_streak_range[0],g)+" &ndash; "+f(t.longest_streak_range[1],g):t.last_contributed?"Last contributed in "+f(t.last_contributed,g)+".":"Rock - Hard Place",n=l("<div>",{class:"contrib-column contrib-column-first table-column",html:'<span class="text-muted">Contributions in the last year</span>\n <span class="contrib-number">'+t.last_year+' total</span>\n <span class="text-muted">'+f(d.add(d.subtract(new Date,1,"year"),1,"day"),p)+" &ndash; "+f(new Date,p)+"</span>"}),r=l("<div>",{class:"contrib-column table-column",html:'<span class="text-muted">Longest streak</span>\n <span class="contrib-number">'+m(t.longest_streak)+'</span>\n <span class="text-muted">'+r+"</span>"}),a=l("<div>",{class:"contrib-column table-column",html:'<span class="text-muted">Current streak</span>\n <span class="contrib-number">'+m(t.current_streak)+'</span>\n <span class="text-muted">'+a+"</span>"}),e.appendChild(n),e.appendChild(r),e.appendChild(a)),s.innerHTML=e.innerHTML,!0===i.tooltips&&(e=s,(o=document.createElement("div")).classList.add("day-tooltip"),e.appendChild(o),e.querySelectorAll(