show usw logo

This commit is contained in:
tophf 2021-04-18 15:43:08 +03:00
parent 000a614933
commit a32adf1c32
2 changed files with 11 additions and 0 deletions

View File

@ -82,6 +82,12 @@ body.search-results-shown {
overflow-wrap: break-word;
}
.search-result-title img {
width: 20px;
height: 20px;
margin: -6px 4px -6px 0;
}
.search-result-title span {
font-size: 12px;
font-weight: 600;

View File

@ -13,6 +13,10 @@
const RESULT_ID_PREFIX = 'search-result-';
const INDEX_URL = URLS.usoArchiveRaw + 'search-index.json';
const USW_INDEX_URL = URLS.usw + 'api/index/uso-format';
const USW_ICON = $create('img', {
src: `${URLS.usw}favicon.ico`,
title: URLS.usw,
});
const STYLUS_CATEGORY = 'chrome-extension';
const PAGE_LENGTH = 10;
// update USO style install counter if the style isn't uninstalled immediately
@ -283,6 +287,7 @@
href: isUsw ? `${URLS.usw}style/${id}` :
`${URLS.usoArchive}?category=${category}&style=${id}`,
});
if (isUsw) $('.search-result-title', entry).prepend(USW_ICON.cloneNode(true));
$('.search-result-title span', entry).textContent =
t.breakWord(name.length < 300 ? name : name.slice(0, 300) + '...');
// screenshot