Whitespaces removed
This commit is contained in:
parent
05eb5c7abd
commit
ac7c78242f
@ -132,7 +132,7 @@ export class AnimeNotifier {
|
|||||||
|
|
||||||
// Infinite scrolling
|
// Infinite scrolling
|
||||||
this.infiniteScroller = new InfiniteScroller(this.app.content.parentElement, 100)
|
this.infiniteScroller = new InfiniteScroller(this.app.content.parentElement, 100)
|
||||||
|
|
||||||
// Loading
|
// Loading
|
||||||
this.loading(false)
|
this.loading(false)
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ export class AnimeNotifier {
|
|||||||
onContentLoaded() {
|
onContentLoaded() {
|
||||||
// Stop watching all the objects from the previous page.
|
// Stop watching all the objects from the previous page.
|
||||||
this.visibilityObserver.disconnect()
|
this.visibilityObserver.disconnect()
|
||||||
|
|
||||||
this.contentLoadedActions = Promise.all([
|
this.contentLoadedActions = Promise.all([
|
||||||
Promise.resolve().then(() => this.mountMountables()),
|
Promise.resolve().then(() => this.mountMountables()),
|
||||||
Promise.resolve().then(() => this.lazyLoad()),
|
Promise.resolve().then(() => this.lazyLoad()),
|
||||||
@ -205,9 +205,9 @@ export class AnimeNotifier {
|
|||||||
if(element.dataset.consumable !== "true") {
|
if(element.dataset.consumable !== "true") {
|
||||||
return this.statusMessage.showError(itemName + " is not a consumable item.")
|
return this.statusMessage.showError(itemName + " is not a consumable item.")
|
||||||
}
|
}
|
||||||
|
|
||||||
let apiEndpoint = this.findAPIEndpoint(element)
|
let apiEndpoint = this.findAPIEndpoint(element)
|
||||||
|
|
||||||
this.post(apiEndpoint + "/use/" + element.dataset.index, "")
|
this.post(apiEndpoint + "/use/" + element.dataset.index, "")
|
||||||
.then(() => this.reloadContent())
|
.then(() => this.reloadContent())
|
||||||
.then(() => this.statusMessage.showInfo(`You used ${itemName}.`))
|
.then(() => this.statusMessage.showInfo(`You used ${itemName}.`))
|
||||||
@ -241,7 +241,7 @@ export class AnimeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let fromElement = inventory.childNodes[fromIndex] as HTMLElement
|
let fromElement = inventory.childNodes[fromIndex] as HTMLElement
|
||||||
|
|
||||||
let toIndex = toElement.dataset.index
|
let toIndex = toElement.dataset.index
|
||||||
|
|
||||||
if(fromElement === toElement || fromIndex === toIndex) {
|
if(fromElement === toElement || fromIndex === toIndex) {
|
||||||
@ -250,13 +250,13 @@ export class AnimeNotifier {
|
|||||||
|
|
||||||
// Swap in database
|
// Swap in database
|
||||||
let apiEndpoint = this.findAPIEndpoint(inventory)
|
let apiEndpoint = this.findAPIEndpoint(inventory)
|
||||||
|
|
||||||
this.post(apiEndpoint + "/swap/" + fromIndex + "/" + toIndex, "")
|
this.post(apiEndpoint + "/swap/" + fromIndex + "/" + toIndex, "")
|
||||||
.catch(err => this.statusMessage.showError(err))
|
.catch(err => this.statusMessage.showError(err))
|
||||||
|
|
||||||
// Swap in UI
|
// Swap in UI
|
||||||
swapElements(fromElement, toElement)
|
swapElements(fromElement, toElement)
|
||||||
|
|
||||||
fromElement.dataset.index = toIndex
|
fromElement.dataset.index = toIndex
|
||||||
toElement.dataset.index = fromIndex
|
toElement.dataset.index = fromIndex
|
||||||
}, false)
|
}, false)
|
||||||
@ -281,7 +281,7 @@ export class AnimeNotifier {
|
|||||||
testButton.innerHTML = "Your browser doesn't support push notifications!"
|
testButton.innerHTML = "Your browser doesn't support push notifications!"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let subscription = await this.pushManager.subscription()
|
let subscription = await this.pushManager.subscription()
|
||||||
|
|
||||||
if(subscription) {
|
if(subscription) {
|
||||||
@ -402,7 +402,7 @@ export class AnimeNotifier {
|
|||||||
this.app.loading.classList.add(this.app.fadeOutClass)
|
this.app.loading.classList.add(this.app.fadeOutClass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assignActions() {
|
assignActions() {
|
||||||
for(let element of findAll("action")) {
|
for(let element of findAll("action")) {
|
||||||
let actionTrigger = element.dataset.trigger
|
let actionTrigger = element.dataset.trigger
|
||||||
@ -453,7 +453,7 @@ export class AnimeNotifier {
|
|||||||
case "IMG":
|
case "IMG":
|
||||||
this.lazyLoadImage(element as HTMLImageElement)
|
this.lazyLoadImage(element as HTMLImageElement)
|
||||||
break
|
break
|
||||||
|
|
||||||
case "IFRAME":
|
case "IFRAME":
|
||||||
this.lazyLoadIFrame(element as HTMLIFrameElement)
|
this.lazyLoadIFrame(element as HTMLIFrameElement)
|
||||||
break
|
break
|
||||||
@ -519,7 +519,7 @@ export class AnimeNotifier {
|
|||||||
modifyDelayed(className: string, func: (element: HTMLElement) => void) {
|
modifyDelayed(className: string, func: (element: HTMLElement) => void) {
|
||||||
const maxDelay = 1000
|
const maxDelay = 1000
|
||||||
const delay = 18
|
const delay = 18
|
||||||
|
|
||||||
let time = 0
|
let time = 0
|
||||||
let start = Date.now()
|
let start = Date.now()
|
||||||
let maxTime = start + maxDelay
|
let maxTime = start + maxDelay
|
||||||
@ -597,7 +597,7 @@ export class AnimeNotifier {
|
|||||||
.then(response => {
|
.then(response => {
|
||||||
return response.text()
|
return response.text()
|
||||||
})
|
})
|
||||||
|
|
||||||
history.pushState(url, null, url)
|
history.pushState(url, null, url)
|
||||||
this.app.currentPath = url
|
this.app.currentPath = url
|
||||||
this.app.markActiveLinks()
|
this.app.markActiveLinks()
|
||||||
@ -651,7 +651,7 @@ export class AnimeNotifier {
|
|||||||
const interval = duration / steps
|
const interval = duration / steps
|
||||||
const fullSin = Math.PI / 2
|
const fullSin = Math.PI / 2
|
||||||
const contentPadding = 24
|
const contentPadding = 24
|
||||||
|
|
||||||
let scrollHandle: number
|
let scrollHandle: number
|
||||||
let oldScroll = this.app.content.parentElement.scrollTop
|
let oldScroll = this.app.content.parentElement.scrollTop
|
||||||
let newScroll = 0
|
let newScroll = 0
|
||||||
@ -735,11 +735,11 @@ export class AnimeNotifier {
|
|||||||
if("blur" in activeElement) {
|
if("blur" in activeElement) {
|
||||||
activeElement["blur"]()
|
activeElement["blur"]()
|
||||||
}
|
}
|
||||||
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user