diff --git a/assets/plugins/github-calendar/.gitignore b/assets/plugins/github-calendar/.gitignore new file mode 100644 index 00000000..61f29005 --- /dev/null +++ b/assets/plugins/github-calendar/.gitignore @@ -0,0 +1,5 @@ +*.swp +*.swo +*~ +*.log +node_modules diff --git a/assets/plugins/github-calendar/CONTRIBUTING.md b/assets/plugins/github-calendar/CONTRIBUTING.md old mode 100755 new mode 100644 index 35951df5..7a9ae0e1 --- a/assets/plugins/github-calendar/CONTRIBUTING.md +++ b/assets/plugins/github-calendar/CONTRIBUTING.md @@ -59,6 +59,8 @@ Contributions are more than welcome! Thanks! :sweat_smile: + + [1]: https://github.com/IonicaBizau/github-calendar/issues -[2]: https://github.com/IonicaBizau/code-style \ No newline at end of file +[2]: https://github.com/IonicaBizau/code-style diff --git a/assets/plugins/github-calendar/LICENSE b/assets/plugins/github-calendar/LICENSE old mode 100755 new mode 100644 index b25b8c60..0fc5744f --- a/assets/plugins/github-calendar/LICENSE +++ b/assets/plugins/github-calendar/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Ionică Bizău (http://ionicabizau.net) +Copyright (c) 2016-17 Ionică Bizău (https://ionicabizau.net) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/assets/plugins/github-calendar/README.md b/assets/plugins/github-calendar/README.md old mode 100755 new mode 100644 index 620e6c24..af6519ee --- a/assets/plugins/github-calendar/README.md +++ b/assets/plugins/github-calendar/README.md @@ -1,19 +1,33 @@ -# github-calendar.js [![Support this project][donate-now]][paypal-donations] -Embed your GitHub contributions calendar anywhere. +# github-calendar.js + + [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Version](https://img.shields.io/npm/v/github-calendar.svg)](https://www.npmjs.com/package/github-calendar) [![Downloads](https://img.shields.io/npm/dt/github-calendar.svg)](https://www.npmjs.com/package/github-calendar) + +> Embed your GitHub contributions calendar anywhere. + Everybodywell, haters gonna hate loves GitHub and everybody loves stats. So, why not making the GitHub contributions calendar available for being embeded in your web pages? Now [you can](https://ionicabizau.github.io/github-calendar/example). :tada: + [![](http://i.imgur.com/S1h8XoB.jpg)](https://ionicabizau.github.io/github-calendar/example) -## Installation + +## :cloud: Installation + Check out the [`dist`](/dist) directory to download the needed files and include them on your page. +If you're using this module in a CommonJS environment, you can install it from `npm` and `require` it: + +```sh +$ npm i --save github-calendar +``` + + ```html - + @@ -33,9 +47,11 @@ Check out the [`dist`](/dist) directory to download the needed files and include ``` -[Here](http://jsbin.com/wewihogevu/edit?html,output) you can see this example in action. +[Here](http://codepen.io/anon/pen/aZmjvZ?editors=1000) you can see this example in action. + + +## :memo: Documentation -## Documentation ### `GitHubCalendar(container, username, options)` Brings the contributions calendar from GitHub (provided username) into your page. @@ -48,37 +64,88 @@ Brings the contributions calendar from GitHub (provided username) into your page pull requests, issues opened, and commits made by "`). - `proxy` (Function): A function that receives as argument an url (string) and should return the proxied url. The default is using [@izuzak](https://github.com/izuzak)'s [`urlreq`](https://github.com/izuzak/urlreq). + - `global_stats` (Boolean): If `false`, the global stats (total, longest and current streaks) will not be calculated and displayed. By default this is enabled. #### Return - **Promise** A promise returned by the `fetch()` call. -## How to contribute + + +## :yum: How to contribute Have an idea? Found a bug? See [how to contribute][contributing]. -## Thanks + +## :sparkling_heart: Support my projects + +I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, +this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it). + +However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it: + + - Starring and sharing the projects you like :rocket: + - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea: + - [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone). + - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6` + + ![](https://i.imgur.com/z6OQI95.png) + +Thanks! :heart: + + +## :cake: Thanks - Big thanks to [**@izuzak**](https://github.com/izuzak) for creating the [urlreq](https://github.com/izuzak/urlreq) project–the default proxy used by this library. :cake: - Part of the CSS code was taken from the GitHub profile page to offer the same experience. :art: -## Where is this library used? -If you are using this library in one of your projects, add it in this list. :sparkles: - -## Related - - [`github-calendar-parser`](https://github.com/IonicaBizau/github-calendar-parser)–Parses the GitHub calendar SVG into JSON. - - [`github-calendar-legend`](https://github.com/IonicaBizau/github-calendar-legend)–The GitHub contributions calendar colors. - - [`ghcal`](https://github.com/IonicaBizau/ghcal)–See the GitHub contributions calendar of a user in the command line. - - [`github-stats`](https://github.com/IonicaBizau/github-stats)–Visualize stats about GitHub users and projects in your terminal. - - [...and other goodies...](https://github.com/search?q=user%3AIonicaBizau+github) -## License +## :sparkles: Related + + - [`github-profile-languages`](https://github.com/IonicaBizau/github-profile-languages)—Create a nice pie chart with the user's programming languages from their GitHub profile. + - [`github-org-members.js`](https://github.com/IonicaBizau/github-org-members.js)—A JavaScript library for fetching and rendering in HTML the members of a GitHub organization. + - [`gh-contributions`](https://github.com/IonicaBizau/github-contributions)—A tool that generates a repository which being pushed into your GitHub account creates a nice contributions calendar. + - [`github-emojify`](https://github.com/IonicaBizau/github-emojifiy#readme)—Emojify your GitHub repository descriptions. + - [`github-stats`](https://github.com/IonicaBizau/github-stats)—Visualize stats about GitHub users and projects in your terminal. + - [`github-labeller`](https://github.com/IonicaBizau/github-labeller#readme)—Automagically create issue labels in your GitHub projects. + - [`cli-gh-cal`](https://github.com/IonicaBizau/cli-gh-cal)—GitHub like calendar graphs in command line. + - [`gh-destroy`](https://github.com/IonicaBizau/gh-destroy#readme)—Delete multiple GitHub repositories. + - [`ship-release`](https://github.com/IonicaBizau/ship-release#readme)—Publish new versions on GitHub and npm with ease. + - [`github-calendar-legend`](https://github.com/IonicaBizau/github-calendar-legend#readme)—The GitHub contributions calendar colors. + - [`github-pr-branch-links`](https://github.com/IonicaBizau/github-pr-branch-links)—Open in a new tab the clicked branch on a pull request page. + - [`github-emoji-form-submit`](https://github.com/IonicaBizau/github-emoji-form-submit#readme)—Autocomplete selected Emoji when submitting forms on GitHub.com. + - [`gh-repeat`](https://github.com/IonicaBizau/gh-repeat#readme)—Repetitive actions on multiple GitHub repositories. + - [`gh-repos`](https://github.com/IonicaBizau/gh-repos#readme)—Get one or all the owner repositories from GitHub. + - [`github-old-header`](https://github.com/IonicaBizau/github-old-header)—Brings the old header links back. + - [`gh.js`](https://github.com/IonicaBizau/gh.js)—Tiny GitHub API wrapper for server and client. + - [`ghcal`](https://github.com/IonicaBizau/ghcal)—See the GitHub contributions calendar of a user in the command line. + - [`sort-github-user-repos`](https://github.com/IonicaBizau/sort-github-user-repos#readme)—Sort GitHub repositories by stars for user. + - [`github-calendar-parser`](https://github.com/IonicaBizau/github-calendar-parser#readme)—Parses the GitHub contributions calendar SVG code into JSON. + - [`gh-notifier`](https://bitbucket.org/IonicaBizau/gh-notifier#readme)—Receive desktop notifications from your GitHub dashboard. + - [`octimatch`](https://github.com/IonicaBizau/OctiMatch#readme)—A matching game with GitHub's Octicons. + - [`github-portfolio`](https://github.com/IonicaBizau/github-portfolio#readme)—A tool to generate a portfolio using data from your Github projects. + - [`gh-polyglot`](https://github.com/IonicaBizau/node-gh-polyglot)—Get language stats about GitHub users and repositories. + - [`cli-github`](https://github.com/IonicaBizau/cli-github)—A fancy GitHub client for command line. + - [`github-calendar`](https://github.com/IonicaBizau/github-calendar#readme)—Embed your GitHub contributions calendar anywhere. + - [`git-stats`](https://github.com/IonicaBizau/git-stats)—Local git statistics including GitHub-like contributions calendars. + - [`repository-downloader`](https://github.com/IonicaBizau/repository-downloader)—Download all the repositories from BitBucket and GitHub, including your account, teams and where you created pull requests. + - [`github-colors`](https://github.com/IonicaBizau/github-colors)—GitHub colors and file extensions mapping + + + +## :scroll: License [MIT][license] © [Ionică Bizău][website] +[badge_patreon]: http://ionicabizau.github.io/badges/patreon.svg +[badge_amazon]: http://ionicabizau.github.io/badges/amazon.svg +[badge_paypal]: http://ionicabizau.github.io/badges/paypal.svg +[badge_paypal_donate]: http://ionicabizau.github.io/badges/paypal_donate.svg +[patreon]: https://www.patreon.com/ionicabizau +[amazon]: http://amzn.eu/hRo9sIZ [paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW [donate-now]: http://i.imgur.com/6cMbHOC.png -[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(http%3A%2F%2Fionicabizau.net)&year=2016#license-mit -[website]: http://ionicabizau.net +[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(https%3A%2F%2Fionicabizau.net)&year=2016#license-mit +[website]: https://ionicabizau.net [contributing]: /CONTRIBUTING.md -[docs]: /DOCUMENTATION.md \ No newline at end of file +[docs]: /DOCUMENTATION.md diff --git a/assets/plugins/github-calendar/dist/github-calendar.css b/assets/plugins/github-calendar/dist/github-calendar.css old mode 100755 new mode 100644 index 1c3174bb..3a68edd2 --- a/assets/plugins/github-calendar/dist/github-calendar.css +++ b/assets/plugins/github-calendar/dist/github-calendar.css @@ -114,3 +114,11 @@ .monospace a:hover { text-decoration: underline; } + +h2.f4.text-normal.mb-3 { + display: none; +} + +.float-left.text-gray { + float: left; +} \ No newline at end of file diff --git a/assets/plugins/github-calendar/dist/github-calendar.min.js b/assets/plugins/github-calendar/dist/github-calendar.min.js old mode 100755 new mode 100644 index 9c57e09d..aaeeca7a --- a/assets/plugins/github-calendar/dist/github-calendar.min.js +++ b/assets/plugins/github-calendar/dist/github-calendar.min.js @@ -1 +1 @@ -"use strict";function _typeof(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.GitHubCalendar=e()}}(function(){return function e(t,n,r){function o(i,f){if(!n[i]){if(!t[i]){var d="function"==typeof require&&require;if(!f&&d)return d(i,!0);if(u)return u(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var p=n[i]={exports:{}};t[i][0].call(p.exports,function(e){var n=t[i][1][e];return o(n?n:e)},p,p.exports,e,t,n,r)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i@'+t+"",n.proxy=n.proxy||function(e){return"https://urlreq.appspot.com/req?method=GET&url="+e},fetch(n.proxy("https://github.com/"+t)).then(function(e){return e.text()}).then(function(t){var r=document.createElement("div");r.innerHTML=t;var o=r.querySelector("#contributions-calendar");o.querySelector(".left.text-muted").innerHTML=n.summary_text,e.innerHTML=o.innerHTML})}},{}]},{},[1])(1)}); \ No newline at end of file +"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.GitHubCalendar=e()}}(function(){return function e(t,n,r){function a(u,s){if(!n[u]){if(!t[u]){var c="function"==typeof require&&require;if(!s&&c)return c(u,!0);if(o)return o(u,!0);var i=new Error("Cannot find module '"+u+"'");throw i.code="MODULE_NOT_FOUND",i}var l=n[u]={exports:{}};t[u][0].call(l.exports,function(e){var n=t[u][1][e];return a(n?n:e)},l,l.exports,e,t,n,r)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u@'+t+"",c.global_stats===!1&&(e.style.minHeight="175px"),c.proxy=c.proxy||function(e){return"https://urlreq.appspot.com/req?method=GET&url="+e};var i=function l(){return fetch(c.proxy("https://github.com/"+t)).then(function(e){return e.text()}).then(function(t){var i=document.createElement("div");i.innerHTML=t;var f=i.querySelector(".js-contribution-graph");if(f.querySelector(".float-left.text-gray").innerHTML=c.summary_text,f.querySelector("include-fragment"))setTimeout(l,500);else{if(c.global_stats!==!1){var d=n(r("svg",f).outerHTML),p=d.current_streak?o(d.current_streak_range[0],s)+" – "+o(d.current_streak_range[1],s):d.last_contributed?"Last contributed in "+o(d.last_contributed,s)+".":"Rock - Hard Place",g=d.longest_streak?o(d.longest_streak_range[0],s)+" – "+o(d.longest_streak_range[1],s):d.last_contributed?"Last contributed in "+o(d.last_contributed,s)+".":"Rock - Hard Place",y=r("
",{"class":"contrib-column contrib-column-first table-column",html:'Contributions in the last year\n '+d.last_year+' total\n '+o(a.subtract(new Date,1,"year"),u)+" – "+o(new Date,u)+""}),m=r("
",{"class":"contrib-column table-column",html:'Longest streak\n '+d.longest_streak+' days\n '+g+""}),b=r("
",{"class":"contrib-column table-column",html:'Current streak\n '+d.current_streak+' days\n '+p+""});f.appendChild(y),f.appendChild(m),f.appendChild(b)}e.innerHTML=f.innerHTML}})["catch"](function(e){return console.error(e)})};return i()}},{"add-subtract-date":2,elly:4,formatoid:6,"github-calendar-parser":8}],2:[function(e,t){function n(e){return function t(n,r,a){switch(r=e*r,a){case"years":case"year":n.setFullYear(n.getFullYear()+r);break;case"months":case"month":n.setMonth(n.getMonth()+r);break;case"weeks":case"week":return t(n,7*r,"days");case"days":case"day":n.setDate(n.getDate()+r);break;case"hours":case"hour":n.setHours(n.getHours()+r);break;case"minutes":case"minute":n.setMinutes(n.getMinutes()+r);break;case"seconds":case"second":n.setSeconds(n.getSeconds()+r);break;case"milliseconds":case"millisecond":n.setMilliseconds(n.getMilliseconds()+r);break;default:throw new Error("Invalid range: "+a)}return n}}t.exports={add:n(1),subtract:n(-1)}},{}],3:[function(e,t){t.exports=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],t.exports.abbr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],t.exports["short"]=["Su","Mo","Tu","We","Th","Fr","Sa"]},{}],4:[function(e,t){function n(e,t){return"string"==typeof e?"<"===e.charAt(0)?(e=document.createElement(e.slice(1,-1)),r(t||{},function(t,n){switch(n){case"text":return void(e.textContent=t);case"html":return void(e.innerHTML=t)}e.setAttribute(n,t)}),e):(t=t||document,t.querySelector(e)):e}var r=e("iterate-object"),a=e("sliced");n.$$=function(e,t){return t=t||document,a(t.querySelectorAll(e))},t.exports=n},{"iterate-object":9,sliced:13}],5:[function(e,t){t.exports=function(e,t,n){t=t||2,n=n||"0",e=e.toString();var r=t-e.length;return(0>=r?"":n.repeat(r))+e}},{}],6:[function(e,t){var n=e("months"),r=e("days"),a=e("fillo"),o=e("parse-it").Parser,u=new o({YYYY:function(e){return e.getFullYear()},YY:function(e){return e.getFullYear()%100},MMMM:function(e){return n[e.getMonth()]},MMM:function(e){return n.abbr[e.getMonth()]},MM:function(e){return a(e.getMonth()+1)},M:function(e){return e.getMonth()+1},dddd:function(e){return r[e.getDay()]},ddd:function(e){return r.abbr[e.getDay()]},dd:function(e){return r["short"][e.getDay()]},d:function(e){return e.getDay()},DD:function(e){return a(e.getDate())},D:function(e){return e.getDate()},A:function(e){return e.getHours()>=12?"PM":"AM"},a:function(e){return e.getHours()>=12?"pm":"am"},hh:function(e){return a(e.getHours()%12||12)},h:function(e){return e.getHours()%12||12},HH:function(e){return a(e.getHours())},H:function(e){return e.getHours()},mm:function(e){return a(e.getMinutes())},m:function(e){return e.getMinutes()},ss:function(e){return a(e.getSeconds())},s:function(e){return e.getSeconds()}});t.exports=function(e,t){return u.run(t,[e])}},{days:3,fillo:5,months:10,"parse-it":11}],7:[function(e,t){t.exports=["#eee","#d6e685","#8cc665","#44a340","#1e6823"]},{}],8:[function(e,t){var n=e("github-calendar-legend");t.exports=function(e){var t={last_year:0,longest_streak:-1,longest_streak_range:[],current_streak:0,current_streak_range:[],weeks:[],days:[],last_contributed:null},r=[],a=function(){t.current_streak>t.longest_streak&&(t.longest_streak=t.current_streak,t.longest_streak_range[0]=t.current_streak_range[0],t.longest_streak_range[1]=t.current_streak_range[1])};return e.split("\n").slice(2).map(function(e){return e.trim()}).forEach(function(e){if(e.startsWith("t?Math.max(0,t+a):t||0;for(void 0!==n&&(a=0>n?n+a:n);a-->o;)r[a-o]=e[a];return r}},{}]},{},[1])(1)}); \ No newline at end of file diff --git a/assets/plugins/github-calendar/example/css/style.css b/assets/plugins/github-calendar/example/css/style.css old mode 100755 new mode 100644 diff --git a/assets/plugins/github-calendar/example/index.html b/assets/plugins/github-calendar/example/index.html old mode 100755 new mode 100644 index 6bf5b21f..e7614a6b --- a/assets/plugins/github-calendar/example/index.html +++ b/assets/plugins/github-calendar/example/index.html @@ -19,7 +19,7 @@

Embed your GitHub contributions calendar anywhere!

If you want to know more about this project, check out the GitHub repository.

Embed guide <3

-<!-- Prepare a container for your calendar. -->
+<!-- Include the library. -->
 <script
   src="https://cdn.rawgit.com/IonicaBizau/github-calendar/gh-pages/dist/github-calendar.min.js"
 ></script>
diff --git a/assets/plugins/github-calendar/example/js/main.js b/assets/plugins/github-calendar/example/js/main.js
old mode 100755
new mode 100644
diff --git a/assets/plugins/github-calendar/lib/index.js b/assets/plugins/github-calendar/lib/index.js
old mode 100755
new mode 100644
index 7bfb8f51..f479253f
--- a/assets/plugins/github-calendar/lib/index.js
+++ b/assets/plugins/github-calendar/lib/index.js
@@ -1,3 +1,15 @@
+"use strict";
+
+const parse = require("github-calendar-parser")
+    , $ = require("elly")
+    , addSubtractDate = require("add-subtract-date")
+    , formatoid = require("formatoid")
+    ;
+
+const DATE_FORMAT1 = "MMM D, YYYY"
+    , DATE_FORMAT2 = "MMMM D"
+    ;
+
 /**
  * GitHubCalendar
  * Brings the contributions calendar from GitHub (provided username) into your page.
@@ -12,30 +24,79 @@
  *    pull requests, issues opened, and commits made by "`).
  *  - `proxy` (Function): A function that receives as argument an url (string) and should return the proxied url.
  *    The default is using [@izuzak](https://github.com/izuzak)'s [`urlreq`](https://github.com/izuzak/urlreq).
+ *  - `global_stats` (Boolean): If `false`, the global stats (total, longest and current streaks) will not be calculated and displayed. By default this is enabled.
  *
  * @return {Promise} A promise returned by the `fetch()` call.
  */
 module.exports = function GitHubCalendar (container, username, options) {
-    if (typeof container === "string") {
-        container = document.querySelector(container);
-    }
+
+    container = $(container);
 
     options = options || {};
     options.summary_text = options.summary_text || `Summary of pull requests, issues opened, and commits made by @${username}`;
 
+    if (options.global_stats === false) {
+        container.style.minHeight = "175px";
+    }
+
     // We need a proxy for CORS
     // Thanks, @izuzak (https://github.com/izuzak/urlreq)
     options.proxy = options.proxy || function (url) {
         return "https://urlreq.appspot.com/req?method=GET&url=" + url;
     };
 
-    return fetch(options.proxy("https://github.com/" + username)).then(response => {
+    let fetchCalendar = () => fetch(options.proxy("https://github.com/" + username)).then(response => {
         return response.text()
     }).then(body => {
-        var div = document.createElement("div");
+        let div = document.createElement("div");
         div.innerHTML = body;
-        var cal = div.querySelector("#contributions-calendar");
-        cal.querySelector(".left.text-muted").innerHTML = options.summary_text;
-        container.innerHTML = cal.innerHTML;
-    });
-};
+        let cal = div.querySelector(".js-contribution-graph");
+        cal.querySelector(".float-left.text-gray").innerHTML = options.summary_text;
+
+        // If 'include-fragment' with spinner img loads instead of the svg, fetchCalendar again
+        if (cal.querySelector("include-fragment")) {
+            setTimeout(fetchCalendar, 500);
+        } else {
+            if (options.global_stats !== false) {
+                let parsed = parse($("svg", cal).outerHTML)
+                  , currentStreakInfo = parsed.current_streak
+                                      ? `${formatoid(parsed.current_streak_range[0], DATE_FORMAT2)} – ${formatoid(parsed.current_streak_range[1], DATE_FORMAT2)}`
+                                      : parsed.last_contributed
+                                      ? `Last contributed in ${formatoid(parsed.last_contributed, DATE_FORMAT2)}.`
+                                      : "Rock - Hard Place"
+                  , longestStreakInfo = parsed.longest_streak
+                                      ? `${formatoid(parsed.longest_streak_range[0], DATE_FORMAT2)} – ${formatoid(parsed.longest_streak_range[1], DATE_FORMAT2)}`
+                                      : parsed.last_contributed
+                                      ? `Last contributed in ${formatoid(parsed.last_contributed, DATE_FORMAT2)}.`
+                                      : "Rock - Hard Place"
+                  , firstCol = $("
", { + "class": "contrib-column contrib-column-first table-column" + , html: `Contributions in the last year + ${parsed.last_year} total + ${formatoid(addSubtractDate.subtract(new Date(), 1, "year"), DATE_FORMAT1)} – ${formatoid(new Date(), DATE_FORMAT1)}` + }) + , secondCol = $("
", { + "class": "contrib-column table-column" + , html: `Longest streak + ${parsed.longest_streak} days + ${longestStreakInfo}` + }) + , thirdCol = $("
", { + "class": "contrib-column table-column" + , html: `Current streak + ${parsed.current_streak} days + ${currentStreakInfo}` + }) + ; + + cal.appendChild(firstCol); + cal.appendChild(secondCol); + cal.appendChild(thirdCol); + } + + container.innerHTML = cal.innerHTML; + } + }).catch(e => console.error(e)); + + return fetchCalendar(); +} diff --git a/assets/plugins/github-calendar/package.json b/assets/plugins/github-calendar/package.json old mode 100755 new mode 100644 index 115d28d3..69705006 --- a/assets/plugins/github-calendar/package.json +++ b/assets/plugins/github-calendar/package.json @@ -1,6 +1,6 @@ { "name": "github-calendar", - "version": "1.0.1", + "version": "1.1.12", "description": "Embed your GitHub contributions calendar anywhere.", "main": "lib/index.js", "directories": { @@ -8,7 +8,7 @@ }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "release": "browserify lib/index.js -o dist/github-calendar.min.js -s GitHubCalendar && babel dist/github-calendar.min.js | uglifyjs -c -m -o dist/github-calendar.min.js" + "release": "dist-it lib/index.js github-calendar.min.js" }, "repository": { "type": "git", @@ -19,14 +19,22 @@ "calendar", "embed" ], - "author": "Ionică Bizău (http://ionicabizau.net)", + "author": "Ionică Bizău (https://ionicabizau.net)", + "contributors": [ + "Evan Palmer (http://evanpalmer.net)", + "Francesco Tonini (https://francescotonini.it)", + "Miroslav Vidovic " + ], "license": "MIT", "bugs": { "url": "https://github.com/IonicaBizau/github-calendar/issues" }, "homepage": "https://github.com/IonicaBizau/github-calendar#readme", "dependencies": { - "github-calendar-parser": "^1.0.0" + "add-subtract-date": "^1.0.5", + "elly": "^1.0.0", + "formatoid": "^1.0.3", + "github-calendar-parser": "^1.1.3" }, "blah": { "example": [ @@ -34,9 +42,9 @@ "code": { "language": "html", "content": [ - "", + "", "", "", "", "", @@ -58,7 +66,7 @@ } }, { - "p": "[Here](http://jsbin.com/wewihogevu/edit?html,output) you can see this example in action." + "p": "[Here](http://codepen.io/anon/pen/aZmjvZ?editors=1000) you can see this example in action." } ], "thanks": { @@ -78,12 +86,47 @@ "title": "github-calendar.js", "related": { "ul": [ - "[`github-calendar-parser`](https://github.com/IonicaBizau/github-calendar-parser)–Parses the GitHub calendar SVG into JSON.", - "[`github-calendar-legend`](https://github.com/IonicaBizau/github-calendar-legend)–The GitHub contributions calendar colors.", - "[`ghcal`](https://github.com/IonicaBizau/ghcal)–See the GitHub contributions calendar of a user in the command line.", - "[`github-stats`](https://github.com/IonicaBizau/github-stats)–Visualize stats about GitHub users and projects in your terminal.", - "[...and other goodies...](https://github.com/search?q=user%3AIonicaBizau+github)" + "github-profile-languages", + "github-org-members.js", + "gh-contributions", + "github-emojify", + "github-stats", + "github-labeller", + "cli-gh-cal", + "gh-destroy", + "ship-release", + "github-calendar-legend", + "github-pr-branch-links", + "github-emoji-form-submit", + "gh-repeat", + "gh-repos", + "github-old-header", + "gh.js", + "ghcal", + "sort-github-user-repos", + "github-calendar-parser", + "gh-notifier", + "octimatch", + "github-portfolio", + "gh-polyglot", + "cli-github", + "github-calendar", + "git-stats", + "repository-downloader", + "github-colors" ] } - } + }, + "files": [ + "bin/", + "app/", + "lib/", + "dist/", + "src/", + "scripts/", + "resources/", + "menu/", + "cli.js", + "index.js" + ] } \ No newline at end of file diff --git a/index.html b/index.html index ab2e9612..54270da2 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ /> - + @@ -403,7 +403,7 @@

Credits

- +