bootstrap-generators 2.0.1 → 2.0.4

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 (127) hide show
  1. data/README.md +258 -33
  2. data/Rakefile +0 -59
  3. data/lib/bootstrap/generators/engine.rb +6 -1
  4. data/lib/bootstrap/generators/version.rb +1 -1
  5. data/lib/generators/bootstrap/install/install_generator.rb +10 -2
  6. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.css.scss +120 -15
  7. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.less +206 -0
  8. data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css +2 -0
  9. data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css.less +5 -4
  10. data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css.scss +3 -2
  11. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css +2 -0
  12. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.less +5 -4
  13. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.scss +3 -2
  14. data/lib/generators/bootstrap/install/templates/config/initializers/simple_form.rb +3 -0
  15. data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.erb +3 -3
  16. data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.haml +2 -2
  17. data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.erb +1 -1
  18. data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.haml +1 -1
  19. data/test/fixtures/application.js +3 -0
  20. data/test/lib/generators/bootstrap/install_generator_test.rb +4 -3
  21. data/test/test_helper.rb +8 -1
  22. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  23. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  24. data/vendor/assets/javascripts/bootstrap-alert.js +28 -32
  25. data/vendor/assets/javascripts/bootstrap-button.js +29 -33
  26. data/vendor/assets/javascripts/bootstrap-carousel.js +33 -21
  27. data/vendor/assets/javascripts/bootstrap-collapse.js +47 -26
  28. data/vendor/assets/javascripts/bootstrap-dropdown.js +18 -10
  29. data/vendor/assets/javascripts/bootstrap-modal.js +25 -17
  30. data/vendor/assets/javascripts/bootstrap-popover.js +13 -10
  31. data/vendor/assets/javascripts/bootstrap-scrollspy.js +44 -18
  32. data/vendor/assets/javascripts/bootstrap-tab.js +12 -7
  33. data/vendor/assets/javascripts/bootstrap-tooltip.js +40 -35
  34. data/vendor/assets/javascripts/bootstrap-transition.js +30 -20
  35. data/vendor/assets/javascripts/bootstrap-typeahead.js +29 -15
  36. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/accordion.less +5 -0
  37. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/alerts.less +2 -14
  38. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/bootstrap.less +2 -2
  39. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/breadcrumbs.less +2 -0
  40. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/button-groups.less +76 -33
  41. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/buttons.less +32 -24
  42. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/carousel.less +0 -0
  43. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/close.less +12 -1
  44. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/code.less +6 -6
  45. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/component-animations.less +7 -5
  46. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/dropdowns.less +58 -45
  47. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/forms.less +205 -144
  48. data/vendor/twitter/bootstrap/less/grid.less +5 -0
  49. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/hero-unit.less +3 -1
  50. data/vendor/twitter/bootstrap/less/labels-badges.less +55 -0
  51. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/layouts.less +1 -1
  52. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/mixins.less +235 -179
  53. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/modals.less +13 -6
  54. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/navbar.less +131 -72
  55. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/navs.less +53 -43
  56. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/pager.less +6 -0
  57. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/pagination.less +1 -0
  58. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/popovers.less +0 -0
  59. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/progress-bars.less +27 -5
  60. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/reset.less +8 -3
  61. data/vendor/twitter/bootstrap/less/responsive-1200px-min.less +26 -0
  62. data/vendor/twitter/bootstrap/less/responsive-767px-max.less +149 -0
  63. data/vendor/twitter/bootstrap/less/responsive-768px-979px.less +17 -0
  64. data/vendor/twitter/bootstrap/less/responsive-navbar.less +153 -0
  65. data/vendor/twitter/bootstrap/less/responsive-utilities.less +41 -0
  66. data/vendor/twitter/bootstrap/less/responsive.less +48 -0
  67. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/scaffolding.less +4 -4
  68. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/sprites.less +42 -9
  69. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/tables.less +46 -20
  70. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/thumbnails.less +14 -2
  71. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/tooltip.less +0 -0
  72. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/type.less +27 -13
  73. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/utilities.less +0 -0
  74. data/vendor/twitter/bootstrap/less/variables.less +206 -0
  75. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/wells.less +10 -0
  76. data/vendor/{assets/stylesheets/scss/accordion.scss → twitter/bootstrap/sass/_accordion.scss} +5 -0
  77. data/vendor/{assets/stylesheets/scss/alerts.scss → twitter/bootstrap/sass/_alerts.scss} +3 -15
  78. data/vendor/{assets/stylesheets/scss/breadcrumbs.scss → twitter/bootstrap/sass/_breadcrumbs.scss} +2 -0
  79. data/vendor/{assets/stylesheets/scss/button-groups.scss → twitter/bootstrap/sass/_button-groups.scss} +76 -33
  80. data/vendor/{assets/stylesheets/scss/buttons.scss → twitter/bootstrap/sass/_buttons.scss} +33 -25
  81. data/vendor/{assets/stylesheets/scss/carousel.scss → twitter/bootstrap/sass/_carousel.scss} +1 -1
  82. data/vendor/{assets/stylesheets/scss/close.scss → twitter/bootstrap/sass/_close.scss} +12 -1
  83. data/vendor/{assets/stylesheets/scss/code.scss → twitter/bootstrap/sass/_code.scss} +7 -7
  84. data/vendor/{assets/stylesheets/scss/component-animations.scss → twitter/bootstrap/sass/_component-animations.scss} +9 -7
  85. data/vendor/{assets/stylesheets/scss/dropdowns.scss → twitter/bootstrap/sass/_dropdowns.scss} +58 -45
  86. data/vendor/{assets/stylesheets/scss/forms.scss → twitter/bootstrap/sass/_forms.scss} +205 -145
  87. data/vendor/twitter/bootstrap/sass/_grid.scss +5 -0
  88. data/vendor/{assets/stylesheets/scss/hero-unit.scss → twitter/bootstrap/sass/_hero-unit.scss} +3 -1
  89. data/vendor/twitter/bootstrap/sass/_labels-badges.scss +52 -0
  90. data/vendor/{assets/stylesheets/scss/layouts.scss → twitter/bootstrap/sass/_layouts.scss} +2 -2
  91. data/vendor/{assets/stylesheets/scss/mixins.scss → twitter/bootstrap/sass/_mixins.scss} +246 -182
  92. data/vendor/{assets/stylesheets/scss/modals.scss → twitter/bootstrap/sass/_modals.scss} +14 -7
  93. data/vendor/{assets/stylesheets/scss/navbar.scss → twitter/bootstrap/sass/_navbar.scss} +132 -73
  94. data/vendor/{assets/stylesheets/scss/navs.scss → twitter/bootstrap/sass/_navs.scss} +53 -43
  95. data/vendor/{assets/stylesheets/scss/pager.scss → twitter/bootstrap/sass/_pager.scss} +6 -0
  96. data/vendor/{assets/stylesheets/scss/pagination.scss → twitter/bootstrap/sass/_pagination.scss} +1 -0
  97. data/vendor/{assets/stylesheets/scss/popovers.scss → twitter/bootstrap/sass/_popovers.scss} +0 -0
  98. data/vendor/{assets/stylesheets/scss/progress-bars.scss → twitter/bootstrap/sass/_progress-bars.scss} +27 -5
  99. data/vendor/{assets/stylesheets/scss/reset.scss → twitter/bootstrap/sass/_reset.scss} +8 -3
  100. data/vendor/twitter/bootstrap/sass/_responsive-1200px-min.scss +26 -0
  101. data/vendor/twitter/bootstrap/sass/_responsive-767px-max.scss +149 -0
  102. data/vendor/twitter/bootstrap/sass/_responsive-768px-979px.scss +17 -0
  103. data/vendor/twitter/bootstrap/sass/_responsive-navbar.scss +153 -0
  104. data/vendor/twitter/bootstrap/sass/_responsive-utilities.scss +41 -0
  105. data/vendor/{assets/stylesheets/scss/scaffolding.scss → twitter/bootstrap/sass/_scaffolding.scss} +4 -4
  106. data/vendor/{assets/stylesheets/scss/sprites.scss → twitter/bootstrap/sass/_sprites.scss} +40 -7
  107. data/vendor/{assets/stylesheets/scss/tables.scss → twitter/bootstrap/sass/_tables.scss} +37 -32
  108. data/vendor/{assets/stylesheets/scss/thumbnails.scss → twitter/bootstrap/sass/_thumbnails.scss} +14 -2
  109. data/vendor/{assets/stylesheets/scss/tooltip.scss → twitter/bootstrap/sass/_tooltip.scss} +1 -1
  110. data/vendor/{assets/stylesheets/scss/type.scss → twitter/bootstrap/sass/_type.scss} +27 -13
  111. data/vendor/{assets/stylesheets/scss/utilities.scss → twitter/bootstrap/sass/_utilities.scss} +0 -0
  112. data/vendor/twitter/bootstrap/sass/_variables.scss +204 -0
  113. data/vendor/{assets/stylesheets/scss/wells.scss → twitter/bootstrap/sass/_wells.scss} +10 -0
  114. data/vendor/{assets/stylesheets/scss → twitter/bootstrap/sass}/bootstrap.scss +3 -3
  115. data/vendor/twitter/bootstrap/sass/responsive.scss +48 -0
  116. metadata +93 -84
  117. data/lib/generators/bootstrap/install/templates/assets/javascripts/bootstrap-generators.js +0 -1
  118. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.css.less +0 -98
  119. data/vendor/assets/stylesheets/bootstrap.css +0 -3363
  120. data/vendor/assets/stylesheets/less/grid.less +0 -8
  121. data/vendor/assets/stylesheets/less/labels.less +0 -32
  122. data/vendor/assets/stylesheets/less/responsive.less +0 -327
  123. data/vendor/assets/stylesheets/less/variables.less +0 -107
  124. data/vendor/assets/stylesheets/scss/grid.scss +0 -8
  125. data/vendor/assets/stylesheets/scss/labels.scss +0 -32
  126. data/vendor/assets/stylesheets/scss/responsive.scss +0 -327
  127. data/vendor/assets/stylesheets/scss/variables.scss +0 -107
@@ -1,5 +1,5 @@
1
1
  /* ========================================================
2
- * bootstrap-tab.js v2.0.1
2
+ * bootstrap-tab.js v2.0.4
3
3
  * http://twitter.github.com/bootstrap/javascript.html#tabs
4
4
  * ========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -18,9 +18,10 @@
18
18
  * ======================================================== */
19
19
 
20
20
 
21
- !function( $ ){
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
22
24
 
23
- "use strict"
24
25
 
25
26
  /* TAB CLASS DEFINITION
26
27
  * ==================== */
@@ -39,6 +40,7 @@
39
40
  , selector = $this.attr('data-target')
40
41
  , previous
41
42
  , $target
43
+ , e
42
44
 
43
45
  if (!selector) {
44
46
  selector = $this.attr('href')
@@ -49,11 +51,14 @@
49
51
 
50
52
  previous = $ul.find('.active a').last()[0]
51
53
 
52
- $this.trigger({
53
- type: 'show'
54
- , relatedTarget: previous
54
+ e = $.Event('show', {
55
+ relatedTarget: previous
55
56
  })
56
57
 
58
+ $this.trigger(e)
59
+
60
+ if (e.isDefaultPrevented()) return
61
+
57
62
  $target = $(selector)
58
63
 
59
64
  this.activate($this.parent('li'), $ul)
@@ -127,4 +132,4 @@
127
132
  })
128
133
  })
129
134
 
130
- }( window.jQuery );
135
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ===========================================================
2
- * bootstrap-tooltip.js v2.0.1
2
+ * bootstrap-tooltip.js v2.0.4
3
3
  * http://twitter.github.com/bootstrap/javascript.html#tooltips
4
4
  * Inspired by the original jQuery.tipsy by Jason Frame
5
5
  * ===========================================================
@@ -18,14 +18,16 @@
18
18
  * limitations under the License.
19
19
  * ========================================================== */
20
20
 
21
- !function( $ ) {
22
21
 
23
- "use strict"
22
+ !function ($) {
23
+
24
+ "use strict"; // jshint ;_;
25
+
24
26
 
25
27
  /* TOOLTIP PUBLIC CLASS DEFINITION
26
28
  * =============================== */
27
29
 
28
- var Tooltip = function ( element, options ) {
30
+ var Tooltip = function (element, options) {
29
31
  this.init('tooltip', element, options)
30
32
  }
31
33
 
@@ -33,7 +35,7 @@
33
35
 
34
36
  constructor: Tooltip
35
37
 
36
- , init: function ( type, element, options ) {
38
+ , init: function (type, element, options) {
37
39
  var eventIn
38
40
  , eventOut
39
41
 
@@ -54,7 +56,7 @@
54
56
  this.fixTitle()
55
57
  }
56
58
 
57
- , getOptions: function ( options ) {
59
+ , getOptions: function (options) {
58
60
  options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
59
61
 
60
62
  if (options.delay && typeof options.delay == 'number') {
@@ -67,34 +69,28 @@
67
69
  return options
68
70
  }
69
71
 
70
- , enter: function ( e ) {
72
+ , enter: function (e) {
71
73
  var self = $(e.currentTarget)[this.type](this._options).data(this.type)
72
74
 
73
- if (!self.options.delay || !self.options.delay.show) {
74
- self.show()
75
- } else {
76
- self.hoverState = 'in'
77
- setTimeout(function() {
78
- if (self.hoverState == 'in') {
79
- self.show()
80
- }
81
- }, self.options.delay.show)
82
- }
75
+ if (!self.options.delay || !self.options.delay.show) return self.show()
76
+
77
+ clearTimeout(this.timeout)
78
+ self.hoverState = 'in'
79
+ this.timeout = setTimeout(function() {
80
+ if (self.hoverState == 'in') self.show()
81
+ }, self.options.delay.show)
83
82
  }
84
83
 
85
- , leave: function ( e ) {
84
+ , leave: function (e) {
86
85
  var self = $(e.currentTarget)[this.type](this._options).data(this.type)
87
86
 
88
- if (!self.options.delay || !self.options.delay.hide) {
89
- self.hide()
90
- } else {
91
- self.hoverState = 'out'
92
- setTimeout(function() {
93
- if (self.hoverState == 'out') {
94
- self.hide()
95
- }
96
- }, self.options.delay.hide)
97
- }
87
+ if (this.timeout) clearTimeout(this.timeout)
88
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
89
+
90
+ self.hoverState = 'out'
91
+ this.timeout = setTimeout(function() {
92
+ if (self.hoverState == 'out') self.hide()
93
+ }, self.options.delay.hide)
98
94
  }
99
95
 
100
96
  , show: function () {
@@ -152,9 +148,20 @@
152
148
  }
153
149
  }
154
150
 
151
+ , isHTML: function(text) {
152
+ // html string detection logic adapted from jQuery
153
+ return typeof text != 'string'
154
+ || ( text.charAt(0) === "<"
155
+ && text.charAt( text.length - 1 ) === ">"
156
+ && text.length >= 3
157
+ ) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
158
+ }
159
+
155
160
  , setContent: function () {
156
161
  var $tip = this.tip()
157
- $tip.find('.tooltip-inner').html(this.getTitle())
162
+ , title = this.getTitle()
163
+
164
+ $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
158
165
  $tip.removeClass('fade in top bottom left right')
159
166
  }
160
167
 
@@ -206,8 +213,6 @@
206
213
  title = $e.attr('data-original-title')
207
214
  || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
208
215
 
209
- title = title.toString().replace(/(^\s*|\s*$)/, "")
210
-
211
216
  return title
212
217
  }
213
218
 
@@ -259,12 +264,12 @@
259
264
 
260
265
  $.fn.tooltip.defaults = {
261
266
  animation: true
262
- , delay: 0
263
- , selector: false
264
267
  , placement: 'top'
268
+ , selector: false
269
+ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
265
270
  , trigger: 'hover'
266
271
  , title: ''
267
- , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
272
+ , delay: 0
268
273
  }
269
274
 
270
- }( window.jQuery );
275
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ===================================================
2
- * bootstrap-transition.js v2.0.1
2
+ * bootstrap-transition.js v2.0.4
3
3
  * http://twitter.github.com/bootstrap/javascript.html#transitions
4
4
  * ===================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -17,35 +17,45 @@
17
17
  * limitations under the License.
18
18
  * ========================================================== */
19
19
 
20
- !function( $ ) {
20
+
21
+ !function ($) {
21
22
 
22
23
  $(function () {
23
24
 
24
- "use strict"
25
+ "use strict"; // jshint ;_;
26
+
25
27
 
26
- /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
28
+ /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
27
29
  * ======================================================= */
28
30
 
29
31
  $.support.transition = (function () {
30
- var thisBody = document.body || document.documentElement
31
- , thisStyle = thisBody.style
32
- , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
33
-
34
- return support && {
35
- end: (function () {
36
- var transitionEnd = "TransitionEnd"
37
- if ( $.browser.webkit ) {
38
- transitionEnd = "webkitTransitionEnd"
39
- } else if ( $.browser.mozilla ) {
40
- transitionEnd = "transitionend"
41
- } else if ( $.browser.opera ) {
42
- transitionEnd = "oTransitionEnd"
32
+
33
+ var transitionEnd = (function () {
34
+
35
+ var el = document.createElement('bootstrap')
36
+ , transEndEventNames = {
37
+ 'WebkitTransition' : 'webkitTransitionEnd'
38
+ , 'MozTransition' : 'transitionend'
39
+ , 'OTransition' : 'oTransitionEnd'
40
+ , 'msTransition' : 'MSTransitionEnd'
41
+ , 'transition' : 'transitionend'
42
+ }
43
+ , name
44
+
45
+ for (name in transEndEventNames){
46
+ if (el.style[name] !== undefined) {
47
+ return transEndEventNames[name]
43
48
  }
44
- return transitionEnd
45
- }())
49
+ }
50
+
51
+ }())
52
+
53
+ return transitionEnd && {
54
+ end: transitionEnd
46
55
  }
56
+
47
57
  })()
48
58
 
49
59
  })
50
60
 
51
- }( window.jQuery );
61
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* =============================================================
2
- * bootstrap-typeahead.js v2.0.1
2
+ * bootstrap-typeahead.js v2.0.4
3
3
  * http://twitter.github.com/bootstrap/javascript.html#typeahead
4
4
  * =============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -17,16 +17,22 @@
17
17
  * limitations under the License.
18
18
  * ============================================================ */
19
19
 
20
- !function( $ ){
21
20
 
22
- "use strict"
21
+ !function($){
23
22
 
24
- var Typeahead = function ( element, options ) {
23
+ "use strict"; // jshint ;_;
24
+
25
+
26
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
27
+ * ================================= */
28
+
29
+ var Typeahead = function (element, options) {
25
30
  this.$element = $(element)
26
31
  this.options = $.extend({}, $.fn.typeahead.defaults, options)
27
32
  this.matcher = this.options.matcher || this.matcher
28
33
  this.sorter = this.options.sorter || this.sorter
29
34
  this.highlighter = this.options.highlighter || this.highlighter
35
+ this.updater = this.options.updater || this.updater
30
36
  this.$menu = $(this.options.menu).appendTo('body')
31
37
  this.source = this.options.source
32
38
  this.shown = false
@@ -39,10 +45,16 @@
39
45
 
40
46
  , select: function () {
41
47
  var val = this.$menu.find('.active').attr('data-value')
42
- this.$element.val(val)
48
+ this.$element
49
+ .val(this.updater(val))
50
+ .change()
43
51
  return this.hide()
44
52
  }
45
53
 
54
+ , updater: function (item) {
55
+ return item
56
+ }
57
+
46
58
  , show: function () {
47
59
  var pos = $.extend({}, this.$element.offset(), {
48
60
  height: this.$element[0].offsetHeight
@@ -76,7 +88,7 @@
76
88
  }
77
89
 
78
90
  items = $.grep(this.source, function (item) {
79
- if (that.matcher(item)) return item
91
+ return that.matcher(item)
80
92
  })
81
93
 
82
94
  items = this.sorter(items)
@@ -108,7 +120,8 @@
108
120
  }
109
121
 
110
122
  , highlighter: function (item) {
111
- return item.replace(new RegExp('(' + this.query + ')', 'ig'), function ($1, match) {
123
+ var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
124
+ return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
112
125
  return '<strong>' + match + '</strong>'
113
126
  })
114
127
  }
@@ -165,9 +178,6 @@
165
178
  }
166
179
 
167
180
  , keyup: function (e) {
168
- e.stopPropagation()
169
- e.preventDefault()
170
-
171
181
  switch(e.keyCode) {
172
182
  case 40: // down arrow
173
183
  case 38: // up arrow
@@ -180,6 +190,7 @@
180
190
  break
181
191
 
182
192
  case 27: // escape
193
+ if (!this.shown) return
183
194
  this.hide()
184
195
  break
185
196
 
@@ -187,10 +198,11 @@
187
198
  this.lookup()
188
199
  }
189
200
 
201
+ e.stopPropagation()
202
+ e.preventDefault()
190
203
  }
191
204
 
192
205
  , keypress: function (e) {
193
- e.stopPropagation()
194
206
  if (!this.shown) return
195
207
 
196
208
  switch(e.keyCode) {
@@ -201,21 +213,23 @@
201
213
  break
202
214
 
203
215
  case 38: // up arrow
216
+ if (e.type != 'keydown') break
204
217
  e.preventDefault()
205
218
  this.prev()
206
219
  break
207
220
 
208
221
  case 40: // down arrow
222
+ if (e.type != 'keydown') break
209
223
  e.preventDefault()
210
224
  this.next()
211
225
  break
212
226
  }
227
+
228
+ e.stopPropagation()
213
229
  }
214
230
 
215
231
  , blur: function (e) {
216
232
  var that = this
217
- e.stopPropagation()
218
- e.preventDefault()
219
233
  setTimeout(function () { that.hide() }, 150)
220
234
  }
221
235
 
@@ -236,7 +250,7 @@
236
250
  /* TYPEAHEAD PLUGIN DEFINITION
237
251
  * =========================== */
238
252
 
239
- $.fn.typeahead = function ( option ) {
253
+ $.fn.typeahead = function (option) {
240
254
  return this.each(function () {
241
255
  var $this = $(this)
242
256
  , data = $this.data('typeahead')
@@ -268,4 +282,4 @@
268
282
  })
269
283
  })
270
284
 
271
- }( window.jQuery );
285
+ }(window.jQuery);
@@ -21,6 +21,11 @@
21
21
  padding: 8px 15px;
22
22
  }
23
23
 
24
+ // General toggle styles
25
+ .accordion-toggle {
26
+ cursor: pointer;
27
+ }
28
+
24
29
  // Inner needs the styles because you can't animate properly with any styles on the element
25
30
  .accordion-inner {
26
31
  padding: 9px 15px;
@@ -9,10 +9,10 @@
9
9
  background-color: @warningBackground;
10
10
  border: 1px solid @warningBorder;
11
11
  .border-radius(4px);
12
+ color: @warningText;
12
13
  }
13
- .alert,
14
14
  .alert-heading {
15
- color: @warningText;
15
+ color: inherit;
16
16
  }
17
17
 
18
18
  // Adjust close link position
@@ -29,32 +29,20 @@
29
29
  .alert-success {
30
30
  background-color: @successBackground;
31
31
  border-color: @successBorder;
32
- }
33
- .alert-success,
34
- .alert-success .alert-heading {
35
32
  color: @successText;
36
33
  }
37
34
  .alert-danger,
38
35
  .alert-error {
39
36
  background-color: @errorBackground;
40
37
  border-color: @errorBorder;
41
- }
42
- .alert-danger,
43
- .alert-error,
44
- .alert-danger .alert-heading,
45
- .alert-error .alert-heading {
46
38
  color: @errorText;
47
39
  }
48
40
  .alert-info {
49
41
  background-color: @infoBackground;
50
42
  border-color: @infoBorder;
51
- }
52
- .alert-info,
53
- .alert-info .alert-heading {
54
43
  color: @infoText;
55
44
  }
56
45
 
57
-
58
46
  // Block alerts
59
47
  // ------------------------
60
48
  .alert-block {