Fix view full text links not working correctly from manage pages

merge-requests/208/head
Thomas Lynch 4 years ago
parent 049b26f4c8
commit 06bf1ffa17
  1. 1
      gulp/res/js/localstorage.js
  2. 2
      gulp/res/js/viewfulltext.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 {

@ -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('/');

Loading…
Cancel
Save