feat: default search form to Main Forum, subforums off

The server renders search.php with no forum preselected and "Search
subforums" set to Yes, which searches the whole board by default. Most
searches from the mobile view are scoped to Main Forum only, so leaving
the server defaults in place meant re-selecting the same options on
every visit.
This commit is contained in:
Andre
2026-08-03 09:11:48 +02:00
parent a8ca211805
commit e7f3f56456
2 changed files with 17 additions and 3 deletions
+10 -1
View File
@@ -1,7 +1,7 @@
// ==UserScript==
// @name RIN Mobile
// @description Mobile Ansicht fuer cs.rin.ru: Themenlisten als Karten, Threads als Beitragsstrom
// @version 3.13
// @version 3.14
// @match *://cs.rin.ru/forum/*
// @run-at document-start
// ==/UserScript==
@@ -1132,6 +1132,15 @@
var form = picker && picker.closest('form');
if (!form) return false;
// Vorbelegung fuer die mobile Nutzung: Main Forum (Forum-ID 10, siehe
// dev/viewforum.php) vorausgewaehlt statt "kein Forum", Unterforen dabei
// nicht automatisch mitgesucht — das serverseitige Formular startet sonst
// mit leerem Forenwaehler und "Search subforums: Yes".
var mainForum = picker.querySelector('option[value="10"]');
if (mainForum) mainForum.selected = true;
var noSubforums = form.querySelector('input[name="sc"][value="0"]');
if (noSubforums) noSubforums.checked = true;
var root = document.createElement('div');
root.className = 'rm-root rm-searchform';