summaryrefslogtreecommitdiffabout
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--dict.ml7
2 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 5195574..c8e8558 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,7 @@
.PHONY: dict deploy clean
-dict:
- dune build
-
-deploy: dict
+deploy:
+ dune build --profile=release
mkdir -p public
cp _build/default/dict.bc.js public/dict.js
cp -r css public/
diff --git a/dict.ml b/dict.ml
index 3a19176..8676f61 100644
--- a/dict.ml
+++ b/dict.ml
@@ -109,12 +109,15 @@ let () =
let main = Dom_html.getElementById "main" in
let input_node = Tyxml_js.To_dom.of_input input_box in
let anchor () =
- Dom_html.window##.location##.hash |> Js.to_string
+ Dom_html.window##.location##.hash
+ |> Js.decodeURIComponent
+ |> Js.to_string
|> String.chop_prefix ~pre:"#"
|> Option.get_or ~default:""
in
let set_anchor s =
- Dom_html.window##.location##.hash := Js.string ("#" ^ s) in
+ Dom_html.window##.location##.hash := Js.string s
+ in
Lwt.async (fun _ ->
Lwt_js_events.domContentLoaded () >>= fun _ ->