From 623005e068d5dbe4957d0ab9d0680c3d3826b291 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 18 Apr 2021 15:17:29 +0300 Subject: [PATCH] fix usw title and author links --- popup/search.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/popup/search.js b/popup/search.js index af71775c..b03309e3 100644 --- a/popup/search.js +++ b/popup/search.js @@ -280,7 +280,8 @@ // title Object.assign($('.search-result-title', entry), { onclick: Events.openURLandHide, - href: URLS.usoArchive + `?category=${category}&style=${id}`, + href: isUsw ? `${URLS.usw}style/${id}` : + `${URLS.usoArchive}?category=${category}&style=${id}`, }); $('.search-result-title span', entry).textContent = t.breakWord(name.length < 300 ? name : name.slice(0, 300) + '...'); @@ -299,10 +300,12 @@ }); } // author + const eAuthor = encodeURIComponent(author); Object.assign($('[data-type="author"] a', entry), { textContent: author, title: author, - href: URLS.usoArchive + '?author=' + encodeURIComponent(author).replace(/%20/g, '+'), + href: isUsw ? `${URLS.usw}user/${eAuthor}` : + `${URLS.usoArchive}?author=${eAuthor.replace(/%20/g, '+')}`, onclick: Events.openURLandHide, }); // rating