Merge pull request #1812 from jerryc127/revert-1811-feat/knocket-chat

Revert "Add Knocket as a free live chat option (alongside Chatra/Tidio/Crisp)"
This commit is contained in:
Jerry Wong
2026-07-14 14:50:04 +08:00
committed by GitHub
Unverified
4 changed files with 2 additions and 55 deletions
+1 -5
View File
@@ -659,7 +659,7 @@ artalk:
# --------------------------------------
chat:
# Choose: chatra/tidio/crisp/knocket
# Choose: chatra/tidio/crisp
# Leave it empty if you don't need chat
use:
# Chat Button [recommend]
@@ -680,10 +680,6 @@ tidio:
crisp:
website_id:
# https://trtc.io/solutions/knocket
knocket:
identifier:
# --------------------------------------
# Analysis
# --------------------------------------
-2
View File
@@ -5,5 +5,3 @@ case theme.chat.use
include ./tidio.pug
when 'crisp'
include ./crisp.pug
when 'knocket'
include ./knocket.pug
-44
View File
@@ -1,44 +0,0 @@
//- Knocket live chat — https://trtc.io/solutions/knocket
script.
(() => {
const id = '#{theme.knocket.identifier}'
if (!id) return
btf.getScript(`https://trtc.io/knocket-sdk/sdk.js?identifier=${id}`).then(() => {
const isChatBtn = !{theme.chat.rightside_button}
const isChatHideShow = !{theme.chat.button_hide_show}
const getWidget = () => document.getElementById('contact-widget-auto')
if (isChatBtn) {
const hide = () => { const w = getWidget(); if (w) w.style.display = 'none' }
const show = () => { const w = getWidget(); if (w) w.style.display = '' }
// Hide the native Knocket floating button
const observer = new MutationObserver(() => {
if (getWidget()) { hide(); observer.disconnect() }
})
observer.observe(document.body, { childList: true, subtree: true })
hide()
window.chatBtnFn = () => {
const w = getWidget()
if (!w) return
if (w.style.display === 'none') show()
else hide()
}
document.getElementById('chat-btn').style.display = 'block'
} else if (isChatHideShow) {
const observer = new MutationObserver(() => {
if (getWidget()) observer.disconnect()
})
observer.observe(document.body, { childList: true, subtree: true })
window.chatBtn = {
hide: () => { const w = getWidget(); if (w) w.style.display = 'none' },
show: () => { const w = getWidget(); if (w) w.style.display = '' }
}
}
})
})()
-3
View File
@@ -394,9 +394,6 @@ module.exports = {
crisp: {
website_id: null
},
knocket: {
identifier: null
},
google_tag_manager: {
tag_id: null,
domain: 'https://www.googletagmanager.com'