locomotivecms_wagon 2.0.0.rc2 → 2.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
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: collapse.js v3.1.1
2
+ * Bootstrap: collapse.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#collapse
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
 
@@ -16,12 +16,23 @@
16
16
  var Collapse = function (element, options) {
17
17
  this.$element = $(element)
18
18
  this.options = $.extend({}, Collapse.DEFAULTS, options)
19
+ this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
20
+ '[data-toggle="collapse"][data-target="#' + element.id + '"]')
19
21
  this.transitioning = null
20
22
 
21
- if (this.options.parent) this.$parent = $(this.options.parent)
23
+ if (this.options.parent) {
24
+ this.$parent = this.getParent()
25
+ } else {
26
+ this.addAriaAndCollapsedClass(this.$element, this.$trigger)
27
+ }
28
+
22
29
  if (this.options.toggle) this.toggle()
23
30
  }
24
31
 
32
+ Collapse.VERSION = '3.3.5'
33
+
34
+ Collapse.TRANSITION_DURATION = 350
35
+
25
36
  Collapse.DEFAULTS = {
26
37
  toggle: true
27
38
  }
@@ -34,35 +45,43 @@
34
45
  Collapse.prototype.show = function () {
35
46
  if (this.transitioning || this.$element.hasClass('in')) return
36
47
 
48
+ var activesData
49
+ var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
50
+
51
+ if (actives && actives.length) {
52
+ activesData = actives.data('bs.collapse')
53
+ if (activesData && activesData.transitioning) return
54
+ }
55
+
37
56
  var startEvent = $.Event('show.bs.collapse')
38
57
  this.$element.trigger(startEvent)
39
58
  if (startEvent.isDefaultPrevented()) return
40
59
 
41
- var actives = this.$parent && this.$parent.find('> .panel > .in')
42
-
43
60
  if (actives && actives.length) {
44
- var hasData = actives.data('bs.collapse')
45
- if (hasData && hasData.transitioning) return
46
- actives.collapse('hide')
47
- hasData || actives.data('bs.collapse', null)
61
+ Plugin.call(actives, 'hide')
62
+ activesData || actives.data('bs.collapse', null)
48
63
  }
49
64
 
50
65
  var dimension = this.dimension()
51
66
 
52
67
  this.$element
53
68
  .removeClass('collapse')
54
- .addClass('collapsing')
55
- [dimension](0)
69
+ .addClass('collapsing')[dimension](0)
70
+ .attr('aria-expanded', true)
71
+
72
+ this.$trigger
73
+ .removeClass('collapsed')
74
+ .attr('aria-expanded', true)
56
75
 
57
76
  this.transitioning = 1
58
77
 
59
78
  var complete = function () {
60
79
  this.$element
61
80
  .removeClass('collapsing')
62
- .addClass('collapse in')
63
- [dimension]('auto')
81
+ .addClass('collapse in')[dimension]('')
64
82
  this.transitioning = 0
65
- this.$element.trigger('shown.bs.collapse')
83
+ this.$element
84
+ .trigger('shown.bs.collapse')
66
85
  }
67
86
 
68
87
  if (!$.support.transition) return complete.call(this)
@@ -70,9 +89,8 @@
70
89
  var scrollSize = $.camelCase(['scroll', dimension].join('-'))
71
90
 
72
91
  this.$element
73
- .one($.support.transition.end, $.proxy(complete, this))
74
- .emulateTransitionEnd(350)
75
- [dimension](this.$element[0][scrollSize])
92
+ .one('bsTransitionEnd', $.proxy(complete, this))
93
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
76
94
  }
77
95
 
78
96
  Collapse.prototype.hide = function () {
@@ -84,55 +102,85 @@
84
102
 
85
103
  var dimension = this.dimension()
86
104
 
87
- this.$element
88
- [dimension](this.$element[dimension]())
89
- [0].offsetHeight
105
+ this.$element[dimension](this.$element[dimension]())[0].offsetHeight
90
106
 
91
107
  this.$element
92
108
  .addClass('collapsing')
93
- .removeClass('collapse')
94
- .removeClass('in')
109
+ .removeClass('collapse in')
110
+ .attr('aria-expanded', false)
111
+
112
+ this.$trigger
113
+ .addClass('collapsed')
114
+ .attr('aria-expanded', false)
95
115
 
96
116
  this.transitioning = 1
97
117
 
98
118
  var complete = function () {
99
119
  this.transitioning = 0
100
120
  this.$element
101
- .trigger('hidden.bs.collapse')
102
121
  .removeClass('collapsing')
103
122
  .addClass('collapse')
123
+ .trigger('hidden.bs.collapse')
104
124
  }
105
125
 
106
126
  if (!$.support.transition) return complete.call(this)
107
127
 
108
128
  this.$element
109
129
  [dimension](0)
110
- .one($.support.transition.end, $.proxy(complete, this))
111
- .emulateTransitionEnd(350)
130
+ .one('bsTransitionEnd', $.proxy(complete, this))
131
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
112
132
  }
113
133
 
114
134
  Collapse.prototype.toggle = function () {
115
135
  this[this.$element.hasClass('in') ? 'hide' : 'show']()
116
136
  }
117
137
 
138
+ Collapse.prototype.getParent = function () {
139
+ return $(this.options.parent)
140
+ .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
141
+ .each($.proxy(function (i, element) {
142
+ var $element = $(element)
143
+ this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
144
+ }, this))
145
+ .end()
146
+ }
147
+
148
+ Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
149
+ var isOpen = $element.hasClass('in')
150
+
151
+ $element.attr('aria-expanded', isOpen)
152
+ $trigger
153
+ .toggleClass('collapsed', !isOpen)
154
+ .attr('aria-expanded', isOpen)
155
+ }
156
+
157
+ function getTargetFromTrigger($trigger) {
158
+ var href
159
+ var target = $trigger.attr('data-target')
160
+ || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
161
+
162
+ return $(target)
163
+ }
164
+
118
165
 
119
166
  // COLLAPSE PLUGIN DEFINITION
120
167
  // ==========================
121
168
 
122
- var old = $.fn.collapse
123
-
124
- $.fn.collapse = function (option) {
169
+ function Plugin(option) {
125
170
  return this.each(function () {
126
171
  var $this = $(this)
127
172
  var data = $this.data('bs.collapse')
128
173
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
129
174
 
130
- if (!data && options.toggle && option == 'show') option = !option
175
+ if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
131
176
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
132
177
  if (typeof option == 'string') data[option]()
133
178
  })
134
179
  }
135
180
 
181
+ var old = $.fn.collapse
182
+
183
+ $.fn.collapse = Plugin
136
184
  $.fn.collapse.Constructor = Collapse
137
185
 
138
186
 
@@ -148,23 +196,16 @@
148
196
  // COLLAPSE DATA-API
149
197
  // =================
150
198
 
151
- $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
152
- var $this = $(this), href
153
- var target = $this.attr('data-target')
154
- || e.preventDefault()
155
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
156
- var $target = $(target)
199
+ $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
200
+ var $this = $(this)
201
+
202
+ if (!$this.attr('data-target')) e.preventDefault()
203
+
204
+ var $target = getTargetFromTrigger($this)
157
205
  var data = $target.data('bs.collapse')
158
206
  var option = data ? 'toggle' : $this.data()
159
- var parent = $this.attr('data-parent')
160
- var $parent = parent && $(parent)
161
-
162
- if (!data || !data.transitioning) {
163
- if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
164
- $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
165
- }
166
207
 
167
- $target.collapse(option)
208
+ Plugin.call($target, option)
168
209
  })
169
210
 
170
211
  }(jQuery);
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: dropdown.js v3.1.1
2
+ * Bootstrap: dropdown.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#dropdowns
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
 
@@ -14,11 +14,47 @@
14
14
  // =========================
15
15
 
16
16
  var backdrop = '.dropdown-backdrop'
17
- var toggle = '[data-toggle=dropdown]'
17
+ var toggle = '[data-toggle="dropdown"]'
18
18
  var Dropdown = function (element) {
19
19
  $(element).on('click.bs.dropdown', this.toggle)
20
20
  }
21
21
 
22
+ Dropdown.VERSION = '3.3.5'
23
+
24
+ function getParent($this) {
25
+ var selector = $this.attr('data-target')
26
+
27
+ if (!selector) {
28
+ selector = $this.attr('href')
29
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
30
+ }
31
+
32
+ var $parent = selector && $(selector)
33
+
34
+ return $parent && $parent.length ? $parent : $this.parent()
35
+ }
36
+
37
+ function clearMenus(e) {
38
+ if (e && e.which === 3) return
39
+ $(backdrop).remove()
40
+ $(toggle).each(function () {
41
+ var $this = $(this)
42
+ var $parent = getParent($this)
43
+ var relatedTarget = { relatedTarget: this }
44
+
45
+ if (!$parent.hasClass('open')) return
46
+
47
+ if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
48
+
49
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
50
+
51
+ if (e.isDefaultPrevented()) return
52
+
53
+ $this.attr('aria-expanded', 'false')
54
+ $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
55
+ })
56
+ }
57
+
22
58
  Dropdown.prototype.toggle = function (e) {
23
59
  var $this = $(this)
24
60
 
@@ -32,7 +68,10 @@
32
68
  if (!isActive) {
33
69
  if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
34
70
  // if mobile we use a backdrop because click events don't delegate
35
- $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
71
+ $(document.createElement('div'))
72
+ .addClass('dropdown-backdrop')
73
+ .insertAfter($(this))
74
+ .on('click', clearMenus)
36
75
  }
37
76
 
38
77
  var relatedTarget = { relatedTarget: this }
@@ -40,18 +79,20 @@
40
79
 
41
80
  if (e.isDefaultPrevented()) return
42
81
 
82
+ $this
83
+ .trigger('focus')
84
+ .attr('aria-expanded', 'true')
85
+
43
86
  $parent
44
87
  .toggleClass('open')
45
88
  .trigger('shown.bs.dropdown', relatedTarget)
46
-
47
- $this.focus()
48
89
  }
49
90
 
50
91
  return false
51
92
  }
52
93
 
53
94
  Dropdown.prototype.keydown = function (e) {
54
- if (!/(38|40|27)/.test(e.keyCode)) return
95
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
55
96
 
56
97
  var $this = $(this)
57
98
 
@@ -63,57 +104,30 @@
63
104
  var $parent = getParent($this)
64
105
  var isActive = $parent.hasClass('open')
65
106
 
66
- if (!isActive || (isActive && e.keyCode == 27)) {
67
- if (e.which == 27) $parent.find(toggle).focus()
68
- return $this.click()
107
+ if (!isActive && e.which != 27 || isActive && e.which == 27) {
108
+ if (e.which == 27) $parent.find(toggle).trigger('focus')
109
+ return $this.trigger('click')
69
110
  }
70
111
 
71
- var desc = ' li:not(.divider):visible a'
72
- var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
112
+ var desc = ' li:not(.disabled):visible a'
113
+ var $items = $parent.find('.dropdown-menu' + desc)
73
114
 
74
115
  if (!$items.length) return
75
116
 
76
- var index = $items.index($items.filter(':focus'))
117
+ var index = $items.index(e.target)
77
118
 
78
- if (e.keyCode == 38 && index > 0) index-- // up
79
- if (e.keyCode == 40 && index < $items.length - 1) index++ // down
80
- if (!~index) index = 0
119
+ if (e.which == 38 && index > 0) index-- // up
120
+ if (e.which == 40 && index < $items.length - 1) index++ // down
121
+ if (!~index) index = 0
81
122
 
82
- $items.eq(index).focus()
83
- }
84
-
85
- function clearMenus(e) {
86
- $(backdrop).remove()
87
- $(toggle).each(function () {
88
- var $parent = getParent($(this))
89
- var relatedTarget = { relatedTarget: this }
90
- if (!$parent.hasClass('open')) return
91
- $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
92
- if (e.isDefaultPrevented()) return
93
- $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
94
- })
95
- }
96
-
97
- function getParent($this) {
98
- var selector = $this.attr('data-target')
99
-
100
- if (!selector) {
101
- selector = $this.attr('href')
102
- selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
103
- }
104
-
105
- var $parent = selector && $(selector)
106
-
107
- return $parent && $parent.length ? $parent : $this.parent()
123
+ $items.eq(index).trigger('focus')
108
124
  }
109
125
 
110
126
 
111
127
  // DROPDOWN PLUGIN DEFINITION
112
128
  // ==========================
113
129
 
114
- var old = $.fn.dropdown
115
-
116
- $.fn.dropdown = function (option) {
130
+ function Plugin(option) {
117
131
  return this.each(function () {
118
132
  var $this = $(this)
119
133
  var data = $this.data('bs.dropdown')
@@ -123,6 +137,9 @@
123
137
  })
124
138
  }
125
139
 
140
+ var old = $.fn.dropdown
141
+
142
+ $.fn.dropdown = Plugin
126
143
  $.fn.dropdown.Constructor = Dropdown
127
144
 
128
145
 
@@ -142,6 +159,7 @@
142
159
  .on('click.bs.dropdown.data-api', clearMenus)
143
160
  .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
144
161
  .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
145
- .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
162
+ .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
163
+ .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
146
164
 
147
165
  }(jQuery);