Skip to content

Commit

Permalink
Compile against Eliom_client_value and related modules
Browse files Browse the repository at this point in the history
  • Loading branch information
vasilisp committed Mar 30, 2016
1 parent 7b08618 commit 65d49cd
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 33 deletions.
6 changes: 3 additions & 3 deletions src/widgets/ot_calendar.eliom
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,12 @@ let%client make :
let%server make :
?init : (int * int * int) ->
?highlight :
(int -> int -> int list Lwt.t) Eliom_client_common.client_value ->
(int -> int -> int list Lwt.t) Eliom_client_value.t ->
?click_non_highlighted : bool ->
?update :
(int * int * int) React.E.t Eliom_client_common.client_value ->
(int * int * int) React.E.t Eliom_client_value.t ->
?action :
(int -> int -> int -> unit Lwt.t) Eliom_client_common.client_value ->
(int -> int -> int -> unit Lwt.t) Eliom_client_value.t ->
?intl : intl ->
unit ->
[> Html5_types.table ] elt =
Expand Down
8 changes: 4 additions & 4 deletions src/widgets/ot_calendar.eliomi
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ type intl = {
val make :
?init : (int * int * int) ->
?highlight :
(int -> int -> int list Lwt.t) Eliom_client_common.client_value ->
(int -> int -> int list Lwt.t) Eliom_client_value.t ->
?click_non_highlighted :
bool ->
?update :
(int * int * int) React.E.t Eliom_client_common.client_value ->
(int * int * int) React.E.t Eliom_client_value.t ->
?action :
(int -> int -> int -> unit Lwt.t) Eliom_client_common.client_value ->
(int -> int -> int -> unit Lwt.t) Eliom_client_value.t ->
?intl : intl ->
unit ->
[> Html5_types.table ] Eliom_content.Html5.elt
Expand All @@ -65,7 +65,7 @@ val make :
val make_date_picker :
?init : (int * int * int) ->
?update :
(int * int * int) React.E.t Eliom_client_common.client_value ->
(int * int * int) React.E.t Eliom_client_value.t ->
?intl : intl ->
unit ->
[> Html5_types.table ] Eliom_content.Html5.F.elt *
Expand Down
8 changes: 4 additions & 4 deletions src/widgets/ot_range.eliom
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ let display
e (v, f) =
D.(div ~a:[a_class ["ot-range"]]
[div ~a:[a_class ["ot-r-up"];
a_onclick ([%client (fun _ -> go_up ~%e ~%v ~%f : _ -> _) ]
: _ Eliom_client_common.client_value)]
a_onclick
[%client (fun _ -> go_up ~%e ~%v ~%f : _ -> _) ]]
[pcdata txt_up];
display_aux e v;
div ~a:[a_class ["ot-r-down"];
a_onclick ([%client (fun _ -> go_down ~%e ~%v ~%f : _ -> _) ]
: _ Eliom_client_common.client_value)]
a_onclick
[%client (fun _ -> go_down ~%e ~%v ~%f : _ -> _) ]]
[pcdata txt_down]])

let make ?txt_up ?txt_down ?f ?lb:(lb = 0) ub =
Expand Down
19 changes: 8 additions & 11 deletions src/widgets/ot_time_picker.eliom
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type polar = int * int

type cartesian = int * int

type time_receiver = (int -> int -> unit) Eliom_client_common.client_value
type time_receiver = (int -> int -> unit) Eliom_client_value.t

type 'a rf = ?step:React.step -> 'a -> unit

Expand Down Expand Up @@ -316,7 +316,7 @@ let%client wrap_click_24h ev f_e f_b =
wrap_click_aux ev (fun (r, e) -> f_b r; f_e (e, true))

let clock_html_wrap ?(classes = [])
s (f : (int * bool) rf Eliom_client_common.client_value) =
s (f : (int * bool) rf Eliom_client_value.t) =
let e =
let a =
let open Eliom_content.Svg.F in [
Expand All @@ -325,8 +325,7 @@ let clock_html_wrap ?(classes = [])
:: "ot-tp-click-anywhere"
:: classes);
a_viewbox ( 0. , 0. , 100. , 100. );
a_onclick ([%client fun ev -> wrap_click ev ~%f ]
: _ Eliom_client_common.client_value)
a_onclick [%client fun ev -> wrap_click ev ~%f ]
]
in
Eliom_content.Html5.D.svg ~a [s]
Expand All @@ -346,13 +345,13 @@ let clock_html_wrap ?(classes = [])
let clock_html_wrap_24h ?(classes = []) s f_e f_b =
let e =
let a =
let f = ([%client fun ev ->
let f = [%client fun ev ->
let step' = React.Step.create () in
let step = Some step' in
let f_b r = ~%f_b ?step (r <= 35, true) in
wrap_click_24h ev (~%f_e ?step) f_b;
React.Step.execute step'
] : _ Eliom_client_common.client_value) in
] in
let open Eliom_content.Svg.F in [
a_class
("ot-tp-clock"
Expand Down Expand Up @@ -405,16 +404,14 @@ let display_hours_minutes_seq ?h24:(h24 = false) f (h, m) b =
[D.a_class ["ot-tp-hours"; "ot-tp-active"]]
else
[D.a_class ["ot-tp-hours"; "ot-tp-inactive"];
D.a_onclick ([%client fun _ -> ~%f true ]
: _ Eliom_client_common.client_value)]
D.a_onclick [%client fun _ -> ~%f true ]]
and c = [string_of_hours ~h24 h |> D.pcdata] in
D.span ~a c
and m =
let a =
if b then
D.[a_class ["ot-tp-minutes"; "ot-tp-inactive"];
a_onclick ([%client fun _ -> ~%f false ]
: _ Eliom_client_common.client_value)]
a_onclick [%client fun _ -> ~%f false ]]
else
[D.a_class ["ot-tp-minutes"; "ot-tp-active"]]
and c = [Printf.sprintf "%02d" m |> D.pcdata] in
Expand Down Expand Up @@ -512,7 +509,7 @@ let make_hours_minutes_seq_24h
let g_h =
let e_h' = get_angle_signal ~round:true e_h
and f_e_h =
Eliom_client_common.create_shared_value
Eliom_shared.Value.create
(Eliom_shared.Value.local f_e_h)
[%client fun ?step ((x, b) as p) ->
~%f_e_h ?step p;
Expand Down
12 changes: 6 additions & 6 deletions src/widgets/ot_time_picker.eliomi
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,33 @@
function that can be called to go back to hours selection. *)
val make :
?action :
(int * int -> unit Lwt.t) Eliom_client_common.client_value ->
(int * int -> unit Lwt.t) Eliom_client_value.t ->
?init :
int * int ->
?update :
(int * int) React.E.t Eliom_client_common.client_value ->
(int * int) React.E.t Eliom_client_value.t ->
?round_5 :
bool ->
?h24 :
bool ->
unit ->
[> Html5_types.div] Eliom_content.Html5.D.elt *
(int * int) Eliom_shared.React.S.t *
(unit -> unit) Eliom_client_common.client_value
(unit -> unit) Eliom_client_value.t

(** Alias of [make]. Deprecated. *)
val make_hours_minutes_seq :
?action :
(int * int -> unit Lwt.t) Eliom_client_common.client_value ->
(int * int -> unit Lwt.t) Eliom_client_value.t ->
?init :
int * int ->
?update :
(int * int) React.E.t Eliom_client_common.client_value ->
(int * int) React.E.t Eliom_client_value.t ->
?round_5 :
bool ->
?h24 :
bool ->
unit ->
[> Html5_types.div] Eliom_content.Html5.D.elt *
(int * int) Eliom_shared.React.S.t *
(unit -> unit) Eliom_client_common.client_value
(unit -> unit) Eliom_client_value.t
6 changes: 2 additions & 4 deletions src/widgets/ot_toggle.eliom
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ let display_toggle
[div ~a:[a_class ["ot-active"; "ot-up"]]
[pcdata up_txt];
div ~a:[a_class ["ot-inactive"; "ot-down"];
a_onclick ([%client (fun _ -> ~%f T_Down : _ -> _) ]
: _ Eliom_client_common.client_value)]
a_onclick [%client (fun _ -> ~%f T_Down : _ -> _) ]]
[pcdata down_txt]]
| T_Down ->
div ~a:[a_class ["ot-toggle"]]
[div ~a:[a_class ["ot-inactive"; "ot-up"];
a_onclick ([%client (fun _ -> ~%f T_Up : _ -> _) ]
: _ Eliom_client_common.client_value)]
a_onclick [%client (fun _ -> ~%f T_Up : _ -> _) ]]
[pcdata up_txt];
div ~a:[a_class ["ot-active"; "ot-down"]]
[pcdata down_txt]]
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/ot_toggle.eliomi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ val make :
?init_up : bool ->
?up_txt : string ->
?down_txt : string ->
?update : bool React.E.t Eliom_client_common.client_value ->
?update : bool React.E.t Eliom_client_value.t ->
unit ->
[> Html5_types.div ] Eliom_content.Html5.D.elt *
bool Eliom_shared.React.S.t

0 comments on commit 65d49cd

Please sign in to comment.