nzbGeekFilter

Adds a result filter to the top of the results list. This filter is used to show/hide items from the list that exists on the current web page. It will only filter what is on the page locally client side. Default is to show any items that match the typed text, use the INVERT switch to instead hide items that match the typed text. Also defaults to being case insensitive, use the CASE SENSITIVE switch to for sensitivity.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name     		nzbGeekFilter
// @namespace		turtle1980.com
// @version  		0.1
// @match    		https://www.nzbgeek.info/geekseek.php*
// @grant    		none
// @description	Adds a result filter to the top of the results list. This filter is used to show/hide items from the list that exists on the current web page. It will only filter what is on the page locally client side. Default is to show any items that match the typed text, use the INVERT switch to instead hide items that match the typed text. Also defaults to being case insensitive, use the CASE SENSITIVE switch to for sensitivity.
// ==/UserScript==

const inputId = "nzbGeekFilter_txt"
let caseSensitive = false
let invert = false
let val = ""


document.querySelector("#multisubmit").insertAdjacentHTML("beforebegin", `
<div style="color: #888; font-weight: 700; display: flex; column-gap: 30px; row-gap: 5px; flex-wrap: wrap; align-items: center; font-family: Verdana, Arial, Sans-Serif; width:100%; max-width:100vw; box-sizing:border-box;">
	<div style="color: #CCC; font-weight: 900">
  	Result Filter
  </div>
	<div>
  	<label for="${inputId}_invert">Invert</label>
    <input type="checkbox" id="${inputId}_invert" />
    <label for="${inputId}_case">Case Sensitive</label>
    <input type="checkbox" id="${inputId}_case" />
  </div>
	<div>
  	<input id="${inputId}" class="nav_search_input" />
    <button id="${inputId}_rst" class="geekseek_button">Clear</button>
  </div>
</div>
`)

function resetView() {
	document.querySelectorAll(`table.releases`).forEach(r => {
    r.style.display = "table"
  })
}


function updateView() {
  resetView()
  if(document.getElementById(inputId)?.value.length > 0) {
    document.querySelectorAll(`table.releases`).forEach(r => {
      if(caseSensitive) {
        if(r.querySelector(`.releases_title`)?.text?.includes(val)) {
          r.style.display = invert ? "none" : "table"
        } else {
          r.style.display = invert ? "table" : "none"
        }
      } else {
        if(r.querySelector(`.releases_title`)?.text?.toLocaleLowerCase().includes(val.toLocaleLowerCase())) {
          r.style.display = invert ? "none" : "table"
        } else {
          r.style.display = invert ? "table" : "none"
        }
      }
    })
  }
}


document.getElementById(inputId)?.addEventListener("input", async e => {
  if(e.target.value.length > 0) {
    val = e.target.value
  } else {
    val = ""
  }
  updateView()
})


document.getElementById(inputId + "_rst")?.addEventListener("click", async e => {
  document.getElementById(inputId).value = val = ""
  resetView()
})

document.getElementById(inputId + "_invert")?.addEventListener("change", async e => {
  invert = document.getElementById(inputId + "_invert").checked
  updateView()
})

document.getElementById(inputId + "_case")?.addEventListener("change", async e => {
  caseSensitive = document.getElementById(inputId + "_case").checked
  updateView()
})