Commit 804f049b authored by Benoit Barbot's avatar Benoit Barbot
Browse files

prog

parent b0b0446d
Pipeline #980 passed with stage
in 31 seconds
......@@ -317,8 +317,7 @@ module GraphEditor (G: GRAPH ) = struct
download string_value "graph.gex" "data:application/xml") ]
[pcdata "Get GEX"];*)
button ~a:[a_onclick (fun _ -> layout_graph s; draw s (0.0,0.0))] [pcdata "Layout Graph"];
Raw.a ~a:[a_href "tikzeditor.html?q=GEXNAm6Yh+QlTMY29udGVudA==SEYQ==lTMQXR0cmlidXRlSIZHJhdw==NAr3Al7QlTMY29udGVudA==SEYg==lTMQXR0cmlidXRlSIZHJhdw==AABlTMQXR0cmlidXRlSIZHJhdw==lTMQXR0cmlidXRlSELT4="] [pcdata "Direct Link"]
update_link "Direct Link" (fun n -> (n^"?q="^(get_exchange_string s.graph)))
]]
let init canvas_elt attr_list_div saveload_elt slider_elt =
......
......@@ -13,6 +13,16 @@ let text_input ?(class_ = "") ?(on_change = fun _ -> true) value =
input##.className := Js.string class_;
input2
let update_link n f =
let link = Raw.a ~a:[a_href "#"] [pcdata n] in
let domlink = Eliom_content.Html.To_dom.of_a link in
let currref = Js.to_string Dom_html.window##.location##.href in
domlink##.onmouseover:= Dom.handler (fun _ ->
let string_value = f currref in
domlink##.href := Js.string string_value;
Js._true);
link
let choice_input ?(class_ = "") ?(on_change = fun _ -> ()) ?(init_value=None) option_list =
let choice_list = List.map (fun x -> option (pcdata (">"^x))) option_list in
let input2 = select (match init_value with
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment