github-buttons
Advanced tools
Comparing version 2.8.1 to 2.9.0
/*! | ||
* github-buttons v2.8.1 | ||
* github-buttons v2.9.0 | ||
* (c) 2020 なつき | ||
@@ -60,12 +60,14 @@ * @license BSD-2-Clause | ||
var name = "github-buttons"; | ||
var version = "2.8.1"; | ||
var version = "2.9.0"; | ||
var iframeURL = 'https://' + (/* istanbul ignore next */ 'unpkg.com/' + name + '@' + version + '/dist' ) + '/buttons.html'; | ||
var apiBaseURL = 'https://api.github.com'; | ||
var domain = 'github.com'; | ||
var useXHR = XMLHttpRequest && XMLHttpRequest.prototype && 'withCredentials' in XMLHttpRequest.prototype; | ||
var apiBaseURL = 'https://api.' + domain; | ||
var useShadowDOM = useXHR && HTMLElement && HTMLElement.prototype.attachShadow && !HTMLElement.prototype.attachShadow.prototype; | ||
var useXHR = XMLHttpRequest && 'prototype' in XMLHttpRequest && 'withCredentials' in XMLHttpRequest.prototype; | ||
var useShadowDOM = useXHR && HTMLElement && 'attachShadow' in HTMLElement.prototype && !('prototype' in HTMLElement.prototype.attachShadow); | ||
var onEvent = function (target, eventName, func) { | ||
@@ -163,3 +165,3 @@ /* istanbul ignore else: IE lt 9 */ | ||
var params = str.split(sep); | ||
for (var i = 0, len = params.length; i < len; ++i) { | ||
for (var i = 0, len = params.length; i < len; i++) { | ||
var entry = params[i]; | ||
@@ -300,7 +302,4 @@ if (entry !== '') { | ||
var domain = btn.hostname.split('.').reverse(); | ||
if (domain[0] === '') { | ||
domain.shift(); | ||
} | ||
if (domain[0] !== 'com' || domain[1] !== 'github') { | ||
var hostname = btn.hostname.replace(/\.$/, ''); | ||
if (hostname.length < domain.length || ('.' + hostname).substring(hostname.length - domain.length) !== ('.' + domain)) { | ||
btn.href = '#'; | ||
@@ -312,11 +311,10 @@ btn.target = '_self'; | ||
var len = domain.length; | ||
var path = (' /' + btn.pathname).split(/\/+/); | ||
if (((len === 2 || (len === 3 && domain[2] === 'gist')) && path[3] === 'archive') || | ||
(len === 2 && path[3] === 'releases' && path[4] === 'download') || | ||
(len === 3 && domain[2] === 'codeload')) { | ||
if (((hostname === domain || hostname === 'gist.' + domain) && path[3] === 'archive') || | ||
(hostname === domain && path[3] === 'releases' && path[4] === 'download') || | ||
(hostname === 'codeload.' + domain)) { | ||
btn.target = '_top'; | ||
} | ||
if (!/^true$/i.test(options['data-show-count']) || len !== 2) { | ||
if (!/^true$/i.test(options['data-show-count']) || hostname !== domain) { | ||
func(widget); | ||
@@ -323,0 +321,0 @@ return |
/*! | ||
* github-buttons v2.8.1 | ||
* github-buttons v2.9.0 | ||
* (c) 2020 なつき | ||
@@ -56,12 +56,14 @@ * @license BSD-2-Clause | ||
var name = "github-buttons"; | ||
var version = "2.8.1"; | ||
var version = "2.9.0"; | ||
var iframeURL = 'https://' + (/* istanbul ignore next */ 'unpkg.com/' + name + '@' + version + '/dist' ) + '/buttons.html'; | ||
var apiBaseURL = 'https://api.github.com'; | ||
var domain = 'github.com'; | ||
var useXHR = XMLHttpRequest && XMLHttpRequest.prototype && 'withCredentials' in XMLHttpRequest.prototype; | ||
var apiBaseURL = 'https://api.' + domain; | ||
var useShadowDOM = useXHR && HTMLElement && HTMLElement.prototype.attachShadow && !HTMLElement.prototype.attachShadow.prototype; | ||
var useXHR = XMLHttpRequest && 'prototype' in XMLHttpRequest && 'withCredentials' in XMLHttpRequest.prototype; | ||
var useShadowDOM = useXHR && HTMLElement && 'attachShadow' in HTMLElement.prototype && !('prototype' in HTMLElement.prototype.attachShadow); | ||
var onEvent = function (target, eventName, func) { | ||
@@ -159,3 +161,3 @@ /* istanbul ignore else: IE lt 9 */ | ||
var params = str.split(sep); | ||
for (var i = 0, len = params.length; i < len; ++i) { | ||
for (var i = 0, len = params.length; i < len; i++) { | ||
var entry = params[i]; | ||
@@ -296,7 +298,4 @@ if (entry !== '') { | ||
var domain = btn.hostname.split('.').reverse(); | ||
if (domain[0] === '') { | ||
domain.shift(); | ||
} | ||
if (domain[0] !== 'com' || domain[1] !== 'github') { | ||
var hostname = btn.hostname.replace(/\.$/, ''); | ||
if (hostname.length < domain.length || ('.' + hostname).substring(hostname.length - domain.length) !== ('.' + domain)) { | ||
btn.href = '#'; | ||
@@ -308,11 +307,10 @@ btn.target = '_self'; | ||
var len = domain.length; | ||
var path = (' /' + btn.pathname).split(/\/+/); | ||
if (((len === 2 || (len === 3 && domain[2] === 'gist')) && path[3] === 'archive') || | ||
(len === 2 && path[3] === 'releases' && path[4] === 'download') || | ||
(len === 3 && domain[2] === 'codeload')) { | ||
if (((hostname === domain || hostname === 'gist.' + domain) && path[3] === 'archive') || | ||
(hostname === domain && path[3] === 'releases' && path[4] === 'download') || | ||
(hostname === 'codeload.' + domain)) { | ||
btn.target = '_top'; | ||
} | ||
if (!/^true$/i.test(options['data-show-count']) || len !== 2) { | ||
if (!/^true$/i.test(options['data-show-count']) || hostname !== domain) { | ||
func(widget); | ||
@@ -319,0 +317,0 @@ return |
/*! | ||
* github-buttons v2.8.1 | ||
* github-buttons v2.9.0 | ||
* (c) 2020 なつき | ||
@@ -20,3 +20,3 @@ * @license BSD-2-Clause | ||
var name = "github-buttons"; | ||
var version = "2.8.1"; | ||
var version = "2.9.0"; | ||
@@ -27,8 +27,10 @@ var buttonClass = 'github-button'; | ||
var apiBaseURL = 'https://api.github.com'; | ||
var domain = 'github.com'; | ||
var useXHR = XMLHttpRequest && XMLHttpRequest.prototype && 'withCredentials' in XMLHttpRequest.prototype; | ||
var apiBaseURL = 'https://api.' + domain; | ||
var useShadowDOM = useXHR && HTMLElement && HTMLElement.prototype.attachShadow && !HTMLElement.prototype.attachShadow.prototype; | ||
var useXHR = XMLHttpRequest && 'prototype' in XMLHttpRequest && 'withCredentials' in XMLHttpRequest.prototype; | ||
var useShadowDOM = useXHR && HTMLElement && 'attachShadow' in HTMLElement.prototype && !('prototype' in HTMLElement.prototype.attachShadow); | ||
var stringify = function (obj, sep, eq, encodeURIComponent) { | ||
@@ -66,3 +68,3 @@ if (sep == null) { | ||
var params = str.split(sep); | ||
for (var i = 0, len = params.length; i < len; ++i) { | ||
for (var i = 0, len = params.length; i < len; i++) { | ||
var entry = params[i]; | ||
@@ -302,7 +304,4 @@ if (entry !== '') { | ||
var domain = btn.hostname.split('.').reverse(); | ||
if (domain[0] === '') { | ||
domain.shift(); | ||
} | ||
if (domain[0] !== 'com' || domain[1] !== 'github') { | ||
var hostname = btn.hostname.replace(/\.$/, ''); | ||
if (hostname.length < domain.length || ('.' + hostname).substring(hostname.length - domain.length) !== ('.' + domain)) { | ||
btn.href = '#'; | ||
@@ -314,11 +313,10 @@ btn.target = '_self'; | ||
var len = domain.length; | ||
var path = (' /' + btn.pathname).split(/\/+/); | ||
if (((len === 2 || (len === 3 && domain[2] === 'gist')) && path[3] === 'archive') || | ||
(len === 2 && path[3] === 'releases' && path[4] === 'download') || | ||
(len === 3 && domain[2] === 'codeload')) { | ||
if (((hostname === domain || hostname === 'gist.' + domain) && path[3] === 'archive') || | ||
(hostname === domain && path[3] === 'releases' && path[4] === 'download') || | ||
(hostname === 'codeload.' + domain)) { | ||
btn.target = '_top'; | ||
} | ||
if (!/^true$/i.test(options['data-show-count']) || len !== 2) { | ||
if (!/^true$/i.test(options['data-show-count']) || hostname !== domain) { | ||
func(widget); | ||
@@ -462,3 +460,3 @@ return | ||
for (var i = 0, len = ref.length; i < len; i++) { | ||
if (~(' ' + ref[i].className + ' ').replace(/[ \t\n\f\r]+/g, ' ').indexOf(' ' + buttonClass + ' ')) { | ||
if ((' ' + ref[i].className + ' ').replace(/[ \t\n\f\r]+/g, ' ').indexOf(' ' + buttonClass + ' ') !== -1) { | ||
results.push(ref[i]); | ||
@@ -465,0 +463,0 @@ } |
/*! | ||
* github-buttons v2.8.1 | ||
* github-buttons v2.9.0 | ||
* (c) 2020 なつき | ||
* @license BSD-2-Clause | ||
*/ | ||
!function(){"use strict";var e=window.document,t=e.location,o=window.Math,r=window.HTMLElement,n=window.XMLHttpRequest,a="https://unpkg.com/github-buttons@2.8.1/dist/buttons.html",i=n&&n.prototype&&"withCredentials"in n.prototype,l=i&&r&&r.prototype.attachShadow&&!r.prototype.attachShadow.prototype,c=function(e,t,o,r){null==t&&(t="&"),null==o&&(o="="),null==r&&(r=window.decodeURIComponent);for(var n={},a=e.split(t),i=0,l=a.length;i<l;++i){var c=a[i];if(""!==c){var d=c.split(o);n[r(d[0])]=null!=d[1]?r(d.slice(1).join(o)):void 0}}return n},d=function(e,t,o){e.addEventListener?e.addEventListener(t,o,!1):e.attachEvent("on"+t,o)},s=function(e,t,o){e.removeEventListener?e.removeEventListener(t,o,!1):e.detachEvent("on"+t,o)},f=function(e,t,o){var r=function(n){return s(e,t,r),o(n)};d(e,t,r)},h=function(e,t,o){var r=function(n){if(t.test(e.readyState))return s(e,"readystatechange",r),o(n)};d(e,"readystatechange",r)},u=function(e){return function(t,o,r){var n=e.createElement(t);if(null!=o)for(var a in o){var i=o[a];null!=i&&(null!=n[a]?n[a]=i:n.setAttribute(a,i))}if(null!=r)for(var l=0,c=r.length;l<c;l++){var d=r[l];n.appendChild("string"==typeof d?e.createTextNode(d):d)}return n}},g=u(e),p=function(e){var t;return function(){t||(t=1,e.apply(this,arguments))}},b=function(e,t){return{}.hasOwnProperty.call(e,t)},v={light:".btn{color:#24292e;background-color:#eff3f6;border-color:#c5c9cc;border-color:rgba(27,31,35,.2);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%23fafbfc'/%3e%3cstop offset='90%25' stop-color='%23eff3f6'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #fafbfc, #eff3f6 90%);background-image:linear-gradient(180deg, #fafbfc, #eff3f6 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FFFAFBFC', endColorstr='#FFEEF2F5')}:root .btn{filter:none}.btn:focus,.btn:hover{background-color:#e6ebf1;background-position:-0.5em;border-color:#9fa4a9;border-color:rgba(27,31,35,.35);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%23f0f3f6'/%3e%3cstop offset='90%25' stop-color='%23e6ebf1'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #f0f3f6, #e6ebf1 90%);background-image:linear-gradient(180deg, #f0f3f6, #e6ebf1 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FFF0F3F6', endColorstr='#FFE5EAF0')}:root .btn:focus,:root .btn:hover{filter:none}.btn:active{background-color:#e9ecef;border-color:#a1a4a8;border-color:rgba(27,31,35,.35);box-shadow:inset 0 .15em .3em rgba(27,31,35,.15);background-image:none;filter:none}.social-count{color:#24292e;background-color:#fff;border-color:#d1d2d3;border-color:rgba(27,31,35,.2)}.social-count:focus,.social-count:hover{color:#0366d6}.octicon-heart{color:#ea4aaa}",dark:".btn{color:#fafbfc;background-color:#202428;border-color:#1f2327;border-color:rgba(27,31,35,.2);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%232f363d'/%3e%3cstop offset='90%25' stop-color='%23202428'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #2f363d, #202428 90%);background-image:linear-gradient(180deg, #2f363d, #202428 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FF2F363D', endColorstr='#FF1E2226')}:root .btn{filter:none}.btn:focus,.btn:hover{background-color:#1b1f23;background-position:-0.5em;border-color:#1b1f23;border-color:rgba(27,31,35,.5);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%232b3137'/%3e%3cstop offset='90%25' stop-color='%231b1f23'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #2b3137, #1b1f23 90%);background-image:linear-gradient(180deg, #2b3137, #1b1f23 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FF2B3137', endColorstr='#FF191D21')}:root .btn:focus,:root .btn:hover{filter:none}.btn:active{background-color:#181b1f;border-color:#1a1d21;border-color:rgba(27,31,35,.5);box-shadow:inset 0 .15em .3em rgba(27,31,35,.15);background-image:none;filter:none}.social-count{color:#fafbfc;background-color:#1b1f23;border-color:#1b1f23;border-color:rgba(27,31,35,.2)}.social-count:focus,.social-count:hover{color:#2188ff}.octicon-heart{color:#ec6cb9}"},m=function(e,t){return"@media(prefers-color-scheme:"+e+"){"+v[b(v,t)?t:e]+"}"},w={"mark-github":{width:16,height:16,path:'<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path>'},heart:{width:12,height:16,path:'<path fill-rule="evenodd" d="M8.727 3C7.091 3 6.001 4.65 6.001 4.65S4.909 3 3.273 3C1.636 3 0 4.1 0 6.3 0 9.6 6 14 6 14s6-4.4 6-7.7C12 4.1 10.364 3 8.727 3z"></path>'},eye:{width:16,height:16,path:'<path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"></path>'},star:{width:14,height:16,path:'<path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74L14 6z"></path>'},"repo-forked":{width:10,height:16,path:'<path fill-rule="evenodd" d="M8 1a1.993 1.993 0 00-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 002 1a1.993 1.993 0 00-1 3.72V6.5l3 3v1.78A1.993 1.993 0 005 15a1.993 1.993 0 001-3.72V9.5l3-3V4.72A1.993 1.993 0 008 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"></path>'},"repo-template":{width:14,height:16,path:'<path fill-rule="evenodd" d="M12 8V1c0-.55-.45-1-1-1H1C.45 0 0 .45 0 1v12c0 .55.45 1 1 1h2v2l1.5-1.5L6 16v-4H3v1H1v-2h7v-1H2V1h9v7h1zM4 2H3v1h1V2zM3 4h1v1H3V4zm1 2H3v1h1V6zm0 3H3V8h1v1zm6 3H8v2h2v2h2v-2h2v-2h-2v-2h-2v2z"></path>'},"issue-opened":{width:14,height:16,path:'<path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 011.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path>'},"cloud-download":{width:16,height:16,path:'<path fill-rule="evenodd" d="M9 12h2l-3 3-3-3h2V7h2v5zm3-8c0-.44-.91-3-4.5-3C5.08 1 3 2.92 3 5 1.02 5 0 6.52 0 8c0 1.53 1 3 3 3h3V9.7H3C1.38 9.7 1.3 8.28 1.3 8c0-.17.05-1.7 1.7-1.7h1.3V5c0-1.39 1.56-2.7 3.2-2.7 2.55 0 3.13 1.55 3.2 1.8v1.2H12c.81 0 2.7.22 2.7 2.2 0 2.09-2.25 2.2-2.7 2.2h-2V11h2c2.08 0 4-1.16 4-3.5C16 5.06 14.08 4 12 4z"></path>'}},x={},y=function(e,t){var o=x[e]||(x[e]=[]);if(!(o.push(t)>1)){var r=p((function(){for(delete x[e];t=o.shift();)t.apply(null,arguments)}));if(i){var a=new n;d(a,"abort",r),d(a,"error",r),d(a,"load",(function(){var e;try{e=JSON.parse(a.responseText)}catch(e){return void r(e)}r(200!==a.status,e)})),a.open("GET",e),a.send()}else{var l=this||window;l._=function(e){l._=null,r(200!==e.meta.status,e.data)};var c=u(l.document)("script",{async:!0,src:e+(/\?/.test(e)?"&":"?")+"callback=_"}),s=function(){l._&&l._({meta:{}})};d(c,"load",s),d(c,"error",s),c.readyState&&h(c,/de|m/,s),l.document.getElementsByTagName("head")[0].appendChild(c)}}},k=function(e,t,o){var r=u(e.ownerDocument),n=e.appendChild(r("style",{type:"text/css"})),a="body{margin:0}a{text-decoration:none;outline:0}.widget{display:inline-block;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;font-size:0;white-space:nowrap}.btn,.social-count{position:relative;display:inline-block;height:14px;padding:2px 5px;font-size:11px;font-weight:600;line-height:14px;vertical-align:bottom;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-repeat:repeat-x;background-position:-1px -1px;background-size:110% 110%;border:1px solid}.btn{border-radius:.25em}.btn:not(:last-child){border-radius:.25em 0 0 .25em}.social-count{border-left:0;border-radius:0 .25em .25em 0}.widget-lg .btn,.widget-lg .social-count{height:20px;padding:3px 10px;font-size:12px;line-height:20px}.octicon{display:inline-block;vertical-align:text-top;fill:currentColor}"+function(e){if(null==e)return v.light;var t=c(e,";",":",(function(e){return e.replace(/^[ \t\n\f\r]+|[ \t\n\f\r]+$/g,"")}));return v[b(v,t["no-preference"])?t["no-preference"]:"light"]+m("light",t.light)+m("dark",t.dark)}(t["data-color-scheme"]);n.styleSheet?n.styleSheet.cssText=a:n.appendChild(e.ownerDocument.createTextNode(a));var i,l,d=r("a",{className:"btn",href:t.href,rel:"noopener",target:"_blank",title:t.title||void 0,"aria-label":t["aria-label"]||void 0,innerHTML:(i=t["data-icon"],l=/^large$/i.test(t["data-size"])?16:14,i=(""+i).toLowerCase().replace(/^octicon-/,""),b(w,i)||(i="mark-github"),'<svg viewBox="0 0 '+w[i].width+" "+w[i].height+'" class="octicon octicon-'+i+'" style="width: '+l*w[i].width/w[i].height+"px; height: "+l+'px;" aria-hidden="true">'+w[i].path+"</svg>")},[" ",r("span",{},[t["data-text"]||""])]),s=e.appendChild(r("div",{className:"widget"+(/^large$/i.test(t["data-size"])?" widget-lg":"")},[d])),f=d.hostname.split(".").reverse();if(""===f[0]&&f.shift(),"com"!==f[0]||"github"!==f[1])return d.href="#",d.target="_self",void o(s);var h=f.length,g=(" /"+d.pathname).split(/\/+/);if(((2===h||3===h&&"gist"===f[2])&&"archive"===g[3]||2===h&&"releases"===g[3]&&"download"===g[4]||3===h&&"codeload"===f[2])&&(d.target="_top"),/^true$/i.test(t["data-show-count"])&&2===h){var p,x;if(!g[2]&&g[1])p=x="followers";else if(!g[3]&&g[2])x="stargazers_count",p="stargazers";else if(g[4]||"subscription"!==g[3])if(g[4]||"fork"!==g[3]){if("issues"!==g[3])return void o(s);x="open_issues_count",p="issues"}else x="forks_count",p="network/members";else x="subscribers_count",p="watchers";var k=g[2]?"/repos/"+g[1]+"/"+g[2]:"/users/"+g[1];y.call(this,"https://api.github.com"+k,(function(e,t){if(!e){var n=t[x];s.appendChild(r("a",{className:"social-count",href:t.html_url+"/"+p,rel:"noopener",target:"_blank","aria-label":n+" "+x.replace(/_count$/,"").replace("_"," ").slice(0,n<2?-1:void 0)+" on GitHub"},[(""+n).replace(/\B(?=(\d{3})+(?!\d))/g,",")]))}o(s)}))}else o(s)},C=window.devicePixelRatio||1,z=function(e){return(C>1?o.ceil(o.round(e*C)/C*2)/2:o.ceil(e))||0},F=function(e,t){e.style.width=t[0]+"px",e.style.height=t[1]+"px"},M=function(t,r){if(null!=t&&null!=r)if(t.getAttribute&&(t=function(e){for(var t={href:e.href,title:e.title,"aria-label":e.getAttribute("aria-label")},o=["icon","color-scheme","text","size","show-count"],r=0,n=o.length;r<n;r++){var a="data-"+o[r];t[a]=e.getAttribute(a)}return null==t["data-text"]&&(t["data-text"]=e.textContent||e.innerText),t}(t)),l){var n=g("span");k(n.attachShadow({mode:"closed"}),t,(function(){r(n)}))}else{var i=g("iframe",{src:"javascript:0",title:t.title||void 0,allowtransparency:!0,scrolling:"no",frameBorder:0});F(i,[0,0]),i.style.border="none";var c=function(){var n,l=i.contentWindow;try{n=l.document.body}catch(t){return void e.body.appendChild(i.parentNode.removeChild(i))}s(i,"load",c),k.call(l,n,t,(function(e){var n=function(e){var t=e.offsetWidth,r=e.offsetHeight;if(e.getBoundingClientRect){var n=e.getBoundingClientRect();t=o.max(t,z(n.width)),r=o.max(r,z(n.height))}return[t,r]}(e);i.parentNode.removeChild(i),f(i,"load",(function(){F(i,n)})),i.src=a+"#"+(i.name=function(e,t,o,r){null==t&&(t="&"),null==o&&(o="="),null==r&&(r=window.encodeURIComponent);var n=[];for(var a in e){var i=e[a];null!=i&&n.push(r(a)+o+r(i))}return n.join(t)}(t)),r(i)}))};d(i,"load",c),e.body.appendChild(i)}};t.protocol+"//"+t.host+t.pathname===a?k(e.body,c(window.name||t.hash.replace(/^#/,"")),(function(){})):function(t){if("complete"===e.readyState||"loading"!==e.readyState&&!e.documentElement.doScroll)setTimeout(t);else if(e.addEventListener){var o=p(t);f(e,"DOMContentLoaded",o),f(window,"load",o)}else h(e,/m/,t)}((function(){for(var t=e.querySelectorAll?e.querySelectorAll("a.github-button"):function(){for(var t=[],o=e.getElementsByTagName("a"),r=0,n=o.length;r<n;r++)~(" "+o[r].className+" ").replace(/[ \t\n\f\r]+/g," ").indexOf(" github-button ")&&t.push(o[r]);return t}(),o=0,r=t.length;o<r;o++)!function(e){M(e,(function(t){e.parentNode.replaceChild(t,e)}))}(t[o])}))}(); | ||
!function(){"use strict";var e=window.document,t=e.location,o=window.Math,r=window.HTMLElement,n=window.XMLHttpRequest,a="https://unpkg.com/github-buttons@2.9.0/dist/buttons.html",i="github.com",l=n&&"prototype"in n&&"withCredentials"in n.prototype,c=l&&r&&"attachShadow"in r.prototype&&!("prototype"in r.prototype.attachShadow),d=function(e,t,o,r){null==t&&(t="&"),null==o&&(o="="),null==r&&(r=window.decodeURIComponent);for(var n={},a=e.split(t),i=0,l=a.length;i<l;i++){var c=a[i];if(""!==c){var d=c.split(o);n[r(d[0])]=null!=d[1]?r(d.slice(1).join(o)):void 0}}return n},s=function(e,t,o){e.addEventListener?e.addEventListener(t,o,!1):e.attachEvent("on"+t,o)},h=function(e,t,o){e.removeEventListener?e.removeEventListener(t,o,!1):e.detachEvent("on"+t,o)},f=function(e,t,o){var r=function(n){return h(e,t,r),o(n)};s(e,t,r)},u=function(e,t,o){var r=function(n){if(t.test(e.readyState))return h(e,"readystatechange",r),o(n)};s(e,"readystatechange",r)},g=function(e){return function(t,o,r){var n=e.createElement(t);if(null!=o)for(var a in o){var i=o[a];null!=i&&(null!=n[a]?n[a]=i:n.setAttribute(a,i))}if(null!=r)for(var l=0,c=r.length;l<c;l++){var d=r[l];n.appendChild("string"==typeof d?e.createTextNode(d):d)}return n}},p=g(e),b=function(e){var t;return function(){t||(t=1,e.apply(this,arguments))}},v=function(e,t){return{}.hasOwnProperty.call(e,t)},m={light:".btn{color:#24292e;background-color:#eff3f6;border-color:#c5c9cc;border-color:rgba(27,31,35,.2);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%23fafbfc'/%3e%3cstop offset='90%25' stop-color='%23eff3f6'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #fafbfc, #eff3f6 90%);background-image:linear-gradient(180deg, #fafbfc, #eff3f6 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FFFAFBFC', endColorstr='#FFEEF2F5')}:root .btn{filter:none}.btn:focus,.btn:hover{background-color:#e6ebf1;background-position:-0.5em;border-color:#9fa4a9;border-color:rgba(27,31,35,.35);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%23f0f3f6'/%3e%3cstop offset='90%25' stop-color='%23e6ebf1'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #f0f3f6, #e6ebf1 90%);background-image:linear-gradient(180deg, #f0f3f6, #e6ebf1 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FFF0F3F6', endColorstr='#FFE5EAF0')}:root .btn:focus,:root .btn:hover{filter:none}.btn:active{background-color:#e9ecef;border-color:#a1a4a8;border-color:rgba(27,31,35,.35);box-shadow:inset 0 .15em .3em rgba(27,31,35,.15);background-image:none;filter:none}.social-count{color:#24292e;background-color:#fff;border-color:#d1d2d3;border-color:rgba(27,31,35,.2)}.social-count:focus,.social-count:hover{color:#0366d6}.octicon-heart{color:#ea4aaa}",dark:".btn{color:#fafbfc;background-color:#202428;border-color:#1f2327;border-color:rgba(27,31,35,.2);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%232f363d'/%3e%3cstop offset='90%25' stop-color='%23202428'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #2f363d, #202428 90%);background-image:linear-gradient(180deg, #2f363d, #202428 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FF2F363D', endColorstr='#FF1E2226')}:root .btn{filter:none}.btn:focus,.btn:hover{background-color:#1b1f23;background-position:-0.5em;border-color:#1b1f23;border-color:rgba(27,31,35,.5);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%232b3137'/%3e%3cstop offset='90%25' stop-color='%231b1f23'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #2b3137, #1b1f23 90%);background-image:linear-gradient(180deg, #2b3137, #1b1f23 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FF2B3137', endColorstr='#FF191D21')}:root .btn:focus,:root .btn:hover{filter:none}.btn:active{background-color:#181b1f;border-color:#1a1d21;border-color:rgba(27,31,35,.5);box-shadow:inset 0 .15em .3em rgba(27,31,35,.15);background-image:none;filter:none}.social-count{color:#fafbfc;background-color:#1b1f23;border-color:#1b1f23;border-color:rgba(27,31,35,.2)}.social-count:focus,.social-count:hover{color:#2188ff}.octicon-heart{color:#ec6cb9}"},w=function(e,t){return"@media(prefers-color-scheme:"+e+"){"+m[v(m,t)?t:e]+"}"},x={"mark-github":{width:16,height:16,path:'<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path>'},heart:{width:12,height:16,path:'<path fill-rule="evenodd" d="M8.727 3C7.091 3 6.001 4.65 6.001 4.65S4.909 3 3.273 3C1.636 3 0 4.1 0 6.3 0 9.6 6 14 6 14s6-4.4 6-7.7C12 4.1 10.364 3 8.727 3z"></path>'},eye:{width:16,height:16,path:'<path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"></path>'},star:{width:14,height:16,path:'<path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74L14 6z"></path>'},"repo-forked":{width:10,height:16,path:'<path fill-rule="evenodd" d="M8 1a1.993 1.993 0 00-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 002 1a1.993 1.993 0 00-1 3.72V6.5l3 3v1.78A1.993 1.993 0 005 15a1.993 1.993 0 001-3.72V9.5l3-3V4.72A1.993 1.993 0 008 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"></path>'},"repo-template":{width:14,height:16,path:'<path fill-rule="evenodd" d="M12 8V1c0-.55-.45-1-1-1H1C.45 0 0 .45 0 1v12c0 .55.45 1 1 1h2v2l1.5-1.5L6 16v-4H3v1H1v-2h7v-1H2V1h9v7h1zM4 2H3v1h1V2zM3 4h1v1H3V4zm1 2H3v1h1V6zm0 3H3V8h1v1zm6 3H8v2h2v2h2v-2h2v-2h-2v-2h-2v2z"></path>'},"issue-opened":{width:14,height:16,path:'<path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 011.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path>'},"cloud-download":{width:16,height:16,path:'<path fill-rule="evenodd" d="M9 12h2l-3 3-3-3h2V7h2v5zm3-8c0-.44-.91-3-4.5-3C5.08 1 3 2.92 3 5 1.02 5 0 6.52 0 8c0 1.53 1 3 3 3h3V9.7H3C1.38 9.7 1.3 8.28 1.3 8c0-.17.05-1.7 1.7-1.7h1.3V5c0-1.39 1.56-2.7 3.2-2.7 2.55 0 3.13 1.55 3.2 1.8v1.2H12c.81 0 2.7.22 2.7 2.2 0 2.09-2.25 2.2-2.7 2.2h-2V11h2c2.08 0 4-1.16 4-3.5C16 5.06 14.08 4 12 4z"></path>'}},y={},k=function(e,t){var o=y[e]||(y[e]=[]);if(!(o.push(t)>1)){var r=b((function(){for(delete y[e];t=o.shift();)t.apply(null,arguments)}));if(l){var a=new n;s(a,"abort",r),s(a,"error",r),s(a,"load",(function(){var e;try{e=JSON.parse(a.responseText)}catch(e){return void r(e)}r(200!==a.status,e)})),a.open("GET",e),a.send()}else{var i=this||window;i._=function(e){i._=null,r(200!==e.meta.status,e.data)};var c=g(i.document)("script",{async:!0,src:e+(/\?/.test(e)?"&":"?")+"callback=_"}),d=function(){i._&&i._({meta:{}})};s(c,"load",d),s(c,"error",d),c.readyState&&u(c,/de|m/,d),i.document.getElementsByTagName("head")[0].appendChild(c)}}},C=function(e,t,o){var r=g(e.ownerDocument),n=e.appendChild(r("style",{type:"text/css"})),a="body{margin:0}a{text-decoration:none;outline:0}.widget{display:inline-block;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;font-size:0;white-space:nowrap}.btn,.social-count{position:relative;display:inline-block;height:14px;padding:2px 5px;font-size:11px;font-weight:600;line-height:14px;vertical-align:bottom;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-repeat:repeat-x;background-position:-1px -1px;background-size:110% 110%;border:1px solid}.btn{border-radius:.25em}.btn:not(:last-child){border-radius:.25em 0 0 .25em}.social-count{border-left:0;border-radius:0 .25em .25em 0}.widget-lg .btn,.widget-lg .social-count{height:20px;padding:3px 10px;font-size:12px;line-height:20px}.octicon{display:inline-block;vertical-align:text-top;fill:currentColor}"+function(e){if(null==e)return m.light;var t=d(e,";",":",(function(e){return e.replace(/^[ \t\n\f\r]+|[ \t\n\f\r]+$/g,"")}));return m[v(m,t["no-preference"])?t["no-preference"]:"light"]+w("light",t.light)+w("dark",t.dark)}(t["data-color-scheme"]);n.styleSheet?n.styleSheet.cssText=a:n.appendChild(e.ownerDocument.createTextNode(a));var l,c,s=r("a",{className:"btn",href:t.href,rel:"noopener",target:"_blank",title:t.title||void 0,"aria-label":t["aria-label"]||void 0,innerHTML:(l=t["data-icon"],c=/^large$/i.test(t["data-size"])?16:14,l=(""+l).toLowerCase().replace(/^octicon-/,""),v(x,l)||(l="mark-github"),'<svg viewBox="0 0 '+x[l].width+" "+x[l].height+'" class="octicon octicon-'+l+'" style="width: '+c*x[l].width/x[l].height+"px; height: "+c+'px;" aria-hidden="true">'+x[l].path+"</svg>")},[" ",r("span",{},[t["data-text"]||""])]),h=e.appendChild(r("div",{className:"widget"+(/^large$/i.test(t["data-size"])?" widget-lg":"")},[s])),f=s.hostname.replace(/\.$/,"");if(f.length<i.length||("."+f).substring(f.length-i.length)!=="."+i)return s.href="#",s.target="_self",void o(h);var u=(" /"+s.pathname).split(/\/+/);if(((f===i||f==="gist."+i)&&"archive"===u[3]||f===i&&"releases"===u[3]&&"download"===u[4]||f==="codeload."+i)&&(s.target="_top"),/^true$/i.test(t["data-show-count"])&&f===i){var p,b;if(!u[2]&&u[1])p=b="followers";else if(!u[3]&&u[2])b="stargazers_count",p="stargazers";else if(u[4]||"subscription"!==u[3])if(u[4]||"fork"!==u[3]){if("issues"!==u[3])return void o(h);b="open_issues_count",p="issues"}else b="forks_count",p="network/members";else b="subscribers_count",p="watchers";var y=u[2]?"/repos/"+u[1]+"/"+u[2]:"/users/"+u[1];k.call(this,"https://api.github.com"+y,(function(e,t){if(!e){var n=t[b];h.appendChild(r("a",{className:"social-count",href:t.html_url+"/"+p,rel:"noopener",target:"_blank","aria-label":n+" "+b.replace(/_count$/,"").replace("_"," ").slice(0,n<2?-1:void 0)+" on GitHub"},[(""+n).replace(/\B(?=(\d{3})+(?!\d))/g,",")]))}o(h)}))}else o(h)},z=window.devicePixelRatio||1,F=function(e){return(z>1?o.ceil(o.round(e*z)/z*2)/2:o.ceil(e))||0},M=function(e,t){e.style.width=t[0]+"px",e.style.height=t[1]+"px"},H=function(t,r){if(null!=t&&null!=r)if(t.getAttribute&&(t=function(e){for(var t={href:e.href,title:e.title,"aria-label":e.getAttribute("aria-label")},o=["icon","color-scheme","text","size","show-count"],r=0,n=o.length;r<n;r++){var a="data-"+o[r];t[a]=e.getAttribute(a)}return null==t["data-text"]&&(t["data-text"]=e.textContent||e.innerText),t}(t)),c){var n=p("span");C(n.attachShadow({mode:"closed"}),t,(function(){r(n)}))}else{var i=p("iframe",{src:"javascript:0",title:t.title||void 0,allowtransparency:!0,scrolling:"no",frameBorder:0});M(i,[0,0]),i.style.border="none";var l=function(){var n,c=i.contentWindow;try{n=c.document.body}catch(t){return void e.body.appendChild(i.parentNode.removeChild(i))}h(i,"load",l),C.call(c,n,t,(function(e){var n=function(e){var t=e.offsetWidth,r=e.offsetHeight;if(e.getBoundingClientRect){var n=e.getBoundingClientRect();t=o.max(t,F(n.width)),r=o.max(r,F(n.height))}return[t,r]}(e);i.parentNode.removeChild(i),f(i,"load",(function(){M(i,n)})),i.src=a+"#"+(i.name=function(e,t,o,r){null==t&&(t="&"),null==o&&(o="="),null==r&&(r=window.encodeURIComponent);var n=[];for(var a in e){var i=e[a];null!=i&&n.push(r(a)+o+r(i))}return n.join(t)}(t)),r(i)}))};s(i,"load",l),e.body.appendChild(i)}};t.protocol+"//"+t.host+t.pathname===a?C(e.body,d(window.name||t.hash.replace(/^#/,"")),(function(){})):function(t){if("complete"===e.readyState||"loading"!==e.readyState&&!e.documentElement.doScroll)setTimeout(t);else if(e.addEventListener){var o=b(t);f(e,"DOMContentLoaded",o),f(window,"load",o)}else u(e,/m/,t)}((function(){for(var t=e.querySelectorAll?e.querySelectorAll("a.github-button"):function(){for(var t=[],o=e.getElementsByTagName("a"),r=0,n=o.length;r<n;r++)-1!==(" "+o[r].className+" ").replace(/[ \t\n\f\r]+/g," ").indexOf(" github-button ")&&t.push(o[r]);return t}(),o=0,r=t.length;o<r;o++)!function(e){H(e,(function(t){e.parentNode.replaceChild(t,e)}))}(t[o])}))}(); |
{ | ||
"name": "github-buttons", | ||
"version": "2.8.1", | ||
"version": "2.9.0", | ||
"description": "GitHub Buttons", | ||
@@ -45,3 +45,3 @@ "keywords": [ | ||
"istanbul-instrumenter-loader": "^3.0.1", | ||
"karma": "^5.0.7", | ||
"karma": "^5.0.9", | ||
"karma-chai": "^0.1.0", | ||
@@ -60,5 +60,5 @@ "karma-chrome-launcher": "^3.1.0", | ||
"raw-loader": "^4.0.1", | ||
"rollup": "^2.10.2", | ||
"rollup": "^2.10.5", | ||
"@rollup/plugin-json": "^4.0.3", | ||
"@rollup/plugin-node-resolve": "^7.1.3", | ||
"@rollup/plugin-node-resolve": "^8.0.0", | ||
"@rollup/plugin-replace": "^2.3.2", | ||
@@ -65,0 +65,0 @@ "rollup-plugin-terser": "^5.3.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81146
1299