First batch of day one
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64.044 64.044">
|
||||
<path d="M46.103 136.34c-.642-.394-1.222-2.242-1.98-2.358-.76-.117-1.353.506-1.618 1.519-.266 1.012-.446 4.188.173 5.538.213.435.482.787 1.03.845.547.057.967-.504 1.45-1.027.482-.523.437-.9 1.142-.612.705.289 1.051.4 1.586 1.229.535.828 1.085 4.043.868 5.598-.241 1.458-.531 2.8-.59 4.088.26.075.517.148.772.217 2.68.724 5.373 1.037 7.873.02.001-.028.01-.105.008-.11-.048-.165-.18-.41-.36-.698-.18-.29-.414-.645-.586-1.114a3.212 3.212 0 0 1-.125-1.735c.056-.21.153-.342.249-.475 1.237-1.193 2.932-1.373 4.244-1.384.557-.004 1.389.016 2.198.255.809.239 1.706.724 2.068 1.843.187.578.114 1.17-.043 1.623-.153.438-.369.783-.545 1.091-.178.31-.329.6-.401.821-.007.02-.003.071-.005.094 2.256 1.008 4.716.91 7.189.398.55-.114 1.11-.247 1.673-.377.344-1.085.678-2.145.852-3.208.124-.752.158-2.311-.078-3.538-.118-.613-.306-1.15-.52-1.489-.221-.349-.413-.501-.747-.538-.243-.027-.51.013-.796.098-.67.223-1.33.606-1.966.76l-.008.002-.109.032c-.556.152-1.233.158-1.797-.36-.556-.51-.89-1.367-1.117-2.596-.283-1.528-.075-3.279.89-4.518l.071-.09h.07c.65-.71 1.485-.802 2.16-.599.706.213 1.333.629 1.772.84.736.354 1.185.319 1.475.171.291-.148.5-.439.668-.955.332-1.017.301-2.819.022-4.106-.148-.684-.13-1.292-.13-1.883-1.558-.463-3.067-.982-4.574-1.208-1.128-.169-2.263-.173-3.298.164-.13.046-.256.095-.38.15-.373.164-.633.342-.805.52-.077.098-.081.105-.087.21-.004.068.031.289.13.571.1.282.256.634.467 1.03.279.524.448 1.063.431 1.618a2.12 2.12 0 0 1-.499 1.309 1.757 1.757 0 0 1-.62.51h-.002c-.515.291-1.107.404-1.723.464-.86.083-1.787.026-2.598-.097-.806-.123-1.47-.28-1.948-.555-.444-.256-.79-.547-1.037-.925a2.273 2.273 0 0 1-.356-1.301c.029-.837.403-1.437.625-1.897.111-.23.191-.433.236-.583.045-.15.044-.25.046-.24-.005-.029-.127-.355-1.015-.741-1.138-.495-2.322-.673-3.533-.668h-.015a9.711 9.711 0 0 0-.521.016h-.002c-1.163.057-2.35.308-3.541.569.383 1.531.79 2.753.818 4.502-.096 1.297.158 2.114-1.03 2.935-.85.588-1.508.729-2.15.335" style="fill:#3d414d;fill-opacity:1;stroke:none;stroke-width:1.03763;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" transform="translate(-40.698 -95.175)"/>
|
||||
<path d="M61.472 101.34v.002c-.3-.003-.603.01-.894.04-.544.055-1.39.165-1.778.306-1.238.364.13 2.344.41 2.913.28.569.285 2.03.14 2.134-.144.103-.375.261-.934.345-.56.084.03-.037-1.589.086-1.62.122-5.506.29-8.265.248-.022.26-.036.521-.097.808-.309 1.442-.63 3.163-.494 4.074.071.473.168.65.414.8.23.14.737.235 1.62-.004.834-.227 1.3-.442 1.887-.456.595-.016 1.555.472 1.965.717.411.245-.03-.008.002 0s.128.05.176.102c.049.053-.276-.523.104.199.379.721.72 3.256.002 4.68-.46.913-1.01 1.49-1.64 1.711-.63.22-1.229.067-1.734-.135-.881-.353-1.584-.7-2.205-.647-1.199 1.94-1.186 4.17-.6 6.602.097.397.212.814.327 1.23 2.68-.556 5.542-1.016 8.337.132 1.064.437 1.73 1.015 1.902 1.857.169.831-.193 1.508-.438 1.986-.122.238-.23.46-.307.642-.07.164-.096.28-.104.324.069.429.309.723.686.945.385.227.89.355 1.35.423.723.104 1.567.152 2.287.086.693-.064 1.032-.338 1.241-.544a2.447 2.447 0 0 0 .303-.437.175.175 0 0 0 .013-.035c-.004-.066-.037-.246-.195-.527-.46-.816-.87-1.595-.817-2.51.028-.476.218-.938.529-1.288.304-.343.698-.586 1.186-.79 1.442-.606 2.96-.609 4.372-.409 1.525.216 2.963.679 4.378 1.083.226-2.09.784-3.9.592-5.77-.058-.565-.287-1.333-.598-1.827-.32-.508-.59-.717-1.036-.642-.648.11-1.472.935-2.707 1.078-.791.092-1.494-.267-1.95-.86-.45-.583-.678-1.335-.78-2.101-.202-1.525.031-3.229.89-4.27.615-.747 1.45-.887 2.15-.74.687.145 1.307.492 1.857.745v-.002c.546.252 1.033.388 1.281.344a.547.547 0 0 0 .353-.188c.113-.124.242-.35.384-.75.604-1.712.206-3.68-.303-5.654-.667.145-1.336.293-2.018.413-1.341.236-2.73.392-4.136.273-.656-.055-1.695-.085-2.58-.476-.442-.195-.903-.514-1.157-1.093-.259-.591-.205-1.313.08-2.014.223-.64 1.082-2.178.692-2.585-.391-.407-1.651-.56-2.554-.571z" style="fill:#3d414d;fill-opacity:1;stroke:none;stroke-width:.992837;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" transform="translate(-40.698 -95.175)"/>
|
||||
<path d="M83.128 98.116c-.484 1.875-1.057 3.757-2.486 5.033-.638.57-1.13.666-1.483.548-.401-.134-.715-.506-1.058-.973-.338-.461-.655-.97-1.076-1.332-.192-.165-.404-.315-.683-.38-.279-.066-.599-.02-.9.102-.489.196-.89.58-1.28 1.047a6.1 6.1 0 0 0-.985 1.632c-.234.591-.356 1.174-.277 1.713.072.487.392.977.905 1.185.463.187.926.156 1.36.154.433 0 .843.01 1.242.147.55.189.79.736.822 1.368.034.66-.145 1.412-.393 1.988l-.008.021c-.74 1.705-1.946 2.893-3.004 4.349l-.664.915.979.099c.924.092 1.788.26 2.468.675.46.281 1.806 1.205 2.794 2.222.497.513.888 1.031 1.047 1.502.078.231.095.422.05.6a.93.93 0 0 1-.345.474c-.301.223-.606.395-.864.532l-.354.186c-.107.058-.189.087-.345.228a.637.637 0 0 1 .062-.045l-.064.041-.209.236-.103.343s.003.126.007.152c.003.017.003.007.004.015v.002c.016.195.061.307.133.476a4.1 4.1 0 0 0 .32.596 5.7 5.7 0 0 0 2.8 2.258c.284.108.908.321 1.548.36.33.02.59.015.912-.13h.002c.08-.037.228-.095.382-.281.153-.186.19-.355.212-.445l.019-.075.003-.078c.023-.585-.037-1.296.072-1.899.153-.657.435-.956 1.009-.909 2.771.239 4.74 1.955 6.693 3.83l.742.714.279-1.155c.55-2.29 1.093-4.464 2.928-5.977.692-.57 1.184-.642 1.527-.509.39.151.676.536.996.995.319.458.605.926 1.07 1.212.194.119.464.232.784.209.32-.024.638-.163.988-.384 1.022-.645 1.778-1.756 2.086-2.942.136-.522.102-.991-.046-1.301-.158-.334-.433-.553-.754-.707-.653-.314-1.468-.373-2.094-.486-.825-.15-1.22-.475-1.345-.878-.13-.417 0-.953.335-1.61.6-1.173 1.887-2.602 3.13-3.911l.498-.526-.449-.432c-1.545-1.49-3.163-3.01-5.252-3.715h-.002c-.473-.16-1.097-.413-1.73-.424h-.003c-.311-.004-.596.04-.883.24v.002c-.22.155-.483.537-.583.937l-.008.036-.006.038c-.116.773-.06 1.467-.217 1.995-.063.212-.198.418-.359.507-.202.111-.492.153-.976.072-.582-.097-1.978-.69-3.021-1.503-.523-.407-.934-.85-1.117-1.3a1.153 1.153 0 0 1-.083-.63c.03-.184.1-.477.308-.593.21-.116.941-.32 1.377-.642h.002c.192-.141.403-.367.518-.64.114-.275.127-.526.123-.774-.006-.142-.036-.192-.08-.3a8.417 8.417 0 0 0-3-3.027c-1.226-.725-2.585-1.135-3.927-1.539-.434-.12-.844-.111-1.02.466zm.912.947c1.186.364 2.357.718 3.345 1.303 1.035.612 1.864 1.488 2.507 2.528-.514.263-1.095.5-1.44.79-.345.29-.729.914-.815 1.434-.084.509 0 .968.155 1.347.301.74.85 1.276 1.44 1.735 1.18.92 2.554 1.545 3.47 1.698.604.1 1.186.088 1.739-.216.594-.327.935-.911 1.088-1.427.264-.884.193-1.664.262-2.17h.1c.3.006.926.206 1.417.371 1.646.554 3.044 1.773 4.431 3.089-1.102 1.174-2.222 2.423-2.888 3.73-.42.823-.73 1.789-.453 2.687.283.913 1.1 1.415 2.138 1.603.691.126 1.472.226 1.84.403.19.091.258.182.278.223.03.064.058.075-.023.387-.21.804-.761 1.598-1.413 2.01-.247.155-.365.183-.407.187-.042.003-.061.002-.172-.066-.144-.088-.455-.473-.772-.929-.317-.454-.714-1.07-1.452-1.356-.783-.304-1.776-.022-2.713.75-1.942 1.6-2.626 3.764-3.146 5.8-1.802-1.676-3.772-3.138-6.589-3.517h-.002c-.346-.095-1.013-.031-1.293.143-.735.501-1.005 1.132-1.168 2.007-.125.69-.082 1.216-.074 1.659-.055.006-.046.01-.104.006-.42-.026-1.035-.215-1.244-.295-.947-.361-1.774-1.006-2.314-1.857-.054-.085-.072-.132-.109-.2l.027-.016c.284-.15.656-.36 1.045-.648.44-.327.789-.798.93-1.35a2.4 2.4 0 0 0-.068-1.379c-.254-.751-.753-1.353-1.295-1.911-1.09-1.124-2.452-2.049-2.99-2.378-.609-.372-1.303-.44-1.981-.56.875-1.094 1.878-2.251 2.596-3.921.294-.823.543-1.907.513-2.658-.049-.97-.489-2.013-1.52-2.367-.579-.2-1.131-.204-1.58-.203-.45.002-.786-.006-.97-.08h-.002c-.264-.107-.236-.108-.268-.33-.025-.17.021-.553.183-.962a4.67 4.67 0 0 1 .725-1.192c.29-.348.617-.59.705-.626.142-.057.176-.05.22-.04.045.011.127.052.263.17.235.201.56.671.92 1.161.354.484.791 1.08 1.543 1.33.8.267 1.784-.052 2.671-.846 1.594-1.424 2.235-3.317 2.714-5.051zm11.705 7.023c-.02.014.042-.002.042 0l-.008.035c.05-.2-.028-.04-.034-.035zM79.472 122.45a.198.198 0 0 1 .005.023v.014c-.002-.01-.003-.03-.005-.037zm-.29.732-.006.01-.044.027c.016-.01.033-.024.05-.036z" style="color:#000;fill:#3d414d;stroke-width:1.02352;-inkscape-stroke:none" transform="translate(-40.698 -95.175)"/>
|
||||
<path d="M76.694 128.845c-.85-.012-1.668.253-2.434.67-.01.592-.015 1.17.109 1.772.323 1.573.422 3.553-.07 5.147-.247.804-.684 1.535-1.347 1.891-.663.356-1.467.296-2.362-.159-.522-.266-1.059-.62-1.487-.757-.223-.072-.392-.096-.522-.069-.13.027-.232.094-.362.27-.53.719-.681 1.823-.497 2.876.177 1.012.418 1.438.543 1.56.143.137.26.154.604.055.548-.158 1.523-.857 2.573-.972l.02-.002.5.058c.686.081 1.247.562 1.622 1.19.372.62.591 1.37.73 2.136.279 1.532.25 3.16.083 4.232-.14.91-.394 1.72-.632 2.53 1.719-.385 3.485-.692 5.307-.36 1.174.214 2.749.574 3.762 1.977l.088.122.046.159c.162.551.16 1.114.024 1.578-.13.45-.348.772-.533 1.023-.181.246-.336.444-.437.606-.102.16-.141.275-.145.336-.01.17 0 .197.07.315.057.1.186.242.39.366.408.246 1.106.414 1.843.45a7.842 7.842 0 0 0 2.174-.21 4.28 4.28 0 0 0 .822-.296c.218-.106.385-.242.377-.233l.029-.031c.025-.035.05-.072.05-.068 0-.004 0-.017-.003-.05a2.733 2.733 0 0 0-.21-.579c-.26-.548-.839-1.333-.822-2.46.01-.657.27-1.21.598-1.576.32-.357.696-.575 1.074-.736.759-.323 1.57-.418 2.054-.458 1.653-.136 3.252.296 4.755.765.457.142.905.29 1.352.434.325-2.258.902-4.247.598-6.217-.071-.46-.25-1.169-.486-1.684-.238-.518-.495-.762-.675-.779-.351-.032-.716.14-1.174.418-.457.277-1.005.665-1.695.742-.745.082-1.406-.291-1.84-.908-.428-.608-.653-1.394-.754-2.196-.203-1.596.016-3.377.794-4.493.568-.813 1.358-.984 2.024-.835.65.146 1.243.51 1.769.779.524.267.99.413 1.237.365a.527.527 0 0 0 .346-.2c.11-.132.235-.373.37-.798.612-1.918.27-3.894-.246-6.054-2.815-.851-5.49-1.534-8.089-.267a.727.727 0 0 0-.223.148c-.024.028-.018.021-.026.056.001-.003-.01.178.07.44.162.522.611 1.29.911 1.978l.004.009.029.063.024.084V133c.162.635.016 1.297-.274 1.727-.272.404-.618.636-.952.81-.675.353-1.399.484-1.724.533a5.888 5.888 0 0 1-3.973-.795c-.512-.311-.876-.594-1.133-1.02-.282-.466-.318-1.084-.172-1.557.252-.814.715-1.266.971-1.89a.663.663 0 0 0 .047-.14c.001-.013 0-.006-.007-.037a.761.761 0 0 0-.184-.268c-.264-.267-.865-.595-1.54-.826-1.356-.462-3.07-.659-3.583-.686-.062-.002-.121-.006-.178-.006z" style="fill:#3d414d;fill-opacity:1;stroke:none;stroke-width:.991342;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" transform="translate(-40.698 -95.175)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,589 @@
|
||||
/*!
|
||||
* github-buttons v2.27.0
|
||||
McShelby/hugo-theme-relearn#155
|
||||
- make render() available on window.githubButtons
|
||||
* (c) 2023 なつき
|
||||
* @license BSD-2-Clause
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var document = window.document;
|
||||
|
||||
var location = document.location;
|
||||
|
||||
var Math = window.Math;
|
||||
|
||||
var HTMLElement = window.HTMLElement;
|
||||
|
||||
var XMLHttpRequest = window.XMLHttpRequest;
|
||||
|
||||
var buttonClass = 'github-button';
|
||||
|
||||
var iframeURL = 'https://' + (/* istanbul ignore next */ 'buttons.github.io') + '/buttons.html';
|
||||
|
||||
var domain = 'github.com';
|
||||
|
||||
var apiBaseURL = 'https://api.' + domain;
|
||||
|
||||
var useXHR = XMLHttpRequest && 'prototype' in XMLHttpRequest && 'withCredentials' in XMLHttpRequest.prototype;
|
||||
|
||||
var useShadowDOM = useXHR && HTMLElement && 'attachShadow' in HTMLElement.prototype && !('prototype' in HTMLElement.prototype.attachShadow);
|
||||
|
||||
var forEach = function (obj, func) {
|
||||
for (var i = 0, len = obj.length; i < len; i++) {
|
||||
func(obj[i]);
|
||||
}
|
||||
};
|
||||
|
||||
var createElementInDocument = function (document) {
|
||||
return function (tag, props, children) {
|
||||
var el = document.createElement(tag);
|
||||
if (props != null) {
|
||||
for (var prop in props) {
|
||||
var val = props[prop];
|
||||
if (val != null) {
|
||||
if (el[prop] != null) {
|
||||
el[prop] = val;
|
||||
} else {
|
||||
el.setAttribute(prop, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (children != null) {
|
||||
forEach(children, function (child) {
|
||||
el.appendChild(typeof child === 'string' ? document.createTextNode(child) : child);
|
||||
});
|
||||
}
|
||||
return el
|
||||
}
|
||||
};
|
||||
|
||||
var createElement = createElementInDocument(document);
|
||||
|
||||
var dispatchOnce = function (func) {
|
||||
var onceToken;
|
||||
return function () {
|
||||
if (!onceToken) {
|
||||
onceToken = 1;
|
||||
func.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var hasOwnProperty = function (obj, prop) {
|
||||
return {}.hasOwnProperty.call(obj, prop)
|
||||
};
|
||||
|
||||
var toLowerCase = function (obj) {
|
||||
return ('' + obj).toLowerCase()
|
||||
};
|
||||
|
||||
var stringify = function (obj, sep, eq, encodeURIComponent) {
|
||||
if (sep == null) {
|
||||
sep = '&';
|
||||
}
|
||||
if (eq == null) {
|
||||
eq = '=';
|
||||
}
|
||||
if (encodeURIComponent == null) {
|
||||
encodeURIComponent = window.encodeURIComponent;
|
||||
}
|
||||
var params = [];
|
||||
for (var name in obj) {
|
||||
var value = obj[name];
|
||||
if (value != null) {
|
||||
params.push(encodeURIComponent(name) + eq + encodeURIComponent(value));
|
||||
}
|
||||
}
|
||||
return params.join(sep)
|
||||
};
|
||||
|
||||
var parse = function (str, sep, eq, decodeURIComponent) {
|
||||
if (sep == null) {
|
||||
sep = '&';
|
||||
}
|
||||
if (eq == null) {
|
||||
eq = '=';
|
||||
}
|
||||
if (decodeURIComponent == null) {
|
||||
decodeURIComponent = window.decodeURIComponent;
|
||||
}
|
||||
var obj = {};
|
||||
forEach(str.split(sep), function (entry) {
|
||||
if (entry !== '') {
|
||||
var ref = entry.split(eq);
|
||||
obj[decodeURIComponent(ref[0])] = (ref[1] != null ? decodeURIComponent(ref.slice(1).join(eq)) : undefined);
|
||||
}
|
||||
});
|
||||
return obj
|
||||
};
|
||||
|
||||
var onEvent = function (target, eventName, func) {
|
||||
/* istanbul ignore else: IE lt 9 */
|
||||
if (target.addEventListener) {
|
||||
target.addEventListener(eventName, func, false);
|
||||
} else {
|
||||
target.attachEvent('on' + eventName, func);
|
||||
}
|
||||
};
|
||||
|
||||
var offEvent = function (target, eventName, func) {
|
||||
/* istanbul ignore else: IE lt 9 */
|
||||
if (target.removeEventListener) {
|
||||
target.removeEventListener(eventName, func, false);
|
||||
} else {
|
||||
target.detachEvent('on' + eventName, func);
|
||||
}
|
||||
};
|
||||
|
||||
var onceEvent = function (target, eventName, func) {
|
||||
var callback = function () {
|
||||
offEvent(target, eventName, callback);
|
||||
return func.apply(this, arguments)
|
||||
};
|
||||
onEvent(target, eventName, callback);
|
||||
};
|
||||
|
||||
var onceReadyStateChange = /* istanbul ignore next: IE lt 9 */ function (target, regex, func) {
|
||||
if (target.readyState != null) {
|
||||
var eventName = 'readystatechange';
|
||||
var callback = function () {
|
||||
if (regex.test(target.readyState)) {
|
||||
offEvent(target, eventName, callback);
|
||||
return func.apply(this, arguments)
|
||||
}
|
||||
};
|
||||
onEvent(target, eventName, callback);
|
||||
}
|
||||
};
|
||||
|
||||
var defer = /* istanbul ignore next */ function (func) {
|
||||
if (document.readyState === 'complete' || (document.readyState !== 'loading' && !document.documentElement.doScroll)) {
|
||||
setTimeout(func);
|
||||
} else {
|
||||
if (document.addEventListener) {
|
||||
var callback = dispatchOnce(func);
|
||||
onceEvent(document, 'DOMContentLoaded', callback);
|
||||
onceEvent(window, 'load', callback);
|
||||
} else {
|
||||
onceReadyStateChange(document, /m/, func);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var buttonsCssText = "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;line-height:0;white-space:nowrap}.btn,.social-count{position:relative;display:inline-block;display:inline-flex;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:16px;padding:5px 10px;font-size:12px;line-height:16px}.octicon{display:inline-block;vertical-align:text-top;fill:currentColor;overflow:visible}";
|
||||
|
||||
var light = ".btn:focus-visible,.social-count:focus-visible{outline:2px solid #0969da;outline-offset:-2px}.btn{color:#24292f;background-color:#ebf0f4;border-color:#ccd1d5;border-color:rgba(31,35,40,.15);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='%23f6f8fa'/%3e%3cstop offset='90%25' stop-color='%23ebf0f4'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #f6f8fa, #ebf0f4 90%);background-image:linear-gradient(180deg, #f6f8fa, #ebf0f4 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FFF6F8FA', endColorstr='#FFEAEFF3')}:root .btn{filter:none}.btn:hover,.btn:focus{background-color:#e9ebef;background-position:0 -0.5em;border-color:#cbcdd1;border-color:rgba(31,35,40,.15);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='%23f3f4f6'/%3e%3cstop offset='90%25' stop-color='%23e9ebef'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #f3f4f6, #e9ebef 90%);background-image:linear-gradient(180deg, #f3f4f6, #e9ebef 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FFF3F4F6', endColorstr='#FFE8EAEE')}:root .btn:hover,:root .btn:focus{filter:none}.btn:active{background-color:#e5e9ed;border-color:#c7cbcf;border-color:rgba(31,35,40,.15);background-image:none;filter:none}.social-count{color:#24292f;background-color:#fff;border-color:#dddedf;border-color:rgba(31,35,40,.15)}.social-count:hover,.social-count:focus{color:#0969da}.octicon-heart{color:#bf3989}";
|
||||
|
||||
var lightHighContrast = ".btn:focus-visible,.social-count:focus-visible{outline:2px solid #0349b4;outline-offset:-2px}.btn{color:#0e1116;background-color:#e7ecf0;border-color:#2f3237;border-color:rgba(1,4,9,.8);background-image:none;filter:none}.btn:hover,.btn:focus{background-color:#c4cdd5;background-position:0 -0.5em;border-color:#282c32;border-color:rgba(1,4,9,.8);background-image:none;filter:none}.btn:active{background-color:#d8dde1;border-color:#2c2f34;border-color:rgba(1,4,9,.8)}.social-count{color:#0e1116;background-color:#fff;border-color:#34363a;border-color:rgba(1,4,9,.8)}.social-count:hover,.social-count:focus{color:#0349b4}.octicon-heart{color:#971368}";
|
||||
|
||||
var dark = ".btn:focus-visible,.social-count:focus-visible{outline:2px solid #2f81f7;outline-offset:-2px}.btn{color:#c9d1d9;background-color:#1a1e23;border-color:#2f3439;border-color:rgba(240,246,252,.1);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='%2321262d'/%3e%3cstop offset='90%25' stop-color='%231a1e23'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #21262d, #1a1e23 90%);background-image:linear-gradient(180deg, #21262d, #1a1e23 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FF21262D', endColorstr='#FF191D22')}:root .btn{filter:none}.btn:hover,.btn:focus{background-color:#292e33;background-position:0 -0.5em;border-color:#8b949e;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='%2330363d'/%3e%3cstop offset='90%25' stop-color='%23292e33'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #30363d, #292e33 90%);background-image:linear-gradient(180deg, #30363d, #292e33 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FF30363D', endColorstr='#FF282D32')}:root .btn:hover,:root .btn:focus{filter:none}.btn:active{background-color:#161719;border-color:#8b949e;background-image:none;filter:none}.social-count{color:#c9d1d9;background-color:#0d1117;border-color:#24282e;border-color:rgba(240,246,252,.1)}.social-count:hover,.social-count:focus{color:#2f81f7}.octicon-heart{color:#db61a2}";
|
||||
|
||||
var darkDimmed = ".btn:focus-visible,.social-count:focus-visible{outline:2px solid #539bf5;outline-offset:-2px}.btn{color:#adbac7;background-color:#30363d;border-color:#40464e;border-color:rgba(205,217,229,.1);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='%23373e47'/%3e%3cstop offset='90%25' stop-color='%2330363d'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #373e47, #30363d 90%);background-image:linear-gradient(180deg, #373e47, #30363d 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FF373E47', endColorstr='#FF2F353C')}:root .btn{filter:none}.btn:hover,.btn:focus{background-color:#3c444d;background-position:0 -0.5em;border-color:#768390;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='%23444c56'/%3e%3cstop offset='90%25' stop-color='%233c444d'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #444c56, #3c444d 90%);background-image:linear-gradient(180deg, #444c56, #3c444d 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FF444C56', endColorstr='#FF3B434C')}:root .btn:hover,:root .btn:focus{filter:none}.btn:active{background-color:#2e3031;border-color:#768390;background-image:none;filter:none}.social-count{color:#adbac7;background-color:#22272e;border-color:#333940;border-color:rgba(205,217,229,.1)}.social-count:hover,.social-count:focus{color:#539bf5}.octicon-heart{color:#c96198}";
|
||||
|
||||
var darkHighContrast = ".btn:focus-visible,.social-count:focus-visible{outline:2px solid #71b7ff;outline-offset:-2px}.btn{color:#f0f3f6;background-color:#272b33;border-color:#7a828e;background-image:none;filter:none}.btn:hover,.btn:focus{background-color:#4a515b;background-position:0 -0.5em;border-color:#bdc4cc;background-image:none;filter:none}.btn:active{background-color:#1d1d1f;border-color:#bdc4cc}.social-count{color:#f0f3f6;background-color:#0a0c10;border-color:#7a828e}.social-count:hover,.social-count:focus{color:#71b7ff}.octicon-heart{color:#ef6eb1}";
|
||||
|
||||
var widgetColorSchemes = {
|
||||
light: light,
|
||||
light_high_contrast: lightHighContrast,
|
||||
dark: dark,
|
||||
dark_dimmed: darkDimmed,
|
||||
dark_high_contrast: darkHighContrast
|
||||
};
|
||||
|
||||
var getColorSchemeMediaQuery = function (systemColorScheme, widgetColorScheme) {
|
||||
return '@media(prefers-color-scheme:' + systemColorScheme + '){' + widgetColorSchemes[hasOwnProperty(widgetColorSchemes, widgetColorScheme) ? widgetColorScheme : systemColorScheme] + '}'
|
||||
};
|
||||
|
||||
var getColorScheme = function (declarations) {
|
||||
if (declarations == null) {
|
||||
return widgetColorSchemes.light
|
||||
}
|
||||
|
||||
if (hasOwnProperty(widgetColorSchemes, declarations)) {
|
||||
return widgetColorSchemes[declarations]
|
||||
}
|
||||
|
||||
var colorSchemes = parse(declarations, ';', ':', function (str) {
|
||||
return str.replace(/^[ \t\n\f\r]+|[ \t\n\f\r]+$/g, '')
|
||||
});
|
||||
|
||||
return widgetColorSchemes[hasOwnProperty(widgetColorSchemes, colorSchemes['no-preference']) ? colorSchemes['no-preference'] : 'light'] +
|
||||
getColorSchemeMediaQuery('light', colorSchemes.light) +
|
||||
getColorSchemeMediaQuery('dark', colorSchemes.dark)
|
||||
};
|
||||
|
||||
var data = {
|
||||
"comment-discussion": {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z\"></path>"
|
||||
}
|
||||
}
|
||||
},
|
||||
download: {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z\"></path><path d=\"M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z\"></path>"
|
||||
}
|
||||
}
|
||||
},
|
||||
eye: {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"M8 2c1.981 0 3.671.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.62 1.62 0 0 1 0 1.798c-.45.678-1.367 1.932-2.637 3.023C11.67 13.008 9.981 14 8 14c-1.981 0-3.671-.992-4.933-2.078C1.797 10.83.88 9.576.43 8.898a1.62 1.62 0 0 1 0-1.798c.45-.677 1.367-1.931 2.637-3.022C4.33 2.992 6.019 2 8 2ZM1.679 7.932a.12.12 0 0 0 0 .136c.411.622 1.241 1.75 2.366 2.717C5.176 11.758 6.527 12.5 8 12.5c1.473 0 2.825-.742 3.955-1.715 1.124-.967 1.954-2.096 2.366-2.717a.12.12 0 0 0 0-.136c-.412-.621-1.242-1.75-2.366-2.717C10.824 4.242 9.473 3.5 8 3.5c-1.473 0-2.825.742-3.955 1.715-1.124.967-1.954 2.096-2.366 2.717ZM8 10a2 2 0 1 1-.001-3.999A2 2 0 0 1 8 10Z\"></path>"
|
||||
}
|
||||
}
|
||||
},
|
||||
heart: {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z\"></path>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"issue-opened": {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\"></path><path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z\"></path>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"mark-github": {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z\"></path>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"package": {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z\"></path>"
|
||||
}
|
||||
}
|
||||
},
|
||||
play: {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z\"></path>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo-forked": {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z\"></path>"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo-template": {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"M13.25 8a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-.75a.75.75 0 0 1 0-1.5h.75v-.25a.75.75 0 0 1 .75-.75ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2ZM2.75 8a.75.75 0 0 1 .75.75v.268c.083-.012.166-.018.25-.018h.5a.75.75 0 0 1 0 1.5h-.5a.25.25 0 0 0-.25.25v.75c0 .28.114.532.3.714a.75.75 0 1 1-1.05 1.072A2.495 2.495 0 0 1 2 11.5V8.75A.75.75 0 0 1 2.75 8ZM11 .75a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0V1.5h-.75A.75.75 0 0 1 11 .75Zm-5 0A.75.75 0 0 1 6.75 0h2.5a.75.75 0 0 1 0 1.5h-2.5A.75.75 0 0 1 6 .75Zm0 9A.75.75 0 0 1 6.75 9h2.5a.75.75 0 0 1 0 1.5h-2.5A.75.75 0 0 1 6 9.75ZM4.992.662a.75.75 0 0 1-.636.848c-.436.063-.783.41-.846.846a.751.751 0 0 1-1.485-.212A2.501 2.501 0 0 1 4.144.025a.75.75 0 0 1 .848.637ZM2.75 4a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0v-1.5A.75.75 0 0 1 2.75 4Zm10.5 0a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0v-1.5a.75.75 0 0 1 .75-.75Z\"></path>"
|
||||
}
|
||||
}
|
||||
},
|
||||
star: {
|
||||
heights: {
|
||||
"16": {
|
||||
width: 16,
|
||||
path: "<path d=\"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z\"></path>"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var octicon = function (icon, height) {
|
||||
icon = toLowerCase(icon).replace(/^octicon-/, '');
|
||||
if (!hasOwnProperty(data, icon)) {
|
||||
icon = 'mark-github';
|
||||
}
|
||||
|
||||
var defaultHeight = height >= 24 && /* istanbul ignore next */ 24 in data[icon].heights ? /* istanbul ignore next */ 24 : 16;
|
||||
|
||||
var svg = data[icon].heights[defaultHeight];
|
||||
|
||||
return '<svg viewBox="0 0 ' + svg.width + ' ' + defaultHeight + '" width="' + (height * svg.width / defaultHeight) + '" height="' + height + '" class="octicon octicon-' + icon + '" aria-hidden="true">' + svg.path + '</svg>'
|
||||
};
|
||||
|
||||
var queues = {};
|
||||
|
||||
var fetch = function (url, func) {
|
||||
var queue = queues[url] || (queues[url] = []);
|
||||
if (queue.push(func) > 1) {
|
||||
return
|
||||
}
|
||||
|
||||
var callback = dispatchOnce(function () {
|
||||
delete queues[url];
|
||||
while ((func = queue.shift())) {
|
||||
func.apply(null, arguments);
|
||||
}
|
||||
});
|
||||
|
||||
if (useXHR) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
onEvent(xhr, 'abort', callback);
|
||||
onEvent(xhr, 'error', callback);
|
||||
onEvent(xhr, 'load', function () {
|
||||
var data;
|
||||
try {
|
||||
data = JSON.parse(this.responseText);
|
||||
} catch (error) {
|
||||
callback(error);
|
||||
return
|
||||
}
|
||||
callback(this.status !== 200, data);
|
||||
});
|
||||
xhr.open('GET', url);
|
||||
xhr.send();
|
||||
} else {
|
||||
var contentWindow = this || window;
|
||||
contentWindow._ = function (json) {
|
||||
contentWindow._ = null;
|
||||
callback(json.meta.status !== 200, json.data);
|
||||
};
|
||||
var script = createElementInDocument(contentWindow.document)('script', {
|
||||
async: true,
|
||||
src: url + (url.indexOf('?') !== -1 ? '&' : '?') + 'callback=_'
|
||||
});
|
||||
var onloadend = /* istanbul ignore next: IE lt 9 */ function () {
|
||||
if (contentWindow._) {
|
||||
contentWindow._({
|
||||
meta: {}
|
||||
});
|
||||
}
|
||||
};
|
||||
onEvent(script, 'load', onloadend);
|
||||
onEvent(script, 'error', onloadend);
|
||||
onceReadyStateChange(script, /de|m/, onloadend);
|
||||
contentWindow.document.getElementsByTagName('head')[0].appendChild(script);
|
||||
}
|
||||
};
|
||||
|
||||
var render$1 = function (root, options, func) {
|
||||
var createElement = createElementInDocument(root.ownerDocument);
|
||||
|
||||
var style = root.appendChild(createElement('style', {
|
||||
type: 'text/css'
|
||||
}));
|
||||
|
||||
var cssText = buttonsCssText + getColorScheme(options['data-color-scheme']);
|
||||
|
||||
/* istanbul ignore if: IE lt 9 */
|
||||
if (style.styleSheet) {
|
||||
style.styleSheet.cssText = cssText;
|
||||
} else {
|
||||
style.appendChild(root.ownerDocument.createTextNode(cssText));
|
||||
}
|
||||
|
||||
var isLarge = toLowerCase(options['data-size']) === 'large';
|
||||
|
||||
var btn = createElement('a', {
|
||||
className: 'btn',
|
||||
href: options.href,
|
||||
rel: 'noopener',
|
||||
target: '_blank',
|
||||
title: options.title || undefined,
|
||||
'aria-label': options['aria-label'] || undefined,
|
||||
innerHTML: octicon(options['data-icon'], isLarge ? 16 : 14) + ' '
|
||||
}, [
|
||||
createElement('span', {}, [options['data-text'] || ''])
|
||||
]);
|
||||
|
||||
var widget = root.appendChild(createElement('div', {
|
||||
className: 'widget' + (isLarge ? ' widget-lg' : '')
|
||||
}, [
|
||||
btn
|
||||
]));
|
||||
|
||||
var hostname = btn.hostname.replace(/\.$/, '');
|
||||
if (('.' + hostname).substring(hostname.length - domain.length) !== ('.' + domain)) {
|
||||
btn.removeAttribute('href');
|
||||
func(widget);
|
||||
return
|
||||
}
|
||||
|
||||
var path = (' /' + btn.pathname).split(/\/+/);
|
||||
if (((hostname === domain || hostname === 'gist.' + domain) && path[3] === 'archive') ||
|
||||
(hostname === domain && path[3] === 'releases' && (path[4] === 'download' || (path[4] === 'latest' && path[5] === 'download'))) ||
|
||||
(hostname === 'codeload.' + domain)) {
|
||||
btn.target = '_top';
|
||||
}
|
||||
|
||||
if (toLowerCase(options['data-show-count']) !== 'true' ||
|
||||
hostname !== domain ||
|
||||
path[1] === 'marketplace' ||
|
||||
path[1] === 'sponsors' ||
|
||||
path[1] === 'orgs' ||
|
||||
path[1] === 'users' ||
|
||||
path[1] === '-') {
|
||||
func(widget);
|
||||
return
|
||||
}
|
||||
|
||||
var href, property;
|
||||
if (!path[2] && path[1]) {
|
||||
property = 'followers';
|
||||
href = '?tab=followers';
|
||||
} else if (!path[3] && path[2]) {
|
||||
property = 'stargazers_count';
|
||||
href = '/stargazers';
|
||||
} else if (!path[4] && path[3] === 'subscription') {
|
||||
property = 'subscribers_count';
|
||||
href = '/watchers';
|
||||
} else if (!path[4] && path[3] === 'fork') {
|
||||
property = 'forks_count';
|
||||
href = '/forks';
|
||||
} else if (path[3] === 'issues') {
|
||||
property = 'open_issues_count';
|
||||
href = '/issues';
|
||||
} else {
|
||||
func(widget);
|
||||
return
|
||||
}
|
||||
|
||||
var api = path[2] ? '/repos/' + path[1] + '/' + path[2] : '/users/' + path[1];
|
||||
fetch.call(this, apiBaseURL + api, function (error, json) {
|
||||
if (!error) {
|
||||
var data = json[property];
|
||||
widget.appendChild(createElement('a', {
|
||||
className: 'social-count',
|
||||
href: json.html_url + href,
|
||||
rel: 'noopener',
|
||||
target: '_blank',
|
||||
'aria-label': data + ' ' + property.replace(/_count$/, '').replace('_', ' ').slice(0, data < 2 ? -1 : undefined) + ' on GitHub'
|
||||
}, [
|
||||
('' + data).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
||||
]));
|
||||
}
|
||||
func(widget);
|
||||
});
|
||||
};
|
||||
|
||||
var parseOptions = function (anchor) {
|
||||
var options = {
|
||||
href: anchor.href,
|
||||
title: anchor.title,
|
||||
'aria-label': anchor.getAttribute('aria-label')
|
||||
};
|
||||
|
||||
forEach(['icon', 'color-scheme', 'text', 'size', 'show-count'], function (option) {
|
||||
var attribute = 'data-' + option;
|
||||
options[attribute] = anchor.getAttribute(attribute);
|
||||
});
|
||||
|
||||
if (options['data-text'] == null) {
|
||||
options['data-text'] = anchor.textContent || anchor.innerText;
|
||||
}
|
||||
|
||||
return options
|
||||
};
|
||||
|
||||
var devicePixelRatio = window.devicePixelRatio || /* istanbul ignore next */ 1;
|
||||
|
||||
var ceilPixel = function (px) {
|
||||
return (devicePixelRatio > 1 ? Math.ceil(Math.round(px * devicePixelRatio) / devicePixelRatio * 2) / 2 : Math.ceil(px)) || 0
|
||||
};
|
||||
|
||||
var get = function (el) {
|
||||
var width = el.offsetWidth;
|
||||
var height = el.offsetHeight;
|
||||
if (el.getBoundingClientRect) {
|
||||
var boundingClientRect = el.getBoundingClientRect();
|
||||
width = Math.max(width, ceilPixel(boundingClientRect.width));
|
||||
height = Math.max(height, ceilPixel(boundingClientRect.height));
|
||||
}
|
||||
return [width, height]
|
||||
};
|
||||
|
||||
var set = function (el, size) {
|
||||
el.style.width = size[0] + 'px';
|
||||
el.style.height = size[1] + 'px';
|
||||
};
|
||||
|
||||
var render = function (options, func) {
|
||||
if (options == null || func == null) {
|
||||
return
|
||||
}
|
||||
if (options.getAttribute) {
|
||||
options = parseOptions(options);
|
||||
}
|
||||
if (useShadowDOM) {
|
||||
var host = createElement('span');
|
||||
render$1(host.attachShadow({ mode: 'closed' }), options, function () {
|
||||
func(host);
|
||||
});
|
||||
} else {
|
||||
var iframe = createElement('iframe', {
|
||||
src: 'javascript:0',
|
||||
title: options.title || undefined,
|
||||
allowtransparency: true,
|
||||
scrolling: 'no',
|
||||
frameBorder: 0
|
||||
});
|
||||
set(iframe, [0, 0]);
|
||||
iframe.style.border = 'none';
|
||||
var callback = function () {
|
||||
var contentWindow = iframe.contentWindow;
|
||||
var body;
|
||||
try {
|
||||
body = contentWindow.document.body;
|
||||
} catch (_) /* istanbul ignore next: IE 11 */ {
|
||||
document.body.appendChild(iframe.parentNode.removeChild(iframe));
|
||||
return
|
||||
}
|
||||
offEvent(iframe, 'load', callback);
|
||||
render$1.call(contentWindow, body, options, function (widget) {
|
||||
var size = get(widget);
|
||||
iframe.parentNode.removeChild(iframe);
|
||||
onceEvent(iframe, 'load', function () {
|
||||
set(iframe, size);
|
||||
});
|
||||
iframe.src = iframeURL + '#' + (iframe.name = stringify(options));
|
||||
func(iframe);
|
||||
});
|
||||
};
|
||||
onEvent(iframe, 'load', callback);
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
};
|
||||
|
||||
if (location.protocol + '//' + location.host + location.pathname === iframeURL) {
|
||||
render$1(document.body, parse(window.name || location.hash.replace(/^#/, '')), function () {});
|
||||
} else {
|
||||
defer(function () {
|
||||
var anchors = document.querySelectorAll
|
||||
? document.querySelectorAll('a.' + buttonClass)
|
||||
: (function () {
|
||||
var results = [];
|
||||
forEach(document.getElementsByTagName('a'), function (a) {
|
||||
if ((' ' + a.className + ' ').replace(/[ \t\n\f\r]+/g, ' ').indexOf(' ' + buttonClass + ' ') !== -1) {
|
||||
results.push(a);
|
||||
}
|
||||
});
|
||||
return results
|
||||
})();
|
||||
forEach(anchors, function (anchor) {
|
||||
render(anchor, function (el) {
|
||||
anchor.parentNode.replaceChild(el, anchor);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
window.githubButtons = { render: render };
|
||||
})();
|
||||
Reference in New Issue
Block a user