summaryrefslogtreecommitdiff
path: root/webapps/ldapadmin
diff options
context:
space:
mode:
Diffstat (limited to 'webapps/ldapadmin')
-rw-r--r--webapps/ldapadmin/clojurescript/ldapadmin/src/core.cljs38
1 files changed, 4 insertions, 34 deletions
diff --git a/webapps/ldapadmin/clojurescript/ldapadmin/src/core.cljs b/webapps/ldapadmin/clojurescript/ldapadmin/src/core.cljs
index 02b5f6a..13fdcd4 100644
--- a/webapps/ldapadmin/clojurescript/ldapadmin/src/core.cljs
+++ b/webapps/ldapadmin/clojurescript/ldapadmin/src/core.cljs
@@ -3,16 +3,14 @@
(:require [ajax.core :refer [GET POST]]
[dommy.core :as dommy]
[hiccups.runtime :as hiccupsrt]
- [clojure.string :as str]))
+ [clojure.string :as str]
+ [org-ckons-cljs.notifications.core :as ck-notifications]))
;; declarations
(enable-console-print!)
(def jquery (js* "$"))
-(declare template-message)
-(declare maybe-error)
-(declare maybe-message)
(declare notifications)
(declare auth-notifications)
(declare template-generic-form)
@@ -66,37 +64,9 @@
;; notifications
-(hiccups/defhtml template-error [errormsg]
- [:div {:class "alert alert-danger"} errormsg])
-
-(hiccups/defhtml template-message [message]
- [:div {:class "alert alert-success"} message])
-
-(defn maybe-message [jsonobj]
- (when (get jsonobj "locationP")
- (let [message (get jsonobj "message")]
- (cond (empty? message)
- (dommy/set-style! (dommy/sel1 :#message) :display "none")
- :else
- (do
- (dommy/set-style! (dommy/sel1 :#message) :display "block")
- (dommy/set-html! (dommy/sel1 :#message)
- (template-message message)))))))
-
-(defn maybe-error [jsonobj]
- (when (get jsonobj "locationP")
- (let [errormsg (get jsonobj "errormsg")]
- (cond (empty? errormsg)
- (dommy/set-style! (dommy/sel1 :#errormsg) :display "none")
- :else
- (do
- (dommy/set-style! (dommy/sel1 :#errormsg) :display "block")
- (dommy/set-html! (dommy/sel1 :#errormsg)
- (template-error errormsg)))))))
-
(defn notifications [jsonobj]
- (maybe-message jsonobj)
- (maybe-error jsonobj))
+ (ck-notifications/maybe-message jsonobj)
+ (ck-notifications/maybe-error jsonobj))
(defn auth-notifications [jsonobj]
(cond (empty? (get jsonobj "errormsg"))