From 4cdfae6ad5d5f9808ebf3078fb4630298051f464 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 27 Oct 2026 20:02:23 +0100 Subject: web: GPS paste field in Viewpoint section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One text field accepting '47.676,13.32042' (optionally ',alt' as a third component; commas, semicolons or spaces as separators) — the format gallery apps show, so the coordinates can simply be copied and pasted. This replaces the PWA/share-target detour for getting a viewpoint onto mobile: EXIF GPS may be redacted by the OS, but the gallery displays the true coordinates for manual transfer. --- crates/wipfel/src/widgets.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'crates/wipfel/src/widgets.rs') diff --git a/crates/wipfel/src/widgets.rs b/crates/wipfel/src/widgets.rs index 1d22bac..93e2cdc 100644 --- a/crates/wipfel/src/widgets.rs +++ b/crates/wipfel/src/widgets.rs @@ -46,6 +46,35 @@ pub fn slider_item(p: &SliderProps) -> Html { } } +/// single-line text row (e.g. paste a GPS string) +#[derive(Properties, PartialEq)] +pub struct TextProps { + pub label: AttrValue, + pub placeholder: AttrValue, + pub onchange: Callback, +} + +#[function_component(TextItem)] +pub fn text_item(p: &TextProps) -> Html { + let onchange = { + let onchange = p.onchange.clone(); + Callback::from(move |e: Event| { + let input: HtmlInputElement = e.target_unchecked_into(); + onchange.emit(input.value()); + }) + }; + html! { + + } +} + #[derive(Properties, PartialEq)] pub struct NumProps { pub label: AttrValue, -- cgit v1.2.3