Removed unused parameters in scripts
This commit is contained in:
parent
6e4097b3b6
commit
b78785cadc
@ -2,7 +2,7 @@ import AnimeNotifier from "../AnimeNotifier"
|
||||
import { findAll } from "scripts/Utils"
|
||||
|
||||
// Filter anime on explore page
|
||||
export function filterAnime(arn: AnimeNotifier, input: HTMLInputElement) {
|
||||
export function filterAnime(arn: AnimeNotifier, _: HTMLInputElement) {
|
||||
let root = document.getElementById("filter-root") as HTMLElement
|
||||
|
||||
let elementYear = document.getElementById("filter-year") as HTMLSelectElement
|
||||
|
@ -1,7 +1,7 @@
|
||||
import AnimeNotifier from "../AnimeNotifier"
|
||||
|
||||
// Edit post
|
||||
export function editPost(arn: AnimeNotifier, element: HTMLElement) {
|
||||
export function editPost(_: AnimeNotifier, element: HTMLElement) {
|
||||
let postId = element.dataset.id
|
||||
|
||||
if(!postId) {
|
||||
@ -147,7 +147,7 @@ export async function reply(arn: AnimeNotifier, element: HTMLElement) {
|
||||
}
|
||||
|
||||
// Cancel replying to a post
|
||||
export function cancelReply(arn: AnimeNotifier, element: HTMLElement) {
|
||||
export function cancelReply(arn: AnimeNotifier, _: HTMLElement) {
|
||||
arn.reloadContent()
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import AnimeNotifier from "../AnimeNotifier"
|
||||
|
||||
// Enable notifications
|
||||
export async function enableNotifications(arn: AnimeNotifier, button: HTMLElement) {
|
||||
export async function enableNotifications(arn: AnimeNotifier, _: HTMLElement) {
|
||||
if(!arn.user || !arn.user.dataset.id) {
|
||||
return
|
||||
}
|
||||
@ -13,7 +13,7 @@ export async function enableNotifications(arn: AnimeNotifier, button: HTMLElemen
|
||||
}
|
||||
|
||||
// Disable notifications
|
||||
export async function disableNotifications(arn: AnimeNotifier, button: HTMLElement) {
|
||||
export async function disableNotifications(arn: AnimeNotifier, _: HTMLElement) {
|
||||
if(!arn.user || !arn.user.dataset.id) {
|
||||
return
|
||||
}
|
||||
|
@ -199,11 +199,11 @@ export function searchBySpeech(arn: AnimeNotifier, element: HTMLElement) {
|
||||
recognition.stop()
|
||||
}
|
||||
|
||||
recognition.onerror = e => {
|
||||
recognition.onerror = _ => {
|
||||
recognition.stop()
|
||||
}
|
||||
|
||||
recognition.onend = e => {
|
||||
recognition.onend = _ => {
|
||||
searchInput.placeholder = oldPlaceholder
|
||||
element.classList.remove("speech-listening")
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ export function chargeUp(arn: AnimeNotifier, button: HTMLElement) {
|
||||
}
|
||||
|
||||
// Toggle fade
|
||||
export function toggleFade(arn: AnimeNotifier, button: HTMLElement) {
|
||||
export function toggleFade(_: AnimeNotifier, button: HTMLElement) {
|
||||
let elementId = button.dataset.elementId
|
||||
|
||||
if(!elementId) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import AnimeNotifier from "../AnimeNotifier"
|
||||
|
||||
// Toggle sidebar
|
||||
export function toggleSidebar(arn: AnimeNotifier) {
|
||||
export function toggleSidebar(_: AnimeNotifier) {
|
||||
let sidebar = document.getElementById("sidebar") as HTMLElement
|
||||
sidebar.classList.toggle("sidebar-visible")
|
||||
}
|
@ -166,7 +166,7 @@ export function applyTheme(themeName: string) {
|
||||
}
|
||||
|
||||
// Color picker
|
||||
export function pickColor(arn: AnimeNotifier, element: HTMLElement) {
|
||||
export function pickColor(_: AnimeNotifier, element: HTMLElement) {
|
||||
let rootStyle = document.documentElement.style
|
||||
let variableName = `--${element.dataset.variable}`
|
||||
|
||||
|
@ -31,7 +31,7 @@ async function updateFollow(arn: AnimeNotifier, element: HTMLElement, message: s
|
||||
}
|
||||
|
||||
// Show more
|
||||
export function showMore(arn: AnimeNotifier, showMoreElement: HTMLElement) {
|
||||
export function showMore(_: AnimeNotifier, showMoreElement: HTMLElement) {
|
||||
const elements = [...document.getElementsByClassName("show-more")]
|
||||
|
||||
for(let element of elements) {
|
||||
|
@ -40,7 +40,7 @@ function togglePlayVideoElement(video: HTMLVideoElement) {
|
||||
}
|
||||
|
||||
// Toggle fullscreen
|
||||
export function toggleFullscreen(arn: AnimeNotifier, button: HTMLElement) {
|
||||
export function toggleFullscreen(_: AnimeNotifier, button: HTMLElement) {
|
||||
let elementId = button.dataset.id
|
||||
|
||||
if(!elementId) {
|
||||
|
@ -75,7 +75,7 @@ export default class AnimeNotifier {
|
||||
observe: (elem: HTMLElement) => {
|
||||
elem["became visible"]()
|
||||
},
|
||||
unobserve: (elem: HTMLElement) => {}
|
||||
unobserve: (_: HTMLElement) => {}
|
||||
} as IntersectionObserver
|
||||
}
|
||||
}
|
||||
@ -514,7 +514,7 @@ export default class AnimeNotifier {
|
||||
e.dataTransfer.setData("text", element.dataset.index)
|
||||
}, false)
|
||||
|
||||
element.addEventListener("dblclick", async e => {
|
||||
element.addEventListener("dblclick", async _ => {
|
||||
if(!element.draggable || !element.dataset.index) {
|
||||
return
|
||||
}
|
||||
@ -536,11 +536,11 @@ export default class AnimeNotifier {
|
||||
}
|
||||
}, false)
|
||||
|
||||
element.addEventListener("dragenter", e => {
|
||||
element.addEventListener("dragenter", _ => {
|
||||
element.classList.add("drag-enter")
|
||||
}, false)
|
||||
|
||||
element.addEventListener("dragleave", e => {
|
||||
element.addEventListener("dragleave", _ => {
|
||||
element.classList.remove("drag-enter")
|
||||
}, false)
|
||||
|
||||
|
@ -111,7 +111,7 @@ export default class AudioPlayer {
|
||||
this.audioNode.playbackRate.setValueAtTime(this.targetSpeed, 0)
|
||||
this.audioNode.start(0)
|
||||
|
||||
this.audioNode.onended = (event: MediaStreamErrorEvent) => {
|
||||
this.audioNode.onended = (_: MediaStreamErrorEvent) => {
|
||||
if(currentPlayId !== this.playId) {
|
||||
return
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ export default class Diff {
|
||||
let container = document.createElement("main")
|
||||
container.innerHTML = html
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, _) => {
|
||||
Diff.childNodes(aRoot, container)
|
||||
this.mutations.wait(resolve)
|
||||
})
|
||||
@ -29,7 +29,7 @@ export default class Diff {
|
||||
|
||||
// root will diff the document root element with the given HTML string and apply DOM mutations.
|
||||
static root(aRoot: HTMLElement, html: string) {
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, _) => {
|
||||
let rootContainer = document.createElement("html")
|
||||
rootContainer.innerHTML = html.replace("<!DOCTYPE html>", "")
|
||||
|
||||
|
@ -14,7 +14,7 @@ export default class InfiniteScroller {
|
||||
}
|
||||
}
|
||||
|
||||
this.container.addEventListener("scroll", e => {
|
||||
this.container.addEventListener("scroll", _ => {
|
||||
// Wait for mutations to finish before checking if we need infinite scroll to trigger.
|
||||
if(Diff.mutations.mutations.length > 0) {
|
||||
Diff.mutations.wait(() => check())
|
||||
|
@ -44,7 +44,7 @@ export default class ServerEvents {
|
||||
}
|
||||
}
|
||||
|
||||
ping(e: ServerEvent) {
|
||||
ping(_: ServerEvent) {
|
||||
console.log("ping")
|
||||
}
|
||||
|
||||
|
@ -85,15 +85,18 @@ let excludeCache = new Set<string>([
|
||||
])
|
||||
|
||||
// onInstall
|
||||
async function onInstall(evt: InstallEvent) {
|
||||
async function onInstall(_: InstallEvent) {
|
||||
console.log("service worker install")
|
||||
|
||||
// Skip waiting for the old service worker to shutdown
|
||||
await self.skipWaiting()
|
||||
|
||||
// Install cache
|
||||
await installCache()
|
||||
}
|
||||
|
||||
// onActivate
|
||||
function onActivate(evt: any) {
|
||||
function onActivate(_: any) {
|
||||
console.log("service worker activate")
|
||||
|
||||
// Only keep current version of the cache and delete old caches
|
||||
@ -450,7 +453,7 @@ class MyClient {
|
||||
|
||||
// onDOMContentLoaded is called when the client sent this service worker
|
||||
// a message that the page has been loaded.
|
||||
onDOMContentLoaded(url: string) {
|
||||
onDOMContentLoaded(_: string) {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
@ -15,9 +15,7 @@ export default class ServiceWorkerManager {
|
||||
return
|
||||
}
|
||||
|
||||
navigator.serviceWorker.register(this.uri).then(registration => {
|
||||
// registration.update()
|
||||
})
|
||||
navigator.serviceWorker.register(this.uri)
|
||||
|
||||
navigator.serviceWorker.addEventListener("message", evt => {
|
||||
this.onMessage(evt)
|
||||
|
@ -8,7 +8,7 @@ export default class SideBar {
|
||||
constructor(element) {
|
||||
this.element = element
|
||||
|
||||
document.body.addEventListener("click", e => {
|
||||
document.body.addEventListener("click", _ => {
|
||||
if(document.activeElement && document.activeElement.id === "search") {
|
||||
return
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ export default class VideoPlayer {
|
||||
this.arn = arn
|
||||
}
|
||||
|
||||
play(video: HTMLVideoElement) {
|
||||
play(_: HTMLVideoElement) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,6 @@
|
||||
"strictFunctionTypes": false,
|
||||
"strictNullChecks": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": false
|
||||
"noUnusedParameters": true
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user