Refactor scripts

This commit is contained in:
2019-11-18 11:04:13 +09:00
parent 7e25ee6faf
commit 1ddcd4d570
33 changed files with 670 additions and 749 deletions

View File

@ -1,6 +1,7 @@
import Diff from "scripts/Diff"
import delay from "scripts/Utils/delay"
import requestIdleCallback from "scripts/Utils/requestIdleCallback"
import AnimeNotifier from "../AnimeNotifier"
import { delay, requestIdleCallback } from "../Utils"
import Diff from "scripts/Diff";
// Search page reference
let emptySearchHTML = ""
@ -111,7 +112,7 @@ export async function search(arn: AnimeNotifier, search: HTMLInputElement, evt?:
searchPageTitle.textContent = document.title
if(!term || term.length < 1) {
await arn.innerHTML(searchPage, emptySearchHTML)
await Diff.innerHTML(searchPage, emptySearchHTML)
arn.app.emit("DOMContentLoaded")
return
}
@ -168,7 +169,7 @@ function showResponseInElement(arn: AnimeNotifier, url: string, typeName: string
correctResponseRendered[typeName] = true
}
await arn.innerHTML(element, html)
await Diff.innerHTML(element, html)
arn.onNewContent(element)
}
}