diff options
| author | Sébastien Dailly <sebastien@chimrod.com> | 2021-06-04 22:56:27 +0200 | 
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2022-02-07 16:43:33 +0100 | 
| commit | da1d9ad1c49f31fc9031fd1bc6661dad3600e40c (patch) | |
| tree | d7684f047f6101b57c631c3c80448fc7ae2aa5ca /editor/actions/editor_actions.ml | |
| parent | f7dc93dab194472329d74c056c4730b41e98d650 (diff) | |
Added markdown output
Diffstat (limited to 'editor/actions/editor_actions.ml')
| -rwxr-xr-x | editor/actions/editor_actions.ml | 31 | 
1 files changed, 20 insertions, 11 deletions
| diff --git a/editor/actions/editor_actions.ml b/editor/actions/editor_actions.ml index 91d2a24..518e0c7 100755 --- a/editor/actions/editor_actions.ml +++ b/editor/actions/editor_actions.ml @@ -17,8 +17,8 @@ type t =    }  let build -  : unit -> t -  = fun () -> +  : Prosemirror.t -> t +  = fun pm ->      let delete_button = El.button          ~at:At.[ class' (Jstr.v "action-button") ] @@ -56,6 +56,16 @@ let build              ~at:At.[ class' (Jstr.v "fa")                     ; class' (Jstr.v "fa-2x")                     ; class' (Jstr.v "fa-upload") ] ] + +    and cog_button = El.button +        ~at:At.[class' (Jstr.v "action-button")] +        [ El.i +            [] +            ~at:At.[ class' (Jstr.v "fa") +                   ; class' (Jstr.v "fa-2x") +                   ; class' (Jstr.v "fa-cog") ] +        ] +      in      (* We are waiting for event inside another event ( form validation inside @@ -89,6 +99,11 @@ let build            Ev.click            (fun _ -> Import.create ())            load_button) +    and cog_event = +      Evr.on_el +        Ev.click +        (fun _ -> To_markdown.create pm) +        cog_button      in @@ -128,14 +143,7 @@ let build        ; export_button        ; load_button        ; delete_button -      ; El.button -          ~at:At.[class' (Jstr.v "action-button")] -          [ El.i -              [] -              ~at:At.[ class' (Jstr.v "fa") -                     ; class' (Jstr.v "fa-2x") -                     ; class' (Jstr.v "fa-cog") ] -          ] +      ; cog_button        ; El.hr ()        ; ul ] in @@ -145,7 +153,8 @@ let build          ; redirect_event          ; add_event          ; export_event -        ; import_event ] in +        ; import_event +        ; cog_event ] in      { ev = result_event      ; childs | 
