clean babillard, remove option for multiple boards

This commit is contained in:
Swrup 2022-02-17 03:59:23 +01:00
parent 8c594648c9
commit be599322da
8 changed files with 104 additions and 166 deletions

View file

@ -119,11 +119,6 @@ module Geolocalize = 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" |])
(*todo do this in js_babillard*)
let marker_on_click thread_preview thread_id _e =
log "marker_on_click@.";
@ -131,7 +126,7 @@ module Marker = struct
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 link = Format.sprintf "/%s/%s" board thread_id in
let link = Format.sprintf "/babillard/%s" thread_id in
ignore @@ Jv.set thread_link "href" (Jv.of_string link);
ignore @@ Jv.set thread_link "innerText" (Jv.of_string "[View Thread]");
let _ = Js_pretty_post.make_pretty () in
@ -173,7 +168,7 @@ module Marker = struct
let () =
log "fetch thread geojson@.";
let window = Jv.get Jv.global "window" in
let link = Jv.of_string (Format.sprintf "/%s/markers" board) in
let link = Jv.of_string "/babillard/markers" in
let fetchfutur = Jv.call window "fetch" [| link |] in
ignore @@ Jv.call fetchfutur "then" [| Jv.repr markers_handle_response |];
()