diff options
author | Yorhel <git@yorhel.nl> | 2019-12-09 15:18:34 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-12-12 15:48:35 +0100 |
commit | 2c4203b57652e0c3fdc9bd10973754e911f43b36 (patch) | |
tree | f31e23c6375996d1a413200bcf90cd0624019265 /elm/Lib/Html.elm | |
parent | 5075f0ef4573fa95252c1a91b62239cc9b6347bb (diff) |
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.
Diffstat (limited to 'elm/Lib/Html.elm')
-rw-r--r-- | elm/Lib/Html.elm | 14 |
1 files changed, 14 insertions, 0 deletions
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" |