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 @@
1
+ Bootstrap = window.Bootstrap = Ember.Namespace.create()
@@ -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
+ )
@@ -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,8 @@
1
+ Bootstrap = window.Bootstrap
2
+ get = Ember.get
3
+
4
+ Bootstrap.WithRouter = Ember.Mixin.create(
5
+ router: Ember.computed( ->
6
+ get(this, "controller").container.lookup "router:main"
7
+ )
8
+ )
@@ -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,8 @@
1
+ Showcase.ShowComponentsPanelController = Ember.Controller.extend(
2
+ actions:
3
+ panelClicked: ->
4
+ alert "Hello from controller: A click in a panel!"
5
+
6
+ panelClosed: ->
7
+ alert "Hello from controller: The panel was closed!"
8
+ )
@@ -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,11 @@
1
+ Showcase.ShowComponentsProgressbarController = Ember.Controller.extend(
2
+ prog: 0
3
+ incrementBy: 20
4
+
5
+ actions:
6
+ increment: ->
7
+ if @prog < 100
8
+ @incrementProperty "prog", @incrementBy
9
+ else
10
+ @set "prog", @incrementBy
11
+ )
@@ -0,0 +1 @@
1
+ Showcase.ShowComponentsTooltipBoxController = Bootstrap.TooltipBoxController
@@ -0,0 +1,4 @@
1
+ Showcase.ShowComponentsWellController = Ember.Controller.extend(
2
+ wellClick: ->
3
+ alert "Hello from controller: A click in a well!"
4
+ )
@@ -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
+ )