Improved the comments plug-in load function, close #12

This commit is contained in:
凡梦星尘
2022-07-13 21:25:15 +08:00
parent bf55ada93c
commit 81cff8a5c2
50 changed files with 405 additions and 326 deletions

19
static/js/third-party/chat/chatra.js vendored Normal file
View File

@@ -0,0 +1,19 @@
/* global CONFIG, Chatra */
(function() {
if (CONFIG.chatra.embed) {
window.ChatraSetup = {
mode : 'frame',
injectTo: CONFIG.chatra.embed
};
}
window.ChatraID = CONFIG.chatra.id;
const chatButton = document.querySelector('.sidebar-button button');
if (chatButton) {
chatButton.addEventListener('click', () => {
Chatra('openChat', true);
});
}
})();

5
static/js/third-party/chat/gitter.js vendored Normal file
View File

@@ -0,0 +1,5 @@
/* global CONFIG */
((window.gitter = {}).chat = {}).options = {
room: CONFIG.gitter.room
};

10
static/js/third-party/chat/tidio.js vendored Normal file
View File

@@ -0,0 +1,10 @@
/* global tidioChatApi */
(function() {
const chatButton = document.querySelector('.sidebar-button button');
if (chatButton) {
chatButton.addEventListener('click', () => {
tidioChatApi.open();
});
}
})();