bootstrap-for-ember-rails 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.gitmodules +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +32 -0
- data/Rakefile +2 -0
- data/bootstrap-for-ember-rails.gemspec +36 -0
- data/lib/bootstrap-for-ember-rails.rb +9 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/.bowerrc +3 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/.gitignore +5 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/Gruntfile.js +459 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/LICENSE +191 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/README.md +80 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/index.html +176 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsAlertComponent.coffee +30 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBadgeComponent.coffee +8 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBreadcrumbs.coffee +65 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBtnGroup.coffee +19 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBtnToolbarComponent.coffee +11 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsButtonComponent.coffee +45 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsItemsActionBar.coffee +45 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsLabelComponent.coffee +8 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsListGroupComponent.coffee +34 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsModalComponent.coffee +204 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPageHeaderComponent.coffee +6 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPanelComponent.coffee +35 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPill.coffee +20 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPills.coffee +9 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPopover.coffee +443 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsProgressComponent.coffee +19 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsProgressbarComponent.coffee +22 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsTabPane.coffee +2 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsTabs.coffee +9 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsTabsPanes.coffee +6 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsWellComponent.coffee +10 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsWizardComponent.coffee +175 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/GrowlNotifications.coffee +161 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/Notifications.coffee +88 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/init.coffee +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemSelection.coffee +68 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemValue.coffee +18 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemsSelection.coffee +14 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/Nav.coffee +13 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/NavItem.coffee +7 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/Size.coffee +37 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/Type.coffee +17 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/WithRouter.coffee +8 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase.coffee +16 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsAlertController.coffee +11 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsButtonController.coffee +24 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsItemsActionBarController.coffee +39 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsPanelController.coffee +8 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsPopoverController.coffee +45 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsProgressbarController.coffee +11 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsTooltipBoxController.coffee +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsWellController.coffee +4 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentButtonGroupController.coffee +8 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentPillsController.coffee +20 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsGrowlNotifController.coffee +11 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsListGroupController.coffee +12 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsModalController.coffee +53 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsNotificationsController.coffee +11 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsTabsController.coffee +12 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsTabsFooController.coffee +2 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsTabsPanesController.coffee +6 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsWizardController.coffee +45 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/UserController.coffee +7 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/router.coffee +29 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/routes/ApplicationRoute.coffee +26 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/routes/PopoverRoute.coffee +10 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/vendor/bootstrap.js +2276 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemPaneView.coffee +29 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemView.coffee +49 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemsPanesView.coffee +12 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemsView.coffee +15 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/styles/components/growl-notifications.css +58 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/styles/main.scss +7 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-alert.hbs +4 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-badge.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-btn-toolbar.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-button.hbs +4 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-label.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-modal.hbs +28 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-page-header.hbs +6 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-panel.hbs +26 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-progress.hbs +5 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-progressbar.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-well.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/ads.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/application.hbs +51 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/demo-template.hbs +4 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/footer.hbs +0 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/header.hbs +0 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/index.hbs +7 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/leftnav.hbs +13 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/nav-main.hbs +24 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/alert.md +115 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/badge.md +80 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/breadcrumbs.md +28 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/button.md +247 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/buttonGroup.md +99 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/growl-notif.md +70 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/items_action_bar.md +87 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/label.md +44 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/list-group.md +70 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/modal.md +167 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/notifications.md +76 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/page-header.md +15 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/panel.md +123 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/pills.md +104 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/popover.md +213 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/progressbar.md +117 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/tabs-panes.md +42 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/tabs-with-routes.md +64 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/tabs.md +30 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/template.jst +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/well.md +84 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/wizard.md +109 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/social-buttons.hbs +13 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/tabs/bar-tabpane.hbs +2 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/tabs/baz-tabpane.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/tabs/foo-tabpane.hbs +2 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user.hbs +3 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user/activities.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user/general.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user/privacy.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/wizard/step1.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/wizard/step2.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/wizard/step3.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/views/item-pane.hbs +3 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/bower.json +59 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/css/bs-growl-notifications.min.css +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-alert.max.js +158 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-alert.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-badge.max.js +26 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-badge.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-basic.max.js +230 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-basic.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-breadcrumbs.max.js +77 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-breadcrumbs.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-button.max.js +275 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-button.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-core.max.js +476 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-core.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-growl-notifications.max.js +162 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-growl-notifications.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-items-action-bar.max.js +45 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-items-action-bar.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-label.max.js +26 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-label.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-list-group.max.js +29 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-list-group.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-modal.max.js +314 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-modal.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-nav.max.js +51 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-nav.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-notifications.max.js +111 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-notifications.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-popover.max.js +402 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-popover.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-progressbar.max.js +102 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-progressbar.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-wizard.max.js +182 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-wizard.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/package.json +36 -0
- data/lib/bootstrap-for-ember-rails/version.rb +3 -0
- metadata +253 -0
@@ -0,0 +1 @@
|
|
1
|
+
Bootstrap = window.Bootstrap = Ember.Namespace.create()
|
data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemSelection.coffee
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
###
|
2
|
+
A Mixin to enhance items enhanced with the 'IsItem' Mixin with selection capability.
|
3
|
+
|
4
|
+
When a click event is received the current item will be stored in the parent view 'selected' property,
|
5
|
+
An extra 'active' css class will be assigned to the Item (this) if this is a selected item.
|
6
|
+
###
|
7
|
+
Bootstrap.ItemSelection = Ember.Mixin.create(Bootstrap.ItemValue, Bootstrap.WithRouter,
|
8
|
+
classNameBindings: ["isActive:active"]
|
9
|
+
|
10
|
+
init: ->
|
11
|
+
@_super()
|
12
|
+
@didRouteChange()
|
13
|
+
|
14
|
+
didRouteChange: (->
|
15
|
+
linkTo = @get('content.linkTo')
|
16
|
+
return unless linkTo?
|
17
|
+
itemsView = @get('parentView')
|
18
|
+
return unless itemsView?
|
19
|
+
if @get('router')?.isActive(linkTo)
|
20
|
+
itemsView.set('selected', @get('value'))
|
21
|
+
).observes('router.url')
|
22
|
+
|
23
|
+
###
|
24
|
+
Determine whether the current item is selected,
|
25
|
+
if true the 'active' css class will be associated with the this DOM's element.
|
26
|
+
|
27
|
+
This is a calculated property and will be retriggered if the 'value' property of the item has changed or the 'selected' property
|
28
|
+
in the parent ItemsView.
|
29
|
+
###
|
30
|
+
isActive: (->
|
31
|
+
#TODO: Ensure parentView is inherited from ItemsView
|
32
|
+
itemsView = @get('parentView')
|
33
|
+
if not itemsView?
|
34
|
+
return false
|
35
|
+
selected = itemsView.get 'selected'
|
36
|
+
value = @get 'value'
|
37
|
+
|
38
|
+
if not value?
|
39
|
+
return false
|
40
|
+
|
41
|
+
selected is value
|
42
|
+
).property('value', 'parentView.selected', 'content.linkTo').cacheable()
|
43
|
+
|
44
|
+
###
|
45
|
+
Handle selection by click event.
|
46
|
+
|
47
|
+
The identifier of the selection is based on the 'content' property of this item.
|
48
|
+
###
|
49
|
+
click: (event) ->
|
50
|
+
#event.stopPropagation()
|
51
|
+
event.preventDefault()
|
52
|
+
|
53
|
+
#TODO: Ensure parentView is inherited from ItemsView
|
54
|
+
itemsView = @get('parentView')
|
55
|
+
if not itemsView?
|
56
|
+
return
|
57
|
+
|
58
|
+
content = @get('content')
|
59
|
+
#TODO: Ensure its an Ember object
|
60
|
+
if typeof(content) is 'object'
|
61
|
+
return if content.get('disabled')
|
62
|
+
|
63
|
+
# items with linkTo will be dispatched in didRouteChange
|
64
|
+
return if @get('content.linkTo')?
|
65
|
+
|
66
|
+
#Currently multi selection is not supported
|
67
|
+
itemsView.set('selected', @get('value'))
|
68
|
+
)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
###
|
2
|
+
A mixin for Items that have a value property
|
3
|
+
###
|
4
|
+
Bootstrap.ItemValue = Ember.Mixin.create(
|
5
|
+
###
|
6
|
+
The value of the item, currently Items content supports only an array of strings, so value is the actual 'content' property
|
7
|
+
of the item.
|
8
|
+
###
|
9
|
+
value: (->
|
10
|
+
#TODO: Ensure parentView is inherited from ItemsView
|
11
|
+
itemsView = @get('parentView')
|
12
|
+
if not itemsView?
|
13
|
+
return
|
14
|
+
|
15
|
+
value = @get('content')
|
16
|
+
value
|
17
|
+
).property('content').cacheable()
|
18
|
+
)
|
data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemsSelection.coffee
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
###
|
2
|
+
A Mixin to enhance views that extends from 'ItemsView' with selection capability.
|
3
|
+
###
|
4
|
+
Bootstrap.ItemsSelection = Ember.Mixin.create(
|
5
|
+
###
|
6
|
+
If true, multiple selection is supported
|
7
|
+
###
|
8
|
+
multiSelection: false
|
9
|
+
|
10
|
+
###
|
11
|
+
An array of selected item(s), can be also bound to a controller property via 'selectedBinding'
|
12
|
+
###
|
13
|
+
selected: []
|
14
|
+
)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
###
|
2
|
+
A Mixin that provides the basic configuration for rendering a Bootstrap navigation such as tabs and pills
|
3
|
+
###
|
4
|
+
Bootstrap.Nav = Ember.Mixin.create(
|
5
|
+
classNames: ['nav']
|
6
|
+
classNameBindings: ['navTypeClass']
|
7
|
+
tagName: 'ul'
|
8
|
+
navType: null
|
9
|
+
|
10
|
+
navTypeClass: ( ->
|
11
|
+
if @navType? then "nav-#{@navType}" else null
|
12
|
+
).property('navType').cacheable()
|
13
|
+
)
|
@@ -0,0 +1,7 @@
|
|
1
|
+
###
|
2
|
+
A Mixin that provides the basic configuration for rendering and interacting with Bootstrap navigation item such a pill or a tab.
|
3
|
+
###
|
4
|
+
Bootstrap.NavItem = Ember.Mixin.create(Bootstrap.SelectableView
|
5
|
+
#unncessary as Ember magically matches this according to the parent collectionView tag
|
6
|
+
#tagName: 'li'
|
7
|
+
)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Bootstrap = window.Bootstrap
|
2
|
+
get = Ember.get
|
3
|
+
set = Ember.set
|
4
|
+
|
5
|
+
Bootstrap.SizeSupport = Ember.Mixin.create(
|
6
|
+
classTypePrefix: Ember.required(String)
|
7
|
+
classNameBindings: ['sizeClass', 'largeSizeClass', 'smallSizeClass', 'extraSmallSizeClass']
|
8
|
+
#Size value according to Bootstrap sizes: sm/lg/xs
|
9
|
+
size: null
|
10
|
+
#possible properties to define component size
|
11
|
+
xs: null
|
12
|
+
small: null
|
13
|
+
large: null
|
14
|
+
|
15
|
+
|
16
|
+
extraSmallSizeClass: ( ->
|
17
|
+
pref = @get 'classTypePrefix'
|
18
|
+
if @xs then "#{pref}-xs" else null
|
19
|
+
).property('xs').cacheable()
|
20
|
+
|
21
|
+
smallSizeClass: ( ->
|
22
|
+
pref = @get 'classTypePrefix'
|
23
|
+
if @small then "#{pref}-sm" else null
|
24
|
+
).property('small').cacheable()
|
25
|
+
|
26
|
+
largeSizeClass: ( ->
|
27
|
+
pref = @get 'classTypePrefix'
|
28
|
+
if @large then "#{pref}-lg" else null
|
29
|
+
).property('large').cacheable()
|
30
|
+
|
31
|
+
sizeClass: ( ->
|
32
|
+
size = @get 'size'
|
33
|
+
pref = @get 'classTypePrefix'
|
34
|
+
|
35
|
+
if size then "#{pref}-#{size}" else null
|
36
|
+
).property('size').cacheable()
|
37
|
+
)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Bootstrap = window.Bootstrap
|
2
|
+
get = Ember.get
|
3
|
+
set = Ember.set
|
4
|
+
|
5
|
+
Bootstrap.TypeSupport = Ember.Mixin.create(
|
6
|
+
classTypePrefix: Ember.required(String)
|
7
|
+
classNameBindings: ['typeClass']
|
8
|
+
type: 'default'
|
9
|
+
|
10
|
+
typeClass: ( ->
|
11
|
+
type = @get 'type'
|
12
|
+
type = 'default' if not type?
|
13
|
+
|
14
|
+
pref = @get 'classTypePrefix'
|
15
|
+
"#{pref}-#{type}"
|
16
|
+
).property('type').cacheable()
|
17
|
+
)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Bootstrap = window.Bootstrap
|
2
|
+
Showcase = window.Showcase = Ember.Application.create(
|
3
|
+
LOG_TRANSITIONS: true
|
4
|
+
LOG_VIEW_LOOKUPS: true
|
5
|
+
LOG_ACTIVE_GENERATION: true
|
6
|
+
)
|
7
|
+
|
8
|
+
Ember.ENV =
|
9
|
+
HELPER_PARAM_LOOKUPS: true
|
10
|
+
|
11
|
+
Ember.Handlebars.registerHelper 'raw', (value) ->
|
12
|
+
value.fn(value)
|
13
|
+
|
14
|
+
require('scripts/showcase/router')
|
15
|
+
require('scripts/showcase/routes/*')
|
16
|
+
require('scripts/showcase/controllers/*')
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Showcase.ShowComponentsAlertController = Ember.Controller.extend(
|
2
|
+
actions:
|
3
|
+
submit: ->
|
4
|
+
alert "Action taken by controller!"
|
5
|
+
|
6
|
+
didAlertClosed: ->
|
7
|
+
alert "From controller: The -closed- event was triggered."
|
8
|
+
|
9
|
+
didAlertClose: ->
|
10
|
+
alert "From controller: The -close- event was triggered."
|
11
|
+
)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Showcase.ShowComponentsButtonController = Ember.Controller.extend(
|
2
|
+
isButtonDisabled: false
|
3
|
+
loadingState: null
|
4
|
+
loadingState1: null
|
5
|
+
|
6
|
+
actions:
|
7
|
+
disableButton: ->
|
8
|
+
@set 'isButtonDisabled', true
|
9
|
+
|
10
|
+
startLoading: ->
|
11
|
+
@set 'loadingState', 'loading'
|
12
|
+
Ember.run.later(() =>
|
13
|
+
@set 'loadingState', null
|
14
|
+
, 2000)
|
15
|
+
|
16
|
+
startLoading1: ->
|
17
|
+
@set 'loadingState1', 'loading'
|
18
|
+
Ember.run.later(() =>
|
19
|
+
@set 'loadingState1', 'completed'
|
20
|
+
, 2000)
|
21
|
+
|
22
|
+
buttonWithParam: (expectedMyself) ->
|
23
|
+
alert "Passed controller as a param: #{expectedMyself}"
|
24
|
+
)
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Showcase.ShowComponentsItemsActionBarController = Ember.Controller.extend(
|
2
|
+
actionsInBar: [
|
3
|
+
[
|
4
|
+
{
|
5
|
+
title: 'To Alerts',
|
6
|
+
#return true if action should be disabled, this method is invoked whenever the selection is changed.
|
7
|
+
disabled: (selection) ->
|
8
|
+
true if selection.size < 1 || selection?[0]?.title isnt 'Alerts'
|
9
|
+
#transition to some route when action is clicked
|
10
|
+
transitionTo: 'show_components.alert'
|
11
|
+
},
|
12
|
+
{
|
13
|
+
title: 'To Panels',
|
14
|
+
transitionTo: 'show_components.panel'
|
15
|
+
disabled: (selection) ->
|
16
|
+
true if selection.size < 1 || selection?[0]?.title isnt 'Panels'
|
17
|
+
}
|
18
|
+
]
|
19
|
+
[
|
20
|
+
{
|
21
|
+
title: 'To Wizard',
|
22
|
+
disabled: (selection) ->
|
23
|
+
true if selection.size < 1 || selection?[0]?.title isnt 'Wizards'
|
24
|
+
#invoke a controller action when action is clicked
|
25
|
+
clickActionName: 'wizard'
|
26
|
+
}
|
27
|
+
]
|
28
|
+
]
|
29
|
+
|
30
|
+
actions:
|
31
|
+
wizard: (selection) ->
|
32
|
+
alert "Wizard pressed!"
|
33
|
+
|
34
|
+
items: [
|
35
|
+
Ember.Object.create({title: 'Alerts'}),
|
36
|
+
Ember.Object.create({title: 'Panels'}),
|
37
|
+
Ember.Object.create({title: 'Wizards'})
|
38
|
+
]
|
39
|
+
)
|
@@ -0,0 +1,45 @@
|
|
1
|
+
Showcase.ShowComponentsPopoverController = Ember.Controller.extend(
|
2
|
+
testObject: Ember.Object.createWithMixins
|
3
|
+
sticky: (->
|
4
|
+
return Ember.Object.create(
|
5
|
+
user: this,
|
6
|
+
content: 'know this is a sticky tooltip! You can hover over it.',
|
7
|
+
trigger: 'hover',
|
8
|
+
sticky: true
|
9
|
+
)
|
10
|
+
).property()
|
11
|
+
|
12
|
+
user: Ember.Object.create
|
13
|
+
firstNameBinding: 'content.name'
|
14
|
+
title: 'rename'
|
15
|
+
template: 'name: {{input type="text" value=content.name}}'
|
16
|
+
content:
|
17
|
+
name: 'John'
|
18
|
+
trigger: 'hover'
|
19
|
+
sticky: true
|
20
|
+
|
21
|
+
|
22
|
+
hoverPop: Ember.Object.create
|
23
|
+
title: "I'm a title!"
|
24
|
+
content: "And i'm a content!"
|
25
|
+
trigger: "hover"
|
26
|
+
placement: "right"
|
27
|
+
sticky: true
|
28
|
+
|
29
|
+
clickPop: Ember.Object.create
|
30
|
+
title: "Clickable!"
|
31
|
+
content: '<h1>Hello</h1><small>This is a clickable popover with html content!</small>'
|
32
|
+
placement: "left"
|
33
|
+
html: true
|
34
|
+
|
35
|
+
templPop: Ember.Object.create
|
36
|
+
firstName: 'numbers'
|
37
|
+
title: 'Popover with Template'
|
38
|
+
template: 'numbers:<ul>' +
|
39
|
+
'{{#each val in content.numbers}}' +
|
40
|
+
' <li>{{val}}</li>' +
|
41
|
+
'{{/each}}' +
|
42
|
+
'</ul>'
|
43
|
+
content:
|
44
|
+
numbers: [1,2,3]
|
45
|
+
)
|
@@ -0,0 +1 @@
|
|
1
|
+
Showcase.ShowComponentsTooltipBoxController = Bootstrap.TooltipBoxController
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Showcase.ShowComponentsButtonGroupController = Ember.Controller.extend(
|
2
|
+
options: ['Home', 'Profile', 'Messages']
|
3
|
+
options2: ['Admin','Settings']
|
4
|
+
optionsWithMeta: [
|
5
|
+
Ember.Object.create({title: 'Create', type: 'primary'})
|
6
|
+
Ember.Object.create({title: 'Destroy', type: 'danger'})
|
7
|
+
]
|
8
|
+
)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Showcase.ShowComponentsPillsController = Ember.Controller.extend(
|
2
|
+
content: ['Home', 'Profile', 'Messages']
|
3
|
+
|
4
|
+
init: () ->
|
5
|
+
@._super()
|
6
|
+
@set('content1', Ember.A([
|
7
|
+
Ember.Object.create({ title: 'Home', default: true, disabled: false }),
|
8
|
+
Ember.Object.create({ title: 'Admin', disabled: true })
|
9
|
+
]))
|
10
|
+
|
11
|
+
@set('selected1', @get('content1').objectAt(0))
|
12
|
+
|
13
|
+
contentChanged: (->
|
14
|
+
console.log("Selection has changed to: #{@get('selected')}")
|
15
|
+
).observes('selected')
|
16
|
+
|
17
|
+
actions:
|
18
|
+
disableHome: () ->
|
19
|
+
@get('content1').objectAt(0).set('disabled', true)
|
20
|
+
)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Showcase.ShowComponentsGrowlNotifController = Ember.Controller.extend(
|
2
|
+
actions:
|
3
|
+
pushInfo: () ->
|
4
|
+
Bootstrap.GNM.push('INFO!', 'Hello, this is just an info message.', 'info')
|
5
|
+
pushSuccess: () ->
|
6
|
+
Bootstrap.GNM.push('SUCCESS!', 'Successfully performed operation!', 'success')
|
7
|
+
pushWarn: () ->
|
8
|
+
Bootstrap.GNM.push('WARN!', 'Could not perform operation!', 'warning')
|
9
|
+
pushDanger: () ->
|
10
|
+
Bootstrap.GNM.push('Danger!', 'System is halting!', 'danger')
|
11
|
+
)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Showcase.ShowComponentsListGroupController = Ember.Controller.extend(
|
2
|
+
listSimple: Ember.A(['Cras justo odio', 'Dapibus ac facilisis in', 'Morbi leo risus'])
|
3
|
+
listWithBadges: Ember.A([
|
4
|
+
Ember.Object.create({title: 'Inbox', badge: '45'})
|
5
|
+
Ember.Object.create({title: 'Sent', badge: '33'})
|
6
|
+
])
|
7
|
+
|
8
|
+
listWithSub: Ember.A([
|
9
|
+
Ember.Object.create({title: 'Inbox', sub: 'Incoming mails folder', badge: '45'})
|
10
|
+
Ember.Object.create({title: 'Sent', sub: 'Sent emails folder', badge: '33'})
|
11
|
+
])
|
12
|
+
)
|
@@ -0,0 +1,53 @@
|
|
1
|
+
Showcase.ShowComponentsModalController = Ember.Controller.extend(
|
2
|
+
message: 'Welcome to Bootstrap for Ember..!'
|
3
|
+
|
4
|
+
#Footer buttons meta data
|
5
|
+
myModalButtons: [
|
6
|
+
Ember.Object.create({title: 'Submit', clicked:"submit"})
|
7
|
+
Ember.Object.create({title: 'Cancel', clicked:"cancel", dismiss: 'modal'})
|
8
|
+
]
|
9
|
+
|
10
|
+
manualButtons: [
|
11
|
+
Ember.Object.create({title: 'Submit', clicked:"submitManual"})
|
12
|
+
Ember.Object.create({title: 'Cancel', dismiss: 'modal'})
|
13
|
+
]
|
14
|
+
|
15
|
+
|
16
|
+
actions:
|
17
|
+
#Submit the modal
|
18
|
+
submit: ->
|
19
|
+
#Send a notification upon success submission
|
20
|
+
Bootstrap.NM.push('Successfully submitted modal', 'success')
|
21
|
+
#Hide the modal programatically
|
22
|
+
Bootstrap.ModalManager.hide('myModal')
|
23
|
+
|
24
|
+
#Cancel the modal, we don't need to hide the model manually because we set {..., dismiss: 'modal'} on the button meta data
|
25
|
+
cancel: ->
|
26
|
+
Bootstrap.NM.push('Modal was cancelled', 'info')
|
27
|
+
|
28
|
+
#Show the modal
|
29
|
+
show: ->
|
30
|
+
Bootstrap.ModalManager.show('myModal')
|
31
|
+
|
32
|
+
#Close (destroys) a programatically created modal
|
33
|
+
submitManual: ->
|
34
|
+
Bootstrap.NM.push('Modal destroyed!', 'success')
|
35
|
+
Bootstrap.ModalManager.close('manualModal')
|
36
|
+
|
37
|
+
createModalProgramatically: ->
|
38
|
+
body = Ember.View.extend(
|
39
|
+
template: Ember.Handlebars.compile('This is a programatic ')
|
40
|
+
)
|
41
|
+
|
42
|
+
Bootstrap.ModalManager.open('manualModal', 'Hello', 'demo-template', @manualButtons, @)
|
43
|
+
|
44
|
+
confirm: ->
|
45
|
+
Bootstrap.ModalManager.confirm(@);
|
46
|
+
|
47
|
+
modalConfirmed: ->
|
48
|
+
Bootstrap.NM.push('Confirmed!', 'success')
|
49
|
+
|
50
|
+
modalCanceled: ->
|
51
|
+
Bootstrap.NM.push('Cancelled!', 'info')
|
52
|
+
|
53
|
+
)
|