double.js
Version:
Emulated float128 or double-double arithmetic. A floating point expansion with 31 accurate decimal digits.
1 lines • 2.4 kB
JavaScript
!function(){"use strict";function e(t){return String(t).replace(/(\d)(?=(\d{3})+$)/g,"$1,")}var t,a,r,s,o=(C=function(){for(var t,e=[],a=window.location,r=a.href.slice(a.href.indexOf("?")+1).split("&"),s=0;s<r.length;s++)t=r[s].split("="),e.push(t[0]),e[t[0]]=t[1];return e}()).user,n=C.repo,c=C.type,l=C.count,u=C.size,i=C.v,b=document.querySelector(".gh-btn"),h=document.querySelector(".github-btn"),f=document.querySelector(".gh-text"),d=document.querySelector(".gh-count"),g=" on GitHub",x="https://github.com/",C="https://api.github.com/",w=x+o+"/"+n,m=o+"/"+n;switch(window.callback=function(t){if("Not Found"!==t.data.message){switch(c){case"watch":"2"===i?(d.textContent=t.data.subscribers_count&&e(t.data.subscribers_count),d.setAttribute("aria-label",d.textContent+" watchers"+g)):(d.textContent=t.data.stargazers_count&&e(t.data.stargazers_count),d.setAttribute("aria-label",d.textContent+" stargazers"+g));break;case"star":d.textContent=t.data.stargazers_count&&e(t.data.stargazers_count),d.setAttribute("aria-label",d.textContent+" stargazers"+g);break;case"fork":d.textContent=t.data.network_count&&e(t.data.network_count),d.setAttribute("aria-label",d.textContent+" forks"+g);break;case"follow":d.textContent=t.data.followers&&e(t.data.followers),d.setAttribute("aria-label",d.textContent+" followers"+g)}"true"===l&&""!==d.textContent&&(d.style.display="block",d.removeAttribute("aria-hidden"))}},b.href=w,c){case"watch":"2"===i?(h.className+=" github-watchers",f.textContent="Watch",d.href=w+"/watchers"):(h.className+=" github-stargazers",f.textContent="Star",d.href=w+"/stargazers"),t=f.textContent+" "+m;break;case"star":h.className+=" github-stargazers",f.textContent="Star",d.href=w+"/stargazers",t=f.textContent+" "+m;break;case"fork":h.className+=" github-forks",f.textContent="Fork",b.href=w+"/fork",d.href=w+"/network",t=f.textContent+" "+m;break;case"follow":h.className+=" github-me",f.textContent="Follow @"+o,b.href=x+o,d.href=x+o+"?tab=followers",t=f.textContent;break;case"sponsor":h.className+=" github-me",f.textContent="Sponsor @"+o,b.href=x+"sponsors/"+o,t=f.textContent}b.setAttribute("aria-label",t+g),document.title=t+g,"large"===u&&(h.className+=" github-btn-large"),"true"===l&&"sponsor"!==c&&(a="follow"===c?C+"users/"+o:C+"repos/"+o+"/"+n,r=document.head,(s=document.createElement("script")).src=a+"?callback=callback",r.insertBefore(s,r.firstChild))}()