From da1d9ad1c49f31fc9031fd1bc6661dad3600e40c Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 4 Jun 2021 22:56:27 +0200 Subject: Added markdown output --- editor/actions/editor_actions.ml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'editor/actions/editor_actions.ml') 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 -- cgit v1.2.3