locomotivecms_wagon 2.0.0.rc2 → 2.0.0.rc3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/generators/{bootstrap3 → bootstrap}/Gemfile.tt +0 -0
  4. data/generators/{bootstrap3 → bootstrap}/app/content_types/.empty_directory +0 -0
  5. data/generators/bootstrap/app/views/pages/404.liquid +18 -0
  6. data/generators/bootstrap/app/views/pages/404.liquid.haml +14 -0
  7. data/generators/bootstrap/app/views/pages/index.liquid +31 -0
  8. data/generators/bootstrap/app/views/pages/index.liquid.haml +25 -0
  9. data/generators/bootstrap/app/views/pages/layouts/default.liquid +31 -0
  10. data/generators/bootstrap/app/views/pages/layouts/default.liquid.haml +30 -0
  11. data/generators/bootstrap/app/views/pages/layouts/simple.liquid +36 -0
  12. data/generators/bootstrap/app/views/pages/layouts/simple.liquid.haml +29 -0
  13. data/generators/bootstrap/app/views/snippets/footer.liquid +5 -0
  14. data/generators/bootstrap/app/views/snippets/footer.liquid.haml +3 -0
  15. data/generators/bootstrap/app/views/snippets/nav.liquid +26 -0
  16. data/generators/bootstrap/app/views/snippets/nav.liquid.haml +19 -0
  17. data/generators/{bootstrap3 → bootstrap}/config/deploy.yml +0 -0
  18. data/generators/bootstrap/config/site.yml.tt +1 -6
  19. data/generators/{bootstrap3 → bootstrap}/config/translations.yml +0 -0
  20. data/generators/{bootstrap3 → bootstrap}/data/.empty_directory +0 -0
  21. data/generators/{bootstrap3 → bootstrap}/icon.png +0 -0
  22. data/generators/bootstrap/public/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  23. data/generators/bootstrap/public/fonts/bootstrap/glyphicons-halflings-regular.svg +288 -0
  24. data/generators/bootstrap/public/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  25. data/generators/bootstrap/public/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  26. data/generators/bootstrap/public/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  27. data/generators/{bootstrap3/public/samples → bootstrap/public/images}/favicon.png +0 -0
  28. data/generators/bootstrap/public/javascripts/application.js +2 -0
  29. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/affix.js +60 -35
  30. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/alert.js +15 -9
  31. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/button.js +33 -20
  32. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/carousel.js +79 -47
  33. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/collapse.js +84 -43
  34. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/dropdown.js +64 -46
  35. data/generators/bootstrap/public/javascripts/bootstrap/modal.js +337 -0
  36. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/popover.js +12 -14
  37. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/scrollspy.js +57 -38
  38. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/tab.js +54 -24
  39. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/tooltip.js +202 -87
  40. data/generators/{bootstrap3 → bootstrap}/public/javascripts/bootstrap/transition.js +19 -8
  41. data/generators/bootstrap/public/javascripts/bootstrap.min.js +7 -0
  42. data/generators/bootstrap/public/javascripts/jquery.min.js +5 -0
  43. data/generators/bootstrap/public/stylesheets/application.css +7 -0
  44. data/generators/bootstrap/public/stylesheets/application.scss +7 -0
  45. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_alerts.scss +9 -3
  46. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_badges.scss +26 -13
  47. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_breadcrumbs.scss +3 -1
  48. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_button-groups.scss +32 -14
  49. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_buttons.scss +22 -13
  50. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_carousel.scss +43 -6
  51. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_close.scss +1 -0
  52. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_code.scss +7 -1
  53. data/generators/bootstrap/public/stylesheets/bootstrap/_component-animations.scss +37 -0
  54. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_dropdowns.scss +12 -9
  55. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_forms.scss +240 -65
  56. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_glyphicons.scss +83 -9
  57. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_grid.scss +4 -4
  58. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_input-groups.scss +7 -2
  59. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_jumbotron.scss +12 -4
  60. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_labels.scss +11 -9
  61. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_list-group.scss +32 -12
  62. data/generators/bootstrap/public/stylesheets/bootstrap/_media.scss +66 -0
  63. data/generators/bootstrap/public/stylesheets/bootstrap/_mixins.scss +40 -0
  64. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_modals.scss +18 -7
  65. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_navbar.scss +75 -33
  66. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_navs.scss +4 -4
  67. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_normalize.scss +29 -28
  68. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_pager.scss +2 -3
  69. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_pagination.scss +4 -3
  70. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_panels.scss +40 -10
  71. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_popovers.scss +6 -8
  72. data/generators/bootstrap/public/stylesheets/bootstrap/_print.scss +101 -0
  73. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_progress-bars.scss +13 -6
  74. data/generators/bootstrap/public/stylesheets/bootstrap/_responsive-embed.scss +35 -0
  75. data/generators/bootstrap/public/stylesheets/bootstrap/_responsive-utilities.scss +179 -0
  76. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_scaffolding.scss +31 -4
  77. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_tables.scss +17 -16
  78. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_theme.scss +57 -13
  79. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_thumbnails.scss +2 -2
  80. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_tooltip.scss +13 -7
  81. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_type.scss +38 -24
  82. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_utilities.scss +3 -4
  83. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_variables.scss +86 -47
  84. data/generators/{bootstrap3 → bootstrap}/public/stylesheets/bootstrap/_wells.scss +0 -0
  85. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_alerts.scss +14 -0
  86. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_background-variant.scss +12 -0
  87. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_border-radius.scss +18 -0
  88. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_buttons.scss +68 -0
  89. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
  90. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_clearfix.scss +22 -0
  91. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_forms.scss +88 -0
  92. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_gradients.scss +58 -0
  93. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_grid-framework.scss +81 -0
  94. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_grid.scss +122 -0
  95. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_hide-text.scss +21 -0
  96. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_image.scss +33 -0
  97. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_labels.scss +12 -0
  98. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_list-group.scss +32 -0
  99. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  100. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  101. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_opacity.scss +8 -0
  102. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_pagination.scss +24 -0
  103. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_panels.scss +24 -0
  104. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_progress-bar.scss +10 -0
  105. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
  106. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_reset-text.scss +18 -0
  107. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  108. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_responsive-visibility.scss +21 -0
  109. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_size.scss +10 -0
  110. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
  111. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_table-row.scss +28 -0
  112. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_text-emphasis.scss +12 -0
  113. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_text-overflow.scss +8 -0
  114. data/generators/bootstrap/public/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +222 -0
  115. data/generators/bootstrap/public/stylesheets/bootstrap.css +5 -0
  116. data/generators/{bootstrap3/public/stylesheets/bootstrap.css.scss → bootstrap/public/stylesheets/bootstrap.scss} +16 -2
  117. data/lib/locomotive/wagon/cli.rb +3 -3
  118. data/lib/locomotive/wagon/commands/authenticate_command.rb +2 -1
  119. data/lib/locomotive/wagon/commands/concerns/spinner_concern.rb +29 -0
  120. data/lib/locomotive/wagon/commands/pull_command.rb +18 -3
  121. data/lib/locomotive/wagon/commands/push_command.rb +28 -4
  122. data/lib/locomotive/wagon/commands/sync_command.rb +21 -6
  123. data/lib/locomotive/wagon/commands/sync_sub_commands/sync_pages_command.rb +27 -3
  124. data/lib/locomotive/wagon/generators/site/{bootstrap3.rb → bootstrap.rb} +12 -6
  125. data/lib/locomotive/wagon/generators/site.rb +1 -1
  126. data/lib/locomotive/wagon/tools/listen.rb +1 -1
  127. data/lib/locomotive/wagon/version.rb +1 -1
  128. data/lib/locomotive/wagon.rb +2 -2
  129. data/locomotivecms_wagon.gemspec +3 -2
  130. data/spec/unit/decorators/theme_asset_decorator_spec.rb +10 -0
  131. metadata +124 -90
  132. data/generators/bootstrap3/app/views/pages/404.liquid +0 -13
  133. data/generators/bootstrap3/app/views/pages/404.liquid.haml +0 -10
  134. data/generators/bootstrap3/app/views/pages/index.liquid +0 -738
  135. data/generators/bootstrap3/app/views/pages/index.liquid.haml +0 -1018
  136. data/generators/bootstrap3/app/views/snippets/footer.liquid +0 -3
  137. data/generators/bootstrap3/app/views/snippets/footer.liquid.haml +0 -2
  138. data/generators/bootstrap3/config/site.yml.tt +0 -28
  139. data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.eot +0 -0
  140. data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.svg +0 -229
  141. data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  142. data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.woff +0 -0
  143. data/generators/bootstrap3/public/images/.empty_directory +0 -1
  144. data/generators/bootstrap3/public/javascripts/bootstrap/modal.js +0 -243
  145. data/generators/bootstrap3/public/javascripts/bootstrap.min.js +0 -12
  146. data/generators/bootstrap3/public/samples/apple-touch-icon-114x114-precomposed.png +0 -0
  147. data/generators/bootstrap3/public/samples/apple-touch-icon-144x144-precomposed.png +0 -0
  148. data/generators/bootstrap3/public/samples/apple-touch-icon-72x72-precomposed.png +0 -0
  149. data/generators/bootstrap3/public/samples/apple-touch-icon-precomposed.png +0 -0
  150. data/generators/bootstrap3/public/stylesheets/application.css +0 -1
  151. data/generators/bootstrap3/public/stylesheets/application.css.scss +0 -8
  152. data/generators/bootstrap3/public/stylesheets/bootstrap/_component-animations.scss +0 -29
  153. data/generators/bootstrap3/public/stylesheets/bootstrap/_media.scss +0 -56
  154. data/generators/bootstrap3/public/stylesheets/bootstrap/_mixins.scss +0 -947
  155. data/generators/bootstrap3/public/stylesheets/bootstrap/_print.scss +0 -101
  156. data/generators/bootstrap3/public/stylesheets/bootstrap/_responsive-utilities.scss +0 -74
  157. data/generators/bootstrap3/public/stylesheets/bootstrap/bootstrap.css.scss +0 -49
  158. data/generators/bootstrap3/public/stylesheets/bootstrap.css +0 -5784
  159. data/lib/locomotive/wagon/generators/site/bootstrap2.rb +0 -34
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: affix.js v3.1.1
2
+ * Bootstrap: affix.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#affix
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -15,28 +15,54 @@
15
15
 
16
16
  var Affix = function (element, options) {
17
17
  this.options = $.extend({}, Affix.DEFAULTS, options)
18
- this.$window = $(window)
18
+
19
+ this.$target = $(this.options.target)
19
20
  .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
20
21
  .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
21
22
 
22
23
  this.$element = $(element)
23
- this.affixed =
24
- this.unpin =
24
+ this.affixed = null
25
+ this.unpin = null
25
26
  this.pinnedOffset = null
26
27
 
27
28
  this.checkPosition()
28
29
  }
29
30
 
30
- Affix.RESET = 'affix affix-top affix-bottom'
31
+ Affix.VERSION = '3.3.5'
32
+
33
+ Affix.RESET = 'affix affix-top affix-bottom'
31
34
 
32
35
  Affix.DEFAULTS = {
33
- offset: 0
36
+ offset: 0,
37
+ target: window
38
+ }
39
+
40
+ Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
41
+ var scrollTop = this.$target.scrollTop()
42
+ var position = this.$element.offset()
43
+ var targetHeight = this.$target.height()
44
+
45
+ if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
46
+
47
+ if (this.affixed == 'bottom') {
48
+ if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
49
+ return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
50
+ }
51
+
52
+ var initializing = this.affixed == null
53
+ var colliderTop = initializing ? scrollTop : position.top
54
+ var colliderHeight = initializing ? targetHeight : height
55
+
56
+ if (offsetTop != null && scrollTop <= offsetTop) return 'top'
57
+ if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
58
+
59
+ return false
34
60
  }
35
61
 
36
62
  Affix.prototype.getPinnedOffset = function () {
37
63
  if (this.pinnedOffset) return this.pinnedOffset
38
64
  this.$element.removeClass(Affix.RESET).addClass('affix')
39
- var scrollTop = this.$window.scrollTop()
65
+ var scrollTop = this.$target.scrollTop()
40
66
  var position = this.$element.offset()
41
67
  return (this.pinnedOffset = position.top - scrollTop)
42
68
  }
@@ -48,43 +74,41 @@
48
74
  Affix.prototype.checkPosition = function () {
49
75
  if (!this.$element.is(':visible')) return
50
76
 
51
- var scrollHeight = $(document).height()
52
- var scrollTop = this.$window.scrollTop()
53
- var position = this.$element.offset()
77
+ var height = this.$element.height()
54
78
  var offset = this.options.offset
55
79
  var offsetTop = offset.top
56
80
  var offsetBottom = offset.bottom
57
-
58
- if (this.affixed == 'top') position.top += scrollTop
81
+ var scrollHeight = Math.max($(document).height(), $(document.body).height())
59
82
 
60
83
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
61
84
  if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
62
85
  if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
63
86
 
64
- var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
65
- offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
66
- offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
87
+ var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
67
88
 
68
- if (this.affixed === affix) return
69
- if (this.unpin) this.$element.css('top', '')
89
+ if (this.affixed != affix) {
90
+ if (this.unpin != null) this.$element.css('top', '')
70
91
 
71
- var affixType = 'affix' + (affix ? '-' + affix : '')
72
- var e = $.Event(affixType + '.bs.affix')
92
+ var affixType = 'affix' + (affix ? '-' + affix : '')
93
+ var e = $.Event(affixType + '.bs.affix')
73
94
 
74
- this.$element.trigger(e)
95
+ this.$element.trigger(e)
75
96
 
76
- if (e.isDefaultPrevented()) return
97
+ if (e.isDefaultPrevented()) return
77
98
 
78
- this.affixed = affix
79
- this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
99
+ this.affixed = affix
100
+ this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
80
101
 
81
- this.$element
82
- .removeClass(Affix.RESET)
83
- .addClass(affixType)
84
- .trigger($.Event(affixType.replace('affix', 'affixed')))
102
+ this.$element
103
+ .removeClass(Affix.RESET)
104
+ .addClass(affixType)
105
+ .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
106
+ }
85
107
 
86
108
  if (affix == 'bottom') {
87
- this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
109
+ this.$element.offset({
110
+ top: scrollHeight - height - offsetBottom
111
+ })
88
112
  }
89
113
  }
90
114
 
@@ -92,9 +116,7 @@
92
116
  // AFFIX PLUGIN DEFINITION
93
117
  // =======================
94
118
 
95
- var old = $.fn.affix
96
-
97
- $.fn.affix = function (option) {
119
+ function Plugin(option) {
98
120
  return this.each(function () {
99
121
  var $this = $(this)
100
122
  var data = $this.data('bs.affix')
@@ -105,6 +127,9 @@
105
127
  })
106
128
  }
107
129
 
130
+ var old = $.fn.affix
131
+
132
+ $.fn.affix = Plugin
108
133
  $.fn.affix.Constructor = Affix
109
134
 
110
135
 
@@ -127,10 +152,10 @@
127
152
 
128
153
  data.offset = data.offset || {}
129
154
 
130
- if (data.offsetBottom) data.offset.bottom = data.offsetBottom
131
- if (data.offsetTop) data.offset.top = data.offsetTop
155
+ if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
156
+ if (data.offsetTop != null) data.offset.top = data.offsetTop
132
157
 
133
- $spy.affix(data)
158
+ Plugin.call($spy, data)
134
159
  })
135
160
  })
136
161
 
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: alert.js v3.1.1
2
+ * Bootstrap: alert.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#alerts
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -18,6 +18,10 @@
18
18
  $(el).on('click', dismiss, this.close)
19
19
  }
20
20
 
21
+ Alert.VERSION = '3.3.5'
22
+
23
+ Alert.TRANSITION_DURATION = 150
24
+
21
25
  Alert.prototype.close = function (e) {
22
26
  var $this = $(this)
23
27
  var selector = $this.attr('data-target')
@@ -32,7 +36,7 @@
32
36
  if (e) e.preventDefault()
33
37
 
34
38
  if (!$parent.length) {
35
- $parent = $this.hasClass('alert') ? $this : $this.parent()
39
+ $parent = $this.closest('.alert')
36
40
  }
37
41
 
38
42
  $parent.trigger(e = $.Event('close.bs.alert'))
@@ -42,13 +46,14 @@
42
46
  $parent.removeClass('in')
43
47
 
44
48
  function removeElement() {
45
- $parent.trigger('closed.bs.alert').remove()
49
+ // detach from parent, fire event then clean up data
50
+ $parent.detach().trigger('closed.bs.alert').remove()
46
51
  }
47
52
 
48
53
  $.support.transition && $parent.hasClass('fade') ?
49
54
  $parent
50
- .one($.support.transition.end, removeElement)
51
- .emulateTransitionEnd(150) :
55
+ .one('bsTransitionEnd', removeElement)
56
+ .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
52
57
  removeElement()
53
58
  }
54
59
 
@@ -56,9 +61,7 @@
56
61
  // ALERT PLUGIN DEFINITION
57
62
  // =======================
58
63
 
59
- var old = $.fn.alert
60
-
61
- $.fn.alert = function (option) {
64
+ function Plugin(option) {
62
65
  return this.each(function () {
63
66
  var $this = $(this)
64
67
  var data = $this.data('bs.alert')
@@ -68,6 +71,9 @@
68
71
  })
69
72
  }
70
73
 
74
+ var old = $.fn.alert
75
+
76
+ $.fn.alert = Plugin
71
77
  $.fn.alert.Constructor = Alert
72
78
 
73
79
 
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: button.js v3.1.1
2
+ * Bootstrap: button.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#buttons
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -19,6 +19,8 @@
19
19
  this.isLoading = false
20
20
  }
21
21
 
22
+ Button.VERSION = '3.3.5'
23
+
22
24
  Button.DEFAULTS = {
23
25
  loadingText: 'loading...'
24
26
  }
@@ -29,14 +31,14 @@
29
31
  var val = $el.is('input') ? 'val' : 'html'
30
32
  var data = $el.data()
31
33
 
32
- state = state + 'Text'
33
-
34
- if (!data.resetText) $el.data('resetText', $el[val]())
34
+ state += 'Text'
35
35
 
36
- $el[val](data[state] || this.options[state])
36
+ if (data.resetText == null) $el.data('resetText', $el[val]())
37
37
 
38
38
  // push to event loop to allow forms to submit
39
39
  setTimeout($.proxy(function () {
40
+ $el[val](data[state] == null ? this.options[state] : data[state])
41
+
40
42
  if (state == 'loadingText') {
41
43
  this.isLoading = true
42
44
  $el.addClass(d).attr(d, d)
@@ -54,22 +56,26 @@
54
56
  if ($parent.length) {
55
57
  var $input = this.$element.find('input')
56
58
  if ($input.prop('type') == 'radio') {
57
- if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
58
- else $parent.find('.active').removeClass('active')
59
+ if ($input.prop('checked')) changed = false
60
+ $parent.find('.active').removeClass('active')
61
+ this.$element.addClass('active')
62
+ } else if ($input.prop('type') == 'checkbox') {
63
+ if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
64
+ this.$element.toggleClass('active')
59
65
  }
60
- if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
66
+ $input.prop('checked', this.$element.hasClass('active'))
67
+ if (changed) $input.trigger('change')
68
+ } else {
69
+ this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
70
+ this.$element.toggleClass('active')
61
71
  }
62
-
63
- if (changed) this.$element.toggleClass('active')
64
72
  }
65
73
 
66
74
 
67
75
  // BUTTON PLUGIN DEFINITION
68
76
  // ========================
69
77
 
70
- var old = $.fn.button
71
-
72
- $.fn.button = function (option) {
78
+ function Plugin(option) {
73
79
  return this.each(function () {
74
80
  var $this = $(this)
75
81
  var data = $this.data('bs.button')
@@ -82,6 +88,9 @@
82
88
  })
83
89
  }
84
90
 
91
+ var old = $.fn.button
92
+
93
+ $.fn.button = Plugin
85
94
  $.fn.button.Constructor = Button
86
95
 
87
96
 
@@ -97,11 +106,15 @@
97
106
  // BUTTON DATA-API
98
107
  // ===============
99
108
 
100
- $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
101
- var $btn = $(e.target)
102
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
103
- $btn.button('toggle')
104
- e.preventDefault()
105
- })
109
+ $(document)
110
+ .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
111
+ var $btn = $(e.target)
112
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
113
+ Plugin.call($btn, 'toggle')
114
+ if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
115
+ })
116
+ .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
117
+ $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
118
+ })
106
119
 
107
120
  }(jQuery);
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: carousel.js v3.1.1
2
+ * Bootstrap: carousel.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#carousel
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -17,24 +17,42 @@
17
17
  this.$element = $(element)
18
18
  this.$indicators = this.$element.find('.carousel-indicators')
19
19
  this.options = options
20
- this.paused =
21
- this.sliding =
22
- this.interval =
23
- this.$active =
20
+ this.paused = null
21
+ this.sliding = null
22
+ this.interval = null
23
+ this.$active = null
24
24
  this.$items = null
25
25
 
26
- this.options.pause == 'hover' && this.$element
27
- .on('mouseenter', $.proxy(this.pause, this))
28
- .on('mouseleave', $.proxy(this.cycle, this))
26
+ this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
27
+
28
+ this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
29
+ .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
30
+ .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
29
31
  }
30
32
 
33
+ Carousel.VERSION = '3.3.5'
34
+
35
+ Carousel.TRANSITION_DURATION = 600
36
+
31
37
  Carousel.DEFAULTS = {
32
38
  interval: 5000,
33
39
  pause: 'hover',
34
- wrap: true
40
+ wrap: true,
41
+ keyboard: true
42
+ }
43
+
44
+ Carousel.prototype.keydown = function (e) {
45
+ if (/input|textarea/i.test(e.target.tagName)) return
46
+ switch (e.which) {
47
+ case 37: this.prev(); break
48
+ case 39: this.next(); break
49
+ default: return
50
+ }
51
+
52
+ e.preventDefault()
35
53
  }
36
54
 
37
- Carousel.prototype.cycle = function (e) {
55
+ Carousel.prototype.cycle = function (e) {
38
56
  e || (this.paused = false)
39
57
 
40
58
  this.interval && clearInterval(this.interval)
@@ -46,23 +64,31 @@
46
64
  return this
47
65
  }
48
66
 
49
- Carousel.prototype.getActiveIndex = function () {
50
- this.$active = this.$element.find('.item.active')
51
- this.$items = this.$active.parent().children()
67
+ Carousel.prototype.getItemIndex = function (item) {
68
+ this.$items = item.parent().children('.item')
69
+ return this.$items.index(item || this.$active)
70
+ }
52
71
 
53
- return this.$items.index(this.$active)
72
+ Carousel.prototype.getItemForDirection = function (direction, active) {
73
+ var activeIndex = this.getItemIndex(active)
74
+ var willWrap = (direction == 'prev' && activeIndex === 0)
75
+ || (direction == 'next' && activeIndex == (this.$items.length - 1))
76
+ if (willWrap && !this.options.wrap) return active
77
+ var delta = direction == 'prev' ? -1 : 1
78
+ var itemIndex = (activeIndex + delta) % this.$items.length
79
+ return this.$items.eq(itemIndex)
54
80
  }
55
81
 
56
82
  Carousel.prototype.to = function (pos) {
57
83
  var that = this
58
- var activeIndex = this.getActiveIndex()
84
+ var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
59
85
 
60
86
  if (pos > (this.$items.length - 1) || pos < 0) return
61
87
 
62
- if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
88
+ if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
63
89
  if (activeIndex == pos) return this.pause().cycle()
64
90
 
65
- return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
91
+ return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
66
92
  }
67
93
 
68
94
  Carousel.prototype.pause = function (e) {
@@ -90,22 +116,20 @@
90
116
 
91
117
  Carousel.prototype.slide = function (type, next) {
92
118
  var $active = this.$element.find('.item.active')
93
- var $next = next || $active[type]()
119
+ var $next = next || this.getItemForDirection(type, $active)
94
120
  var isCycling = this.interval
95
121
  var direction = type == 'next' ? 'left' : 'right'
96
- var fallback = type == 'next' ? 'first' : 'last'
97
122
  var that = this
98
123
 
99
- if (!$next.length) {
100
- if (!this.options.wrap) return
101
- $next = this.$element.find('.item')[fallback]()
102
- }
124
+ if ($next.hasClass('active')) return (this.sliding = false)
103
125
 
104
- if ($next.hasClass('active')) return this.sliding = false
105
-
106
- var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
107
- this.$element.trigger(e)
108
- if (e.isDefaultPrevented()) return
126
+ var relatedTarget = $next[0]
127
+ var slideEvent = $.Event('slide.bs.carousel', {
128
+ relatedTarget: relatedTarget,
129
+ direction: direction
130
+ })
131
+ this.$element.trigger(slideEvent)
132
+ if (slideEvent.isDefaultPrevented()) return
109
133
 
110
134
  this.sliding = true
111
135
 
@@ -113,30 +137,31 @@
113
137
 
114
138
  if (this.$indicators.length) {
115
139
  this.$indicators.find('.active').removeClass('active')
116
- this.$element.one('slid.bs.carousel', function () {
117
- var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
118
- $nextIndicator && $nextIndicator.addClass('active')
119
- })
140
+ var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
141
+ $nextIndicator && $nextIndicator.addClass('active')
120
142
  }
121
143
 
144
+ var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
122
145
  if ($.support.transition && this.$element.hasClass('slide')) {
123
146
  $next.addClass(type)
124
147
  $next[0].offsetWidth // force reflow
125
148
  $active.addClass(direction)
126
149
  $next.addClass(direction)
127
150
  $active
128
- .one($.support.transition.end, function () {
151
+ .one('bsTransitionEnd', function () {
129
152
  $next.removeClass([type, direction].join(' ')).addClass('active')
130
153
  $active.removeClass(['active', direction].join(' '))
131
154
  that.sliding = false
132
- setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
155
+ setTimeout(function () {
156
+ that.$element.trigger(slidEvent)
157
+ }, 0)
133
158
  })
134
- .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
159
+ .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
135
160
  } else {
136
161
  $active.removeClass('active')
137
162
  $next.addClass('active')
138
163
  this.sliding = false
139
- this.$element.trigger('slid.bs.carousel')
164
+ this.$element.trigger(slidEvent)
140
165
  }
141
166
 
142
167
  isCycling && this.cycle()
@@ -148,9 +173,7 @@
148
173
  // CAROUSEL PLUGIN DEFINITION
149
174
  // ==========================
150
175
 
151
- var old = $.fn.carousel
152
-
153
- $.fn.carousel = function (option) {
176
+ function Plugin(option) {
154
177
  return this.each(function () {
155
178
  var $this = $(this)
156
179
  var data = $this.data('bs.carousel')
@@ -164,6 +187,9 @@
164
187
  })
165
188
  }
166
189
 
190
+ var old = $.fn.carousel
191
+
192
+ $.fn.carousel = Plugin
167
193
  $.fn.carousel.Constructor = Carousel
168
194
 
169
195
 
@@ -179,26 +205,32 @@
179
205
  // CAROUSEL DATA-API
180
206
  // =================
181
207
 
182
- $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
183
- var $this = $(this), href
184
- var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
208
+ var clickHandler = function (e) {
209
+ var href
210
+ var $this = $(this)
211
+ var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
212
+ if (!$target.hasClass('carousel')) return
185
213
  var options = $.extend({}, $target.data(), $this.data())
186
214
  var slideIndex = $this.attr('data-slide-to')
187
215
  if (slideIndex) options.interval = false
188
216
 
189
- $target.carousel(options)
217
+ Plugin.call($target, options)
190
218
 
191
- if (slideIndex = $this.attr('data-slide-to')) {
219
+ if (slideIndex) {
192
220
  $target.data('bs.carousel').to(slideIndex)
193
221
  }
194
222
 
195
223
  e.preventDefault()
196
- })
224
+ }
225
+
226
+ $(document)
227
+ .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
228
+ .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
197
229
 
198
230
  $(window).on('load', function () {
199
231
  $('[data-ride="carousel"]').each(function () {
200
232
  var $carousel = $(this)
201
- $carousel.carousel($carousel.data())
233
+ Plugin.call($carousel, $carousel.data())
202
234
  })
203
235
  })
204
236