Starting theme support

This commit is contained in:
booploops 2022-02-02 21:33:52 -08:00
parent c3b392abce
commit 09b8960038
6 changed files with 65 additions and 11 deletions

View file

@ -586,6 +586,7 @@ const app = new Vue({
},
async init() {
let self = this
this.setTheme()
this.setLz(this.cfg.general.language)
this.setLzManual()
clearTimeout(this.hangtimer)
@ -840,6 +841,18 @@ const app = new Vue({
this.$forceUpdate()
}, 500)
},
setTheme(theme = "") {
if(this.cfg.visual.theme == "") {
this.cfg.visual.theme = "default.less"
}
if(theme == ""){
theme = this.cfg.visual.theme
}else{
this.cfg.visual.theme = theme
}
document.querySelector("#userTheme").href = `themes/${this.cfg.visual.theme}`
document.querySelectorAll(`[id*='less']`).forEach(el => { el.remove() });less.refresh()
},
unauthorize() {
this.mk.unauthorize()
document.location.reload()