summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mulk/benki/book_marx.clj4
-rw-r--r--src/mulk/benki/lazychat.clj14
2 files changed, 12 insertions, 6 deletions
diff --git a/src/mulk/benki/book_marx.clj b/src/mulk/benki/book_marx.clj
index 80fac1e..5c556c2 100644
--- a/src/mulk/benki/book_marx.clj
+++ b/src/mulk/benki/book_marx.clj
@@ -87,8 +87,8 @@
(let [marks (bookmarks-visible-by *user*)]
(with-dbt
(layout bookmarx-list-page "Book Marx"
- [:div {:id "login-message"
- :class "login-message"}
+ [:div {:id "notifications"
+ :class "notifications"}
(login-message)]
[:div
;;(.toString marks)
diff --git a/src/mulk/benki/lazychat.clj b/src/mulk/benki/lazychat.clj
index 6865d01..e2caaf8 100644
--- a/src/mulk/benki/lazychat.clj
+++ b/src/mulk/benki/lazychat.clj
@@ -20,7 +20,8 @@
hiccup.core
[lamina.core :as lamina]
[aleph.http :as ahttp]
- [aleph.formats :as aformats])
+ [aleph.formats :as aformats]
+ [clojure.data.json :as json])
(:import [org.apache.abdera Abdera]))
@@ -120,12 +121,17 @@
[:div {:class "lafargue-message-body"}
(sanitize-html (markdown->html (:content message)))]]))
+(defn render-message-as-json [message]
+ (json/json-str (assoc message
+ :html (render-message message)
+ :date nil)))
+
(defpage "/lafargue" {}
(with-dbt
(layout lafargue-list-page "Lafargue Lazy Chat"
- [:div {:id "login-message"
- :class "login-message"}
+ [:div {:id "notifications"
+ :class "notifications"}
(login-message)]
[:div
[:div {:id "lafargue-main-input-box" :class "lafargue-input-box"}
@@ -185,7 +191,7 @@
(let [messages (filter* #(may-read? *user* %) lafargue-events)]
(receive-all messages
(fn [msg]
- (async-push conn (render-message msg)))))
+ (async-push conn (render-message-as-json msg)))))
(async-push conn {:status 426})))
(defpage [:any "/lafargue/post"] {content :content, visibility :visibility