diff --git a/japji/japji.html b/japji/japji.html index f88735a..68642f6 100644 --- a/japji/japji.html +++ b/japji/japji.html @@ -1649,25 +1649,25 @@ (set! (.-my_alert js/window) my-alert) - (defn play-segment [start end] (js/alert "foo")) -;; (js/alert (str "Now we should be playing the sefment from " -;; start -;; " to " -;; end -;; ", but this is not yet implemented."))) + (defn play-segment [start end] + (js/alert (str "Now we should be playing the sefment from " + start + " to " + end + ", but this is not yet implemented."))) ;; export function to use from JavaScript: (set! (.-play_segment js/window) play-segment) (defn markup-word [record phrase-no word-no] [:span {:class "word" :id (str "word-" phrase-no "-" word-no) - :on-click (str "play_segment( " (:start record) ", " (:end record) ")")} + :on-click #(play-segment (:start record) (:end record))} (str " " (:text record))]) (defn markup-phrase [record n] [:div {:class "phrase" :id (str "phrase-" n)} [:button {:class "play-control" - :onclick (str "play_segment( " (:lineStart record) ", " (:lineEnd record) ")")} ">"] + :on-click #(play-segment (:lineStart record) (:lineEnd record))} ">"] (map #(markup-word %1 n %2) (:words record) (range))]) (let [content (map markup-phrase data (range))] @@ -1678,7 +1678,7 @@