Fixed a few more linter errors
This commit is contained in:
parent
878f1913e3
commit
7e25ee6faf
@ -3,4 +3,4 @@ import AnimeNotifier from "scripts/AnimeNotifier"
|
|||||||
// Reload content of current page
|
// Reload content of current page
|
||||||
export function reloadContent(arn: AnimeNotifier) {
|
export function reloadContent(arn: AnimeNotifier) {
|
||||||
return arn.reloadContent()
|
return arn.reloadContent()
|
||||||
}
|
}
|
||||||
|
@ -30,4 +30,4 @@ export async function diff(arn: AnimeNotifier, element: HTMLElement) {
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
arn.statusMessage.showError(err)
|
arn.statusMessage.showError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,4 +67,4 @@ export async function calendarShowAddedAnimeOnly(arn: AnimeNotifier, element: HT
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
arn.statusMessage.showError(err)
|
arn.statusMessage.showError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,4 +175,4 @@ async function setThreadLock(arn: AnimeNotifier, element: HTMLButtonElement, sta
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
arn.statusMessage.showError(err)
|
arn.statusMessage.showError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,4 +32,4 @@ export async function leave(arn: AnimeNotifier, element: HTMLElement) {
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
arn.statusMessage.showError(err)
|
arn.statusMessage.showError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,4 +52,4 @@ export async function loadMore(arn: AnimeNotifier, button: HTMLButtonElement) {
|
|||||||
arn.loading(false)
|
arn.loading(false)
|
||||||
button.disabled = false
|
button.disabled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Desktop app installation
|
// Desktop app installation
|
||||||
export function installApp() {
|
export function installApp() {
|
||||||
alert("Open your browser menu > 'Install Anime Notifier'.")
|
alert("Open your browser menu > 'Install Anime Notifier'.")
|
||||||
}
|
}
|
||||||
|
@ -24,4 +24,4 @@ export async function unlike(arn: AnimeNotifier, element: HTMLElement) {
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
arn.statusMessage.showError(err)
|
arn.statusMessage.showError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,4 +32,4 @@
|
|||||||
// let chart = new window["google"].visualization.GeoChart(element)
|
// let chart = new window["google"].visualization.GeoChart(element)
|
||||||
// console.log(element, data)
|
// console.log(element, data)
|
||||||
// chart.draw(data, options)
|
// chart.draw(data, options)
|
||||||
// }
|
// }
|
||||||
|
@ -41,4 +41,4 @@ export async function markNotificationsAsSeen(arn: AnimeNotifier) {
|
|||||||
|
|
||||||
// Update notifications
|
// Update notifications
|
||||||
arn.reloadContent()
|
arn.reloadContent()
|
||||||
}
|
}
|
||||||
|
@ -52,4 +52,4 @@ export async function deleteObject(arn: AnimeNotifier, button: HTMLButtonElement
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
arn.statusMessage.showError(err)
|
arn.statusMessage.showError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,4 +22,4 @@ export async function unpublish(arn: AnimeNotifier, button: HTMLButtonElement) {
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
arn.statusMessage.showError(err)
|
arn.statusMessage.showError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,4 +200,4 @@ export function addNumber(arn: AnimeNotifier, element: HTMLElement) {
|
|||||||
|
|
||||||
input.value = newValue.toString()
|
input.value = newValue.toString()
|
||||||
return save(arn, input)
|
return save(arn, input)
|
||||||
}
|
}
|
||||||
|
@ -83,4 +83,4 @@ export function buyItem(arn: AnimeNotifier, button: HTMLElement) {
|
|||||||
.then(() => arn.statusMessage.showInfo(`You bought ${itemName} for ${price} gems. Check out your inventory to confirm the purchase.`, 4000))
|
.then(() => arn.statusMessage.showInfo(`You bought ${itemName} for ${price} gems. Check out your inventory to confirm the purchase.`, 4000))
|
||||||
.catch(err => arn.statusMessage.showError(err))
|
.catch(err => arn.statusMessage.showError(err))
|
||||||
.then(() => arn.loading(false))
|
.then(() => arn.loading(false))
|
||||||
}
|
}
|
||||||
|
@ -4,4 +4,4 @@ import AnimeNotifier from "../AnimeNotifier"
|
|||||||
export function toggleSidebar(_: AnimeNotifier) {
|
export function toggleSidebar(_: AnimeNotifier) {
|
||||||
const sidebar = document.getElementById("sidebar") as HTMLElement
|
const sidebar = document.getElementById("sidebar") as HTMLElement
|
||||||
sidebar.classList.toggle("sidebar-visible")
|
sidebar.classList.toggle("sidebar-visible")
|
||||||
}
|
}
|
||||||
|
@ -3,4 +3,4 @@ import AnimeNotifier from "../AnimeNotifier"
|
|||||||
// Close status message
|
// Close status message
|
||||||
export function closeStatusMessage(arn: AnimeNotifier) {
|
export function closeStatusMessage(arn: AnimeNotifier) {
|
||||||
arn.statusMessage.close()
|
arn.statusMessage.close()
|
||||||
}
|
}
|
||||||
|
@ -186,4 +186,4 @@ function updateSideBarAvatar(url: string) {
|
|||||||
} else {
|
} else {
|
||||||
location.reload()
|
location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,4 +39,4 @@ export function showMore(_: AnimeNotifier, showMoreElement: HTMLElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Diff.mutations.queue(() => showMoreElement.classList.add("show-more"))
|
Diff.mutations.queue(() => showMoreElement.classList.add("show-more"))
|
||||||
}
|
}
|
||||||
|
@ -64,4 +64,4 @@ export function toggleFullscreen(_: AnimeNotifier, button: HTMLElement) {
|
|||||||
} else {
|
} else {
|
||||||
requestFullscreen.call(element)
|
requestFullscreen.call(element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,4 +20,4 @@ export * from "./SideBar"
|
|||||||
export * from "./StatusMessage"
|
export * from "./StatusMessage"
|
||||||
export * from "./Theme"
|
export * from "./Theme"
|
||||||
export * from "./Upload"
|
export * from "./Upload"
|
||||||
export * from "./Video"
|
export * from "./Video"
|
||||||
|
@ -38,4 +38,4 @@ export default class Analytics {
|
|||||||
body: JSON.stringify(analytics)
|
body: JSON.stringify(analytics)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,18 +310,25 @@ export default class AnimeNotifier {
|
|||||||
// search.setAttribute("list", titleList.id)
|
// search.setAttribute("list", titleList.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
async onBeforeUnload(e: BeforeUnloadEvent) {
|
onBeforeUnload(e: BeforeUnloadEvent) {
|
||||||
let message = ""
|
if(this.app.currentPath !== "/new/thread") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!document.activeElement) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(document.activeElement.tagName !== "TEXTAREA") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if((document.activeElement as HTMLTextAreaElement).value.length < 20) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Prevent closing tab on new thread page
|
// Prevent closing tab on new thread page
|
||||||
if(this.app.currentPath === "/new/thread" && document.activeElement && document.activeElement.tagName === "TEXTAREA" && (document.activeElement as HTMLTextAreaElement).value.length > 20) {
|
e.returnValue = "You have unsaved changes on the current page. Are you sure you want to leave?"
|
||||||
message = "You have unsaved changes on the current page. Are you sure you want to leave?"
|
|
||||||
}
|
|
||||||
|
|
||||||
if(message) {
|
|
||||||
e.returnValue = message
|
|
||||||
return message
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareTooltips(elements?: IterableIterator<HTMLElement>) {
|
prepareTooltips(elements?: IterableIterator<HTMLElement>) {
|
||||||
@ -1156,7 +1163,7 @@ export default class AnimeNotifier {
|
|||||||
|
|
||||||
async diff(url: string) {
|
async diff(url: string) {
|
||||||
if(url === this.app.currentPath) {
|
if(url === this.app.currentPath) {
|
||||||
return null
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const path = "/_" + url
|
const path = "/_" + url
|
||||||
|
@ -326,4 +326,4 @@ export default class AudioPlayer {
|
|||||||
this.animeImage.classList.remove("hidden")
|
this.animeImage.classList.remove("hidden")
|
||||||
this.animeImage["became visible"]()
|
this.animeImage["became visible"]()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,4 +146,4 @@ export function displayTime(element: HTMLElement) {
|
|||||||
const startTime = (h <= 9 ? "0" + h : h) + ":" + (m <= 9 ? "0" + m : m)
|
const startTime = (h <= 9 ? "0" + h : h) + ":" + (m <= 9 ? "0" + m : m)
|
||||||
|
|
||||||
element.textContent = startTime
|
element.textContent = startTime
|
||||||
}
|
}
|
||||||
|
@ -156,4 +156,4 @@ export default class Diff {
|
|||||||
Diff.childNodes(a, b)
|
Diff.childNodes(a, b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,4 +65,4 @@ export default class SVGIcon extends HTMLElement {
|
|||||||
set name(value: string) {
|
set name(value: string) {
|
||||||
this.setAttribute("name", value)
|
this.setAttribute("name", value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,4 +63,4 @@ export default class ToolTip extends HTMLElement {
|
|||||||
this.setAttribute("active", "true")
|
this.setAttribute("active", "true")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,4 +36,4 @@ export default class InfiniteScroller {
|
|||||||
|
|
||||||
button.click()
|
button.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,4 +65,4 @@ export default class MutationQueue {
|
|||||||
|
|
||||||
this.onClearCallBacks.push(callBack)
|
this.onClearCallBacks.push(callBack)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,4 +46,4 @@ export default class NotificationManager {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,4 +108,4 @@ function urlBase64ToUint8Array(base64String: string) {
|
|||||||
|
|
||||||
const rawData = window.atob(base64)
|
const rawData = window.atob(base64)
|
||||||
return Uint8Array.from([...rawData].map(char => char.charCodeAt(0)))
|
return Uint8Array.from([...rawData].map(char => char.charCodeAt(0)))
|
||||||
}
|
}
|
||||||
|
@ -97,4 +97,4 @@ export default class ServerEvents {
|
|||||||
|
|
||||||
this.arn.notificationManager.setCounter(parseInt(e.data))
|
this.arn.notificationManager.setCounter(parseInt(e.data))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,4 +96,4 @@
|
|||||||
// return this.postMessage({
|
// return this.postMessage({
|
||||||
// type: "reload styles"
|
// type: "reload styles"
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
|
@ -66,4 +66,4 @@
|
|||||||
// return evt.respondWith(this.networkFirst(request, network, onResponse))
|
// return evt.respondWith(this.networkFirst(request, network, onResponse))
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// return evt.respondWith(this.cacheFirst(request, network, onResponse))
|
// return evt.respondWith(this.cacheFirst(request, network, onResponse))
|
||||||
|
@ -101,4 +101,4 @@ export default class ServiceWorkerManager {
|
|||||||
// break
|
// break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,4 +38,4 @@ export default class SideBar {
|
|||||||
this.element.style.display = "flex"
|
this.element.style.display = "flex"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
scripts/Types/Anime.d.ts
vendored
2
scripts/Types/Anime.d.ts
vendored
@ -82,4 +82,4 @@ export interface Anime {
|
|||||||
createdBy: string;
|
createdBy: string;
|
||||||
edited: string;
|
edited: string;
|
||||||
editedBy: string;
|
editedBy: string;
|
||||||
}
|
}
|
||||||
|
@ -12,4 +12,4 @@ export function bytesHumanReadable(fileSize: number): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return `${fileSize.toFixed(0)} ${unit}`
|
return `${fileSize.toFixed(0)} ${unit}`
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
export function delay<T>(millis: number, value?: T): Promise<T> {
|
export function delay<T>(millis: number, value?: T): Promise<T> {
|
||||||
return new Promise(resolve => setTimeout(() => resolve(value), millis))
|
return new Promise(resolve => setTimeout(() => resolve(value), millis))
|
||||||
}
|
}
|
||||||
|
@ -6,4 +6,4 @@ export * from "./plural"
|
|||||||
export * from "./requestIdleCallback"
|
export * from "./requestIdleCallback"
|
||||||
export * from "./swapElements"
|
export * from "./swapElements"
|
||||||
export * from "./uploadWithProgress"
|
export * from "./uploadWithProgress"
|
||||||
export * from "./bytesHumanReadable"
|
export * from "./bytesHumanReadable"
|
||||||
|
@ -12,4 +12,4 @@ export function plural(count: number, singular: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return count + " " + singular + "s"
|
return count + " " + singular + "s"
|
||||||
}
|
}
|
||||||
|
@ -4,4 +4,4 @@ export function requestIdleCallback(func: Function) {
|
|||||||
} else {
|
} else {
|
||||||
func()
|
func()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,4 +6,4 @@ export async function supportsWebP(): Promise<boolean> {
|
|||||||
const data = "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="
|
const data = "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="
|
||||||
const blob = await fetch(data).then(r => r.blob())
|
const blob = await fetch(data).then(r => r.blob())
|
||||||
return createImageBitmap(blob).then(() => true, () => false)
|
return createImageBitmap(blob).then(() => true, () => false)
|
||||||
}
|
}
|
||||||
|
@ -20,4 +20,4 @@ export function swapElements(a: Node, b: Node) {
|
|||||||
bParent.appendChild(a)
|
bParent.appendChild(a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,4 @@ export default class VideoPlayer {
|
|||||||
playPause() {
|
playPause() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,4 +17,4 @@ export function register() {
|
|||||||
for(const [tag, definition] of elements.entries()) {
|
for(const [tag, definition] of elements.entries()) {
|
||||||
window.customElements.define(tag, definition)
|
window.customElements.define(tag, definition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,9 @@
|
|||||||
"strict": false,
|
"strict": false,
|
||||||
"strictFunctionTypes": false,
|
"strictFunctionTypes": false,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true
|
"noUnusedParameters": true,
|
||||||
|
"forceConsistentCasingInFileNames": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
"arrow-parens": false,
|
"arrow-parens": false,
|
||||||
"trailing-comma": false,
|
"trailing-comma": false,
|
||||||
"prefer-const": true,
|
"prefer-const": true,
|
||||||
"no-var-keyword": true
|
"no-var-keyword": true,
|
||||||
|
"eofline": true
|
||||||
},
|
},
|
||||||
"rulesDirectory": []
|
"rulesDirectory": []
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user