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,19 @@
|
|
1
|
+
###
|
2
|
+
Parent component of a progressbar component
|
3
|
+
###
|
4
|
+
Bootstrap.BsProgressComponent = Ember.Component.extend(
|
5
|
+
layoutName: 'components/bs-progress'
|
6
|
+
classNames: ['progress']
|
7
|
+
classNameBindings: ['animated:active', 'stripped:progress-striped']
|
8
|
+
|
9
|
+
#If specified, a default progressbar is rendered, otherwise the user requires to supply a bs-progressbar sub component
|
10
|
+
progress: null
|
11
|
+
stripped:false
|
12
|
+
animated:false
|
13
|
+
|
14
|
+
default: (->
|
15
|
+
@progress
|
16
|
+
).property('progress')
|
17
|
+
)
|
18
|
+
|
19
|
+
Ember.Handlebars.helper 'bs-progress', Bootstrap.BsProgressComponent
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Bootstrap.BsProgressbarComponent = Ember.Component.extend(Bootstrap.TypeSupport,
|
2
|
+
layoutName: 'components/bs-progressbar'
|
3
|
+
classNames: ['progress-bar']
|
4
|
+
attributeBindings: ['style', 'role', 'aria-valuemin', 'ariaValueNow:aria-valuenow', 'aria-valuemax']
|
5
|
+
classTypePrefix: 'progress-bar'
|
6
|
+
role: 'progressbar'
|
7
|
+
'aria-valuemin': 0
|
8
|
+
'aria-valuemax': 100
|
9
|
+
|
10
|
+
init: ->
|
11
|
+
@._super()
|
12
|
+
|
13
|
+
style: ( ->
|
14
|
+
"width:#{@progress}%;"
|
15
|
+
).property('progress').cacheable()
|
16
|
+
|
17
|
+
ariaValueNow: ( ->
|
18
|
+
@progress
|
19
|
+
).property('progress').cacheable()
|
20
|
+
)
|
21
|
+
|
22
|
+
Ember.Handlebars.helper 'bs-progressbar', Bootstrap.BsProgressbarComponent
|
data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsWellComponent.coffee
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
Bootstrap.BsWellComponent = Ember.Component.extend(
|
2
|
+
layoutName: 'components/bs-well'
|
3
|
+
classNameBindings: ['small:well-sm', 'large:well-lg']
|
4
|
+
classNames: ['well']
|
5
|
+
|
6
|
+
click: ->
|
7
|
+
@sendAction('clicked')
|
8
|
+
)
|
9
|
+
|
10
|
+
Ember.Handlebars.helper 'bs-well', Bootstrap.BsWellComponent
|
@@ -0,0 +1,175 @@
|
|
1
|
+
Bootstrap.BsWizardStep = Bootstrap.ItemView.extend(Bootstrap.ItemSelection,Bootstrap.NavItem,
|
2
|
+
classNames: ['wizard-step']
|
3
|
+
classNameBindings: ['completed']
|
4
|
+
completed: false
|
5
|
+
template: Ember.Handlebars.compile([
|
6
|
+
'{{view view.stepAsLink}}'
|
7
|
+
].join("\n")
|
8
|
+
)
|
9
|
+
|
10
|
+
stepAsLink: Ember.View.extend (
|
11
|
+
tagName: 'a'
|
12
|
+
template: Ember.Handlebars.compile('{{view.parentView.title}}')
|
13
|
+
attributeBindings: ['href']
|
14
|
+
href: "#"
|
15
|
+
)
|
16
|
+
)
|
17
|
+
|
18
|
+
Bootstrap.BsWizardSteps = Bootstrap.ItemsView.extend(Bootstrap.Nav,
|
19
|
+
navType: 'pills'
|
20
|
+
classNames: ['wizard-steps']
|
21
|
+
itemViewClass: Bootstrap.BsWizardStep
|
22
|
+
|
23
|
+
currentItemIdx: (->
|
24
|
+
selected = @get('selected')
|
25
|
+
i=0
|
26
|
+
for view in @._childViews
|
27
|
+
if view.get('content') is selected
|
28
|
+
selectedItem = view
|
29
|
+
break
|
30
|
+
i++
|
31
|
+
|
32
|
+
if selectedItem then i else null
|
33
|
+
).property('selected')
|
34
|
+
)
|
35
|
+
|
36
|
+
Bootstrap.BsWizardStepPane = Bootstrap.ItemPaneView.extend(
|
37
|
+
)
|
38
|
+
|
39
|
+
Bootstrap.BsWizardStepsPanes = Bootstrap.ItemsPanesView.extend(
|
40
|
+
classNames: ['wizard-panes']
|
41
|
+
itemViewClass: Bootstrap.BsWizardStepPane
|
42
|
+
)
|
43
|
+
|
44
|
+
Bootstrap.BsWizardComponent = Ember.ContainerView.extend(Ember.TargetActionSupport,
|
45
|
+
classNames: ['wizard']
|
46
|
+
childViews: ['steps', 'panes', 'controls']
|
47
|
+
prevAllowed: true
|
48
|
+
|
49
|
+
items: (->
|
50
|
+
@._childViews?[0]
|
51
|
+
).property('content')
|
52
|
+
|
53
|
+
panes: (->
|
54
|
+
@._childViews[1]
|
55
|
+
).property('content')
|
56
|
+
|
57
|
+
steps: Bootstrap.BsWizardSteps.extend(
|
58
|
+
contentBinding: 'parentView.content'
|
59
|
+
selectedBinding: 'parentView.selected'
|
60
|
+
)
|
61
|
+
|
62
|
+
panes: Bootstrap.BsWizardStepsPanes.extend(
|
63
|
+
contentBinding: 'parentView.content'
|
64
|
+
)
|
65
|
+
|
66
|
+
controls: Ember.ContainerView.extend (
|
67
|
+
childViews: ['prev', 'next', 'finish']
|
68
|
+
|
69
|
+
prev: Bootstrap.BsButtonComponent.extend(
|
70
|
+
#TODO: This is a hack until it will be possible to extend from component as it looses the template association
|
71
|
+
#see https://github.com/emberjs/ember.js/issues/3376
|
72
|
+
layoutName: 'components/bs-button'
|
73
|
+
title: 'Prev'
|
74
|
+
size: 'xs'
|
75
|
+
"data-rel": 'PREV'
|
76
|
+
isVisible: (->
|
77
|
+
@get('parentView').get('parentView').get('hasPrev')
|
78
|
+
).property('parentView.parentView.items.selected')
|
79
|
+
)
|
80
|
+
next: Bootstrap.BsButtonComponent.extend(
|
81
|
+
#TODO: This is a hack until it will be possible to extend from component as it looses the template association
|
82
|
+
#see https://github.com/emberjs/ember.js/issues/3376
|
83
|
+
layoutName: 'components/bs-button'
|
84
|
+
title: 'Next'
|
85
|
+
size: 'xs'
|
86
|
+
"data-rel": 'NEXT'
|
87
|
+
isVisible: (->
|
88
|
+
@get('parentView').get('parentView').get('hasNext')
|
89
|
+
).property('parentView.parentView.items.selected')
|
90
|
+
)
|
91
|
+
finish: Bootstrap.BsButtonComponent.extend(
|
92
|
+
#TODO: This is a hack until it will be possible to extend from component as it looses the template association
|
93
|
+
#see https://github.com/emberjs/ember.js/issues/3376
|
94
|
+
layoutName: 'components/bs-button'
|
95
|
+
title: 'Finish'
|
96
|
+
size: 'xs'
|
97
|
+
"data-rel": 'FINISH'
|
98
|
+
isVisible: (->
|
99
|
+
@get('parentView').get('parentView').get('isLast')
|
100
|
+
).property('parentView.parentView.items.selected')
|
101
|
+
)
|
102
|
+
)
|
103
|
+
|
104
|
+
currentStepIdx: (->
|
105
|
+
@get('items').get('currentItemIdx')
|
106
|
+
#TODO: Although the selectedBinding: 'parentView.selected', this doesnt work properly and is only calculated in the next change for some unknown reason.
|
107
|
+
#).property('selected')
|
108
|
+
).property('items.selected')
|
109
|
+
|
110
|
+
willInsertElement: ->
|
111
|
+
@get('panes').set('items-id',@get('items').get('elementId'))
|
112
|
+
@get('items').set('default', @.get('items')._childViews[0].get('content').get('title'))
|
113
|
+
|
114
|
+
click: (event) ->
|
115
|
+
b = event.target.getAttribute("data-rel")
|
116
|
+
@prev() if b is 'PREV'
|
117
|
+
@next() if b is 'NEXT'
|
118
|
+
@close() if b is 'FINISH'
|
119
|
+
next: () ->
|
120
|
+
if @get('hasNext')
|
121
|
+
@stepCompleted(@get('currentStepIdx'))
|
122
|
+
currIdx = @get('currentStepIdx')+1
|
123
|
+
#@set 'currentItemIdx', currIdx
|
124
|
+
@move(currIdx)
|
125
|
+
@triggerAction
|
126
|
+
action: 'onNext'
|
127
|
+
actionContext: @get('targetObject')
|
128
|
+
|
129
|
+
prev: () ->
|
130
|
+
if @get('hasPrev')
|
131
|
+
currIdx = @get('currentStepIdx')-1
|
132
|
+
@stepCompleted(currIdx, false)
|
133
|
+
#@set 'currentItemIdx', currIdx
|
134
|
+
@move(currIdx)
|
135
|
+
@triggerAction
|
136
|
+
action: 'onPrev'
|
137
|
+
actionContext: @get('targetObject')
|
138
|
+
|
139
|
+
|
140
|
+
move: (idx) ->
|
141
|
+
@._childViews[0]?.set 'selected', @._childViews[0]._childViews[idx]?.get('content')
|
142
|
+
|
143
|
+
hasNext: (->
|
144
|
+
@get('items')._childViews.length > @get('currentStepIdx')+1
|
145
|
+
).property('currentStepIdx')
|
146
|
+
|
147
|
+
hasPrev: (->
|
148
|
+
@get('currentStepIdx') > 0
|
149
|
+
@get('currentStepIdx') > 0 and @get('prevAllowed')
|
150
|
+
).property('currentStepIdx')
|
151
|
+
|
152
|
+
isLast: (->
|
153
|
+
@get('items')._childViews.length is @get('currentStepIdx')+1
|
154
|
+
).property('currentStepIdx')
|
155
|
+
|
156
|
+
close: ( ->
|
157
|
+
@triggerAction
|
158
|
+
action: 'onFinish'
|
159
|
+
actionContext: @get('targetObject')
|
160
|
+
@destroy()
|
161
|
+
)
|
162
|
+
|
163
|
+
stepCompleted: (idx, compl=true) ->
|
164
|
+
@._childViews[0]._childViews[idx].set('completed', compl)
|
165
|
+
)
|
166
|
+
|
167
|
+
Bootstrap.BsWizardComponent = Bootstrap.BsWizardComponent.reopenClass(
|
168
|
+
build: (options) ->
|
169
|
+
options = {} unless options
|
170
|
+
options.manual = true
|
171
|
+
wizard = @create(options)
|
172
|
+
wizard.append()
|
173
|
+
)
|
174
|
+
|
175
|
+
Ember.Handlebars.helper 'bs-wizard', Bootstrap.BsWizardComponent
|
@@ -0,0 +1,161 @@
|
|
1
|
+
###
|
2
|
+
A Growl-like notifications component.
|
3
|
+
Originally written by Aaron Haurwitz (http://aaron.haurwitz.com/), licensed under MIT.
|
4
|
+
###
|
5
|
+
Bootstrap.GrowlNotifications = Ember.CollectionView.extend (
|
6
|
+
###
|
7
|
+
@property {String[]} The array of concrete class names to put on this view's element
|
8
|
+
###
|
9
|
+
classNames: ['growl-notifications']
|
10
|
+
###
|
11
|
+
Binding to the GrowlNotificationManager's notifications array
|
12
|
+
Each of the array element will be rendered as a notification view (see ItemViewClass)
|
13
|
+
###
|
14
|
+
contentBinding: 'Bootstrap.GNM.notifications'
|
15
|
+
attributeBindings: ['style']
|
16
|
+
showTime: 10000
|
17
|
+
|
18
|
+
###
|
19
|
+
@property {View} Notification view class
|
20
|
+
Determines what view class to render for each item in the content array.
|
21
|
+
###
|
22
|
+
itemViewClass: Ember.View.extend(
|
23
|
+
classNames: ['growl-notification']
|
24
|
+
template: Ember.Handlebars.compile '''
|
25
|
+
<span class="icon"><i class="fa {{unbound view.iconType}}"></i></span>
|
26
|
+
<a class="close-notification" {{action "close" target="view"}}>
|
27
|
+
<span style="font-size: 15px;"><i class="fa fa-times"></i></span>
|
28
|
+
</a>
|
29
|
+
<strong>
|
30
|
+
{{view.content.title}}
|
31
|
+
</strong>
|
32
|
+
<p>
|
33
|
+
{{view.content.sub}}
|
34
|
+
</p>
|
35
|
+
'''
|
36
|
+
classNameBindings: [
|
37
|
+
":growl-notification"
|
38
|
+
"content.closed"
|
39
|
+
"isOpaque"
|
40
|
+
]
|
41
|
+
attributeBindings: ['style']
|
42
|
+
###
|
43
|
+
@property {Number} Will be set by `didInsertElement`, used for clearing the auto-hide timeout.
|
44
|
+
###
|
45
|
+
timeoutId: null
|
46
|
+
###
|
47
|
+
@property {Boolean} should the view be opaque now?
|
48
|
+
Used for fancy fading purposes.
|
49
|
+
###
|
50
|
+
isOpaque: false
|
51
|
+
|
52
|
+
###
|
53
|
+
Lifecycle hook - called when view is created.
|
54
|
+
###
|
55
|
+
init: ->
|
56
|
+
@._super()
|
57
|
+
fn = (=>
|
58
|
+
@notifyPropertyChange "style"
|
59
|
+
)
|
60
|
+
@set "_recomputeStyle", fn
|
61
|
+
$(window).bind "resize", fn
|
62
|
+
|
63
|
+
###
|
64
|
+
View lifecycle hook - called when the view enters the DOM.
|
65
|
+
###
|
66
|
+
didInsertElement: ->
|
67
|
+
#@$().fadeIn(@get('fadeInTime'))
|
68
|
+
# Be prepared to auto-hide the notification
|
69
|
+
@set "timeoutId", setTimeout((=>
|
70
|
+
#@send "close"
|
71
|
+
@send("close")
|
72
|
+
), @get("parentView.showTime"))
|
73
|
+
|
74
|
+
# Fade in the view.
|
75
|
+
Ember.run.later this, (->
|
76
|
+
@set "isOpaque", true
|
77
|
+
), 1
|
78
|
+
|
79
|
+
###
|
80
|
+
Lifecycle hook - called right before view is destroyed
|
81
|
+
###
|
82
|
+
willDestroyElement: ->
|
83
|
+
$(window).unbind('resize', @get('_recomputeStyle'))
|
84
|
+
|
85
|
+
|
86
|
+
style: (->
|
87
|
+
notifications = @get('parentView.content').rejectProperty('closed', true)
|
88
|
+
index = notifications.indexOf(@get('content'))
|
89
|
+
viewportHeight = $(window).height()
|
90
|
+
unitHeight = 80
|
91
|
+
unitWidth = 320
|
92
|
+
unitsPerColumn = Math.floor(viewportHeight / unitHeight)
|
93
|
+
column = Math.floor(index / unitsPerColumn)
|
94
|
+
row = index % unitsPerColumn
|
95
|
+
|
96
|
+
return '' if index is -1
|
97
|
+
topPx = row * unitHeight
|
98
|
+
rightPx = column * unitWidth
|
99
|
+
|
100
|
+
'top: ' + topPx + 'px; right: ' + rightPx + 'px;'
|
101
|
+
).property('parentView.content.@each.closed')
|
102
|
+
|
103
|
+
|
104
|
+
###
|
105
|
+
This is simply computed property for mapping a meaningful type name to a FontAwesome CSS class.
|
106
|
+
###
|
107
|
+
iconType: (->
|
108
|
+
type = this.get('content.type')
|
109
|
+
hash =
|
110
|
+
'info': 'fa-bullhorn'
|
111
|
+
'success': 'fa-check'
|
112
|
+
'warning': 'fa-exclamation'
|
113
|
+
'danger': 'fa-times'
|
114
|
+
hash[type] || ''
|
115
|
+
).property('content.type')
|
116
|
+
|
117
|
+
actions:
|
118
|
+
close: ->
|
119
|
+
@set('isOpaque', false)
|
120
|
+
setTimeout (=>
|
121
|
+
@get('parentView.content').removeObject(@get('content'))
|
122
|
+
clearTimeout @get("timeoutId")
|
123
|
+
|
124
|
+
), 300
|
125
|
+
)
|
126
|
+
)
|
127
|
+
|
128
|
+
Ember.Handlebars.helper 'bs-growl-notifications', Bootstrap.GrowlNotifications
|
129
|
+
|
130
|
+
###
|
131
|
+
A manager that is responsible for getting told about new notifications and storing them within an array.
|
132
|
+
###
|
133
|
+
Bootstrap.GNM = Bootstrap.GrowlNotificationManager = Ember.Object.create(
|
134
|
+
###
|
135
|
+
@property {Array} A global array for storing notification objects.
|
136
|
+
###
|
137
|
+
notifications: Ember.A()
|
138
|
+
|
139
|
+
###
|
140
|
+
An exposed method for pushing new notification.
|
141
|
+
@param title {String} leading text
|
142
|
+
@param sub {String} supporting text
|
143
|
+
@param type {String} classification; used for which icon to show
|
144
|
+
###
|
145
|
+
push: (title, sub, type) ->
|
146
|
+
type = type?= 'info'
|
147
|
+
notif = Bootstrap.Notification.create(
|
148
|
+
title: title
|
149
|
+
sub: sub
|
150
|
+
type: type
|
151
|
+
closed: false
|
152
|
+
)
|
153
|
+
@get('notifications').pushObject(notif)
|
154
|
+
)
|
155
|
+
|
156
|
+
|
157
|
+
###
|
158
|
+
An object that represents a notification to be displayed.
|
159
|
+
###
|
160
|
+
Bootstrap.GrowlNotification = Ember.Object.extend(
|
161
|
+
)
|
data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/Notifications.coffee
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
###
|
2
|
+
A view that displays notification (messages).
|
3
|
+
|
4
|
+
Currently a single notification is displayed as an Alert on top of the screen, each notification in a time.
|
5
|
+
###
|
6
|
+
Bootstrap.NotificationsView = Ember.CollectionView.extend (
|
7
|
+
classNames: ['notifications']
|
8
|
+
attributeBindings: ['style']
|
9
|
+
contentBinding: 'Bootstrap.NM.content'
|
10
|
+
showTime: 2000
|
11
|
+
fadeInTime: 500
|
12
|
+
fadeOutTime: 3000
|
13
|
+
showTimeTimeoutId: null
|
14
|
+
|
15
|
+
###
|
16
|
+
itemViewClass: Bootstrap.BsAlertComponent.extend(
|
17
|
+
messageBinding: 'content.message'
|
18
|
+
typeBinding: 'content.type'
|
19
|
+
fadeInTimeBinding: 'parentView.fadeInTime'
|
20
|
+
isVisible: false
|
21
|
+
|
22
|
+
didInsertElement: ->
|
23
|
+
@$().fadeIn(@get('fadeInTime'))
|
24
|
+
)
|
25
|
+
###
|
26
|
+
|
27
|
+
itemViewClass: Ember.View.extend(
|
28
|
+
classNames: ['alert', 'notification']
|
29
|
+
template: Ember.Handlebars.compile '{{view.content.message}}'
|
30
|
+
classNameBindings: ["alertType"]
|
31
|
+
isVisible: false
|
32
|
+
alertType: (->
|
33
|
+
@get('content').get('classType')
|
34
|
+
).property('content')
|
35
|
+
|
36
|
+
didInsertElement: ->
|
37
|
+
@$().fadeIn(@get('fadeInTime'))
|
38
|
+
)
|
39
|
+
|
40
|
+
contentChanged: (->
|
41
|
+
if @get('content').length > 0
|
42
|
+
@resetShowTime()
|
43
|
+
).observes('content.length')
|
44
|
+
|
45
|
+
resetShowTime: ->
|
46
|
+
@$().css(display: 'block')
|
47
|
+
@$().stop().animate opacity: "100" if @$().is(":animated")
|
48
|
+
clearTimeout(@showTimeTimeoutId) if @showTimeTimeoutId?
|
49
|
+
@showTimeTimeoutId = setTimeout(=>
|
50
|
+
@fadeOut(@)
|
51
|
+
, @showTime)
|
52
|
+
|
53
|
+
fadeOut: (that)->
|
54
|
+
that.$().fadeOut(that.fadeOutTime, () ->
|
55
|
+
that.get('content').clear()
|
56
|
+
)
|
57
|
+
|
58
|
+
mouseEnter: () ->
|
59
|
+
@$().stop().animate opacity: "100" if @$().is(":animated")
|
60
|
+
|
61
|
+
mouseLeave: () ->
|
62
|
+
@resetShowTime()
|
63
|
+
)
|
64
|
+
|
65
|
+
Ember.Handlebars.helper 'bs-notifications', Bootstrap.NotificationsView
|
66
|
+
|
67
|
+
Bootstrap.NM = Bootstrap.NotificationManager = Ember.Object.create(
|
68
|
+
content: Ember.A()
|
69
|
+
push: (message, type) ->
|
70
|
+
type = type?= 'info'
|
71
|
+
notif = Bootstrap.Notification.create(
|
72
|
+
message: message
|
73
|
+
type: type
|
74
|
+
)
|
75
|
+
@get('content').pushObject(notif)
|
76
|
+
|
77
|
+
)
|
78
|
+
|
79
|
+
|
80
|
+
###
|
81
|
+
This object represents a notification to be displayed.
|
82
|
+
Notification(s) are added into the NotificationQueue by the pushNotification function.
|
83
|
+
###
|
84
|
+
Bootstrap.Notification = Ember.Object.extend(
|
85
|
+
classType: (->
|
86
|
+
if @type? then "alert-#{@type}" else null
|
87
|
+
).property('type').cacheable()
|
88
|
+
)
|