Jake Vanderwerf
2026-05-11 ac444cba221832c012c0435fdc8339fe9f37febb
assets/js/min/interactions.min.js
@@ -1 +1 @@
(()=>{function t(){window.auth.getUser()&&(window.jvbInteractions=new FrontendInteractions)}"requestIdleCallback"in window?requestIdleCallback((async function(){window.auth.subscribe((n=>{"auth-loaded"===n&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t())}))})):"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):setTimeout(t,1),window.toggleFavourite=function(t){window.jvbInteractions?window.jvbInteractions.toggleFavourite(t):console.warn("FrontendInteractions not initialized")},window.handleVote=function(t){window.jvbInteractions?window.jvbInteractions.handleVote(t):console.warn("FrontendInteractions not initialized")},window.isFavourited=function(t,n){return!!window.jvbInteractions&&window.jvbInteractions.isFavourited(t,n)},window.checkVoteStatus=function(t,n){return window.jvbInteractions?window.jvbInteractions.checkVoteStatus(t,n):""},window.formatVote=function(t,n){let e=window.getTemplate("voteButton");e.dataset.itemId=t.id,e.dataset.content=t.content;let o=e.querySelector("button.up"),i=e.querySelector("button.down");return"up"===n&&o.classList.add("voted"),"down"===n&&i.classList.add("voted"),t.upvotes>0&&(o.querySelector(".count").textContent=t.upvotes),t.downvotes>0&&(i.querySelector(".count").textContent="-"+t.downvotes),e},window.checkVoteStatus=function(t,n){if(!window.auth.getUser())return"";let e="";return window.userVotes&&window.userVotes[t]?.has(n)&&(e=window.userVotes[t].get(n)),e}})();
(()=>{function t(){window.auth.getUser()&&(window.jvbInteractions=new FrontendInteractions)}"requestIdleCallback"in window?requestIdleCallback(async function(){window.auth.subscribe(n=>{"auth-loaded"===n&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t())})}):"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):setTimeout(t,1),window.toggleFavourite=function(t){window.jvbInteractions?window.jvbInteractions.toggleFavourite(t):console.warn("FrontendInteractions not initialized")},window.handleVote=function(t){window.jvbInteractions?window.jvbInteractions.handleVote(t):console.warn("FrontendInteractions not initialized")},window.isFavourited=function(t,n){return!!window.jvbInteractions&&window.jvbInteractions.isFavourited(t,n)},window.checkVoteStatus=function(t,n){return window.jvbInteractions?window.jvbInteractions.checkVoteStatus(t,n):""},window.formatVote=function(t,n){let e=window.getTemplate("voteButton");e.dataset.itemId=t.id,e.dataset.content=t.content;let o=e.querySelector("button.up"),i=e.querySelector("button.down");return"up"===n&&o.classList.add("voted"),"down"===n&&i.classList.add("voted"),t.upvotes>0&&(o.querySelector(".count").textContent=t.upvotes),t.downvotes>0&&(i.querySelector(".count").textContent="-"+t.downvotes),e},window.checkVoteStatus=function(t,n){if(!window.auth.getUser())return"";let e="";return window.userVotes&&window.userVotes[t]?.has(n)&&(e=window.userVotes[t].get(n)),e}})();