chore: bump version to v0.9.60 and update widget tooltip parameters

This commit is contained in:
haorwen
2026-03-13 23:27:18 +08:00
committed by cnb
parent f439c5650a
commit 67782712e2
8 changed files with 42 additions and 42 deletions
+6 -6
View File
@@ -14,17 +14,17 @@
logo = "",
position = "right",
welcome = "",
iconTitle = "Need help?",
iconSubtitle = "Our staff are always ready to help!",
iconImage = "",
iconClosable = "true"
popupTitle = "Need help?",
popupSubtitle = "Our staff are always ready to help!",
popupImage = "",
popupClosable = "true"
} = d.currentScript.dataset;
const _src = d.currentScript.src;
const wrapper = d.createElement("iframe");
wrapper.id = "VOCECHAT_WIDGET";
// 如果有提示框内容,关闭状态的宽度和高度需要更大
const hasTooltip = iconTitle || iconSubtitle;
const hasTooltip = popupTitle || popupSubtitle;
const actualCloseWidth = hasTooltip ? 320 : closeWidth;
const actualCloseHeight = hasTooltip ? 120 : closeHeight;
@@ -43,7 +43,7 @@
new URL(_src).origin
}/widget.html?id=${id}&host=${hostId}&autoReg=${autoReg}&token=${loginToken}&themeColor=${encodeURIComponent(
themeColor
)}&from=${encodeURIComponent(location.hostname)}&welcome=${encodeURIComponent(welcome)}&title=${encodeURIComponent(title)}&logo=${encodeURIComponent(logo)}&iconTitle=${encodeURIComponent(iconTitle)}&iconSubtitle=${encodeURIComponent(iconSubtitle)}&iconImage=${encodeURIComponent(iconImage)}&iconClosable=${iconClosable}`;
)}&from=${encodeURIComponent(location.hostname)}&welcome=${encodeURIComponent(welcome)}&title=${encodeURIComponent(title)}&logo=${encodeURIComponent(logo)}&popupTitle=${encodeURIComponent(popupTitle)}&popupSubtitle=${encodeURIComponent(popupSubtitle)}&popupImage=${encodeURIComponent(popupImage)}&popupClosable=${popupClosable}`;
wrapper.width = actualCloseWidth;
wrapper.height = actualCloseHeight;
wrapper.frameborder = 0;