From 8296ba9f150ef9ece794961fe6be5d63223969f2 Mon Sep 17 00:00:00 2001 From: sto Date: Mon, 2 Nov 2015 00:45:27 -0500 Subject: [PATCH 1/7] bug fix for https://github.com/ibdknox/crate/issues/21 --- src/crate/compiler.cljs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/crate/compiler.cljs b/src/crate/compiler.cljs index e618fc6..b678086 100644 --- a/src/crate/compiler.cljs +++ b/src/crate/compiler.cljs @@ -120,8 +120,11 @@ (do (capture-binding :attr [k v]) (bind/value v)) - v)] - (. elem (setAttribute (name k) v)))) + v) + event (second (re-find #"^on(\w+)" (name k)))] + (if event + (. elem (addEventListener event v)) + (. elem (setAttribute (name k) v))))) elem)) ;; From Weavejester's Hiccup: https://github.com/weavejester/hiccup/blob/master/src/hiccup/core.clj#L57 @@ -170,7 +173,8 @@ (defn elem-factory [tag-def] (binding [bindings (atom [])] (let [[nsp tag attrs content] (normalize-element tag-def) - elem (create-elem nsp tag)] + elem (create-elem nsp tag) + onclick (:onclick attrs)] (dom-attr elem attrs) (as-content elem content) (handle-bindings @bindings elem) From 88df134f4f025c90738cdf44417b9405d679fd1b Mon Sep 17 00:00:00 2001 From: sto Date: Mon, 2 Nov 2015 13:08:26 -0500 Subject: [PATCH 2/7] bump version to 0.2.5 to publish on clojar for https://github.com/ibdknox/crate/issues/21 bug fix --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index ea056a3..5739494 100644 --- a/project.clj +++ b/project.clj @@ -1,2 +1,2 @@ -(defproject crate "0.2.4" +(defproject crate "0.2.5" :description "A ClojureScript implementation of Hiccup") From c7d223da921c8b59070df1f9cd67b7b04d571e92 Mon Sep 17 00:00:00 2001 From: sto Date: Mon, 2 Nov 2015 13:10:21 -0500 Subject: [PATCH 3/7] ignore .idea --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c04377c..df62067 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ pom.xml *jar /lib/ /classes/ -.lein-deps-sum \ No newline at end of file +.lein-deps-sum +/.idea/* \ No newline at end of file From 0545904de9b1e81ba9c22ad0aef1044ff72a5464 Mon Sep 17 00:00:00 2001 From: sto Date: Mon, 2 Nov 2015 13:11:14 -0500 Subject: [PATCH 4/7] ignore .iml --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index df62067..c44cb86 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ pom.xml /lib/ /classes/ .lein-deps-sum -/.idea/* \ No newline at end of file +/.idea/* +*.iml \ No newline at end of file From a03791d45d9caef29cf6f84b04452949b6e29dfb Mon Sep 17 00:00:00 2001 From: sto Date: Mon, 2 Nov 2015 13:14:33 -0500 Subject: [PATCH 5/7] 0.2.5-SNAPSHOT deploy on clojars for https://github.com/ibdknox/crate/issues/21 bug fix --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index 5739494..ea291b2 100644 --- a/project.clj +++ b/project.clj @@ -1,2 +1,2 @@ -(defproject crate "0.2.5" +(defproject crate "0.2.5-SNAPSHOT" :description "A ClojureScript implementation of Hiccup") From 09137e852c53f64f4c9b3dbe49b629caf883bd37 Mon Sep 17 00:00:00 2001 From: sto Date: Mon, 2 Nov 2015 13:23:25 -0500 Subject: [PATCH 6/7] url, license info --- project.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/project.clj b/project.clj index ea291b2..fd8387f 100644 --- a/project.clj +++ b/project.clj @@ -1,2 +1,4 @@ (defproject crate "0.2.5-SNAPSHOT" - :description "A ClojureScript implementation of Hiccup") + :url "https://github.com/sonwh98/crate" + :description "A ClojureScript implementation of Hiccup. Fork of https://github.com/ibdknox/crate" + :license "Eclipse Public License") From c618980868f5a0d2ec18abc1d6430bc839cbfae9 Mon Sep 17 00:00:00 2001 From: sto Date: Mon, 2 Nov 2015 16:07:56 -0500 Subject: [PATCH 7/7] rename crate to krate so that I can publish this on clojars --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index fd8387f..b0d0f9a 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject crate "0.2.5-SNAPSHOT" +(defproject krate "0.2.5-SNAPSHOT" :url "https://github.com/sonwh98/crate" :description "A ClojureScript implementation of Hiccup. Fork of https://github.com/ibdknox/crate" :license "Eclipse Public License")