From e7f3f56456964313756e5d04b5991235bdd13168 Mon Sep 17 00:00:00 2001 From: Andre <200930841+Andre-Bzk@users.noreply.github.com> Date: Mon, 3 Aug 2026 09:11:48 +0200 Subject: [PATCH] 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. --- README.md | 9 +++++++-- rin-mobile.user.js | 11 ++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6aa09e9..c4e66db 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,9 @@ forum…" / "Search this topic…" widgets embedded elsewhere — and then moved into the new layout the same way the login form is: table rows collapsed to a vertical stack, radio groups and selects restyled for touch, and the quick links above it ("View new posts", "View your posts", …) turned into a row of -chips. +chips. "Search in forums" defaults to Main Forum and "Search subforums" +defaults to No, overriding the server's own blank/Yes defaults, since that is +the scope most searches from the mobile view actually want. A submitted search lands back on `search.php`, now with results — which, in the "Posts" display mode the in-thread search bar produces, look nothing like @@ -351,7 +353,10 @@ kleinen „Search this forum…" / „Search this topic…"-Widgets an anderer Stelle — und dann wie das Login-Formular in das neue Layout verschoben: Tabellenzeilen zu einer senkrechten Abfolge zusammengeklappt, Radio-Gruppen und Auswahlfelder für Touch umgestylt, die Schnellzugriffe darüber („View new -posts", „View your posts", …) zu einer Reihe aus Chips. +posts", „View your posts", …) zu einer Reihe aus Chips. „Search in forums" +ist dabei standardmäßig auf Main Forum vorausgewählt, „Search subforums" auf +No — statt der leeren/„Yes"-Vorgabe des Servers, weil das dem Suchumfang +entspricht, der von der mobilen Ansicht aus meistens gewollt ist. Eine abgeschickte Suche landet wieder auf `search.php`, diesmal mit Treffern — die im Anzeigemodus „Posts", den die Suchleiste im Thread erzeugt, aber diff --git a/rin-mobile.user.js b/rin-mobile.user.js index d97bb65..9704f92 100644 --- a/rin-mobile.user.js +++ b/rin-mobile.user.js @@ -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';