mirror of
https://github.com/Andre-Bzk/rin-mobile-userscript.git
synced 2026-11-15 09:33:08 +01:00
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:
@@ -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
|
||||
|
||||
+10
-1
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user