您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
add a field beside the search button to search all terms and an option to search within posts https://cs.rin.ru/forum/viewtopic.php?f=14&t=134386
// ==UserScript== // @name cs.rin.ru quick search all terms // @namespace none // @version 1 // @description add a field beside the search button to search all terms and an option to search within posts https://cs.rin.ru/forum/viewtopic.php?f=14&t=134386 // @author odusi // @match https://cs.rin.ru/forum/* // @icon none // @grant none // ==/UserScript== /* Search within all = Post subjects and message text. msgonly = Message text only. titleonly = Topic titles only. topics = First post of topics only */ let sf = 'titleonly' /* Sort results by a = author. t = post time. f = forum. i = topic title. s = post subject */ const sk = 't' const sd = 'd' // Sort results by: a = ascending. d = descending const sr = 'topics' // Display results as: topics, posts const ch = 300; // Return first # characters of posts document.querySelector("#menubar > table:nth-child(3) > tbody > tr > td:nth-child(2)").insertAdjacentHTML('afterbegin', ` <div id="search-all-terms" style="position:relative;display:inline-block;"><input type="text" placeholder="Search for all terms"> <div style="position: absolute; top: 110%"> <input id="somecheckbox" type="checkbox" style="margin-right: 0.3rem;"> <label for="somecheckbox">Search within posts</label></div> </div></div> `) const container = document.getElementById("search-all-terms") const inputField = container.querySelector('input') const checkbox = container.querySelector('#somecheckbox') inputField.addEventListener('keydown', ev => { if (ev.code === 'Enter') { if (checkbox.checked) sf = 'all' window.location.href = `./search.php?keywords=${encodeURIComponent(inputField.value).replace(/%20/g, "+")}&terms=all&author=&sc=1&sf=${sf}&sk=${sk}&sd=${sd}&sr=${sr}&st=0&ch=${ch}&t=0` } })
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址