More formatting fixes

This commit is contained in:
Your New SJW Waifu 2019-10-08 10:45:06 -05:00
parent a28a5c67c4
commit 22925bdb1f
1 changed files with 8 additions and 10 deletions

View File

@ -1,15 +1,14 @@
const Banner = {
data: function () {
return {
url: "https://neckbeard.xyz",
imageUrl: "/static/banner.png",
imageSrc: "/static/banner.png",
url: 'https://neckbeard.xyz',
imageUrl: '/static/banner.png',
imageSrc: '/static/banner.png',
timer: ''
}
},
created () {
this.updateBanner ()
this.timer = setInterval(this.updateBanner, 300000)
this.updateBanner () this.timer = setInterval(this.updateBanner, 300000)
},
beforeDestroy () {
clearInterval(this.timer)
@ -18,17 +17,16 @@ const Banner = {
updateBanner () {
const componentThis = this
const req = new XMLHttpRequest()
req.addEventListener ("load", function () {
req.addEventListener ('load', function () {
const json = JSON.parse (this.responseText)
componentThis.url = json.bannerUrl
console.log("new banner: " + componentThis.url)
componentThis.imageSrc = componentThis.imageUrl + '?bustcache='+(new Date()).getTime()
console.log('new banner: ' + componentThis.url)
componentThis.imageSrc = componentThis.imageUrl + '?bustcache=' + (new Date()).getTime()
})
req.open("GET", "/static/config.json")
req.open('GET', '/static/config.json')
req.send()
}
}
}
export default Banner