From 12a03f524afc322a8436c1d3320ecac421614fdd Mon Sep 17 00:00:00 2001
From: "Q.A.zh" <40236765+QAbot-zh@users.noreply.github.com>
Date: Thu, 8 Jan 2026 08:29:03 +0000
Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=20ui=20=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=EF=BC=9A=20=E6=9B=B4=E6=96=B0=E5=9B=BE=E6=A0=87=E9=A2=9C?=
=?UTF-8?q?=E8=89=B2=E4=BB=A5=E9=80=82=E5=BA=94=E6=9A=97=E8=89=B2=E4=B8=BB?=
=?UTF-8?q?=E9=A2=98=EF=BC=9B=20=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=A4=8D?=
=?UTF-8?q?=E5=9B=BE=E6=A0=87=E9=97=AE=E9=A2=98=EF=BC=9B=20=E5=85=B3?=
=?UTF-8?q?=E9=97=AD=E5=BC=B9=E7=AA=97=E7=9A=84=E6=96=87=E6=A1=88=E6=8F=90?=
=?UTF-8?q?=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Overleaf-Bib-Helper.js | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/Overleaf-Bib-Helper.js b/Overleaf-Bib-Helper.js
index 16d65a6..8d7d0a7 100644
--- a/Overleaf-Bib-Helper.js
+++ b/Overleaf-Bib-Helper.js
@@ -34,7 +34,12 @@
})();
function injectScript() {
+ // 实际注入前再检查一遍图标,避免异步注入导致出现两个图标
waitUtil('div.ol-cm-toolbar-button-group.ol-cm-toolbar-end', el => {
+ if (document.getElementById('toggleIcon')) {
+ return;
+ }
+
let iconBox = createToggleIcon();
el.appendChild(iconBox);
@@ -215,7 +220,8 @@ function createToggleIcon() {
iconBox.style.justifyContent = 'center';
iconBox.style.alignItems = 'center';
iconBox.id = "toggleIcon";
- iconBox.innerHTML = '';
+ iconBox.title = "Overleaf Bib Helper (点击打开/关闭搜索)";
+ iconBox.innerHTML = '';
return iconBox;
}
@@ -225,6 +231,13 @@ function createBox() {
box.style = 'width:300px;background:#eef;padding:10px;border:1px solid #ccc;border-radius:5px;position:absolute;display:none;top:0px;left:0px';
box.innerHTML = `