Upload 2 files
Browse files- static/app.js +11 -0
- static/index.html +1 -0
static/app.js
CHANGED
|
@@ -196,6 +196,9 @@ function updateSelectionUI() {
|
|
| 196 |
var count = Object.keys(selectedIndices).length;
|
| 197 |
DOM.multiSelectedCount.textContent = count > 0 ? "已选 " + count + " 项" : "";
|
| 198 |
DOM.multiActionBar.style.display = DOM.multiSelectToggle.checked ? "" : "none";
|
|
|
|
|
|
|
|
|
|
| 199 |
if (DOM.multiSelectToggle.checked) {
|
| 200 |
document.body.classList.add("multiselect");
|
| 201 |
} else {
|
|
@@ -280,6 +283,7 @@ function cacheDOM() {
|
|
| 280 |
DOM.multiCopyLinks = $("#multi-copy-links");
|
| 281 |
DOM.multiBatchDownload = $("#multi-batch-download");
|
| 282 |
DOM.multiZipDownload = $("#multi-zip-download");
|
|
|
|
| 283 |
DOM.multiSelectedCount = $("#multi-selected-count");
|
| 284 |
DOM.multiDeselect = $("#multi-deselect");
|
| 285 |
}
|
|
@@ -1404,6 +1408,7 @@ function applyMobileMode() {
|
|
| 1404 |
}
|
| 1405 |
updateSidebarVisibility();
|
| 1406 |
if (DOM.sidebarExpandBtn) DOM.sidebarExpandBtn.style.display = (STATE.mode === "repo" && !STATE.isMobile) ? "" : "none";
|
|
|
|
| 1407 |
}
|
| 1408 |
function autoDetectMobile() { return window.innerWidth <= 768; }
|
| 1409 |
|
|
@@ -1710,6 +1715,12 @@ async function init() {
|
|
| 1710 |
updateSelectionUI();
|
| 1711 |
});
|
| 1712 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1713 |
DOM.hamburgerBtn.addEventListener("click", toggleLeftSidebar);
|
| 1714 |
DOM.settingsBtn.addEventListener("click", toggleRightSidebar);
|
| 1715 |
DOM.closeFiltersBtn.addEventListener("click", () => { STATE.rightSidebarOpen = false; updateSidebarVisibility(); });
|
|
|
|
| 196 |
var count = Object.keys(selectedIndices).length;
|
| 197 |
DOM.multiSelectedCount.textContent = count > 0 ? "已选 " + count + " 项" : "";
|
| 198 |
DOM.multiActionBar.style.display = DOM.multiSelectToggle.checked ? "" : "none";
|
| 199 |
+
if (DOM.multiSelectAll) DOM.multiSelectAll.style.display = DOM.multiSelectToggle.checked ? "" : "none";
|
| 200 |
+
if (DOM.multiCopyLinks) DOM.multiCopyLinks.textContent = STATE.isMobile ? "复制" : "复制链接";
|
| 201 |
+
if (DOM.multiDeselect) DOM.multiDeselect.textContent = STATE.isMobile ? "取消" : "取消选择";
|
| 202 |
if (DOM.multiSelectToggle.checked) {
|
| 203 |
document.body.classList.add("multiselect");
|
| 204 |
} else {
|
|
|
|
| 283 |
DOM.multiCopyLinks = $("#multi-copy-links");
|
| 284 |
DOM.multiBatchDownload = $("#multi-batch-download");
|
| 285 |
DOM.multiZipDownload = $("#multi-zip-download");
|
| 286 |
+
DOM.multiSelectAll = $("#multi-select-all");
|
| 287 |
DOM.multiSelectedCount = $("#multi-selected-count");
|
| 288 |
DOM.multiDeselect = $("#multi-deselect");
|
| 289 |
}
|
|
|
|
| 1408 |
}
|
| 1409 |
updateSidebarVisibility();
|
| 1410 |
if (DOM.sidebarExpandBtn) DOM.sidebarExpandBtn.style.display = (STATE.mode === "repo" && !STATE.isMobile) ? "" : "none";
|
| 1411 |
+
updateSelectionUI();
|
| 1412 |
}
|
| 1413 |
function autoDetectMobile() { return window.innerWidth <= 768; }
|
| 1414 |
|
|
|
|
| 1715 |
updateSelectionUI();
|
| 1716 |
});
|
| 1717 |
|
| 1718 |
+
if (DOM.multiSelectAll) DOM.multiSelectAll.addEventListener("click", () => {
|
| 1719 |
+
for (var si = 0; si < STATE.results.length; si++) selectedIndices[si] = true;
|
| 1720 |
+
lastSelectedIndex = STATE.results.length > 0 ? STATE.results.length - 1 : -1;
|
| 1721 |
+
updateSelectionUI();
|
| 1722 |
+
});
|
| 1723 |
+
|
| 1724 |
DOM.hamburgerBtn.addEventListener("click", toggleLeftSidebar);
|
| 1725 |
DOM.settingsBtn.addEventListener("click", toggleRightSidebar);
|
| 1726 |
DOM.closeFiltersBtn.addEventListener("click", () => { STATE.rightSidebarOpen = false; updateSidebarVisibility(); });
|
static/index.html
CHANGED
|
@@ -112,6 +112,7 @@
|
|
| 112 |
<input type="checkbox" id="multi-select-toggle">
|
| 113 |
<span>多选</span>
|
| 114 |
</label>
|
|
|
|
| 115 |
<span id="did-you-mean" class="did-you-mean"></span>
|
| 116 |
</div>
|
| 117 |
<div class="status-right">
|
|
|
|
| 112 |
<input type="checkbox" id="multi-select-toggle">
|
| 113 |
<span>多选</span>
|
| 114 |
</label>
|
| 115 |
+
<button id="multi-select-all" class="text-btn" style="display:none">全选</button>
|
| 116 |
<span id="did-you-mean" class="did-you-mean"></span>
|
| 117 |
</div>
|
| 118 |
<div class="status-right">
|