Skip to content

Commit

Permalink
Merge remote-tracking branch 'racehub/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lenaschoenburg committed Jan 25, 2015
2 parents fab55bb + c796f02 commit 405cbd6
Show file tree
Hide file tree
Showing 24 changed files with 203 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: clojure
lein: lein2
script: lein2 test
script: lein2 do test, test-8
branches:
only:
- develop
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
## 0.3.1 (9/25/2014)
## 0.3.3 (1/13/2015)

- Added collapse functionality for navbars (https://github.com/racehub/om-bootstrap/pull/41)

## 0.3.2 (12/9/2014)

- Added `href` tags to all `Show Code` links. Without these they weren't expanding on mobile browsers (https://github.com/racehub/om-bootstrap/issues/34)
- Fixed compatibility issue with om-0.8.0-beta3, and added tests.
- Upgraded clojure to 1.7.0-alpha2
- Upgraded core.async to 0.1.346.0-17112a-alpha
- Upgraded om-tools to 0.3.6
- Upgraded schema to 0.3.1
- Upgraded weasel to 0.4.2

## 0.3.1 (10/15/2014)

- Revert schema upgrade... fancy that :)

## 0.3.0 (9/25/2014)

- Upgrade to Schema 0.3.0

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Om-Bootstrap's [documentation site](http://om-bootstrap.herokuapp.com/) has usag

## Mixins

The project contains a few mixins that help in writing active Om components. THe current set of mixins makes it easy to set listeners and timeouts on some component, and guarantee that they'll be cleaned up when the component unmounts:
The project contains a few mixins that help in writing active Om components. The current set of mixins makes it easy to set listeners and timeouts on some component, and guarantee that they'll be cleaned up when the component unmounts:

* `set-listener-mixin` (mixins.cljs)
* `set-timeout-mixin` (mixins.cljs)
Expand Down Expand Up @@ -99,8 +99,6 @@ and the latest version of ClojureScript. Please create a [GitHub issue](https://

Note that we've seen trouble with Safari 7.0.x on CLJS versions <= 0.0.2261. See [this ticket](https://github.com/racehub/om-bootstrap/issues/10) for details.

Also, if you're explicitly using [Prismatic's Schema](https://github.com/prismatic/schema), you'll need version `0.3.x` due to the new `:include-macros` syntax.

## Authors

- Sam Ritchie <https://twitter.com/sritchie>
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Om-Bootstrap Documentation Site",
"name": "Om-Bootstrap Doc Site",
"description": "Documentation site for Om-Bootstrap; Bootstrap components on Om.",
"repository": "https://github.com/racehub/om-bootstrap",
"keywords": ["om", "react", "bootstrap", "ui"]
Expand Down
2 changes: 1 addition & 1 deletion dev/snippets/input/types.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
(d/option {:value "select"} "select")
(d/option {:value "other"} "..."))
(i/input {:type "textarea" :default-value "textarea"})
(i/input {:type "static"} "static"))
(i/input {:type "static" :value "Static Text"}))
6 changes: 4 additions & 2 deletions dev/snippets/nav/bar_basic.cljs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#_
(:require [om-bootstrap.button :as b]
[om-bootstrap.nav :as n])
[om-bootstrap.nav :as n]
[om-tools.dom :as d :include-macros true])

(n/navbar
{}
{:brand (d/a {:href "#"}
"Navbar")}
(n/nav
{:collapsible? true}
(n/nav-item {:key 1 :href "#"} "Link")
Expand Down
2 changes: 1 addition & 1 deletion docs/src/cljs/om_bootstrap/docs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[om-bootstrap.docs.shared :refer [four-oh-four]]
[om-tools.core :refer-macros [defcomponentk]]
[om-tools.dom :as d :include-macros true]
[secretary.core :as route :include-macros true :refer [defroute]]
[secretary.core :as route :refer-macros [defroute]]
[weasel.repl :as ws-repl])
(:require-macros [cljs.core.async.macros :refer [go-loop]])
(:import [goog.history EventType]))
Expand Down
7 changes: 5 additions & 2 deletions docs/src/cljs/om_bootstrap/docs/example.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@
(bs-example body)
(when open?
(->code-block {:code code}))
(d/a {:class (d/class-set
(d/a {:href "#"
:class (d/class-set
{:code-toggle true
:open open?})
:on-click #(swap! state update-in [:open?] not)}
:on-click (fn [e]
(swap! state update-in [:open?] not)
(.preventDefault e))}
(if open?
"hide code"
"show code")))))
Expand Down
41 changes: 29 additions & 12 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,43 @@
[http-kit "2.1.18"]
[hiccup "1.0.5"]])

(defproject racehub/om-bootstrap "0.3.1-SNAPSHOT"
(defproject racehub/om-bootstrap "0.3.4-SNAPSHOT"
:description "Bootstrap meets Om."
:url "http://github.com/racehub/om-bootstrap"
:license {:name "MIT Licens"
:license {:name "MIT License"
:url "http://www.opensource.org/licenses/mit-license.php"
:distribution :repo}
:scm {:name "git"
:url "https://github.com/racehub/om-bootstrap"}
:min-lein-version "2.3.0"
:uberjar-name "om-bootstrap.jar"
:jar-exclusions [#".DS_Store"]
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/core.async "0.1.267.0-0d7780-alpha"]
[prismatic/om-tools "0.3.3"]
[prismatic/schema "0.3.0"
:exclude [org.clojure/clojurescript]]
:dependencies [[org.clojure/clojure "1.7.0-alpha2"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
[prismatic/om-tools "0.3.6" :exclusions [om]]
[prismatic/schema "0.3.1"
:exclusions [org.clojure/clojurescript]]
[om "0.7.1"]]
:profiles {:provided
{:dependencies [[org.clojure/clojurescript "0.0-2322"]
{:dependencies [[org.clojure/clojurescript "0.0-2411"]
[secretary "1.2.0"]
[weasel "0.4.0-SNAPSHOT"]]}
[weasel "0.4.2"]]}
;; Change to the first version of the uberjar profile
;; when this bug gets fixed:
;; https://github.com/technomancy/leiningen/issues/1694
;; :uberjar [:docs {}]
:uberjar {:aot :all
:omit-source true
:main om-bootstrap.server
:plugins [[lein-cljsbuild "1.0.3"]]
:prep-tasks ^:replace [["clean"]
["cljsbuild" "clean"]
["cljsbuild" "once" "heroku"]
["javac"]
["compile" ":all"]]
:dependencies ~server-deps
:source-paths ["docs/src/clj"]
:resource-paths ["dev"]}
:docs {:aot :all
:omit-source true
:main om-bootstrap.server
Expand All @@ -37,8 +53,9 @@
:dependencies ~server-deps
:source-paths ["docs/src/clj"]
:resource-paths ["dev"]}
:om-8 {:dependencies [[om "0.8.0-beta3"]]}
:dev {:plugins [[lein-cljsbuild "1.0.3"]
[com.cemerick/clojurescript.test "0.3.0"]
[com.cemerick/clojurescript.test "0.3.1"]
[paddleguru/lein-gitflow "0.1.2"]]
:dependencies ~(conj server-deps '[com.cemerick/piggieback "0.1.3"])
:source-paths ["docs/src/clj" "docs/src-dev"]
Expand All @@ -47,8 +64,8 @@
:repl-options
{:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}
:aliases {"test" ["cljsbuild" "test"]
"repl" ["do" "cljsbuild" "once" "docs," "repl"]
"uberjar" ["with-profile" "docs" "uberjar"]}
"test-8" ["do" "clean," "cljsbuild" "clean," "with-profile" "+om-8" "cljsbuild" "test"]
"repl" ["do" "cljsbuild" "once" "docs," "repl"]}
:cljsbuild
{:test-commands {"unit"
["phantomjs" :runner
Expand Down
31 changes: 16 additions & 15 deletions src/om_bootstrap/button.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
[om-tools.core :refer-macros [defcomponentk]]
[om-tools.dom :as d :include-macros true]
[om-tools.mixin :refer-macros [defmixin]]
[schema.core :as s :include-macros true]))
[schema.core :as s])
(:require-macros [schema.macros :as sm]))

;; ## Basic Button

Expand All @@ -26,7 +27,7 @@

;; ## Code

(s/defn render-anchor
(sm/defn render-anchor
[opts :- {:classes {s/Any s/Any}
:disabled? (s/maybe s/Bool)
:props {s/Any s/Any}}
Expand All @@ -38,7 +39,7 @@
(d/a (u/merge-props props (:props opts))
children)))

(s/defn button :- t/Component
(sm/defn button :- t/Component
"Renders a button."
[props :- Button & children]
(let [[bs props] (t/separate Button props {:bs-class "button"
Expand Down Expand Up @@ -68,7 +69,7 @@

;; ## Button Toolbar

(s/defn toolbar :- t/Component
(sm/defn toolbar :- t/Component
"Renders a button toolbar."
[opts & children]
(let [[bs props] (t/separate {} opts {:bs-class "button-toolbar"})]
Expand All @@ -78,7 +79,7 @@

;; ## Button Group

(s/defn button-group :- t/Component
(sm/defn button-group :- t/Component
"Renders the supplied children in a wrapping button-group div."
[opts :- ButtonGroup & children]
(let [[bs props] (t/separate ButtonGroup opts {:bs-class "button-group"})
Expand All @@ -95,8 +96,8 @@
(t/bootstrap
{(s/optional-key :title) t/Renderable
(s/optional-key :href) s/Str
(s/optional-key :on-click) (s/=> s/Any s/Any)
(s/optional-key :on-select) (s/=> s/Any s/Any)
(s/optional-key :on-click) (sm/=> s/Any s/Any)
(s/optional-key :on-select) (sm/=> s/Any s/Any)
(s/optional-key :pull-right?) s/Bool
(s/optional-key :dropup?) s/Bool
(s/optional-key :nav-item?) s/Bool}))
Expand Down Expand Up @@ -124,7 +125,7 @@
(s/optional-key :divider?) s/Bool
(s/optional-key :href) s/Str
(s/optional-key :title) s/Str
(s/optional-key :on-select) (s/=> s/Any s/Any)}))
(s/optional-key :on-select) (sm/=> s/Any s/Any)}))

(defcomponentk menu-item*
"Generates an Om component of a menu item. Done this way so that
Expand Down Expand Up @@ -153,17 +154,17 @@
(d/li (u/merge-props props li-attrs)
children))))

(s/defn menu-item :- t/Component
(sm/defn menu-item :- t/Component
[opts :- MenuItem & children]
(->menu-item* {:opts opts
:children children}))

(def DropdownMenu
(t/bootstrap
{(s/optional-key :pull-right?) s/Bool
(s/optional-key :on-select) (s/=> s/Any s/Any)}))
(s/optional-key :on-select) (sm/=> s/Any s/Any)}))

(s/defn dropdown-menu :- t/Component
(sm/defn dropdown-menu :- t/Component
[opts :- DropdownMenu & children]
(let [[bs props] (t/separate DropdownMenu opts)
classes {:dropdown-menu true
Expand Down Expand Up @@ -221,7 +222,7 @@
:key 1}
(map #(u/clone-with-props % update-child-props) children))]))))

(s/defn dropdown :- t/Component
(sm/defn dropdown :- t/Component
"Returns a dropdown button component. The component manages its own
dropdown state."
[opts :- DropdownButton & children]
Expand All @@ -238,8 +239,8 @@
(s/optional-key :title) t/Renderable
(s/optional-key :href) s/Str
(s/optional-key :dropdown-title) t/Renderable
(s/optional-key :on-click) (s/=> s/Any s/Any)
(s/optional-key :on-select) (s/=> s/Any s/Any)}))
(s/optional-key :on-click) (sm/=> s/Any s/Any)
(s/optional-key :on-select) (sm/=> s/Any s/Any)}))

(defcomponentk split*
"Generates a split button component responsible for its own
Expand Down Expand Up @@ -286,7 +287,7 @@
:dropup (:dropup? bs)})}
btn drop-btn menu))))

(s/defn split
(sm/defn split
[opts :- SplitButton & children]
(->split* {:opts opts
:children children}))
9 changes: 5 additions & 4 deletions src/om_bootstrap/grid.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
(:require [om-bootstrap.types :as t]
[om-bootstrap.util :as u]
[om-tools.dom :as d :include-macros true]
[schema.core :as s :include-macros true]))
[schema.core :as s])
(:require-macros [schema.macros :as sm]))

;; ## Schema

Expand All @@ -25,7 +26,7 @@
;; ## Code
;;
;; TODO: Do we want a custom component class, like in react-bootstrap?
(s/defn grid :- t/Component
(sm/defn grid :- t/Component
"Generates a wrapper for a bootstrap grid."
[opts :- Grid & children]
(let [[bs props] (t/separate Grid opts {})
Expand All @@ -35,13 +36,13 @@
(d/div (u/merge-props props {:class class})
children)))

(s/defn row :- t/Component
(sm/defn row :- t/Component
"Generates a Bootstrap row element."
[opts & children]
(d/div (u/merge-props opts {:class "row"})
children))

(s/defn col :- t/Component
(sm/defn col :- t/Component
"Generates a Bootstrap column element."
[opts :- Col & children]
(let [[bs props] (t/separate Col opts {})
Expand Down
Loading

0 comments on commit 405cbd6

Please sign in to comment.