diff --git a/js/admin.js b/js/admin.js index c912d90..7d006d9 100644 --- a/js/admin.js +++ b/js/admin.js @@ -5,6 +5,7 @@ import { navbar } from './navbar.js'; import { storage } from './storage.js'; import { session } from './session.js'; import { comment } from './comment.js'; +import { offline } from './offline.js'; import { bootstrap } from './bootstrap.js'; import { request, HTTP_GET, HTTP_PATCH, HTTP_PUT } from './request.js'; @@ -235,7 +236,9 @@ export const admin = (() => { }; const init = () => { + theme.init(); session.init(); + offline.init(); user = storage('user'); if (!session.isAdmin()) { diff --git a/js/app.js b/js/app.js index 2207d02..ca7d343 100644 --- a/js/app.js +++ b/js/app.js @@ -3,16 +3,11 @@ import { like } from './like.js'; import { guest } from './guest.js'; import { theme } from './theme.js'; import { audio } from './audio.js'; -import { offline } from './offline.js'; import { comment } from './comment.js'; import { pagination } from './pagination.js'; document.addEventListener('DOMContentLoaded', () => { - audio.init(); guest.init(); - theme.init(); - offline.init(); - pagination.init(); window.AOS.init(); window.like = like; diff --git a/js/comment.js b/js/comment.js index 2ca4e54..5f3d957 100644 --- a/js/comment.js +++ b/js/comment.js @@ -440,6 +440,7 @@ export const comment = (() => { const init = () => { like.init(); card.init(); + pagination.init(); owns = storage('owns'); user = storage('user'); diff --git a/js/dashboard.js b/js/dashboard.js index e1bdf79..0f995ca 100644 --- a/js/dashboard.js +++ b/js/dashboard.js @@ -2,15 +2,11 @@ import { like } from './like.js'; import { util } from './util.js'; import { admin } from './admin.js'; import { theme } from './theme.js'; -import { offline } from './offline.js'; import { comment } from './comment.js'; import { pagination } from './pagination.js'; document.addEventListener('DOMContentLoaded', () => { admin.init(); - theme.init(); - offline.init(); - pagination.init(); window.util = util; window.like = like; diff --git a/js/guest.js b/js/guest.js index 16809ec..7bac395 100644 --- a/js/guest.js +++ b/js/guest.js @@ -4,6 +4,7 @@ import { theme } from './theme.js'; import { session } from './session.js'; import { storage } from './storage.js'; import { comment } from './comment.js'; +import { offline } from './offline.js'; import { progress } from './progress.js'; import { confetti } from './confetti.js'; import { bootstrap } from './bootstrap.js'; @@ -162,7 +163,10 @@ export const guest = (() => { const closeInformation = () => information.set('info', true); const init = () => { + audio.init(); + theme.init(); session.init(); + offline.init(); countDownDate(); information = storage('information');