Deleted app.find()
This commit is contained in:
@ -32,6 +32,6 @@ export function removeAnimeFromCollection(arn: AnimeNotifier, button: HTMLElemen
|
||||
let apiEndpoint = arn.findAPIEndpoint(button)
|
||||
|
||||
arn.post(apiEndpoint + "/remove/" + animeId, "")
|
||||
.then(() => arn.app.load(`/+${nick}/animelist/` + (arn.app.find("Status") as HTMLSelectElement).value))
|
||||
.then(() => arn.app.load(`/+${nick}/animelist/` + (document.getElementById("Status") as HTMLSelectElement).value))
|
||||
.catch(err => arn.statusMessage.showError(err))
|
||||
}
|
@ -3,11 +3,11 @@ import { findAll } from "scripts/Utils";
|
||||
|
||||
// Filter anime on explore page
|
||||
export function filterAnime(arn: AnimeNotifier, input: HTMLInputElement) {
|
||||
let root = arn.app.find("filter-root")
|
||||
let root = document.getElementById("filter-root")
|
||||
|
||||
let elementYear = arn.app.find("filter-year") as HTMLSelectElement
|
||||
let elementStatus = arn.app.find("filter-status") as HTMLSelectElement
|
||||
let elementType = arn.app.find("filter-type") as HTMLSelectElement
|
||||
let elementYear = document.getElementById("filter-year") as HTMLSelectElement
|
||||
let elementStatus = document.getElementById("filter-status") as HTMLSelectElement
|
||||
let elementType = document.getElementById("filter-type") as HTMLSelectElement
|
||||
|
||||
for(let element of findAll("anime-grid-image")) {
|
||||
let img = element as HTMLImageElement
|
||||
|
@ -4,7 +4,7 @@ import AnimeNotifier from "../AnimeNotifier"
|
||||
export function followUser(arn: AnimeNotifier, elem: HTMLElement) {
|
||||
return arn.post(elem.dataset.api, "")
|
||||
.then(() => arn.reloadContent())
|
||||
.then(() => arn.statusMessage.showInfo("You are now following " + arn.app.find("nick").innerText + "."))
|
||||
.then(() => arn.statusMessage.showInfo("You are now following " + document.getElementById("nick").innerText + "."))
|
||||
.catch(err => arn.statusMessage.showError(err))
|
||||
}
|
||||
|
||||
@ -12,6 +12,6 @@ export function followUser(arn: AnimeNotifier, elem: HTMLElement) {
|
||||
export function unfollowUser(arn: AnimeNotifier, elem: HTMLElement) {
|
||||
return arn.post(elem.dataset.api, "")
|
||||
.then(() => arn.reloadContent())
|
||||
.then(() => arn.statusMessage.showInfo("You stopped following " + arn.app.find("nick").innerText + "."))
|
||||
.then(() => arn.statusMessage.showInfo("You stopped following " + document.getElementById("nick").innerText + "."))
|
||||
.catch(err => arn.statusMessage.showError(err))
|
||||
}
|
@ -4,11 +4,11 @@ import AnimeNotifier from "../AnimeNotifier"
|
||||
export function editPost(arn: AnimeNotifier, element: HTMLElement) {
|
||||
let postId = element.dataset.id
|
||||
|
||||
let render = arn.app.find("render-" + postId)
|
||||
let toolbar = arn.app.find("toolbar-" + postId)
|
||||
let title = arn.app.find("title-" + postId)
|
||||
let source = arn.app.find("source-" + postId)
|
||||
let edit = arn.app.find("edit-toolbar-" + postId)
|
||||
let render = document.getElementById("render-" + postId)
|
||||
let toolbar = document.getElementById("toolbar-" + postId)
|
||||
let title = document.getElementById("title-" + postId)
|
||||
let source = document.getElementById("source-" + postId)
|
||||
let edit = document.getElementById("edit-toolbar-" + postId)
|
||||
|
||||
render.classList.toggle("hidden")
|
||||
toolbar.classList.toggle("hidden")
|
||||
@ -23,8 +23,8 @@ export function editPost(arn: AnimeNotifier, element: HTMLElement) {
|
||||
// Save post
|
||||
export function savePost(arn: AnimeNotifier, element: HTMLElement) {
|
||||
let postId = element.dataset.id
|
||||
let source = arn.app.find("source-" + postId) as HTMLTextAreaElement
|
||||
let title = arn.app.find("title-" + postId) as HTMLInputElement
|
||||
let source = document.getElementById("source-" + postId) as HTMLTextAreaElement
|
||||
let title = document.getElementById("title-" + postId) as HTMLInputElement
|
||||
let text = source.value
|
||||
|
||||
let updates: any = {
|
||||
@ -58,8 +58,8 @@ export function deletePost(arn: AnimeNotifier, element: HTMLElement) {
|
||||
|
||||
// Forum reply
|
||||
export function forumReply(arn: AnimeNotifier) {
|
||||
let textarea = arn.app.find("new-reply") as HTMLTextAreaElement
|
||||
let thread = arn.app.find("thread")
|
||||
let textarea = document.getElementById("new-reply") as HTMLTextAreaElement
|
||||
let thread = document.getElementById("thread")
|
||||
|
||||
let post = {
|
||||
text: textarea.value,
|
||||
@ -80,9 +80,9 @@ export function newGroupPost(arn: AnimeNotifier) {
|
||||
|
||||
// Create thread
|
||||
export function createThread(arn: AnimeNotifier) {
|
||||
let title = arn.app.find("title") as HTMLInputElement
|
||||
let text = arn.app.find("text") as HTMLTextAreaElement
|
||||
let category = arn.app.find("tag") as HTMLInputElement
|
||||
let title = document.getElementById("title") as HTMLInputElement
|
||||
let text = document.getElementById("text") as HTMLTextAreaElement
|
||||
let category = document.getElementById("tag") as HTMLInputElement
|
||||
|
||||
let thread = {
|
||||
title: title.value,
|
||||
|
@ -11,7 +11,7 @@ export async function loadMore(arn: AnimeNotifier, button: HTMLButtonElement) {
|
||||
arn.loading(true)
|
||||
button.disabled = true
|
||||
|
||||
let target = arn.app.find("load-more-target")
|
||||
let target = document.getElementById("load-more-target")
|
||||
let index = button.dataset.index
|
||||
|
||||
try {
|
||||
|
@ -138,7 +138,7 @@ export function addNumber(arn: AnimeNotifier, element: HTMLElement) {
|
||||
return
|
||||
}
|
||||
|
||||
let input = arn.app.find(element.dataset.id) as HTMLInputElement
|
||||
let input = document.getElementById(element.dataset.id) as HTMLInputElement
|
||||
let add = parseInt(element.dataset.add)
|
||||
let num = parseInt(input.value)
|
||||
let newValue = num + add
|
||||
|
@ -2,5 +2,5 @@ import AnimeNotifier from "../AnimeNotifier"
|
||||
|
||||
// Toggle sidebar
|
||||
export function toggleSidebar(arn: AnimeNotifier) {
|
||||
arn.app.find("sidebar").classList.toggle("sidebar-visible")
|
||||
document.getElementById("sidebar").classList.toggle("sidebar-visible")
|
||||
}
|
Reference in New Issue
Block a user