From 41dd2d1ef3bbc9103fd61c95b9e0b4861d558d91 Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 12 Aug 2021 20:18:16 +0300 Subject: [PATCH] shorten shotName to shot --- popup/search.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/popup/search.js b/popup/search.js index 42dad336..193df76b 100644 --- a/popup/search.js +++ b/popup/search.js @@ -278,7 +278,7 @@ ai: authorId, an: author, sa: shotArchived, - sn: shotName, + sn: shot, isUsw, } = entry._result = result; entry.id = RESULT_ID_PREFIX + id; @@ -293,14 +293,14 @@ // screenshot const elShot = $('.search-result-screenshot', entry); if (isUsw) { - elShot.src = !/^https?:/i.test(shotName) ? BLANK_PIXEL : - imgType !== '.jpg' ? shotName.replace(/\.jpg$/, imgType) : - shotName; + elShot.src = !/^https?:/i.test(shot) ? BLANK_PIXEL : + imgType !== '.jpg' ? shot.replace(/\.jpg$/, imgType) : + shot; } else { const auto = URLS.uso + `auto_style_screenshots/${id}${USO_AUTO_PIC_SUFFIX}`; Object.assign(elShot, { - src: shotName && !shotName.endsWith(USO_AUTO_PIC_SUFFIX) - ? `${shotArchived ? URLS.usoArchiveRaw[0] : URLS.uso + 'style_'}screenshots/${shotName}` + src: shot && !shot.endsWith(USO_AUTO_PIC_SUFFIX) + ? `${shotArchived ? URLS.usoArchiveRaw[0] : URLS.uso + 'style_'}screenshots/${shot}` : auto, _src: auto, onerror: fixScreenshot, @@ -310,9 +310,8 @@ Object.assign($('[data-type="author"] a', entry), { textContent: author, title: author, - href: isUsw - ? `${URLS.usw}user/${encodeURIComponent(author)}` - : `${URLS.usoArchive}browse/styles/?search=%40${authorId}`, + href: isUsw ? `${URLS.usw}user/${encodeURIComponent(author)}` : + `${URLS.usoArchive}browse/styles/?search=%40${authorId}`, onclick: Events.openURLandHide, }); // rating