XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Update highlightjs-copy.min.js

75e9a237
foxfire52 <foxfire52@virgilio.it>
提交于

代码差异

1 个文件 +4 -6
Modified g4f/gui/client/static/js/highlightjs-copy.min.js +4 -6
@@ -16,16 +16,14 @@ class CopyButtonPlugin {
16 16 el.parentElement.appendChild(button);
17 17 el.parentElement.style.setProperty("--hljs-theme-background", window.getComputedStyle(el).backgroundColor);
18 18 button.onclick = async () => {
19 if (!navigator.clipboard) {
20 console.error("navigator.clipboard: Clipboard API unavailable.")
21 return;
22 }
23 19 let newText = text;
24 20 if (hook && typeof hook === "function") {
25 21 newText = hook(text, el) || text
26 22 }
27
28 try {
23 try {
24 if (!navigator.clipboard) {
25 throw new Error("navigator.clipboard: Clipboard API unavailable.");
26 }
29 27 await navigator.clipboard.writeText(newText);
30 28 } catch (e) {
31 29 console.error(e);