MCPcopy Create free account
hub / github.com/ChinaGodMan/UserScripts / toggleSelectAll

Function toggleSelectAll

missav-explorer/missav-explorer.user.js:2291–2307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2289 })
2290 //选中全部
2291 function toggleSelectAll() {
2292 const checkboxes = document.querySelectorAll('input[name="fileCheckbox"]')
2293 const allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked)
2294
2295 checkboxes.forEach(checkbox => {
2296 checkbox.checked = !allChecked
2297 })
2298
2299 // 切换按钮文本和背景颜色
2300 if (allChecked) {
2301 selectAllButton.textContent = '全部选中'
2302 selectAllButton.style.backgroundColor = '' // 恢复默认背景颜色
2303 } else {
2304 selectAllButton.textContent = '全部取消选中'
2305 selectAllButton.style.backgroundColor = 'red' // 改为红色背景
2306 }
2307 }
2308 //搜索
2309 //---------------
2310 function toggleSearch() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected