This commit is contained in:
myw
2026-07-16 16:53:38 +08:00 Unverified
parent 6b44647d4e
commit d8942c236a
22 changed files with 263 additions and 240 deletions
+5 -5
View File
@@ -44,7 +44,7 @@ script.
}
}
}
btf.addGlobalFn('pjaxSendOnce', () => { typed.destroy() }, 'typedDestroy')
btf.addGlobalFn('pjaxSendOnce', () => { typed && typed.destroy() }, 'typedDestroy')
case source
when 1
@@ -53,8 +53,8 @@ case source
fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
const from = '出自 ' + data.from
typedJSFn.processSubtitle(data.hitokoto, [from])
const from = data.from ? '出自 ' + data.from : ''
typedJSFn.processSubtitle(data.hitokoto, from ? [from] : [])
})
.catch(err => {
console.error('Failed to get the Hitokoto API:', err)
@@ -79,7 +79,7 @@ case source
})
.catch(err => {
console.error('Failed to get the Yiyan API:', err)
typedJSFn.processSubtitle(!{JSON.stringify(subContent.length)})
typedJSFn.processSubtitle(!{JSON.stringify(subContent)})
})
}
typedJSFn.run(subtitleType)
@@ -99,7 +99,7 @@ case source
})
.catch(err => {
console.error('Failed to get the Jinrishici API:', err)
typedJSFn.processSubtitle(!{JSON.stringify(subContent.length)})
typedJSFn.processSubtitle(!{JSON.stringify(subContent)})
})
}
typedJSFn.run(subtitleType)