blowfish/docs/js/process.min.9cb1881551ab5855d9cdee5d8dfb370e3f0242b9fc5ae05e57b3a881cb16ca53b312f879ab023e1b1f9cac2a318d2be1b20df5177878d1d93cb96ca11fe3bd97.js
2022-09-12 21:33:50 +01:00

1 line
No EOL
649 B
JavaScript

if(typeof auth!='undefined'){var viewsCollection=db.collection('views'),update_views;function numberWithCommas(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,',')}update_views=function(e,t){viewsCollection.doc(t).onSnapshot(s=>{var n,t=s.data();t&&(n=document.querySelectorAll("span[id='"+e+"']")[0].innerText.split(' ')[1],document.querySelectorAll("span[id='"+e+"']")[0].innerText=numberWithCommas(t.views)+" "+n)})},auth.signInAnonymously().then(()=>{var e,t,s,n=document.querySelectorAll("span[id^='views_']");for(s in n)e=n[s].id,t=e&&e.replaceAll("/","-"),t&&update_views(e,t)}).catch(e=>{var t=e.code,n=e.message;console.error(t,n)})}