diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 803cf6e..3ec0e22 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -8,7 +8,7 @@ [hiccups "0.3.0"] [org.clj-commons/hickory "0.7.4"] [com.andrewmcveigh/cljs-time "0.5.2"] - [org.domaindrivenarchitecture/c4k-common-cljs "6.2.3"]] + [org.domaindrivenarchitecture/c4k-common-cljs "8.0.0"]] :dev-http {8080 "public"} :builds {:test {:target :node-test diff --git a/src/main/dda/masto_embed/api.cljs b/src/main/dda/masto_embed/api.cljs index 3f01d00..e685a5e 100644 --- a/src/main/dda/masto_embed/api.cljs +++ b/src/main/dda/masto_embed/api.cljs @@ -17,7 +17,6 @@ (:require ["mastodon-api" :as Mastodon] [dda.masto-embed.infra :as infra] - [cljs-time.format :as t] [clojure.spec.alpha :as s] [orchestra.core :refer-macros [defn-spec]])) diff --git a/src/main/dda/masto_embed/infra.cljs b/src/main/dda/masto_embed/infra.cljs index d6fc0df..d8028de 100644 --- a/src/main/dda/masto_embed/infra.cljs +++ b/src/main/dda/masto_embed/infra.cljs @@ -15,8 +15,6 @@ ; limitations under the License. (ns dda.masto-embed.infra (:require - [cljs.core.async :refer [go]] - [cljs.core.async.interop :refer-macros [!]] + [cljs.core.async :refer [go chan !]] [cljs.core.async.interop :refer-macros [edn (filter #(= account-name (:acct %))) - (empty?) - (not)))) + (seq)))) out)) (defn favorited? [host-url account-name replies] diff --git a/src/main/dda/masto_embed/to_html.cljs b/src/main/dda/masto_embed/to_html.cljs index a8a9a5d..ea58cd1 100644 --- a/src/main/dda/masto_embed/to_html.cljs +++ b/src/main/dda/masto_embed/to_html.cljs @@ -15,12 +15,7 @@ ; limitations under the License. (ns dda.masto-embed.to-html (:require - [cljs.core.async :refer [go chan !]] - [cljs.core.async.interop :refer-macros [ html - (cm/replace-all-matching-values-by-new-value "AVATAR_URL" avatar_static) - (cm/replace-all-matching-values-by-new-value "POST_URL" url) - (cm/replace-all-matching-values-by-new-value "DISPLAY_NAME" display_name) - (cm/replace-all-matching-values-by-new-value "ACCOUNT_NAME" (str "@" username)) - (cm/replace-all-matching-values-by-new-value "DATETIME" created_at) - (cm/replace-all-matching-values-by-new-value "TIME" (t/unparse (t/formatter "EEEE, dd MMMM yyyy") date))))) + (cm/replace-all-matching "AVATAR_URL" avatar_static) + (cm/replace-all-matching "POST_URL" url) + (cm/replace-all-matching "DISPLAY_NAME" display_name) + (cm/replace-all-matching "ACCOUNT_NAME" (str "@" username)) + (cm/replace-all-matching "DATETIME" created_at) + (cm/replace-all-matching "TIME" (t/unparse (t/formatter "EEEE, dd MMMM yyyy") date))))) (defn masto-content->html [html content] (-> html - (cm/replace-all-matching-values-by-new-value "POST_TEXT" content))) + (cm/replace-all-matching "POST_TEXT" content))) ; Meant to be used in postwalk on hiccup/hickory html-representation (defn insert-into-content [item insertion-element] @@ -88,20 +83,20 @@ html (-> html (insert-link-prev) - (cm/replace-all-matching-values-by-new-value "LINK_PREVIEW_URL" url) - (cm/replace-all-matching-values-by-new-value "LINK_PREVIEW_IMG_URL" image) - (cm/replace-all-matching-values-by-new-value "LINK_PREVIEW_TITLE" (str (truncate title 47) "...")) - (cm/replace-all-matching-values-by-new-value "LINK_PREVIEW_DESC" description))))) + (cm/replace-all-matching "LINK_PREVIEW_URL" url) + (cm/replace-all-matching "LINK_PREVIEW_IMG_URL" image) + (cm/replace-all-matching "LINK_PREVIEW_TITLE" (str (truncate title 47) "...")) + (cm/replace-all-matching "LINK_PREVIEW_DESC" description))))) (defn masto-footer->html [html replies_count reblogs_count favourites_count] (-> html - (cm/replace-all-matching-values-by-new-value "REPLIES_COUNT" replies_count) - (cm/replace-all-matching-values-by-new-value "REBLOGS_COUNT" reblogs_count) - (cm/replace-all-matching-values-by-new-value "FAVOURITES_COUNT" favourites_count))) + (cm/replace-all-matching "REPLIES_COUNT" replies_count) + (cm/replace-all-matching "REBLOGS_COUNT" reblogs_count) + (cm/replace-all-matching "FAVOURITES_COUNT" favourites_count))) (defn insert-mode [html mode] (-> html - (cm/replace-all-matching-values-by-new-value "section MODE" (str "section " mode)))) + (cm/replace-all-matching "section MODE" (str "section " mode)))) (defn masto->html [mode statuses] (let [html (b/post-html-hiccup)]