no message

This commit is contained in:
yinjun.chen1
2026-09-15 11:27:20 +08:00
parent 0773da941d
commit ebcd21587f
3 changed files with 18 additions and 10 deletions
+3 -3
View File
@@ -226,8 +226,8 @@ h2 {
border: 1px solid #0f3460; border: 1px solid #0f3460;
border-radius: 6px; border-radius: 6px;
padding: 0 2px; padding: 0 2px;
width: 190px; width: 220px;
height: 24px; height: 22px;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
} }
@@ -757,7 +757,7 @@ h2 {
} }
.btn-io { .btn-io {
padding: 4px 10px; padding: 4px 1px;
background: transparent; background: transparent;
border: none; border: none;
border-radius: 6px; border-radius: 6px;
+3 -3
View File
@@ -130,8 +130,8 @@
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg> <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
</button> </button>
<div id="searchBox" class="search-box-inline" hidden> <div id="searchBox" class="search-box-inline" hidden>
<input type="text" id="searchInput" data-i18n-placeholder="searchPlaceholder" placeholder="搜索域名 / 用户名 / 别名"> <input type="text" id="searchInput" data-i18n-placeholder="searchPlaceholder" placeholder="搜索域名/用户名/别名">
<button type="button" id="searchClear" class="search-clear" title="清除">×</button> <button type="button" id="searchClear" class="search-clear" title="清除" hidden>×</button>
<button type="button" id="searchToggleBtn" class="btn-io btn-icon" data-i18n-title="searchBtnTitle" title="搜索"> <button type="button" id="searchToggleBtn" class="btn-io btn-icon" data-i18n-title="searchBtnTitle" title="搜索">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg> <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
</button> </button>
@@ -154,7 +154,7 @@
</section> </section>
<footer class="footer"> <footer class="footer">
<p class="powered-by" data-i18n="poweredBy">power by chenxuan</p> <p class="powered-by"><span data-i18n="poweredBy">power by chenxuan</span> <span id="versionLabel">v1.0.0</span></p>
</footer> </footer>
</div> </div>
+12 -4
View File
@@ -43,6 +43,9 @@ document.addEventListener("DOMContentLoaded", () => {
applyI18n(); applyI18n();
const versionLabel = $("versionLabel");
if (versionLabel) versionLabel.textContent = "v" + chrome.runtime.getManifest().version;
const domainInput = $("domain"); const domainInput = $("domain");
const aliasInput = $("alias"); const aliasInput = $("alias");
const usernameInput = $("username"); const usernameInput = $("username");
@@ -664,10 +667,12 @@ document.addEventListener("DOMContentLoaded", () => {
exportBtn.disabled = isEmpty; exportBtn.disabled = isEmpty;
exportBtn.classList.toggle("btn-disabled", isEmpty); exportBtn.classList.toggle("btn-disabled", isEmpty);
const parent = addSection.parentElement; const parent = addSection.parentElement;
if (isEmpty) { const addIdx = Array.prototype.indexOf.call(parent.children, addSection);
if (parent.children[0] !== addSection) parent.insertBefore(addSection, listSection); const listIdx = Array.prototype.indexOf.call(parent.children, listSection);
} else { if (isEmpty && addIdx > listIdx) {
if (parent.children[0] !== listSection) parent.insertBefore(listSection, addSection); parent.insertBefore(addSection, listSection);
} else if (!isEmpty && listIdx > addIdx) {
parent.insertBefore(listSection, addSection);
} }
if (isEmpty) { if (isEmpty) {
@@ -937,6 +942,7 @@ document.addEventListener("DOMContentLoaded", () => {
searchToggleBtn.addEventListener("click", () => { searchToggleBtn.addEventListener("click", () => {
searchInput.value = ""; searchInput.value = "";
searchKeyword = ""; searchKeyword = "";
searchClear.hidden = true;
searchBox.hidden = true; searchBox.hidden = true;
searchBtn.hidden = false; searchBtn.hidden = false;
renderConfigList(); renderConfigList();
@@ -945,6 +951,7 @@ document.addEventListener("DOMContentLoaded", () => {
// 搜索输入:实时过滤 // 搜索输入:实时过滤
searchInput.addEventListener("input", () => { searchInput.addEventListener("input", () => {
searchKeyword = searchInput.value; searchKeyword = searchInput.value;
searchClear.hidden = !searchKeyword;
renderConfigList(); renderConfigList();
}); });
@@ -952,6 +959,7 @@ document.addEventListener("DOMContentLoaded", () => {
searchClear.addEventListener("click", () => { searchClear.addEventListener("click", () => {
searchInput.value = ""; searchInput.value = "";
searchKeyword = ""; searchKeyword = "";
searchClear.hidden = true;
renderConfigList(); renderConfigList();
searchInput.focus(); searchInput.focus();
}); });