|
|
|
@ -43,6 +43,7 @@ export default {
|
|
|
|
|
pronunciationConverter: null,
|
|
|
|
|
|
|
|
|
|
customStyleElement, // 仅用于样式生成器中预览样式
|
|
|
|
|
presetCssLinkElement: null,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
@ -92,6 +93,9 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.head.removeChild(this.customStyleElement)
|
|
|
|
|
if (this.presetCssLinkElement) {
|
|
|
|
|
document.head.removeChild(this.presetCssLinkElement)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onVisibilityChange() {
|
|
|
|
@ -110,6 +114,12 @@ export default {
|
|
|
|
|
this.pronunciationConverter = new pronunciation.PronunciationConverter()
|
|
|
|
|
this.pronunciationConverter.loadDict(this.config.giftUsernamePronunciation)
|
|
|
|
|
}
|
|
|
|
|
if (this.config.importPresetCss) {
|
|
|
|
|
this.presetCssLinkElement = document.createElement('link')
|
|
|
|
|
this.presetCssLinkElement.rel = 'stylesheet'
|
|
|
|
|
this.presetCssLinkElement.href = '/custom_public/preset.css'
|
|
|
|
|
document.head.appendChild(this.presetCssLinkElement)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// 其他初始化就不用等了,就算失败了也不会有很大影响
|
|
|
|
@ -159,6 +169,8 @@ export default {
|
|
|
|
|
|
|
|
|
|
cfg.relayMessagesByServer = toBool(cfg.relayMessagesByServer)
|
|
|
|
|
cfg.autoTranslate = toBool(cfg.autoTranslate)
|
|
|
|
|
cfg.importPresetCss = toBool(cfg.importPresetCss)
|
|
|
|
|
|
|
|
|
|
cfg.emoticons = this.toObjIfJson(cfg.emoticons)
|
|
|
|
|
|
|
|
|
|
chatConfig.sanitizeConfig(cfg)
|
|
|
|
|