summaryrefslogtreecommitdiff
path: root/elm/Lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-12-06 13:37:24 +0100
committerYorhel <git@yorhel.nl>2019-12-06 13:37:24 +0100
commitcd57e89ecfadbdc49b02fc0d19c043cdf7229a66 (patch)
treebd8bd260f79c51221bca1ae1ee24f7b9753009fc /elm/Lib
parent6487d1e89b14a4c85bb47c03fbe4d7e2f37e73d3 (diff)
Add link to d9#3 to quick reply box + allow customizing TextPreview header
Diffstat (limited to 'elm/Lib')
-rw-r--r--elm/Lib/Editsum.elm7
-rw-r--r--elm/Lib/TextPreview.elm29
2 files changed, 18 insertions, 18 deletions
diff --git a/elm/Lib/Editsum.elm b/elm/Lib/Editsum.elm
index 99a4be29..09553a40 100644
--- a/elm/Lib/Editsum.elm
+++ b/elm/Lib/Editsum.elm
@@ -57,9 +57,6 @@ view model =
in fieldset [] <|
(if model.authmod then lockhid else [])
++
- [ h2 []
- [ text "Edit summary"
- , b [class "standout"] [text " (English please!)"]
- ]
- , TP.view "" model.editsum Editsum 600 [rows 4, cols 50, minlength 2, maxlength 5000, required True]
+ [ TP.view "" model.editsum Editsum 600 [rows 4, cols 50, minlength 2, maxlength 5000, required True]
+ [ b [class "title"] [ text "Edit summary", b [class "standout"] [text " (English please!)"] ] ]
]
diff --git a/elm/Lib/TextPreview.elm b/elm/Lib/TextPreview.elm
index 2d565e5f..fba61ff3 100644
--- a/elm/Lib/TextPreview.elm
+++ b/elm/Lib/TextPreview.elm
@@ -66,23 +66,26 @@ update msg model =
HandlePreview r -> ({ model | state = Api.Error r }, Cmd.none)
-view : String -> Model -> (Msg -> m) -> Int -> List (Attribute m) -> Html m
-view name model cmdmap width attr =
+view : String -> Model -> (Msg -> m) -> Int -> List (Attribute m) -> List (Html m) -> Html m
+view name model cmdmap width attr header =
let
display = model.display && model.preview /= ""
in
div [ class "textpreview", style "width" (String.fromInt width ++ "px") ]
- [ p (class "head" :: (if model.data == "" then [class "invisible"] else []))
- [ case model.state of
- Api.Loading -> span [ class "spinner" ] []
- Api.Error _ -> b [ class "grayedout" ] [ text "Error loading preview. " ]
- Api.Normal -> text ""
- , if display
- then a [ onClickN (cmdmap TextArea) ] [ text "Edit" ]
- else i [] [text "Edit"]
- , if display
- then i [] [text "Preview"]
- else a [ onClickN (cmdmap Preview) ] [ text "Preview" ]
+ [ span []
+ [ p [] header
+ , p [ class "right", classList [("invisible", model.data == "")] ]
+ [ case model.state of
+ Api.Loading -> span [ class "spinner" ] []
+ Api.Error _ -> b [ class "grayedout" ] [ text "Error loading preview. " ]
+ Api.Normal -> text ""
+ , if display
+ then a [ onClickN (cmdmap TextArea) ] [ text "Edit" ]
+ else i [] [text "Edit"]
+ , if display
+ then i [] [text "Preview"]
+ else a [ onClickN (cmdmap Preview) ] [ text "Preview" ]
+ ]
]
, inputTextArea name model.data (cmdmap << Edit) (class (if display then "hidden" else "") :: attr)
, if not display then text ""