From 1d8b9ac70cc259aac867609931e5867e256523f5 Mon Sep 17 00:00:00 2001 From: Swrup Date: Mon, 17 Jan 2022 21:54:34 +0100 Subject: [PATCH] use valid html: change boardvalue to data-board --- src/babillard_page.eml.html | 2 +- src/js_babillard.ml | 15 +++++---------- src/plants_page.eml.html | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/babillard_page.eml.html b/src/babillard_page.eml.html index accae1c..01c2d90 100644 --- a/src/babillard_page.eml.html +++ b/src/babillard_page.eml.html @@ -1,6 +1,6 @@ let f request = -
+
<%s Format.sprintf "Babillard is love" %>
diff --git a/src/js_babillard.ml b/src/js_babillard.ml index 0a59e15..b9d4622 100644 --- a/src/js_babillard.ml +++ b/src/js_babillard.ml @@ -68,17 +68,17 @@ module Leaflet = struct end module Marker = struct + let board = + let board_div = Jv.get Jv.global "board" in + Jv.to_string + (Jv.call board_div "getAttribute" [| Jv.of_string "data-board" |]) + let marker_on_click thread_preview thread_id _e = log "marker_on_click@."; let thread_id = Jv.to_string thread_id in let thread_preview_div = Jv.get Jv.global "thread_preview_div" in ignore @@ Jv.set thread_preview_div "innerHTML" thread_preview; let thread_link = Jv.get Jv.global "thread_link" in - let board_div = Jv.get Jv.global "board" in - let board = - Jv.to_string - (Jv.call board_div "getAttribute" [| Jv.of_string "boardvalue" |]) - in let link = Format.sprintf "/%s/%s" board thread_id in ignore @@ Jv.set thread_link "href" (Jv.of_string link); ignore @@ Jv.set thread_link "innerText" (Jv.of_string "[View Thread]"); @@ -112,11 +112,6 @@ module Marker = struct let () = log "fetch thread geojson@."; - let board_div = Jv.get Jv.global "board" in - let board = - Jv.to_string - (Jv.call board_div "getAttribute" [| Jv.of_string "boardvalue" |]) - in let window = Jv.get Jv.global "window" in let link = Jv.of_string (Format.sprintf "/%s/markers" board) in let fetchfutur = Jv.call window "fetch" [| link |] in diff --git a/src/plants_page.eml.html b/src/plants_page.eml.html index 5902dd2..4e2fb22 100644 --- a/src/plants_page.eml.html +++ b/src/plants_page.eml.html @@ -1,6 +1,6 @@ let f request = -
+
<%s Format.sprintf "Plants is love" %>