index already has ai
This commit is contained in:
parent
4435a44291
commit
d81c612678
|
@ -64,7 +64,6 @@
|
|||
const $class = sel => (sel instanceof Node ? sel : $(sel)).classList;
|
||||
const show = sel => $class(sel).remove('hidden');
|
||||
const hide = sel => $class(sel).add('hidden');
|
||||
const makeUsoArchiveAuthorUrl = a => `${URLS.usoArchive}browse/styles/?search=%40${a}`;
|
||||
|
||||
Object.assign(Events, {
|
||||
/**
|
||||
|
@ -85,21 +84,6 @@
|
|||
calcCategory();
|
||||
ready = start();
|
||||
},
|
||||
|
||||
usoArchive: {
|
||||
async openAuthor(event) {
|
||||
event.preventDefault();
|
||||
await Events.usoArchive.prefetchAuthorId.call(this);
|
||||
Events.openURLandHide.call(this, event);
|
||||
},
|
||||
async prefetchAuthorId() {
|
||||
return this._fetch || (
|
||||
this._fetch = fetch(`${URLS.usoArchiveRaw[0]}styles/${this._id}.json`)
|
||||
.then(r => r.json())
|
||||
.then(json => (this.href = makeUsoArchiveAuthorUrl(json.info.author.id)))
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
function init() {
|
||||
|
@ -291,6 +275,7 @@
|
|||
u: updateTime,
|
||||
w: weeklyInstalls,
|
||||
t: totalInstalls,
|
||||
ai: authorId,
|
||||
an: author,
|
||||
sa: shotArchived,
|
||||
sn: shotName,
|
||||
|
@ -322,18 +307,13 @@
|
|||
});
|
||||
}
|
||||
// author
|
||||
const eAuthor = encodeURIComponent(author);
|
||||
Object.assign($('[data-type="author"] a', entry), {
|
||||
textContent: author,
|
||||
title: author,
|
||||
}, isUsw ? {
|
||||
href: `${URLS.usw}user/${eAuthor}`,
|
||||
href: isUsw
|
||||
? `${URLS.usw}user/${encodeURIComponent(author)}`
|
||||
: `${URLS.usoArchive}browse/styles/?search=%40${authorId}`,
|
||||
onclick: Events.openURLandHide,
|
||||
} : {
|
||||
_id: id,
|
||||
href: makeUsoArchiveAuthorUrl(eAuthor),
|
||||
onclick: Events.usoArchive.openAuthor,
|
||||
onmousedown: Events.usoArchive.prefetchAuthorId,
|
||||
});
|
||||
// rating
|
||||
$('[data-type="rating"]', entry).dataset.class =
|
||||
|
|
Loading…
Reference in New Issue
Block a user