fix usw title and author links

This commit is contained in:
tophf 2021-04-18 15:17:29 +03:00
parent d02f43f70e
commit 623005e068

View File

@ -280,7 +280,8 @@
// title // title
Object.assign($('.search-result-title', entry), { Object.assign($('.search-result-title', entry), {
onclick: Events.openURLandHide, 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 = $('.search-result-title span', entry).textContent =
t.breakWord(name.length < 300 ? name : name.slice(0, 300) + '...'); t.breakWord(name.length < 300 ? name : name.slice(0, 300) + '...');
@ -299,10 +300,12 @@
}); });
} }
// author // author
const eAuthor = encodeURIComponent(author);
Object.assign($('[data-type="author"] a', entry), { Object.assign($('[data-type="author"] a', entry), {
textContent: author, textContent: author,
title: 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, onclick: Events.openURLandHide,
}); });
// rating // rating