mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-21 07:51:57 +00:00
cleanup, minor fixes
This commit is contained in:
parent
81c27167cd
commit
9f7efce30e
2 changed files with 2 additions and 26 deletions
|
|
@ -65,12 +65,6 @@ function traceAnime (image, type) { // WAIT lookup logic
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function searchBox () { // make searchbox behave nicely
|
|
||||||
search.placeholder = search.value
|
|
||||||
searchAnime(search.value)
|
|
||||||
search.value = ''
|
|
||||||
document.location.hash = '#browse'
|
|
||||||
}
|
|
||||||
// events
|
// events
|
||||||
navNowPlaying.onclick = () => { viewAnime(client.nowPlaying?.media) }
|
navNowPlaying.onclick = () => { viewAnime(client.nowPlaying?.media) }
|
||||||
// AL lookup logic
|
// AL lookup logic
|
||||||
|
|
@ -294,24 +288,6 @@ mutation ($id: Int, $status: MediaListStatus, $episode: Int, $repeat: Int) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let alResponse
|
|
||||||
async function searchAnime (a) { // search bar functionality
|
|
||||||
const cards = []
|
|
||||||
const browse = document.querySelector('.browse')
|
|
||||||
browse.innerHTML = ''
|
|
||||||
// browse.appendChild(skeletonCard) // TODO: fix
|
|
||||||
a ? alResponse = await alRequest({ method: 'SearchName', name: a }) : alResponse = await alRequest({ method: 'Trending' })
|
|
||||||
try {
|
|
||||||
alResponse.data.Page.media.forEach(media => {
|
|
||||||
cards.push(cardCreator({ media: media, onclick: () => viewAnime(media) }))
|
|
||||||
})
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e)
|
|
||||||
}
|
|
||||||
browse.innerHTML = ''
|
|
||||||
browse.append(...cards)
|
|
||||||
}
|
|
||||||
|
|
||||||
// these really shouldnt be global
|
// these really shouldnt be global
|
||||||
const detailsfrag = document.createDocumentFragment()
|
const detailsfrag = document.createDocumentFragment()
|
||||||
const details = {
|
const details = {
|
||||||
|
|
@ -687,7 +663,6 @@ async function releasesRss (limit) {
|
||||||
}
|
}
|
||||||
let alID // login icon
|
let alID // login icon
|
||||||
async function loadAnime () {
|
async function loadAnime () {
|
||||||
// await searchAnime()
|
|
||||||
if (localStorage.getItem('ALtoken')) {
|
if (localStorage.getItem('ALtoken')) {
|
||||||
alRequest({ method: 'Viewer' }).then(result => {
|
alRequest({ method: 'Viewer' }).then(result => {
|
||||||
oauth.removeAttribute('href')
|
oauth.removeAttribute('href')
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,7 @@ async function loadHomePage () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function reloadHome () {
|
function reloadHome () {
|
||||||
|
home.classList.remove('browsing')
|
||||||
lastRSSDate = undefined
|
lastRSSDate = undefined
|
||||||
for (const item of homePreviewElements) {
|
for (const item of homePreviewElements) {
|
||||||
item.textContent = ''
|
item.textContent = ''
|
||||||
|
|
@ -215,7 +216,7 @@ async function loadHomePage () {
|
||||||
searchTimeout = setTimeout(() => {
|
searchTimeout = setTimeout(() => {
|
||||||
homeLoadFunctions.search()
|
homeLoadFunctions.search()
|
||||||
searchTimeout = undefined
|
searchTimeout = undefined
|
||||||
}, 1000)
|
}, 500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue