From 06bf1ffa17d0b0e601815bb085695b3699befa58 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Sun, 20 Sep 2020 02:19:32 +0000 Subject: [PATCH] Fix view full text links not working correctly from manage pages --- gulp/res/js/localstorage.js | 1 + gulp/res/js/viewfulltext.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gulp/res/js/localstorage.js b/gulp/res/js/localstorage.js index b31f5d41..386410c0 100644 --- a/gulp/res/js/localstorage.js +++ b/gulp/res/js/localstorage.js @@ -1,6 +1,7 @@ const isCatalog = window.location.pathname.endsWith('catalog.html'); const isThread = /\/\w+\/thread\/\d+.html/.test(window.location.pathname); const isModView = /\/\w+\/manage\/(thread\/)?(index|\d+).html/.test(window.location.pathname); +const isManage = /\/(\w+\/manage|globalmanage)\/(recent|reports|bans|logs|settings|banners|accounts|news).html/.test(window.location.pathname); function setLocalStorage(key, value) { try { diff --git a/gulp/res/js/viewfulltext.js b/gulp/res/js/viewfulltext.js index f2ab7117..b2d1a9a9 100644 --- a/gulp/res/js/viewfulltext.js +++ b/gulp/res/js/viewfulltext.js @@ -11,7 +11,7 @@ window.addEventListener('DOMContentLoaded', (event) => { const postId = this.hash.substring(1); let jsonParts = this.pathname.replace(/\.html$/, '.json').split('/'); let jsonPath; - if (isModView && jsonParts.length === 5) { + if ((isManage || isModView) && jsonParts.length === 5) { jsonParts.splice(2,1); //remove manage from json url } jsonPath = jsonParts.join('/');