refactor app to use common function
This commit is contained in:
parent
94d2791c4a
commit
1cb2d824d0
1 changed files with 7 additions and 8 deletions
|
@ -25,20 +25,19 @@
|
||||||
|
|
||||||
(def masto-embed "masto-embed")
|
(def masto-embed "masto-embed")
|
||||||
|
|
||||||
(defn host-url-from-document []
|
(defn element-from-document-by-name [name]
|
||||||
(-> js/document
|
(-> js/document
|
||||||
(.getElementById masto-embed)
|
(.getElementById masto-embed)
|
||||||
(.getAttribute "host_url")))
|
(.getAttribute name)))
|
||||||
|
|
||||||
|
(defn host-url-from-document []
|
||||||
|
(element-from-document-by-name "host_url"))
|
||||||
|
|
||||||
(defn account-name-from-document []
|
(defn account-name-from-document []
|
||||||
(-> js/document
|
(element-from-document-by-name "account_name"))
|
||||||
(.getElementById masto-embed)
|
|
||||||
(.getAttribute "account_name")))
|
|
||||||
|
|
||||||
(defn account-id-from-document []
|
(defn account-id-from-document []
|
||||||
(-> js/document
|
(element-from-document-by-name "account_id"))
|
||||||
(.getElementById masto-embed)
|
|
||||||
(.getAttribute "account_id")))
|
|
||||||
|
|
||||||
(defn render-to-document
|
(defn render-to-document
|
||||||
[input]
|
[input]
|
||||||
|
|
Loading…
Reference in a new issue