Jake Vanderwerf
2026-05-11 ac444cba221832c012c0435fdc8339fe9f37febb
assets/js/min/notificationManager.min.js
@@ -1 +1 @@
(()=>{class t{constructor(){this.resetFilters(),this.activeTab="all",this.isLoading=!1,this.loading=window.jvbLoading,this.container=document.querySelector(".container"),this.grid=this.container.querySelector(".notifications-list"),this.tabs=new window.jvbTabs(this.container,{all:()=>{this.resetFilters(),this.activeTab="all",this.loadNotifications()},favourite:()=>{this.resetFilters(),this.activeTab="favourite",this.filters.content="favourite",this.loadNotifications()},artist:()=>{this.resetFilters(),this.activeTab="artist",this.filters.content="artist",this.loadNotifications()},shop:()=>{this.resetFilters(),this.activeTab="shop",this.filters.content="shop",this.loadNotifications()},event:()=>{this.resetFilters(),this.activeTab="favourite",this.filters.content="favourite",this.loadNotifications()},news:()=>{this.resetFilters(),this.activeTab="news",this.filters.content="news",this.loadNotifications()},system:()=>{this.resetFilters(),this.activeTab="system",this.filters.content="system",this.loadNotifications()}}),this.loadNotifications()}resetFilters(){this.filters={content:"all",date:""},this.hasMore=!0}async loadNotifications(t=!0){if(!this.isLoading&&this.hasMore)try{this.isLoading=!0,this.loading.show(),t&&(this.filters.page=1,this.grid.classList.remove("empty"));const i=this.buildFilters();console.log(this.filters),console.log("Reset? ",this.reset);const s=await this.cache.fetchWithCache(`${jvbSettings.api}notifications?${i.toString()}`,{method:"GET",headers:{"X-WP-Nonce":window.auth.getNonce(),"X-Action-Nonce":jvbAdmin.nonce}},{context:"admin",forceRefresh:!0});return console.log(s),s}catch(t){throw this.handleError(t,"loading notifications"),t}finally{this.isLoading=!1,this.loading.hide()}}buildFilters(){const t=JSON.parse(JSON.stringify(this.filters));let i={};for(var[s,e]of Object.entries(t))!1!==e&&null!==e&&(i[s]=e);return i.context="admin",i.user=window.auth.getUser(),new URLSearchParams(i)}}document.addEventListener("DOMContentLoaded",(()=>{window.notificationsDash=new t,console.log(jvbSettings)}))})();
(()=>{class t{constructor(){this.resetFilters(),this.activeTab="all",this.isLoading=!1,this.loading=window.jvbLoading,this.container=document.querySelector(".container"),this.grid=this.container.querySelector(".notifications-list"),this.tabs=new window.jvbTabs(this.container,{all:()=>{this.resetFilters(),this.activeTab="all",this.loadNotifications()},favourite:()=>{this.resetFilters(),this.activeTab="favourite",this.filters.content="favourite",this.loadNotifications()},artist:()=>{this.resetFilters(),this.activeTab="artist",this.filters.content="artist",this.loadNotifications()},shop:()=>{this.resetFilters(),this.activeTab="shop",this.filters.content="shop",this.loadNotifications()},event:()=>{this.resetFilters(),this.activeTab="favourite",this.filters.content="favourite",this.loadNotifications()},news:()=>{this.resetFilters(),this.activeTab="news",this.filters.content="news",this.loadNotifications()},system:()=>{this.resetFilters(),this.activeTab="system",this.filters.content="system",this.loadNotifications()}}),this.loadNotifications()}resetFilters(){this.filters={content:"all",date:""},this.hasMore=!0}async loadNotifications(t=!0){if(!this.isLoading&&this.hasMore)try{this.isLoading=!0,this.loading.show(),t&&(this.filters.page=1,this.grid.classList.remove("empty"));const i=this.buildFilters();console.log(this.filters),console.log("Reset? ",this.reset);const s=await this.cache.fetchWithCache(`${jvbSettings.api}notifications?${i.toString()}`,{method:"GET",headers:{"X-WP-Nonce":window.auth.getNonce(),"X-Action-Nonce":jvbAdmin.nonce}},{context:"admin",forceRefresh:!0});return console.log(s),s}catch(t){throw this.handleError(t,"loading notifications"),t}finally{this.isLoading=!1,this.loading.hide()}}buildFilters(){const t=JSON.parse(JSON.stringify(this.filters));let i={};for(var[s,e]of Object.entries(t))!1!==e&&null!==e&&(i[s]=e);return i.context="admin",i.user=window.auth.getUser(),new URLSearchParams(i)}}document.addEventListener("DOMContentLoaded",()=>{window.notificationsDash=new t,console.log(jvbSettings)})})();