Skip to content

Commit

Permalink
Merge branch 'develop' into feature/fix_upgraded
Browse files Browse the repository at this point in the history
Conflicts:
	project.clj
  • Loading branch information
sritchie committed Jan 31, 2015
2 parents 183d797 + f198c70 commit 49e1e1f
Show file tree
Hide file tree
Showing 25 changed files with 290 additions and 82 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ checkouts
schema.png
dev/public/assets/main.js
dev/public/generated
dev/public/assets/generated
dev/public/assets/generated
*-init.clj
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 0.3.5 (1/27/2015)

- Support for collapsible panels, thanks to @dignati (https://github.com/racehub/om-bootstrap/pull/45)

## 0.3.4 (1/27/2015)

- Turned Om into a provided dependency (https://github.com/racehub/om-bootstrap/pull/44)
- add Pagination, thanks to @dignati (https://github.com/racehub/om-bootstrap/pull/47)
- Fixes a bug where navs were un-expanded by default (https://github.com/racehub/om-bootstrap/pull/48)

## 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)
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Here's the latest Leiningen version info:

[![Clojars Project](http://clojars.org/racehub/om-bootstrap/latest-version.svg)](http://clojars.org/racehub/om-bootstrap)

You'll also need to add Om:

```clojure
[om "0.7.3"]
```

You can find more detailed information on how to configure your Clojurescript project to use Om-Bootstrap on the documentation site's [Getting Started section](http://om-bootstrap.herokuapp.com/getting-started).

**This is an alpha release. The API and organizational structure are
Expand Down Expand Up @@ -37,7 +43,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 All @@ -56,15 +62,13 @@ These, and the mixins below, are the project's biggest TODOs.
* Subnav (?)
* Panel (hard), PanelGroup (easy), Accordion (easy)
* TabbedArea, TabPane
* Pager
* Carousel
* CarouselItem

### Needed Mixins

* FadeMixin
* OverlayMixin
* CollapsibleMixin

## ClojureScript Repl

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
9 changes: 9 additions & 0 deletions dev/snippets/pagination/active.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#_
(:require [om-bootstrap.pager :as pg])

(pg/pagination {}
(pg/previous {:disabled? true})
(pg/page {} "1")
(pg/page {} "2")
(pg/page {:active? true} "3")
(pg/next {}))
7 changes: 7 additions & 0 deletions dev/snippets/pagination/basic.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#_
(:require [om-bootstrap.pager :as pg])

(pg/pagination {}
(pg/page {} "1")
(pg/page {} "2")
(pg/page {} "3"))
9 changes: 9 additions & 0 deletions dev/snippets/pagination/disabled.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#_
(:require [om-bootstrap.pager :as pg])

(pg/pagination {}
(pg/previous {:disabled? true})
(pg/page {} "1")
(pg/page {} "2")
(pg/page {} "3")
(pg/next {}))
9 changes: 9 additions & 0 deletions dev/snippets/pagination/navigation.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#_
(:require [om-bootstrap.pager :as pg])

(pg/pagination {}
(pg/previous {})
(pg/page {} "1")
(pg/page {} "2")
(pg/page {} "3")
(pg/next {}))
6 changes: 6 additions & 0 deletions dev/snippets/panel/collapsible.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#_
(:require [om-bootstrap.panel :as p])

(p/panel {:header "Collapse Me!"
:collapsible? true}
(d/span "Sometimes I'm here, sometimes I'm not"))
4 changes: 4 additions & 0 deletions dev/snippets/progressbar/active.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#_
(:require [om-bootstrap.progress-bar :as pb])

(pb/progress-bar {:now 70 :active? true})
4 changes: 4 additions & 0 deletions dev/snippets/progressbar/basic.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#_
(:require [om-bootstrap.progress-bar :as pb])

(pb/progress-bar {:min 0 :max 100 :now 50})
6 changes: 6 additions & 0 deletions dev/snippets/progressbar/contextual.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#_
(:require [om-bootstrap.progress-bar :as pb])

(for [context [nil "primary" "success" "info" "warning" "danger"]]
(pb/progress-bar (merge {:now 50 :label "50%"}
(when context {:bs-style context}))))
4 changes: 4 additions & 0 deletions dev/snippets/progressbar/label.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#_
(:require [om-bootstrap.progress-bar :as pb])

(pb/progress-bar {:min 0 :max 100 :now 50 :label "Loading"})
4 changes: 4 additions & 0 deletions dev/snippets/progressbar/sr_only_label.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#_
(:require [om-bootstrap.progress-bar :as pb])

(pb/progress-bar {:min 0 :max 100 :now 50 :label "50%" :sr-only? true})
7 changes: 7 additions & 0 deletions dev/snippets/progressbar/stacked.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#_
(:require [om-bootstrap.progress-bar :as pb])

(pb/progress-bar {}
(pb/progress-bar {:now 35 :bs-style "success" :nested? true})
(pb/progress-bar {:now 20 :bs-style "warning" :striped? true :nested? true})
(pb/progress-bar {:now 10 :bs-style "danger" :nested? true}))
4 changes: 4 additions & 0 deletions dev/snippets/progressbar/striped.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#_
(:require [om-bootstrap.progress-bar :as pb])

(pb/progress-bar {:now 70 :striped? true})
41 changes: 34 additions & 7 deletions docs/src/cljs/om_bootstrap/docs/components.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[om-bootstrap.input :as i]
[om-bootstrap.mixins :as m]
[om-bootstrap.nav :as n]
[om-bootstrap.pagination :as pg]
[om-bootstrap.panel :as p]
[om-bootstrap.progress-bar :as pb]
[om-bootstrap.random :as r]
Expand Down Expand Up @@ -214,6 +215,11 @@
particular context by adding a " (d/code ":bs-style") " prop.")
(->example (slurp-example "panel/contextual"))

(d/h3 "Collapsible panels")
(d/p "This panel is collapsed by default and can be extended by clicking
on the title")
(->example (slurp-example "panel/collapsible"))

(d/h3 "Controlled PanelGroups")
(d/p (d/code "p/panel-group") "s can be controlled by a parent
component. The " (d/code ":active-key") " prop dictates which panel
Expand Down Expand Up @@ -314,6 +320,7 @@

;; ## Progress Bars


(defn progress-bar-block []
(section
"progress"
Expand All @@ -323,37 +330,37 @@
action with simple yet flexible progress bars.")
(d/h3 "Basic example")
(d/p "Default progress bar.")
(TODO)
(->example (slurp-example "progressbar/basic"))

(d/h3 "With label")
(d/p "Add a " (d/code ":label") " prop to show a visible
percentage. For low percentages, consider adding
a" (d/code ":min-width") " to ensure the label's text is fully
visible.")
(TODO)
(->example (slurp-example "progressbar/label"))

(d/h3 "Screenreader only label")
(d/p "Add the " (d/code ":sr-only? true") " option to hide the
label visually.")
(TODO)
(->example (slurp-example "progressbar/sr_only_label"))

(d/h3 "Contextual alternatives")
(d/p "Progress bars use some of the same button and alert classes
for consistent styles.")
(TODO)
(->example (slurp-example "progressbar/contextual"))

(d/h3 "Striped")
(d/p "Uses a gradient to create a striped effect. Not available in IE8.")
(TODO)
(->example (slurp-example "progressbar/striped"))

(d/h3 "Animated")
(d/p "Add the " (d/code ":active? true") " option to animate the
stripes right to left. Not available in IE9 and below.")
(TODO)
(->example (slurp-example "progressbar/active"))

(d/h3 "Stacked")
(d/p "Nest " (d/code "pb/progress-bar") "s to stack them.")
(TODO)))
(->example (slurp-example "progressbar/stacked"))))

;; ## Navs

Expand Down Expand Up @@ -405,6 +412,24 @@
(d/a {:href "#navs"} "tabbed navigation component")
" to add tabbable areas."])))

;; ## Pagination
(defn pagination-block []
(section
"pagination"
["Pagination " (d/small "basic.cljs")]
(d/p "Creates pages that can have " (d/code ":href") " or " (d/code ":on-click") " set to navigate between pages")
(d/h3 "Basic Pagination")
(->example (slurp-example "pagination/basic"))

(d/h3 "Pagination with previous and next")
(->example (slurp-example "pagination/navigation"))

(d/h3 "Pages can be disabled")
(->example (slurp-example "pagination/disabled"))

(d/h3 "Pages can be marked as active")
(->example (slurp-example "pagination/active"))))

;; ## Pager

(defn pager-block []
Expand Down Expand Up @@ -639,6 +664,7 @@
(n/nav-item {:href "#navs"} "Navs")
(n/nav-item {:href "#navbars"} "Navbars")
(n/nav-item {:href "#tabs"} "Toggleable Tabs")
(n/nav-item {:href "#pagination"} "Pagination")
(n/nav-item {:href "#pager"} "Pager")
(n/nav-item {:href "#alerts"} "Alerts")
(n/nav-item {:href "#carousels"} "Carousels")
Expand Down Expand Up @@ -681,6 +707,7 @@
(nav-block)
(navbar-block)
(tab-block)
(pagination-block)
(pager-block)
(alert-block)
(carousel-block)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/cljs/om_bootstrap/docs/getting_started.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
(->code-block {:code "(defproject foo \"0.1.0\"
...
:dependencies [[org.clojure/clojure \"1.6.0\"]
[org.clojure/clojurescript \"0.0-2322\"]
[racehub/om-bootstrap \"0.3.1\"]
[org.clojure/clojurescript \"0.0-2411\"]
[racehub/om-bootstrap \"0.3.4\"]
[om \"0.7.3\"]]
...)"})
(d/p "Om-Bootstrap requires Om 0.7.0 or later, and has been tested against Bootstrap 3.1.0 and later. The "
Expand Down
8 changes: 4 additions & 4 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
[http-kit "2.1.18"]
[hiccup "1.0.5"]])

(defproject racehub/om-bootstrap "0.3.3-SNAPSHOT"
(defproject racehub/om-bootstrap "0.4.0-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"
Expand All @@ -17,10 +17,10 @@
:jar-exclusions [#".DS_Store"]
: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/om-tools "0.3.10" :exclusions [om]]
[prismatic/schema "0.3.1"
:exclusions [org.clojure/clojurescript]]
[om "0.8.0-beta5"]]
[org.omcljs/om "0.8.7" :scope "provided"]]
:profiles {:provided
{:dependencies [[org.clojure/clojurescript "0.0-2411"]
[secretary "1.2.0"]
Expand Down
11 changes: 11 additions & 0 deletions src/om_bootstrap/mixins.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,14 @@
(bind-root-close-handlers! owner)
(unbind-root-close-handlers! owner))
(om/set-state! owner [:open?] open?)))


(defmixin collapsible-mixin
"Mixin that enables collapsible Panels. Similar to the Dropdown
Mixin it only manages a single piece of state - :collapsed?. The Panel
is opened and closen by clicking on the header."
(init-state [_] {:collapsed? false})
(isPanelCollapsed [owner] (om/get-state owner :collapsed?))
(toggleCollapsed
[owner]
(om/update-state! owner [:collapsed?] not)))
Loading

0 comments on commit 49e1e1f

Please sign in to comment.