Commit e0094a45 authored by Benoit Barbot's avatar Benoit Barbot
Browse files

cleaning

parent bc1979b5
Pipeline #1733 failed with stage
in 6 seconds
OASISFormat: 0.4
Name: GraphEditor
Version: 0.1
Synopsis: A librairy to edit graph
Synopsis: A library to edit graph
Authors: Benoit Barbot
License: GPL-3
Plugins: META (0.4), DevFiles (0.4)
......
......@@ -73,19 +73,6 @@ module GraphEditor (G: GRAPH ) = struct
|> Rectangle.contains rect
let change_file (cb: string->unit) _ =
let id2 = Js.string "filein" in
let f s = cb (Js.to_string s) in
Js.Unsafe.fun_call (Js.Unsafe.js_expr "upload") [|Js.Unsafe.inject f; Js.Unsafe.inject id2|]
let a_over ?(class_ = "") ?(on_mouse_over = fun _ -> ()) value =
let input2 = Raw.a ~a:[a_href ""] [txt value] in
let input = Eliom_content.Html.To_dom.of_a input2 in
let on_input _ = on_mouse_over input; Js._true in
input##.onclick := Dom.handler on_input;
input##.className := Js.string class_;
input2
let download content name mimetype =
let c = Js.string content
and n = Js.string name
......
open Js_of_ocaml
open Eliom_content.Html.D
let text_input ?(class_ = "") ?(on_change = fun _ -> true) value =
let input2 = input ~a:[a_input_type `Text] () in
let input = Eliom_content.Html.To_dom.of_input input2 in
(*let input2 = input ~a:[a_input_type `Text] () in
let input = Eliom_content.Html.To_dom.of_input input2 in*)
let input = Dom_html.(createInput ~_type: (Js.string "text") document) in
input##.value := Js.string value;
let on_input _ =
let res = on_change (Js.to_string input##.value) in
......@@ -12,7 +13,23 @@ let text_input ?(class_ = "") ?(on_change = fun _ -> true) value =
Js._true in
input##.oninput := Dom.handler on_input;
input##.className := Js.string class_;
input2
Eliom_content.Html.Of_dom.of_input input
open Eliom_content.Html.D
let change_file (cb: string->unit) _ =
let id2 = Js.string "filein" in
let f s = cb (Js.to_string s) in
Js.Unsafe.fun_call (Js.Unsafe.js_expr "upload") [|Js.Unsafe.inject f; Js.Unsafe.inject id2|]
let a_over ?(class_ = "") ?(on_mouse_over = fun _ -> ()) value =
let input2 = Raw.a ~a:[a_href ""] [txt value] in
let input = Eliom_content.Html.To_dom.of_a input2 in
let on_input _ = on_mouse_over input; Js._true in
input##.onclick := Dom.handler on_input;
input##.className := Js.string class_;
input2
let update_link n f =
let link = Raw.a ~a:[a_href "#"] [txt n] in
......
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