bootstrap-generators 2.2.2 → 2.3.1

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 (78) hide show
  1. data/README.md +14 -14
  2. data/bootstrap-generators.gemspec +1 -1
  3. data/lib/bootstrap-generators.rb +0 -1
  4. data/lib/bootstrap/generators/version.rb +1 -1
  5. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.css.scss +9 -9
  6. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.less +3 -3
  7. data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.erb +1 -1
  8. data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.haml +1 -1
  9. data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.erb +1 -1
  10. data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.haml +1 -1
  11. data/vendor/assets/javascripts/bootstrap-affix.js +1 -1
  12. data/vendor/assets/javascripts/bootstrap-alert.js +1 -1
  13. data/vendor/assets/javascripts/bootstrap-button.js +1 -1
  14. data/vendor/assets/javascripts/bootstrap-carousel.js +32 -10
  15. data/vendor/assets/javascripts/bootstrap-collapse.js +4 -4
  16. data/vendor/assets/javascripts/bootstrap-dropdown.js +14 -10
  17. data/vendor/assets/javascripts/bootstrap-modal.js +14 -12
  18. data/vendor/assets/javascripts/bootstrap-popover.js +5 -5
  19. data/vendor/assets/javascripts/bootstrap-scrollspy.js +2 -2
  20. data/vendor/assets/javascripts/bootstrap-tab.js +1 -1
  21. data/vendor/assets/javascripts/bootstrap-tooltip.js +104 -30
  22. data/vendor/assets/javascripts/bootstrap-transition.js +1 -1
  23. data/vendor/assets/javascripts/bootstrap-typeahead.js +16 -4
  24. data/vendor/assets/stylesheets/bootstrap-responsive.css +24 -7
  25. data/vendor/assets/stylesheets/bootstrap.css +238 -119
  26. data/vendor/twitter/bootstrap/less/bootstrap.less +4 -4
  27. data/vendor/twitter/bootstrap/less/button-groups.less +4 -2
  28. data/vendor/twitter/bootstrap/less/buttons.less +8 -10
  29. data/vendor/twitter/bootstrap/less/carousel.less +34 -7
  30. data/vendor/twitter/bootstrap/less/close.less +2 -1
  31. data/vendor/twitter/bootstrap/less/dropdowns.less +16 -12
  32. data/vendor/twitter/bootstrap/less/forms.less +5 -2
  33. data/vendor/twitter/bootstrap/less/labels-badges.less +4 -2
  34. data/vendor/twitter/bootstrap/less/media.less +2 -2
  35. data/vendor/twitter/bootstrap/less/mixins.less +24 -8
  36. data/vendor/twitter/bootstrap/less/navbar.less +20 -13
  37. data/vendor/twitter/bootstrap/less/navs.less +39 -21
  38. data/vendor/twitter/bootstrap/less/pager.less +3 -1
  39. data/vendor/twitter/bootstrap/less/pagination.less +3 -1
  40. data/vendor/twitter/bootstrap/less/popovers.less +5 -1
  41. data/vendor/twitter/bootstrap/less/responsive-767px-max.less +2 -2
  42. data/vendor/twitter/bootstrap/less/responsive-navbar.less +6 -2
  43. data/vendor/twitter/bootstrap/less/responsive-utilities.less +16 -0
  44. data/vendor/twitter/bootstrap/less/responsive.less +1 -10
  45. data/vendor/twitter/bootstrap/less/scaffolding.less +2 -1
  46. data/vendor/twitter/bootstrap/less/sprites.less +7 -3
  47. data/vendor/twitter/bootstrap/less/tables.less +24 -17
  48. data/vendor/twitter/bootstrap/less/thumbnails.less +3 -2
  49. data/vendor/twitter/bootstrap/less/tooltip.less +6 -6
  50. data/vendor/twitter/bootstrap/less/type.less +19 -7
  51. data/vendor/twitter/bootstrap/less/variables.less +3 -3
  52. data/vendor/twitter/bootstrap/sass/_button-groups.scss +4 -2
  53. data/vendor/twitter/bootstrap/sass/_buttons.scss +8 -10
  54. data/vendor/twitter/bootstrap/sass/_carousel.scss +33 -6
  55. data/vendor/twitter/bootstrap/sass/_close.scss +2 -1
  56. data/vendor/twitter/bootstrap/sass/_dropdowns.scss +16 -12
  57. data/vendor/twitter/bootstrap/sass/_forms.scss +5 -2
  58. data/vendor/twitter/bootstrap/sass/_labels-badges.scss +4 -2
  59. data/vendor/twitter/bootstrap/sass/_media.scss +2 -2
  60. data/vendor/twitter/bootstrap/sass/_mixins.scss +8 -2
  61. data/vendor/twitter/bootstrap/sass/_modals.scss +3 -3
  62. data/vendor/twitter/bootstrap/sass/_navbar.scss +18 -11
  63. data/vendor/twitter/bootstrap/sass/_navs.scss +39 -21
  64. data/vendor/twitter/bootstrap/sass/_pager.scss +3 -1
  65. data/vendor/twitter/bootstrap/sass/_pagination.scss +3 -1
  66. data/vendor/twitter/bootstrap/sass/_popovers.scss +5 -1
  67. data/vendor/twitter/bootstrap/sass/_responsive-navbar.scss +6 -2
  68. data/vendor/twitter/bootstrap/sass/_responsive-utilities.scss +29 -13
  69. data/vendor/twitter/bootstrap/sass/_scaffolding.scss +2 -1
  70. data/vendor/twitter/bootstrap/sass/_sprites.scss +7 -3
  71. data/vendor/twitter/bootstrap/sass/_tables.scss +24 -17
  72. data/vendor/twitter/bootstrap/sass/_thumbnails.scss +3 -2
  73. data/vendor/twitter/bootstrap/sass/_tooltip.scss +6 -6
  74. data/vendor/twitter/bootstrap/sass/_type.scss +20 -8
  75. data/vendor/twitter/bootstrap/sass/_variables.scss +4 -4
  76. data/vendor/twitter/bootstrap/sass/bootstrap.scss +1 -1
  77. data/vendor/twitter/bootstrap/sass/responsive.scss +1 -10
  78. metadata +38 -12
@@ -1,5 +1,5 @@
1
1
  /* ===========================================================
2
- * bootstrap-popover.js v2.2.2
2
+ * bootstrap-popover.js v2.3.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#popovers
4
4
  * ===========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -58,8 +58,8 @@
58
58
  , $e = this.$element
59
59
  , o = this.options
60
60
 
61
- content = $e.attr('data-content')
62
- || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
61
+ content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
62
+ || $e.attr('data-content')
63
63
 
64
64
  return content
65
65
  }
@@ -99,7 +99,7 @@
99
99
  placement: 'right'
100
100
  , trigger: 'click'
101
101
  , content: ''
102
- , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'
102
+ , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
103
103
  })
104
104
 
105
105
 
@@ -111,4 +111,4 @@
111
111
  return this
112
112
  }
113
113
 
114
- }(window.jQuery);
114
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* =============================================================
2
- * bootstrap-scrollspy.js v2.2.2
2
+ * bootstrap-scrollspy.js v2.3.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#scrollspy
4
4
  * =============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -59,7 +59,7 @@
59
59
  , $href = /^#\w/.test(href) && $(href)
60
60
  return ( $href
61
61
  && $href.length
62
- && [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
62
+ && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
63
63
  })
64
64
  .sort(function (a, b) { return a[0] - b[0] })
65
65
  .each(function () {
@@ -1,5 +1,5 @@
1
1
  /* ========================================================
2
- * bootstrap-tab.js v2.2.2
2
+ * bootstrap-tab.js v2.3.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#tabs
4
4
  * ========================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -1,5 +1,5 @@
1
1
  /* ===========================================================
2
- * bootstrap-tooltip.js v2.2.2
2
+ * bootstrap-tooltip.js v2.3.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#tooltips
4
4
  * Inspired by the original jQuery.tipsy by Jason Frame
5
5
  * ===========================================================
@@ -38,19 +38,27 @@
38
38
  , init: function (type, element, options) {
39
39
  var eventIn
40
40
  , eventOut
41
+ , triggers
42
+ , trigger
43
+ , i
41
44
 
42
45
  this.type = type
43
46
  this.$element = $(element)
44
47
  this.options = this.getOptions(options)
45
48
  this.enabled = true
46
49
 
47
- if (this.options.trigger == 'click') {
48
- this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
49
- } else if (this.options.trigger != 'manual') {
50
- eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
51
- eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
52
- this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
53
- this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
50
+ triggers = this.options.trigger.split(' ')
51
+
52
+ for (i = triggers.length; i--;) {
53
+ trigger = triggers[i]
54
+ if (trigger == 'click') {
55
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
56
+ } else if (trigger != 'manual') {
57
+ eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
58
+ eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
59
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
60
+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
61
+ }
54
62
  }
55
63
 
56
64
  this.options.selector ?
@@ -59,7 +67,7 @@
59
67
  }
60
68
 
61
69
  , getOptions: function (options) {
62
- options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
70
+ options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
63
71
 
64
72
  if (options.delay && typeof options.delay == 'number') {
65
73
  options.delay = {
@@ -72,7 +80,15 @@
72
80
  }
73
81
 
74
82
  , enter: function (e) {
75
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
83
+ var defaults = $.fn[this.type].defaults
84
+ , options = {}
85
+ , self
86
+
87
+ this._options && $.each(this._options, function (key, value) {
88
+ if (defaults[key] != value) options[key] = value
89
+ }, this)
90
+
91
+ self = $(e.currentTarget)[this.type](options).data(this.type)
76
92
 
77
93
  if (!self.options.delay || !self.options.delay.show) return self.show()
78
94
 
@@ -97,14 +113,16 @@
97
113
 
98
114
  , show: function () {
99
115
  var $tip
100
- , inside
101
116
  , pos
102
117
  , actualWidth
103
118
  , actualHeight
104
119
  , placement
105
120
  , tp
121
+ , e = $.Event('show')
106
122
 
107
123
  if (this.hasContent() && this.enabled) {
124
+ this.$element.trigger(e)
125
+ if (e.isDefaultPrevented()) return
108
126
  $tip = this.tip()
109
127
  this.setContent()
110
128
 
@@ -116,19 +134,18 @@
116
134
  this.options.placement.call(this, $tip[0], this.$element[0]) :
117
135
  this.options.placement
118
136
 
119
- inside = /in/.test(placement)
120
-
121
137
  $tip
122
138
  .detach()
123
139
  .css({ top: 0, left: 0, display: 'block' })
124
- .insertAfter(this.$element)
125
140
 
126
- pos = this.getPosition(inside)
141
+ this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
142
+
143
+ pos = this.getPosition()
127
144
 
128
145
  actualWidth = $tip[0].offsetWidth
129
146
  actualHeight = $tip[0].offsetHeight
130
147
 
131
- switch (inside ? placement.split(' ')[1] : placement) {
148
+ switch (placement) {
132
149
  case 'bottom':
133
150
  tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
134
151
  break
@@ -143,13 +160,58 @@
143
160
  break
144
161
  }
145
162
 
146
- $tip
147
- .offset(tp)
148
- .addClass(placement)
149
- .addClass('in')
163
+ this.applyPlacement(tp, placement)
164
+ this.$element.trigger('shown')
150
165
  }
151
166
  }
152
167
 
168
+ , applyPlacement: function(offset, placement){
169
+ var $tip = this.tip()
170
+ , width = $tip[0].offsetWidth
171
+ , height = $tip[0].offsetHeight
172
+ , actualWidth
173
+ , actualHeight
174
+ , delta
175
+ , replace
176
+
177
+ $tip
178
+ .offset(offset)
179
+ .addClass(placement)
180
+ .addClass('in')
181
+
182
+ actualWidth = $tip[0].offsetWidth
183
+ actualHeight = $tip[0].offsetHeight
184
+
185
+ if (placement == 'top' && actualHeight != height) {
186
+ offset.top = offset.top + height - actualHeight
187
+ replace = true
188
+ }
189
+
190
+ if (placement == 'bottom' || placement == 'top') {
191
+ delta = 0
192
+
193
+ if (offset.left < 0){
194
+ delta = offset.left * -2
195
+ offset.left = 0
196
+ $tip.offset(offset)
197
+ actualWidth = $tip[0].offsetWidth
198
+ actualHeight = $tip[0].offsetHeight
199
+ }
200
+
201
+ this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
202
+ } else {
203
+ this.replaceArrow(actualHeight - height, actualHeight, 'top')
204
+ }
205
+
206
+ if (replace) $tip.offset(offset)
207
+ }
208
+
209
+ , replaceArrow: function(delta, dimension, position){
210
+ this
211
+ .arrow()
212
+ .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
213
+ }
214
+
153
215
  , setContent: function () {
154
216
  var $tip = this.tip()
155
217
  , title = this.getTitle()
@@ -161,6 +223,10 @@
161
223
  , hide: function () {
162
224
  var that = this
163
225
  , $tip = this.tip()
226
+ , e = $.Event('hide')
227
+
228
+ this.$element.trigger(e)
229
+ if (e.isDefaultPrevented()) return
164
230
 
165
231
  $tip.removeClass('in')
166
232
 
@@ -179,13 +245,15 @@
179
245
  removeWithAnimation() :
180
246
  $tip.detach()
181
247
 
248
+ this.$element.trigger('hidden')
249
+
182
250
  return this
183
251
  }
184
252
 
185
253
  , fixTitle: function () {
186
254
  var $e = this.$element
187
255
  if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
188
- $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
256
+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
189
257
  }
190
258
  }
191
259
 
@@ -193,11 +261,12 @@
193
261
  return this.getTitle()
194
262
  }
195
263
 
196
- , getPosition: function (inside) {
197
- return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
198
- width: this.$element[0].offsetWidth
199
- , height: this.$element[0].offsetHeight
200
- })
264
+ , getPosition: function () {
265
+ var el = this.$element[0]
266
+ return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
267
+ width: el.offsetWidth
268
+ , height: el.offsetHeight
269
+ }, this.$element.offset())
201
270
  }
202
271
 
203
272
  , getTitle: function () {
@@ -215,6 +284,10 @@
215
284
  return this.$tip = this.$tip || $(this.options.template)
216
285
  }
217
286
 
287
+ , arrow: function(){
288
+ return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
289
+ }
290
+
218
291
  , validate: function () {
219
292
  if (!this.$element[0].parentNode) {
220
293
  this.hide()
@@ -236,8 +309,8 @@
236
309
  }
237
310
 
238
311
  , toggle: function (e) {
239
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
240
- self[self.tip().hasClass('in') ? 'hide' : 'show']()
312
+ var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
313
+ self.tip().hasClass('in') ? self.hide() : self.show()
241
314
  }
242
315
 
243
316
  , destroy: function () {
@@ -269,10 +342,11 @@
269
342
  , placement: 'top'
270
343
  , selector: false
271
344
  , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
272
- , trigger: 'hover'
345
+ , trigger: 'hover focus'
273
346
  , title: ''
274
347
  , delay: 0
275
348
  , html: false
349
+ , container: false
276
350
  }
277
351
 
278
352
 
@@ -284,4 +358,4 @@
284
358
  return this
285
359
  }
286
360
 
287
- }(window.jQuery);
361
+ }(window.jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ===================================================
2
- * bootstrap-transition.js v2.2.2
2
+ * bootstrap-transition.js v2.3.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#transitions
4
4
  * ===================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -1,5 +1,5 @@
1
1
  /* =============================================================
2
- * bootstrap-typeahead.js v2.2.2
2
+ * bootstrap-typeahead.js v2.3.1
3
3
  * http://twitter.github.com/bootstrap/javascript.html#typeahead
4
4
  * =============================================================
5
5
  * Copyright 2012 Twitter, Inc.
@@ -172,6 +172,7 @@
172
172
 
173
173
  , listen: function () {
174
174
  this.$element
175
+ .on('focus', $.proxy(this.focus, this))
175
176
  .on('blur', $.proxy(this.blur, this))
176
177
  .on('keypress', $.proxy(this.keypress, this))
177
178
  .on('keyup', $.proxy(this.keyup, this))
@@ -183,6 +184,7 @@
183
184
  this.$menu
184
185
  .on('click', $.proxy(this.click, this))
185
186
  .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
187
+ .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
186
188
  }
187
189
 
188
190
  , eventSupported: function(eventName) {
@@ -256,22 +258,33 @@
256
258
  e.preventDefault()
257
259
  }
258
260
 
261
+ , focus: function (e) {
262
+ this.focused = true
263
+ }
264
+
259
265
  , blur: function (e) {
260
- var that = this
261
- setTimeout(function () { that.hide() }, 150)
266
+ this.focused = false
267
+ if (!this.mousedover && this.shown) this.hide()
262
268
  }
263
269
 
264
270
  , click: function (e) {
265
271
  e.stopPropagation()
266
272
  e.preventDefault()
267
273
  this.select()
274
+ this.$element.focus()
268
275
  }
269
276
 
270
277
  , mouseenter: function (e) {
278
+ this.mousedover = true
271
279
  this.$menu.find('.active').removeClass('active')
272
280
  $(e.currentTarget).addClass('active')
273
281
  }
274
282
 
283
+ , mouseleave: function (e) {
284
+ this.mousedover = false
285
+ if (!this.focused && this.shown) this.hide()
286
+ }
287
+
275
288
  }
276
289
 
277
290
 
@@ -316,7 +329,6 @@
316
329
  $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
317
330
  var $this = $(this)
318
331
  if ($this.data('typeahead')) return
319
- e.preventDefault()
320
332
  $this.typeahead($this.data())
321
333
  })
322
334
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap Responsive v2.2.2
2
+ * Bootstrap Responsive v2.3.1
3
3
  *
4
4
  * Copyright 2012 Twitter, Inc
5
5
  * Licensed under the Apache License v2.0
@@ -8,10 +8,6 @@
8
8
  * Designed and built with all the love in the world @twitter by @mdo and @fat.
9
9
  */
10
10
 
11
- @-ms-viewport {
12
- width: device-width;
13
- }
14
-
15
11
  .clearfix {
16
12
  *zoom: 1;
17
13
  }
@@ -44,6 +40,10 @@
44
40
  box-sizing: border-box;
45
41
  }
46
42
 
43
+ @-ms-viewport {
44
+ width: device-width;
45
+ }
46
+
47
47
  .hidden {
48
48
  display: none;
49
49
  visibility: hidden;
@@ -95,6 +95,19 @@
95
95
  }
96
96
  }
97
97
 
98
+ .visible-print {
99
+ display: none !important;
100
+ }
101
+
102
+ @media print {
103
+ .visible-print {
104
+ display: inherit !important;
105
+ }
106
+ .hidden-print {
107
+ display: none !important;
108
+ }
109
+ }
110
+
98
111
  @media (min-width: 1200px) {
99
112
  .row {
100
113
  margin-left: -30px;
@@ -1003,7 +1016,9 @@
1003
1016
  margin-bottom: 2px;
1004
1017
  }
1005
1018
  .nav-collapse .nav > li > a:hover,
1006
- .nav-collapse .dropdown-menu a:hover {
1019
+ .nav-collapse .nav > li > a:focus,
1020
+ .nav-collapse .dropdown-menu a:hover,
1021
+ .nav-collapse .dropdown-menu a:focus {
1007
1022
  background-color: #f2f2f2;
1008
1023
  }
1009
1024
  .navbar-inverse .nav-collapse .nav > li > a,
@@ -1011,7 +1026,9 @@
1011
1026
  color: #999999;
1012
1027
  }
1013
1028
  .navbar-inverse .nav-collapse .nav > li > a:hover,
1014
- .navbar-inverse .nav-collapse .dropdown-menu a:hover {
1029
+ .navbar-inverse .nav-collapse .nav > li > a:focus,
1030
+ .navbar-inverse .nav-collapse .dropdown-menu a:hover,
1031
+ .navbar-inverse .nav-collapse .dropdown-menu a:focus {
1015
1032
  background-color: #111111;
1016
1033
  }
1017
1034
  .nav-collapse.in .btn-group {