Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit float conversions #95

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
(depopts
(lwt (>= 5.3.0))
(base64 (>= 3.2.0))
(js_of_ocaml-tyxml (>= 3.4.0))))
(js_of_ocaml-tyxml (>= 5.5.0))))

(package
(name ezjs_amcharts3)
Expand All @@ -40,7 +40,7 @@
(package
(name ezjs_disqus)
(synopsis "Binding for Disqus")
(depends (js_of_ocaml-ppx (>= 3.4.0))))
(depends (js_of_ocaml-ppx (>= 5.5.0))))

(package
(name ezjs_gauth)
Expand Down
2 changes: 1 addition & 1 deletion ezjs_disqus.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ doc: "https://ocamlpro.github.io/ezjs/doc"
bug-reports: "https://github.com/ocamlpro/ezjs/issues"
depends: [
"dune" {>= "2.5"}
"js_of_ocaml" {>= "3.4.0"}
"js_of_ocaml-ppx" {>= "5.5.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion ezjs_utils.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ depends: [
depopts: [
"lwt" {>= "5.3.0"}
"base64" {>= "3.2.0"}
"js_of_ocaml-tyxml" {>= "3.4.0"}
"js_of_ocaml-tyxml" {>= "5.5.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion libs/amcharts3/amcharts3.ml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class type amCharts =

let amCharts() =
let amCharts : amCharts Js.t =
Js.Unsafe.variable "AmCharts"
Js.Unsafe.global ##. _AmCharts
in
amCharts

Expand Down
6 changes: 3 additions & 3 deletions libs/amcharts3/amcharts3_bis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ class type ['a] chart = object
method usePrefixes : bool_field
method addLabel :
int -> int -> Js.js_string Js.t -> Js.js_string Js.t -> int -> Js.js_string Js.t
-> int -> float -> bool -> Js.js_string Js.t -> unit Js.meth
-> int -> Js.number_t -> bool -> Js.js_string Js.t -> unit Js.meth
method addLegend : legend Js.t -> Js.js_string Js.t -> unit Js.meth
(* method addListerner *)
method addTitle : Js.js_string Js.t -> int -> Js.js_string Js.t -> float ->
method addTitle : Js.js_string Js.t -> int -> Js.js_string Js.t -> Js.number_t ->
bool -> unit Js.meth
method clear : unit Js.meth
method clearLabels : unit Js.meth
Expand Down Expand Up @@ -594,7 +594,7 @@ class type amCharts =
end

let amCharts () =
let amCharts : amCharts Js.t = Js.Unsafe.variable "AmCharts" in
let amCharts : amCharts Js.t = Js.Unsafe.global ##. _AmCharts in
amCharts

let export ?divId () =
Expand Down
2 changes: 1 addition & 1 deletion libs/amcharts3/ammap3.ml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class type amCharts =

let amCharts() =
let amCharts : amCharts Js.t =
Js.Unsafe.variable "AmCharts"
Js.Unsafe.global ##. _AmCharts
in
amCharts

Expand Down
4 changes: 2 additions & 2 deletions libs/disqus/ezjs_disqus.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let build_config ?(lang="en") ?title url identifier () =
let title = match title with
| None -> Printf.sprintf "Thread for %s" identifier
| Some title -> title in
let disqus : disqus Js.t = Js.Unsafe.variable "DISQUS" in
let disqus : disqus Js.t = Js.Unsafe.global ##. _DISQUS in
let page_config : page Js.t = Js.Unsafe.obj [||] in
page_config##.identifier := Js.string identifier;
page_config##.url := Js.string url;
Expand All @@ -42,7 +42,7 @@ let init ?lang ?title url identifier name =
Dom.appendChild doc##.body s

let reset ?lang ?title url identifier =
let disqus : disqus Js.t = Js.Unsafe.variable "DISQUS" in
let disqus : disqus Js.t = Js.Unsafe.global ##. _DISQUS in
let disqus_obj : disqus_reset Js.t = Js.Unsafe.obj [||] in
disqus_obj##.reload := Js._true;
disqus_obj##.config := build_config ?lang ?title url identifier;
Expand Down
8 changes: 4 additions & 4 deletions libs/google_auth/ezjs_gauth.ml
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ type auth_response = {
let verbose = ref false
let set_verbose v = verbose := v

let gapi : gapi t optdef = Unsafe.variable "gapi"
let gapi : gapi t optdef = Unsafe.global ##. gapi

let ready ?(none=fun () -> if !verbose then log_str "cannot find gapi")
?(timeout=500.) (f : gapi t -> unit) =
match Optdef.to_option (Unsafe.variable "gapi") with
match Optdef.to_option (Unsafe.global ##. gapi) with
| None ->
let cb () = Optdef.case (Unsafe.variable "gapi") none f in
ignore @@ Dom_html.window##setTimeout (wrap_callback cb) timeout
let cb () = Optdef.case (Unsafe.global ##. gapi) none f in
ignore @@ Dom_html.window##setTimeout (wrap_callback cb) (Js_of_ocaml.Js.float timeout)
| Some gapi -> f gapi

let init ?timeout params f =
Expand Down
2 changes: 1 addition & 1 deletion libs/utils/ezjs_bind.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ open Js_of_ocaml

type string_field = Js.js_string Js.t Js.prop
type int_field = int Js.prop
type float_field = float Js.prop
type float_field = Js.number_t Js.prop
type bool_field = bool Js.prop
type 'a array_field = 'a Js.js_array Js.t Js.prop

Expand Down
Loading
Loading