From 2c4203b57652e0c3fdc9bd10973754e911f43b36 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Mon, 9 Dec 2019 15:18:34 +0100 Subject: v2rw: Discussion board editing & thread creation Now with BBCode preview, interactive board search, client-side error reporting and lots of new bugs. This took me far too long, turns out it wasn't such a trivial rewrite. --- elm/Lib/Html.elm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'elm/Lib/Html.elm') diff --git a/elm/Lib/Html.elm b/elm/Lib/Html.elm index 1e995f86..66436073 100644 --- a/elm/Lib/Html.elm +++ b/elm/Lib/Html.elm @@ -79,6 +79,20 @@ inputSelect nam sel onch attrs lst = ) <| List.indexedMap opt lst +inputNumber : String -> Int -> (Int -> m) -> List (Attribute m) -> Html m +inputNumber nam val onch attrs = input ( + [ type_ "number" + , class "text" + , tabindex 10 + , style "width" "40px" + , value <| String.fromInt val + , onInput (\s -> onch <| Maybe.withDefault 0 <| String.toInt s) + ] + ++ attrs + ++ (if nam == "" then [] else [ id nam, name nam ]) + ) [] + + inputText : String -> String -> (String -> m) -> List (Attribute m) -> Html m inputText nam val onch attrs = input ( [ type_ "text" -- cgit v1.2.3