Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Barbot
GraphEditor
Commits
e0094a45
Commit
e0094a45
authored
Oct 02, 2020
by
Benoit Barbot
Browse files
cleaning
parent
bc1979b5
Pipeline
#1733
failed with stage
in 6 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
editor/_oasis
View file @
e0094a45
OASISFormat: 0.4
Name: GraphEditor
Version: 0.1
Synopsis: A libra
i
ry to edit graph
Synopsis: A library to edit graph
Authors: Benoit Barbot
License: GPL-3
Plugins: META (0.4), DevFiles (0.4)
...
...
editor/graphDrawing.ml
View file @
e0094a45
...
...
@@ -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
...
...
editor/utilsWeb.ml
View file @
e0094a45
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment