Skip to content

Commit

Permalink
fix: add dist
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan committed Nov 1, 2022
1 parent e7a5d64 commit 88f65f6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ typings/

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
Expand Down
1 change: 1 addition & 0 deletions dist/history-background.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var ft=Object.create;var F=Object.defineProperty;var ut=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var ct=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty;var dt=(n,t)=>()=>(n&&(t=n(n=0)),t);var pt=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),gt=(n,t)=>{for(var e in t)F(n,e,{get:t[e],enumerable:!0});},Tn=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ot(t))!lt.call(n,a)&&a!==e&&F(n,a,{get:()=>t[a],enumerable:!(r=ut(t,a))||r.enumerable});return n};var ht=(n,t,e)=>(e=n!=null?ft(ct(n)):{},Tn(t||!n||!n.__esModule?F(e,"default",{value:n,enumerable:!0}):e,n)),_t=n=>Tn(F({},"__esModule",{value:!0}),n);var kn=pt((R,P)=>{var Pn=200,yt="Expected a function",cn="__lodash_hash_undefined__",Y=1,E=2,ln=1/0,Ln=9007199254740991,K="[object Arguments]",en="[object Array]",En="[object Boolean]",Mn="[object Date]",Dn="[object Error]",Rn="[object Function]",wt="[object GeneratorFunction]",q="[object Map]",Nn="[object Number]",O="[object Object]",bn="[object Promise]",Un="[object RegExp]",B="[object Set]",Gn="[object String]",Hn="[object Symbol]",rn="[object WeakMap]",$n="[object ArrayBuffer]",W="[object DataView]",Tt="[object Float32Array]",bt="[object Float64Array]",vt="[object Int8Array]",At="[object Int16Array]",mt="[object Int32Array]",xt="[object Uint8Array]",Ct="[object Uint8ClampedArray]",St="[object Uint16Array]",It="[object Uint32Array]",Ot=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pt=/^\w*$/,Lt=/^\./,Et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mt=/[\\^$.*+?()[\]{}|]/g,Dt=/\\(\\)?/g,Rt=/^\[object .+?Constructor\]$/,Nt=/^(?:0|[1-9]\d*)$/,o={};o[Tt]=o[bt]=o[vt]=o[At]=o[mt]=o[xt]=o[Ct]=o[St]=o[It]=!0;o[K]=o[en]=o[$n]=o[En]=o[W]=o[Mn]=o[Dn]=o[Rn]=o[q]=o[Nn]=o[O]=o[Un]=o[B]=o[Gn]=o[rn]=!1;var Fn=typeof global=="object"&&global&&global.Object===Object&&global,Ut=typeof self=="object"&&self&&self.Object===Object&&self,m=Fn||Ut||Function("return this")(),Kn=typeof R=="object"&&R&&!R.nodeType&&R,vn=Kn&&typeof P=="object"&&P&&!P.nodeType&&P,Gt=vn&&vn.exports===Kn,An=Gt&&Fn.process,mn=function(){try{return An&&An.binding("util")}catch{}}(),xn=mn&&mn.isTypedArray;function Ht(n,t){var e=n?n.length:0;return !!e&&qt(n,t,0)>-1}function $t(n,t,e){for(var r=-1,a=n?n.length:0;++r<a;)if(e(t,n[r]))return !0;return !1}function Ft(n,t){for(var e=-1,r=n?n.length:0;++e<r;)if(t(n[e],e,n))return !0;return !1}function Kt(n,t,e,r){for(var a=n.length,i=e+(r?1:-1);r?i--:++i<a;)if(t(n[i],i,n))return i;return -1}function qt(n,t,e){if(t!==t)return Kt(n,Bt,e);for(var r=e-1,a=n.length;++r<a;)if(n[r]===t)return r;return -1}function Bt(n){return n!==n}function Wt(n){return function(t){return t==null?void 0:t[n]}}function Xt(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}function Yt(n){return function(t){return n(t)}}function Jt(n,t){return n.has(t)}function Zt(n,t){return n==null?void 0:n[t]}function an(n){var t=!1;if(n!=null&&typeof n.toString!="function")try{t=!!(n+"");}catch{}return t}function Qt(n){var t=-1,e=Array(n.size);return n.forEach(function(r,a){e[++t]=[a,r];}),e}function zt(n,t){return function(e){return n(t(e))}}function dn(n){var t=-1,e=Array(n.size);return n.forEach(function(r){e[++t]=r;}),e}var jt=Array.prototype,Vt=Function.prototype,J=Object.prototype,nn=m["__core-js_shared__"],Cn=function(){var n=/[^.]+$/.exec(nn&&nn.keys&&nn.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),qn=Vt.toString,w=J.hasOwnProperty,M=J.toString,kt=RegExp("^"+qn.call(w).replace(Mt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sn=m.Symbol,In=m.Uint8Array,ne=J.propertyIsEnumerable,te=jt.splice,ee=zt(Object.keys,Object),sn=D(m,"DataView"),N=D(m,"Map"),fn=D(m,"Promise"),L=D(m,"Set"),un=D(m,"WeakMap"),U=D(Object,"create"),re=I(sn),ie=I(N),ae=I(fn),se=I(L),fe=I(un),X=Sn?Sn.prototype:void 0,tn=X?X.valueOf:void 0,On=X?X.toString:void 0;function C(n){var t=-1,e=n?n.length:0;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1]);}}function ue(){this.__data__=U?U(null):{};}function oe(n){return this.has(n)&&delete this.__data__[n]}function ce(n){var t=this.__data__;if(U){var e=t[n];return e===cn?void 0:e}return w.call(t,n)?t[n]:void 0}function le(n){var t=this.__data__;return U?t[n]!==void 0:w.call(t,n)}function de(n,t){var e=this.__data__;return e[n]=U&&t===void 0?cn:t,this}C.prototype.clear=ue;C.prototype.delete=oe;C.prototype.get=ce;C.prototype.has=le;C.prototype.set=de;function T(n){var t=-1,e=n?n.length:0;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1]);}}function pe(){this.__data__=[];}function ge(n){var t=this.__data__,e=Z(t,n);if(e<0)return !1;var r=t.length-1;return e==r?t.pop():te.call(t,e,1),!0}function he(n){var t=this.__data__,e=Z(t,n);return e<0?void 0:t[e][1]}function _e(n){return Z(this.__data__,n)>-1}function ye(n,t){var e=this.__data__,r=Z(e,n);return r<0?e.push([n,t]):e[r][1]=t,this}T.prototype.clear=pe;T.prototype.delete=ge;T.prototype.get=he;T.prototype.has=_e;T.prototype.set=ye;function b(n){var t=-1,e=n?n.length:0;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1]);}}function we(){this.__data__={hash:new C,map:new(N||T),string:new C};}function Te(n){return Q(this,n).delete(n)}function be(n){return Q(this,n).get(n)}function ve(n){return Q(this,n).has(n)}function Ae(n,t){return Q(this,n).set(n,t),this}b.prototype.clear=we;b.prototype.delete=Te;b.prototype.get=be;b.prototype.has=ve;b.prototype.set=Ae;function G(n){var t=-1,e=n?n.length:0;for(this.__data__=new b;++t<e;)this.add(n[t]);}function me(n){return this.__data__.set(n,cn),this}function xe(n){return this.__data__.has(n)}G.prototype.add=G.prototype.push=me;G.prototype.has=xe;function y(n){this.__data__=new T(n);}function Ce(){this.__data__=new T;}function Se(n){return this.__data__.delete(n)}function Ie(n){return this.__data__.get(n)}function Oe(n){return this.__data__.has(n)}function Pe(n,t){var e=this.__data__;if(e instanceof T){var r=e.__data__;if(!N||r.length<Pn-1)return r.push([n,t]),this;e=this.__data__=new b(r);}return e.set(n,t),this}y.prototype.clear=Ce;y.prototype.delete=Se;y.prototype.get=Ie;y.prototype.has=Oe;y.prototype.set=Pe;function Le(n,t){var e=S(n)||zn(n)?Xt(n.length,String):[],r=e.length,a=!!r;for(var i in n)(t||w.call(n,i))&&!(a&&(i=="length"||Yn(i,r)))&&e.push(i);return e}function Z(n,t){for(var e=n.length;e--;)if(Qn(n[e][0],t))return e;return -1}function Bn(n,t){t=z(t,n)?[t]:Wn(t);for(var e=0,r=t.length;n!=null&&e<r;)n=n[j(t[e++])];return e&&e==r?n:void 0}function Ee(n){return M.call(n)}function Me(n,t){return n!=null&&t in Object(n)}function pn(n,t,e,r,a){return n===t?!0:n==null||t==null||!V(n)&&!k(t)?n!==n&&t!==t:De(n,t,pn,e,r,a)}function De(n,t,e,r,a,i){var s=S(n),f=S(t),u=en,l=en;s||(u=A(n),u=u==K?O:u),f||(l=A(t),l=l==K?O:l);var c=u==O&&!an(n),d=l==O&&!an(t),p=u==l;if(p&&!c)return i||(i=new y),s||tr(n)?Xn(n,t,e,r,a,i):Xe(n,t,u,e,r,a,i);if(!(a&E)){var g=c&&w.call(n,"__wrapped__"),h=d&&w.call(t,"__wrapped__");if(g||h){var v=g?n.value():n,_=h?t.value():t;return i||(i=new y),e(v,_,r,a,i)}}return p?(i||(i=new y),Ye(n,t,e,r,a,i)):!1}function Re(n,t,e,r){var a=e.length,i=a,s=!r;if(n==null)return !i;for(n=Object(n);a--;){var f=e[a];if(s&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return !1}for(;++a<i;){f=e[a];var u=f[0],l=n[u],c=f[1];if(s&&f[2]){if(l===void 0&&!(u in n))return !1}else {var d=new y;if(r)var p=r(l,c,u,n,t,d);if(!(p===void 0?pn(c,l,r,Y|E,d):p))return !1}}return !0}function Ne(n){if(!V(n)||ze(n))return !1;var t=Vn(n)||an(n)?kt:Rt;return t.test(I(n))}function Ue(n){return k(n)&&hn(n.length)&&!!o[M.call(n)]}function Ge(n){return typeof n=="function"?n:n==null?ar:typeof n=="object"?S(n)?Fe(n[0],n[1]):$e(n):fr(n)}function He(n){if(!je(n))return ee(n);var t=[];for(var e in Object(n))w.call(n,e)&&e!="constructor"&&t.push(e);return t}function $e(n){var t=Je(n);return t.length==1&&t[0][2]?Zn(t[0][0],t[0][1]):function(e){return e===n||Re(e,n,t)}}function Fe(n,t){return z(n)&&Jn(t)?Zn(j(n),t):function(e){var r=rr(e,n);return r===void 0&&r===t?ir(e,n):pn(t,r,void 0,Y|E)}}function Ke(n){return function(t){return Bn(t,n)}}function qe(n){if(typeof n=="string")return n;if(_n(n))return On?On.call(n):"";var t=n+"";return t=="0"&&1/n==-ln?"-0":t}function Be(n,t,e){var r=-1,a=Ht,i=n.length,s=!0,f=[],u=f;if(e)s=!1,a=$t;else if(i>=Pn){var l=t?null:We(n);if(l)return dn(l);s=!1,a=Jt,u=new G;}else u=t?[]:f;n:for(;++r<i;){var c=n[r],d=t?t(c):c;if(c=e||c!==0?c:0,s&&d===d){for(var p=u.length;p--;)if(u[p]===d)continue n;t&&u.push(d),f.push(c);}else a(u,d,e)||(u!==f&&u.push(d),f.push(c));}return f}function Wn(n){return S(n)?n:Ve(n)}var We=L&&1/dn(new L([,-0]))[1]==ln?function(n){return new L(n)}:sr;function Xn(n,t,e,r,a,i){var s=a&E,f=n.length,u=t.length;if(f!=u&&!(s&&u>f))return !1;var l=i.get(n);if(l&&i.get(t))return l==t;var c=-1,d=!0,p=a&Y?new G:void 0;for(i.set(n,t),i.set(t,n);++c<f;){var g=n[c],h=t[c];if(r)var v=s?r(h,g,c,t,n,i):r(g,h,c,n,t,i);if(v!==void 0){if(v)continue;d=!1;break}if(p){if(!Ft(t,function(_,x){if(!p.has(x)&&(g===_||e(g,_,r,a,i)))return p.add(x)})){d=!1;break}}else if(!(g===h||e(g,h,r,a,i))){d=!1;break}}return i.delete(n),i.delete(t),d}function Xe(n,t,e,r,a,i,s){switch(e){case W:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return !1;n=n.buffer,t=t.buffer;case $n:return !(n.byteLength!=t.byteLength||!r(new In(n),new In(t)));case En:case Mn:case Nn:return Qn(+n,+t);case Dn:return n.name==t.name&&n.message==t.message;case Un:case Gn:return n==t+"";case q:var f=Qt;case B:var u=i&E;if(f||(f=dn),n.size!=t.size&&!u)return !1;var l=s.get(n);if(l)return l==t;i|=Y,s.set(n,t);var c=Xn(f(n),f(t),r,a,i,s);return s.delete(n),c;case Hn:if(tn)return tn.call(n)==tn.call(t)}return !1}function Ye(n,t,e,r,a,i){var s=a&E,f=on(n),u=f.length,l=on(t),c=l.length;if(u!=c&&!s)return !1;for(var d=u;d--;){var p=f[d];if(!(s?p in t:w.call(t,p)))return !1}var g=i.get(n);if(g&&i.get(t))return g==t;var h=!0;i.set(n,t),i.set(t,n);for(var v=s;++d<u;){p=f[d];var _=n[p],x=t[p];if(r)var wn=s?r(x,_,p,t,n,i):r(_,x,p,n,t,i);if(!(wn===void 0?_===x||e(_,x,r,a,i):wn)){h=!1;break}v||(v=p=="constructor");}if(h&&!v){var H=n.constructor,$=t.constructor;H!=$&&"constructor"in n&&"constructor"in t&&!(typeof H=="function"&&H instanceof H&&typeof $=="function"&&$ instanceof $)&&(h=!1);}return i.delete(n),i.delete(t),h}function Q(n,t){var e=n.__data__;return Qe(t)?e[typeof t=="string"?"string":"hash"]:e.map}function Je(n){for(var t=on(n),e=t.length;e--;){var r=t[e],a=n[r];t[e]=[r,a,Jn(a)];}return t}function D(n,t){var e=Zt(n,t);return Ne(e)?e:void 0}var A=Ee;(sn&&A(new sn(new ArrayBuffer(1)))!=W||N&&A(new N)!=q||fn&&A(fn.resolve())!=bn||L&&A(new L)!=B||un&&A(new un)!=rn)&&(A=function(n){var t=M.call(n),e=t==O?n.constructor:void 0,r=e?I(e):void 0;if(r)switch(r){case re:return W;case ie:return q;case ae:return bn;case se:return B;case fe:return rn}return t});function Ze(n,t,e){t=z(t,n)?[t]:Wn(t);for(var r,a=-1,s=t.length;++a<s;){var i=j(t[a]);if(!(r=n!=null&&e(n,i)))break;n=n[i];}if(r)return r;var s=n?n.length:0;return !!s&&hn(s)&&Yn(i,s)&&(S(n)||zn(n))}function Yn(n,t){return t=t??Ln,!!t&&(typeof n=="number"||Nt.test(n))&&n>-1&&n%1==0&&n<t}function z(n,t){if(S(n))return !1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||_n(n)?!0:Pt.test(n)||!Ot.test(n)||t!=null&&n in Object(t)}function Qe(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function ze(n){return !!Cn&&Cn in n}function je(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||J;return n===e}function Jn(n){return n===n&&!V(n)}function Zn(n,t){return function(e){return e==null?!1:e[n]===t&&(t!==void 0||n in Object(e))}}var Ve=gn(function(n){n=er(n);var t=[];return Lt.test(n)&&t.push(""),n.replace(Et,function(e,r,a,i){t.push(a?i.replace(Dt,"$1"):r||e);}),t});function j(n){if(typeof n=="string"||_n(n))return n;var t=n+"";return t=="0"&&1/n==-ln?"-0":t}function I(n){if(n!=null){try{return qn.call(n)}catch{}try{return n+""}catch{}}return ""}function ke(n,t){return n&&n.length?Be(n,Ge(t)):[]}function gn(n,t){if(typeof n!="function"||t&&typeof t!="function")throw new TypeError(yt);var e=function(){var r=arguments,a=t?t.apply(this,r):r[0],i=e.cache;if(i.has(a))return i.get(a);var s=n.apply(this,r);return e.cache=i.set(a,s),s};return e.cache=new(gn.Cache||b),e}gn.Cache=b;function Qn(n,t){return n===t||n!==n&&t!==t}function zn(n){return nr(n)&&w.call(n,"callee")&&(!ne.call(n,"callee")||M.call(n)==K)}var S=Array.isArray;function jn(n){return n!=null&&hn(n.length)&&!Vn(n)}function nr(n){return k(n)&&jn(n)}function Vn(n){var t=V(n)?M.call(n):"";return t==Rn||t==wt}function hn(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Ln}function V(n){var t=typeof n;return !!n&&(t=="object"||t=="function")}function k(n){return !!n&&typeof n=="object"}function _n(n){return typeof n=="symbol"||k(n)&&M.call(n)==Hn}var tr=xn?Yt(xn):Ue;function er(n){return n==null?"":qe(n)}function rr(n,t,e){var r=n==null?void 0:Bn(n,t);return r===void 0?e:r}function ir(n,t){return n!=null&&Ze(n,t,Me)}function on(n){return jn(n)?Le(n):He(n)}function ar(n){return n}function sr(){}function fr(n){return z(n)?Wt(j(n)):Ke(n)}P.exports=ke;});var it={};gt(it,{filterItem:()=>ur,getRepo:()=>yn,isCode:()=>rt,isDiscussion:()=>et,isIssue:()=>nt,isPR:()=>tt,transformItem:()=>or});var nt,tt,et,rt,yn,ur,or,at=dt(()=>{nt=n=>/\/issues\/\d+/.test(n),tt=n=>/\/pull\/\d+/.test(n),et=n=>/\/discussions\/\d+/.test(n),rt=n=>/github.com\/.+\/.+\/blob\/.+/.test(n),yn=n=>{let t=n.match(/https:\/\/github.com\/([^\/]+\/[^\/]+)/);return t&&t[1]},ur=(n,t)=>n.filter(e=>{if(!t)return !!yn(e.url);let{keyword:r,type:a}=t,i=r.toLocaleLowerCase();if(r&&e.url.toLocaleLowerCase().indexOf(i)<0&&e.title.toLocaleLowerCase().indexOf(i)<0)return !1;let s=a.toLocaleLowerCase();return s==="all"?!0:!!e[s]}),or=n=>n.map(t=>({...t,issue:nt(t.url),pr:tt(t.url),discussions:et(t.url),code:rt(t.url),repo:yn(t.url)}));});var st=ht(kn()),{transformItem:cr,filterItem:lr}=(at(),_t(it)),dr=7*24*3600*1e3,pr=()=>new Promise(n=>{chrome.history.search({text:"https://github.com",maxResults:200,startTime:dr},n);}),gr=()=>{chrome.runtime.onMessage.addListener(function(n,t,e){if(n.type=="history-query")return pr().then(r=>e(cr((0, st.default)(lr(r),"url")))),!0}),chrome.action.onClicked.addListener(n=>{chrome.tabs.sendMessage(n.id,{type:"history-modal"});}),chrome.commands.onCommand.addListener(n=>{n==="history-modal"&&chrome.tabs.query({currentWindow:!0,active:!0},function(t){let e=t[0];chrome.tabs.sendMessage(e.id,{type:"history-modal"});});});};gr();
1 change: 1 addition & 0 deletions dist/history-popup.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function n(){chrome.tabs.query({currentWindow:!0,active:!0},function(e){let t=e[0];chrome.tabs.sendMessage(t.id,{type:"history-modal"});});}document.addEventListener("DOMContentLoaded",function(){n();});
25 changes: 25 additions & 0 deletions dist/history.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var u=e=>{let t=e.match(/https:\/\/github.com\/([^\/]+\/[^\/]+)/);return t&&t[1]},h=(e,t)=>e.filter(s=>{if(!t)return !!u(s.url);let{keyword:i,type:n}=t,r=i.toLocaleLowerCase();if(i&&s.url.toLocaleLowerCase().indexOf(r)<0&&s.title.toLocaleLowerCase().indexOf(r)<0)return !1;let c=n.toLocaleLowerCase();return c==="all"?!0:!!s[c]});var d=class{values=[];selectedValue=void 0;constructor(t){this.values=t,this.selectedValue=t[0];}init(){this.container=document.createElement("ul"),this.container.id="github-history-radio";}mount(t){this.init(),this.render(),t.appendChild(this.container);}render(){this.container.innerHTML=this.values.reduce((t,s)=>t+`
<li class='${this.selectedValue===s&&"selected"}'>${s}</li>
`,"");}onClick(t){let s=document.getElementById(this.container.id);s.addEventListener("click",i=>{this.values.includes(i.target.innerHTML)&&(Array.from(s.getElementsByTagName("li")).forEach(n=>{n.className="";}),this.selectedValue=i.target.innerHTML,i.target.className="selected",t&&t(this.selectedValue)),i.preventDefault();},!1);}change(t){this.selectedValue=t,this.render();}};var l=class{radio=new d(["All","Issue","PR","Code","Discussions"]);data=[];keyword="";constructor(t){this.fetchData=t,this.init;}init(){this.modal=document.createElement("div"),this.modal.id="github-history-modal",this.modal.className="hide",this.modal.innerHTML=`
<div id='github-history-modal-body'>
<div id='github-history-header'>
<input id='github-history-search' type='text' placeholder="type keyword" autofocus>
</div>
<ul id='github-history-result'>
</ul>
<div id='github-history-footer'>
<span class='results'></span>
</div>
</div>
<div id='github-history-modal-mask'></div>
`;}mount(){this.init(),document.body.append(this.modal),this.radio.mount(document.getElementById("github-history-footer")),document.getElementById("github-history-modal-mask").addEventListener("click",()=>this.toggle()),document.getElementById("github-history-search").addEventListener("input",t=>{this.keyword=t.target.value,this.render();}),document.getElementById("github-history-result").addEventListener("click",()=>this.toggle()),this.radio.onClick(()=>this.render());}render(){let t=document.getElementById("github-history-result");t||(this.mount(),t=document.getElementById("github-history-result"));let s=h(this.data,{type:this.radio.selectedValue,keyword:this.keyword}),i=document.getElementById("github-history-footer");document.getElementById("github-history-search").focus(),t.innerHTML=s.reduce((n,r)=>n+`<a class='github-history-link' href=${r.url}><li>
<img src='https://github.githubassets.com/favicons/favicon.png' >
<span class='title'>${r.title}</span>
</li></a>`,""),i.childNodes[1].innerHTML=`
<span>Search ${this.keyword&&`'${this.keyword}'`}</span>
<span>Results: </span>
<span>${s.length}</span>
`;}toggle(){document.getElementById("github-history-modal")||this.mount(),this.modal.className.indexOf("hide")>-1?this.fetchData().then(t=>{this.data=t,this.modal.className="show",this.render();}):(this.clear(),this.modal.className="hide");}contains(t){return this.modal.contains(t)}visible(){return this.modal.className.indexOf("show")>-1}clear(){this.keyword="",document.getElementById("github-history-search").value="",this.radio.change("All");}};var a=class{style=document.createElement("style");constructor(){this.style.textContent=`
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');
`;}mount(){document.head.appendChild(this.style);}};var m=()=>new Promise(e=>{chrome.runtime.sendMessage({type:"history-query"},t=>{console.log(t),e(t);});}),o=new l(m),g=new a,y=()=>{chrome.runtime.onMessage.addListener(function(e,t,s){console.log(e),e.type=="history-modal"&&o.toggle();});};document.addEventListener("keydown",e=>{e.code==="Escape"&&o.visible()&&o.toggle();});document.addEventListener("click",e=>{o.visible()&&!o.contains(e.target)&&o.toggle();});y();g.mount();o.mount();
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"build": "tsup --config ./tsup.config.ts",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"precommit": "npm run build && git add ."
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 88f65f6

Please sign in to comment.