bootstrap-for-ember-rails 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +6 -0
  3. data/.gitmodules +3 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +32 -0
  7. data/Rakefile +2 -0
  8. data/bootstrap-for-ember-rails.gemspec +36 -0
  9. data/lib/bootstrap-for-ember-rails.rb +9 -0
  10. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/.bowerrc +3 -0
  11. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/.gitignore +5 -0
  12. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/Gruntfile.js +459 -0
  13. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/LICENSE +191 -0
  14. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/README.md +80 -0
  15. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/index.html +176 -0
  16. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsAlertComponent.coffee +30 -0
  17. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBadgeComponent.coffee +8 -0
  18. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBreadcrumbs.coffee +65 -0
  19. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBtnGroup.coffee +19 -0
  20. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBtnToolbarComponent.coffee +11 -0
  21. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsButtonComponent.coffee +45 -0
  22. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsItemsActionBar.coffee +45 -0
  23. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsLabelComponent.coffee +8 -0
  24. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsListGroupComponent.coffee +34 -0
  25. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsModalComponent.coffee +204 -0
  26. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPageHeaderComponent.coffee +6 -0
  27. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPanelComponent.coffee +35 -0
  28. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPill.coffee +20 -0
  29. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPills.coffee +9 -0
  30. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPopover.coffee +443 -0
  31. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsProgressComponent.coffee +19 -0
  32. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsProgressbarComponent.coffee +22 -0
  33. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsTabPane.coffee +2 -0
  34. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsTabs.coffee +9 -0
  35. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsTabsPanes.coffee +6 -0
  36. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsWellComponent.coffee +10 -0
  37. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsWizardComponent.coffee +175 -0
  38. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/GrowlNotifications.coffee +161 -0
  39. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/Notifications.coffee +88 -0
  40. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/init.coffee +1 -0
  41. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemSelection.coffee +68 -0
  42. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemValue.coffee +18 -0
  43. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemsSelection.coffee +14 -0
  44. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/Nav.coffee +13 -0
  45. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/NavItem.coffee +7 -0
  46. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/Size.coffee +37 -0
  47. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/Type.coffee +17 -0
  48. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/WithRouter.coffee +8 -0
  49. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase.coffee +16 -0
  50. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsAlertController.coffee +11 -0
  51. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsButtonController.coffee +24 -0
  52. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsItemsActionBarController.coffee +39 -0
  53. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsPanelController.coffee +8 -0
  54. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsPopoverController.coffee +45 -0
  55. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsProgressbarController.coffee +11 -0
  56. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsTooltipBoxController.coffee +1 -0
  57. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsWellController.coffee +4 -0
  58. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentButtonGroupController.coffee +8 -0
  59. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentPillsController.coffee +20 -0
  60. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsGrowlNotifController.coffee +11 -0
  61. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsListGroupController.coffee +12 -0
  62. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsModalController.coffee +53 -0
  63. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsNotificationsController.coffee +11 -0
  64. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsTabsController.coffee +12 -0
  65. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsTabsFooController.coffee +2 -0
  66. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsTabsPanesController.coffee +6 -0
  67. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsWizardController.coffee +45 -0
  68. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/UserController.coffee +7 -0
  69. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/router.coffee +29 -0
  70. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/routes/ApplicationRoute.coffee +26 -0
  71. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/routes/PopoverRoute.coffee +10 -0
  72. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/vendor/bootstrap.js +2276 -0
  73. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemPaneView.coffee +29 -0
  74. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemView.coffee +49 -0
  75. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemsPanesView.coffee +12 -0
  76. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemsView.coffee +15 -0
  77. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/styles/components/growl-notifications.css +58 -0
  78. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/styles/main.scss +7 -0
  79. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-alert.hbs +4 -0
  80. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-badge.hbs +1 -0
  81. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-btn-toolbar.hbs +1 -0
  82. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-button.hbs +4 -0
  83. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-label.hbs +1 -0
  84. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-modal.hbs +28 -0
  85. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-page-header.hbs +6 -0
  86. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-panel.hbs +26 -0
  87. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-progress.hbs +5 -0
  88. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-progressbar.hbs +1 -0
  89. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-well.hbs +1 -0
  90. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/ads.hbs +1 -0
  91. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/application.hbs +51 -0
  92. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/demo-template.hbs +4 -0
  93. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/footer.hbs +0 -0
  94. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/header.hbs +0 -0
  95. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/index.hbs +7 -0
  96. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/leftnav.hbs +13 -0
  97. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/nav-main.hbs +24 -0
  98. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/alert.md +115 -0
  99. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/badge.md +80 -0
  100. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/breadcrumbs.md +28 -0
  101. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/button.md +247 -0
  102. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/buttonGroup.md +99 -0
  103. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/growl-notif.md +70 -0
  104. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/items_action_bar.md +87 -0
  105. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/label.md +44 -0
  106. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/list-group.md +70 -0
  107. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/modal.md +167 -0
  108. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/notifications.md +76 -0
  109. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/page-header.md +15 -0
  110. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/panel.md +123 -0
  111. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/pills.md +104 -0
  112. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/popover.md +213 -0
  113. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/progressbar.md +117 -0
  114. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/tabs-panes.md +42 -0
  115. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/tabs-with-routes.md +64 -0
  116. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/tabs.md +30 -0
  117. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/template.jst +1 -0
  118. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/well.md +84 -0
  119. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/wizard.md +109 -0
  120. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/social-buttons.hbs +13 -0
  121. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/tabs/bar-tabpane.hbs +2 -0
  122. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/tabs/baz-tabpane.hbs +1 -0
  123. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/tabs/foo-tabpane.hbs +2 -0
  124. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user.hbs +3 -0
  125. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user/activities.hbs +1 -0
  126. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user/general.hbs +1 -0
  127. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user/privacy.hbs +1 -0
  128. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/wizard/step1.hbs +1 -0
  129. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/wizard/step2.hbs +1 -0
  130. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/wizard/step3.hbs +1 -0
  131. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/views/item-pane.hbs +3 -0
  132. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/bower.json +59 -0
  133. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/css/bs-growl-notifications.min.css +1 -0
  134. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-alert.max.js +158 -0
  135. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-alert.min.js +1 -0
  136. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-badge.max.js +26 -0
  137. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-badge.min.js +1 -0
  138. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-basic.max.js +230 -0
  139. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-basic.min.js +1 -0
  140. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-breadcrumbs.max.js +77 -0
  141. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-breadcrumbs.min.js +1 -0
  142. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-button.max.js +275 -0
  143. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-button.min.js +1 -0
  144. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-core.max.js +476 -0
  145. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-core.min.js +1 -0
  146. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-growl-notifications.max.js +162 -0
  147. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-growl-notifications.min.js +1 -0
  148. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-items-action-bar.max.js +45 -0
  149. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-items-action-bar.min.js +1 -0
  150. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-label.max.js +26 -0
  151. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-label.min.js +1 -0
  152. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-list-group.max.js +29 -0
  153. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-list-group.min.js +1 -0
  154. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-modal.max.js +314 -0
  155. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-modal.min.js +1 -0
  156. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-nav.max.js +51 -0
  157. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-nav.min.js +1 -0
  158. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-notifications.max.js +111 -0
  159. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-notifications.min.js +1 -0
  160. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-popover.max.js +402 -0
  161. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-popover.min.js +1 -0
  162. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-progressbar.max.js +102 -0
  163. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-progressbar.min.js +1 -0
  164. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-wizard.max.js +182 -0
  165. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-wizard.min.js +1 -0
  166. data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/package.json +36 -0
  167. data/lib/bootstrap-for-ember-rails/version.rb +3 -0
  168. metadata +253 -0
@@ -0,0 +1,8 @@
1
+ Bootstrap.BsBadgeComponent = Ember.Component.extend(Bootstrap.TypeSupport,
2
+ layoutName: 'components/bs-badge'
3
+ tagName: 'span'
4
+ classNames: ['badge']
5
+ classTypePrefix: 'badge'
6
+ )
7
+
8
+ Ember.Handlebars.helper 'bs-badge', Bootstrap.BsBadgeComponent
@@ -0,0 +1,65 @@
1
+ ###
2
+ Breadcrumbs component.
3
+ ###
4
+ Bootstrap.BsBreadcrumbsItem = Bootstrap.ItemView.extend(
5
+ tagName: ['li']
6
+ classNameBindings: ["isActive:active"]
7
+ template: Ember.Handlebars.compile '{{#unless view.isActive}}{{#if view.content.model}}{{#link-to view.content.route model.id}}{{view.content.name}}{{/link-to}}{{else}}{{#link-to view.content.route}}{{view.content.name}}{{/link-to}}{{/if}}{{else}}{{view.content.name}}{{/unless}}'
8
+
9
+ isActive: (->
10
+ @get('content.active')
11
+ ).property('content.active')
12
+ )
13
+
14
+ Bootstrap.BsBreadcrumbs = Bootstrap.ItemsView.extend(Bootstrap.WithRouter,
15
+ tagName: ['ol']
16
+ classNames: ['breadcrumb']
17
+ currentPathObserver: (->
18
+ #FIXME: without touching routing the observer in some latest versions of ember doesn't response
19
+ @get('router');
20
+ @send('updateCrumbsByRoute')
21
+ ).observes('router.url').on('init')
22
+ content: []
23
+ itemViewClass: Bootstrap.BsBreadcrumbsItem
24
+ nameDictionary: undefined
25
+ dictionaryNamePrefix: 'breadcrumbs'
26
+
27
+ actions:
28
+ currentPathDidChange: ->
29
+ @send 'updateCrumbsByRoute'
30
+
31
+ updateCrumbsByRoute: ->
32
+ @get('content').clear()
33
+
34
+ routes = @get('container').lookup 'router:main'
35
+ routes.get('router.currentHandlerInfos').forEach (route, i, arr) =>
36
+ name = route.name
37
+ return if name.indexOf('.index') isnt -1 || name is 'application'
38
+ return if route.handler.breadcrumbs?.hidden
39
+
40
+ routeName = route.handler.routeName
41
+ if route.handler.breadcrumbs?.name
42
+ displayName = route.handler.breadcrumbs.name
43
+ else if @get('nameDictionary')?["#{@dictionaryNamePrefix}.#{routeName}"]
44
+ displayName = @get('nameDictionary')["#{@dictionaryNamePrefix}.#{routeName}"]
45
+ else
46
+ displayName = route.handler.routeName.split('.').pop()
47
+ displayName = displayName[0].toUpperCase() + displayName[1..-1].toLowerCase()
48
+
49
+ crumb = Ember.Object.create
50
+ route: route.handler.routeName
51
+ name: displayName
52
+ model: null
53
+
54
+ crumb.set('icon', 'fa fa-home home-icon') if @get('content').length is 0
55
+
56
+ if route.isDynamic
57
+ crumb.setProperties
58
+ model: route.handler.context
59
+ name: route.handler.context.get('name')
60
+
61
+ @get('content').pushObject crumb
62
+ @get('content.lastObject').set 'active', true
63
+ )
64
+
65
+ Ember.Handlebars.helper 'bs-breadcrumbs', Bootstrap.BsBreadcrumbs
@@ -0,0 +1,19 @@
1
+ ###
2
+ Button Group.
3
+
4
+ In its simple form, each item in the button group is a Bootstrap.Button component,
5
+ In case this is a Radio, each item is rendered as a label.
6
+ ###
7
+ Bootstrap.BsBtnGroup = Bootstrap.ItemsView.extend(Bootstrap.SizeSupport, Bootstrap.ItemsSelection,
8
+ classTypePrefix: ['btn-group']
9
+ classNames: ['btn-group']
10
+ classNameBindings: ['vertical:btn-group-vertical']
11
+ itemViewClass: Bootstrap.BsButtonComponent.extend(Bootstrap.ItemValue, Bootstrap.ItemSelection,
12
+ init: ->
13
+ @_super()
14
+ @set('icon_active', @get('parentView.icon_active'))
15
+ @set('icon_inactive', @get('parentView.icon_inactive'))
16
+ )
17
+ )
18
+
19
+ Ember.Handlebars.helper 'bs-btn-group', Bootstrap.BsBtnGroup
@@ -0,0 +1,11 @@
1
+ ###
2
+ Button Toolbar.
3
+
4
+ A collection of button groups
5
+ ###
6
+ Bootstrap.BsBtnToolbarComponent = Ember.Component.extend(
7
+ layoutName: 'components/bs-btn-toolbar'
8
+ classNames: ['btn-toolbar']
9
+ )
10
+
11
+ Ember.Handlebars.helper 'bs-btn-toolbar', Bootstrap.BsBtnToolbarComponent
@@ -0,0 +1,45 @@
1
+ Bootstrap.BsButtonComponent = Ember.Component.extend(Bootstrap.TypeSupport, Bootstrap.SizeSupport,
2
+ layoutName: 'components/bs-button'
3
+ tagName: 'button'
4
+ classNames: ['btn']
5
+ classNameBindings: ['blockClass']
6
+ classTypePrefix: 'btn'
7
+ clickedParam: null
8
+ block: null
9
+ attributeBindings: ['disabled', 'dismiss:data-dismiss', '_type:type', 'style']
10
+ _type: 'button'
11
+ bubbles: true
12
+ allowedProperties: ['title', 'type', 'size', 'block', 'disabled', 'clicked', 'dismiss', 'class']
13
+ icon_active: undefined
14
+ icon_inactive: undefined
15
+
16
+ init: ->
17
+ @_super()
18
+ # If content is an object (may happen when a button is the view class of a collectionView), then assign allowed properties to the button component.
19
+ if @get('content')? and Ember.typeOf(@get('content')) is 'instance'
20
+ c = @get('content')
21
+ @set key, c[key] for key in @get('allowedProperties') when c[key]?
22
+ else
23
+ if not @get('title')?
24
+ @set('title', @get('content'))
25
+ @attributeBindings.pushObject attr for attr of @ when attr.match(/^data-[\w-]*$/)?
26
+
27
+ blockClass: ( ->
28
+ if @block then "#{@classTypePrefix}-block" else null
29
+ ).property('block').cacheable()
30
+
31
+ click: (evt) ->
32
+ evt.stopPropagation() unless @get('bubbles')
33
+ @sendAction('clicked', @get('clickedParam'))
34
+
35
+ loadingChanged: (->
36
+ loading = if @get('loading') isnt null then @get('loading') else "reset"
37
+ Ember.$("##{@elementId}").button(loading)
38
+ ).observes('loading')
39
+
40
+ icon: (->
41
+ if @get('isActive') then @get('icon_active') else @get('icon_inactive')
42
+ ).property('isActive')
43
+ )
44
+
45
+ Ember.Handlebars.helper 'bs-button', Bootstrap.BsButtonComponent
@@ -0,0 +1,45 @@
1
+ Bootstrap.ItemsActionBar = Ember.CollectionView.extend
2
+ classNames: 'btn-toolbar'
3
+ classNameBindings: 'rtl:pull-right'
4
+ role: 'toolbar'
5
+ selectedItems: []
6
+ rtl: false
7
+
8
+ selection: (->
9
+ items = @get('selectedItems')
10
+ return [] if not items?
11
+
12
+ if Array.isArray items
13
+ return items
14
+ else
15
+ [items]
16
+ ).property('selectedItems')
17
+
18
+ itemViewClass: Ember.CollectionView.extend
19
+ tagName: ['div']
20
+ classNames: ['btn-group']
21
+ itemViewClass: Ember.View.extend
22
+ tagName: 'button'
23
+ classNames: ['btn', 'btn-default']
24
+ attributeBindings: ['disabled']
25
+ #FIXME: if transitionTo exist we render the link-to as an inner div coz we need some tag but this will cause
26
+ #only the internal div to be clickable, not the outer 'button' tag so part of the button area wont be clickable
27
+ template: Ember.Handlebars.compile("
28
+ {{#if view.content.transitionTo}}
29
+ {{link-to view.content.title view.content.transitionTo tagName='div'}}
30
+ {{else}}
31
+ {{view.content.title}}
32
+ {{/if}}
33
+ ")
34
+
35
+ disabled: (->
36
+ @get('content.disabled')?(@get('parentView.parentView.selection'))
37
+ ).property('parentView.parentView.selection.@each', 'parentView.parentView.selection')
38
+
39
+ click: ->
40
+ if @get('content.clickActionName')?
41
+ @get('controller').send @get('content.clickActionName'), @get('parentView.parentView.selection')
42
+ else if @get('content.click')
43
+ @get('content.click')(@get('parentView.parentView.selection'))
44
+
45
+ Ember.Handlebars.helper 'bs-items-action-bar', Bootstrap.ItemsActionBar
@@ -0,0 +1,8 @@
1
+ Bootstrap.BsLabelComponent = Ember.Component.extend(Bootstrap.TypeSupport,
2
+ layoutName: 'components/bs-label'
3
+ tagName: 'span'
4
+ classNames: ['label']
5
+ classTypePrefix: 'label'
6
+ )
7
+
8
+ Ember.Handlebars.helper 'bs-label', Bootstrap.BsLabelComponent
@@ -0,0 +1,34 @@
1
+ Bootstrap.BsListGroupComponent = Bootstrap.ItemsView.extend(
2
+ tagName: 'ul'
3
+ classNames: ['list-group']
4
+ itemViewClass: Bootstrap.ItemView.extend(Bootstrap.ItemSelection,
5
+ classNames: ['list-group-item']
6
+ template: Ember.Handlebars.compile '''
7
+ {{#if view.badge}}
8
+ {{bs-badge contentBinding="view.badge"}}
9
+ {{/if}}
10
+ {{#if view.sub}}
11
+ <h4 class="list-group-item-heading">{{view.title}}</h4>
12
+ <p class="list-group-item-text">{{view.sub}}</p>
13
+ {{else}}
14
+ {{view.title}}
15
+ {{/if}}
16
+ '''
17
+
18
+ badge: (->
19
+ #TODO: Consolidate with ItemView
20
+ content = @get('content')
21
+ return null unless Ember.typeOf(content ) is 'instance' or Ember.canInvoke(content, 'get')
22
+ content.get 'badge'
23
+ ).property('content')
24
+
25
+ sub: (->
26
+ #TODO: Consolidate with ItemView
27
+ content = @get('content')
28
+ return null unless Ember.typeOf(content ) is 'instance' or Ember.canInvoke(content, 'get')
29
+ content.get 'sub'
30
+ ).property('content')
31
+ )
32
+ )
33
+
34
+ Ember.Handlebars.helper('bs-list-group', Bootstrap.BsListGroupComponent)
@@ -0,0 +1,204 @@
1
+ ###
2
+ Modal component.
3
+ ###
4
+ Bootstrap.BsModalComponent = Ember.Component.extend(Ember.Evented,
5
+ layoutName: 'components/bs-modal'
6
+ classNames: ['modal']
7
+ classNameBindings: ['fade', 'isVis:in']
8
+ attributeBindings: ['role', 'aria-labelledby', 'isAriaHidden:aria-hidden', "ariaLabelledBy:aria-labelledby"]
9
+ isAriaHidden: (->
10
+ "#{@get('isVisible')}"
11
+ ).property('isVisible')
12
+ modalBackdrop: '<div class="modal-backdrop fade in"></div>'
13
+ role: 'dialog'
14
+ footerViews: []
15
+
16
+ #--Defaults--
17
+ backdrop: true
18
+ title: null
19
+ isVisible: false
20
+ manual: false
21
+ isVis: false
22
+ fullSizeButtons: false
23
+ fade: true
24
+
25
+ didInsertElement: ->
26
+ @._super()
27
+ @setupBinders()
28
+ #Register modal in the modal manager
29
+ name = @get('name')
30
+ Ember.assert("Modal name is required for modal view #{@get('elementId')}", @get('name'))
31
+ name?= @get('elementId')
32
+ Bootstrap.ModalManager.add(name, @)
33
+
34
+ if @manual
35
+ @show()
36
+
37
+ becameVisible: ->
38
+ Em.$('body').addClass('modal-open')
39
+ @appendBackdrop() if @get("backdrop")
40
+
41
+ becameHidden: ->
42
+ Em.$('body').removeClass('modal-open')
43
+ @_backdrop.remove() if @_backdrop
44
+
45
+ appendBackdrop: ->
46
+ parentElement = @$().parent()
47
+ @_backdrop = Em.$(@modalBackdrop).appendTo(parentElement)
48
+
49
+ show: ->
50
+ @set 'isVisible', true
51
+ current = this
52
+ setTimeout (->
53
+ current.set 'isVis', true
54
+ return
55
+ ), 15
56
+ return
57
+
58
+ hide: ->
59
+ @set 'isVis', false
60
+ current = this
61
+ @$().one 'webkitTransitionEnd', (e) ->
62
+ current.set 'isVisible', false
63
+ return
64
+ false
65
+
66
+ toggle: ->
67
+ @toggleProperty 'isVisible'
68
+
69
+ click: (event) ->
70
+ target = event.target
71
+ targetDismiss = target.getAttribute("data-dismiss")
72
+ if targetDismiss is 'modal'
73
+ @close()
74
+
75
+ keyPressed: (event) ->
76
+ #Handle ESC
77
+ if event.keyCode is 27
78
+ @close event
79
+
80
+ close: (event) ->
81
+ @set 'isVis', false
82
+ current = this
83
+ @$().one 'webkitTransitionEnd', (e) ->
84
+ if current.get('manual') then current.destroy() else current.hide()
85
+ return
86
+ @trigger 'closed'
87
+
88
+
89
+ #Invoked automatically by ember when the view is destroyed, giving us a chance to perform cleanups
90
+ willDestroyElement: ->
91
+ Em.$('body').removeClass('modal-open')
92
+ @removeHandlers()
93
+ name = @get('name')
94
+ name?= @get('elementId')
95
+ Bootstrap.ModalManager.remove(name, @)
96
+ @_backdrop.remove() if @_backdrop
97
+
98
+ removeHandlers: ->
99
+ #Remove key press
100
+ jQuery(window.document).unbind "keyup", @_keyUpHandler
101
+
102
+ setupBinders: ->
103
+ #Key press
104
+ handler = (event) =>
105
+ @keyPressed event
106
+ jQuery(window.document).bind "keyup", handler
107
+ @_keyUpHandler = handler
108
+ )
109
+
110
+ ###
111
+ Bootstrap.BsModalComponent = Bootstrap.BsModalComponent.reopenClass(
112
+ build: (options) ->
113
+ options = {} unless options
114
+ options.manual = true
115
+ modalPane = @create(options)
116
+ modalPane.append()
117
+ )
118
+ ###
119
+
120
+ Bootstrap.ModalManager = Ember.Object.create(
121
+ add: (name, modalInstance) ->
122
+ @set name, modalInstance
123
+
124
+ register: (name, modalInstance) ->
125
+ @add(name, modalInstance);
126
+ modalInstance.appendTo(modalInstance.get('targetObject').namespace.rootElement)
127
+
128
+ remove: (name) ->
129
+ @set name, null
130
+
131
+ close: (name) ->
132
+ @get(name).close()
133
+
134
+ hide: (name) ->
135
+ @get(name).hide()
136
+
137
+ show: (name) ->
138
+ @get(name).show()
139
+
140
+ toggle: (name) ->
141
+ @get(name).toggle()
142
+
143
+ confirm: (controller, title, message, confirmButtonTitle = "Confirm", confirmButtonEvent = "modalConfirmed",confirmButtonType = null, cancelButtonTitle = "Cancel", cancelButtonEvent = "modalCanceled",cancelButtonType = null, targetObj = controller, fade = true, fullSizeButtons = false) ->
144
+ body = Ember.View.extend(
145
+ template: Ember.Handlebars.compile(message || "Are you sure you would like to perform this action?")
146
+ )
147
+ buttons = [
148
+ Ember.Object.create({title: confirmButtonTitle, clicked: confirmButtonEvent, type: confirmButtonType, dismiss: 'modal'})
149
+ Ember.Object.create({title: cancelButtonTitle, clicked: cancelButtonEvent, type: cancelButtonType, dismiss: 'modal'})
150
+ ]
151
+ @open('confirm-modal', title || 'Confirmation required!', body, buttons, controller, fade, fullSizeButtons, targetObj)
152
+
153
+ okModal: (controller, title, message, okButtonTitle = "OK", okButtonEvent = "okModal", okButtonType = null, targetObj = controller, fade = true, fullSizeButtons = false) ->
154
+ body = Ember.View.extend(
155
+ template: Ember.Handlebars.compile(message || "Are you sure you would like to perform this action?")
156
+ )
157
+ buttons = [
158
+ Ember.Object.create({title: okButtonTitle, clicked:okButtonEvent, type: okButtonType, dismiss: 'modal'})
159
+ ]
160
+ @open('ok-modal', title || 'Confirmation required!', body, buttons, controller, fade, fullSizeButtons, targetObj)
161
+
162
+ openModal: (modalView, options = {}) ->
163
+ rootElement = options.rootElement or '.ember-application'
164
+ instance = modalView.create options
165
+ instance.appendTo rootElement
166
+
167
+ open: (name, title, view, footerButtons, controller, fade , fullSizeButtons = false, targetObj = controller) ->
168
+ cl = controller.container.lookup 'component-lookup:main'
169
+ modalComponent = cl.lookupFactory('bs-modal', controller.get('container')).create()
170
+
171
+ modalComponent.setProperties(
172
+ name: name
173
+ title: title
174
+ manual: true
175
+ footerButtons: footerButtons
176
+ targetObject: targetObj
177
+ fade: fade
178
+ fullSizeButtons: fullSizeButtons
179
+ )
180
+
181
+ if Ember.typeOf(view) is 'string'
182
+ template = controller.container.lookup("template:#{view}")
183
+ Ember.assert("Template #{view} was specified for Modal but template could not be found.", template)
184
+ if template
185
+ modalComponent.setProperties(
186
+ body: Ember.View.extend(
187
+ template: template,
188
+ controller: controller
189
+ )
190
+ )
191
+ else if Ember.typeOf(view) is 'class'
192
+ modalComponent.setProperties(
193
+ body: view,
194
+ controller: controller
195
+ )
196
+
197
+ modalComponent.appendTo(controller.namespace.rootElement)
198
+ )
199
+
200
+
201
+ Ember.Application.initializer
202
+ name: 'bs-modal'
203
+ initialize: (container, application) ->
204
+ container.register 'component:bs-modal', Bootstrap.BsModalComponent