您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds filters to show/hide whole crime scenario cards by level on Torn's faction crimes page with persistent settings and position
当前为
// ==UserScript== // @name Torn Crime Scenario Filter with Level // @namespace http://tampermonkey.net/ // @version 1.5 // @description Adds filters to show/hide whole crime scenario cards by level on Torn's faction crimes page with persistent settings and position // @match https://www.torn.com/factions.php* // @grant none // @license MIT // ==/UserScript== /* Previous code remains the same until the updateFilters function */ // Only showing the modified updateFilters function for clarity function updateFilters() { const showCheckbox = document.getElementById('crimeFilterCheckbox'); const levelInput = document.getElementById('minCrimeLevelInput'); const shouldApplyFilter = showCheckbox.checked; const minLevel = parseInt(levelInput.value, 10) || 1; // Save filter settings saveSettings({ show: shouldApplyFilter, level: minLevel }); // Update status text const statusEl = document.getElementById('filterStatus'); let visibleCount = 0; let totalCount = 0; document.querySelectorAll('.wrapper___U2Ap7').forEach(card => { const levelEl = card.querySelector('.level___sBl49'); totalCount++; if (!shouldApplyFilter) { // Show all cards when filter is disabled card.style.display = ''; visibleCount++; } else if (levelEl) { // Apply level filter only when filter is enabled const text = levelEl.textContent.trim(); const parts = text.split('/'); const level = parseInt(parts[0], 10) || 0; if (level >= minLevel) { card.style.display = ''; visibleCount++; } else { card.style.display = 'none'; } } else { // For cards without level info, show them when filter is enabled card.style.display = ''; visibleCount++; } }); // Update status text with more descriptive message if (!shouldApplyFilter) { statusEl.textContent = `Showing all ${totalCount} crimes (filter disabled)`; } else { statusEl.textContent = `Showing ${visibleCount} of ${totalCount} crimes (min level: ${minLevel})`; } } /* Rest of the code remains the same */
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址