|
|
@@ -28,11 +28,43 @@
|
|
|
<script src="//code.tidio.co/kguf93rbmc3c9icmkbgbh3akvjznunfo.js" async></script>
|
|
|
<script src="./jquery-3.6.1.min.js"></script>
|
|
|
<script>
|
|
|
+ function onTidioChatApiReady() {
|
|
|
+ $("#tidio-chat-iframe").ready(function () {
|
|
|
+ console.log('tidio-chat-iframe open')
|
|
|
+ var head = $("#tidio-chat-iframe").contents().find("head");
|
|
|
+ head.append($('<meta name="color-scheme" content="dark">'));
|
|
|
+ head.append($('<style>textarea {color: black; background: white;}</style>'));
|
|
|
+ });
|
|
|
+
|
|
|
+ window.tidioChatApi.hide()
|
|
|
+ window.tidioChatApi.on('close', function () {
|
|
|
+ window.tidioChatApi.hide()
|
|
|
+ })
|
|
|
+
|
|
|
+ window.tidioChatApi.on('open', function () {
|
|
|
+ console.log('open')
|
|
|
+ setTimeout(() => {
|
|
|
+ $("#tidio-chat-iframe").ready(function () {
|
|
|
+ console.log('tidio-chat-iframe open')
|
|
|
+ var head = $("#tidio-chat-iframe").contents().find("head");
|
|
|
+ head.append($('<meta name="color-scheme" content="dark">'));
|
|
|
+ head.append($('<style>textarea {color: black; background: white;}</style>'));
|
|
|
+ });
|
|
|
+ }, 500);
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (window.tidioChatApi) {
|
|
|
+ window.tidioChatApi.on('ready', onTidioChatApiReady)
|
|
|
+ } else {
|
|
|
+ document.addEventListener('tidioChat-ready', onTidioChatApiReady)
|
|
|
+ }
|
|
|
$("#s-chat-plugin").ready(function () {
|
|
|
var head = $("#s-chat-plugin").contents().find("head");
|
|
|
- head.append($('<meta name="color-scheme" content="dark">'));
|
|
|
- head.append($('<style>textarea {color: black; background: white;}</style>'));
|
|
|
+ head.append($('<meta name="color-scheme" content="dark">'));
|
|
|
+ head.append($('<style>textarea {color: black; background: white;}</style>'));
|
|
|
});
|
|
|
+
|
|
|
</script>
|
|
|
</body>
|
|
|
|