bootstrap-sass 3.1.1.1 → 3.2.0.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bootstrap-sass might be problematic. Click here for more details.

Files changed (143) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.travis.yml +6 -2
  4. data/CHANGELOG.md +19 -0
  5. data/Gemfile +5 -10
  6. data/README.md +140 -75
  7. data/Rakefile +4 -5
  8. data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  9. data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.svg +0 -0
  10. data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  11. data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  12. data/assets/images/.keep +0 -0
  13. data/assets/javascripts/bootstrap-sprockets.js +12 -0
  14. data/assets/javascripts/bootstrap.js +2107 -0
  15. data/{vendor/assets → assets}/javascripts/bootstrap/affix.js +18 -11
  16. data/{vendor/assets → assets}/javascripts/bootstrap/alert.js +10 -6
  17. data/{vendor/assets → assets}/javascripts/bootstrap/button.js +11 -8
  18. data/{vendor/assets → assets}/javascripts/bootstrap/carousel.js +49 -31
  19. data/{vendor/assets → assets}/javascripts/bootstrap/collapse.js +19 -24
  20. data/{vendor/assets → assets}/javascripts/bootstrap/dropdown.js +9 -5
  21. data/{vendor/assets → assets}/javascripts/bootstrap/modal.js +25 -16
  22. data/{vendor/assets → assets}/javascripts/bootstrap/popover.js +9 -6
  23. data/{vendor/assets → assets}/javascripts/bootstrap/scrollspy.js +37 -21
  24. data/{vendor/assets → assets}/javascripts/bootstrap/tab.js +11 -8
  25. data/{vendor/assets → assets}/javascripts/bootstrap/tooltip.js +52 -17
  26. data/{vendor/assets → assets}/javascripts/bootstrap/transition.js +14 -3
  27. data/assets/stylesheets/_bootstrap-compass.scss +7 -0
  28. data/{vendor/assets → assets}/stylesheets/_bootstrap-mincer.scss +0 -0
  29. data/assets/stylesheets/_bootstrap-sprockets.scss +7 -0
  30. data/{vendor/assets/stylesheets/bootstrap.scss → assets/stylesheets/_bootstrap.scss} +0 -0
  31. data/{vendor/assets → assets}/stylesheets/bootstrap/_alerts.scss +4 -3
  32. data/{vendor/assets → assets}/stylesheets/bootstrap/_badges.scss +0 -0
  33. data/{vendor/assets → assets}/stylesheets/bootstrap/_breadcrumbs.scss +0 -0
  34. data/{vendor/assets → assets}/stylesheets/bootstrap/_button-groups.scss +5 -1
  35. data/{vendor/assets → assets}/stylesheets/bootstrap/_buttons.scss +0 -2
  36. data/{vendor/assets → assets}/stylesheets/bootstrap/_carousel.scss +3 -1
  37. data/{vendor/assets → assets}/stylesheets/bootstrap/_close.scss +0 -0
  38. data/{vendor/assets → assets}/stylesheets/bootstrap/_code.scss +6 -0
  39. data/{vendor/assets → assets}/stylesheets/bootstrap/_component-animations.scss +0 -0
  40. data/{vendor/assets → assets}/stylesheets/bootstrap/_dropdowns.scss +1 -0
  41. data/{vendor/assets → assets}/stylesheets/bootstrap/_forms.scss +82 -22
  42. data/{vendor/assets → assets}/stylesheets/bootstrap/_glyphicons.scss +4 -4
  43. data/{vendor/assets → assets}/stylesheets/bootstrap/_grid.scss +0 -0
  44. data/{vendor/assets → assets}/stylesheets/bootstrap/_input-groups.scss +6 -2
  45. data/{vendor/assets → assets}/stylesheets/bootstrap/_jumbotron.scss +0 -0
  46. data/{vendor/assets → assets}/stylesheets/bootstrap/_labels.scss +0 -0
  47. data/{vendor/assets → assets}/stylesheets/bootstrap/_list-group.scss +3 -1
  48. data/{vendor/assets → assets}/stylesheets/bootstrap/_media.scss +0 -0
  49. data/{vendor/assets → assets}/stylesheets/bootstrap/_mixins.scss +0 -0
  50. data/{vendor/assets → assets}/stylesheets/bootstrap/_modals.scss +7 -4
  51. data/{vendor/assets → assets}/stylesheets/bootstrap/_navbar.scss +1 -0
  52. data/{vendor/assets → assets}/stylesheets/bootstrap/_navs.scss +1 -1
  53. data/{vendor/assets → assets}/stylesheets/bootstrap/_normalize.scss +0 -0
  54. data/{vendor/assets → assets}/stylesheets/bootstrap/_pager.scss +0 -0
  55. data/{vendor/assets → assets}/stylesheets/bootstrap/_pagination.scss +0 -0
  56. data/{vendor/assets → assets}/stylesheets/bootstrap/_panels.scss +6 -3
  57. data/{vendor/assets → assets}/stylesheets/bootstrap/_popovers.scss +0 -0
  58. data/{vendor/assets → assets}/stylesheets/bootstrap/_print.scss +0 -0
  59. data/{vendor/assets → assets}/stylesheets/bootstrap/_progress-bars.scss +18 -2
  60. data/{vendor/assets → assets}/stylesheets/bootstrap/_responsive-embed.scss +0 -0
  61. data/{vendor/assets → assets}/stylesheets/bootstrap/_responsive-utilities.scss +2 -1
  62. data/{vendor/assets → assets}/stylesheets/bootstrap/_scaffolding.scss +1 -1
  63. data/{vendor/assets → assets}/stylesheets/bootstrap/_tables.scss +2 -2
  64. data/{vendor/assets → assets}/stylesheets/bootstrap/_theme.scss +11 -0
  65. data/{vendor/assets → assets}/stylesheets/bootstrap/_thumbnails.scss +0 -0
  66. data/{vendor/assets → assets}/stylesheets/bootstrap/_tooltip.scss +0 -0
  67. data/{vendor/assets → assets}/stylesheets/bootstrap/_type.scss +16 -6
  68. data/{vendor/assets → assets}/stylesheets/bootstrap/_utilities.scss +1 -0
  69. data/{vendor/assets → assets}/stylesheets/bootstrap/_variables.scss +25 -20
  70. data/{vendor/assets → assets}/stylesheets/bootstrap/_wells.scss +0 -0
  71. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_alerts.scss +0 -0
  72. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_background-variant.scss +0 -0
  73. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_border-radius.scss +0 -0
  74. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_buttons.scss +0 -0
  75. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_center-block.scss +0 -0
  76. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_clearfix.scss +0 -0
  77. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_forms.scss +0 -0
  78. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_gradients.scss +1 -1
  79. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_grid-framework.scss +2 -8
  80. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_grid.scss +3 -3
  81. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_hide-text.scss +0 -0
  82. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_image.scss +1 -0
  83. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_labels.scss +0 -0
  84. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_list-group.scss +0 -0
  85. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -0
  86. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +0 -0
  87. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_opacity.scss +0 -0
  88. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_pagination.scss +0 -0
  89. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_panels.scss +4 -0
  90. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_progress-bar.scss +2 -0
  91. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_reset-filter.scss +0 -0
  92. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_resize.scss +1 -1
  93. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -0
  94. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_size.scss +0 -0
  95. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_tab-focus.scss +0 -0
  96. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_table-row.scss +0 -0
  97. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -0
  98. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_text-overflow.scss +0 -0
  99. data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +5 -10
  100. data/bootstrap-sass.gemspec +11 -6
  101. data/bower.json +22 -90
  102. data/composer.json +1 -1
  103. data/lib/bootstrap-sass.rb +3 -2
  104. data/lib/bootstrap-sass/engine.rb +4 -1
  105. data/lib/bootstrap-sass/version.rb +2 -2
  106. data/package.json +6 -1
  107. data/sache.json +5 -0
  108. data/tasks/bower.rake +6 -5
  109. data/tasks/converter.rb +3 -3
  110. data/tasks/converter/js_conversion.rb +11 -5
  111. data/tasks/converter/less_conversion.rb +30 -21
  112. data/tasks/converter/logger.rb +1 -0
  113. data/tasks/converter/network.rb +14 -16
  114. data/templates/project/{_variables.sass.erb → _bootstrap-variables.sass.erb} +0 -2
  115. data/templates/project/manifest.rb +17 -16
  116. data/templates/project/styles.sass +2 -2
  117. data/test/compass_test.rb +5 -4
  118. data/test/compilation_test.rb +10 -9
  119. data/test/dummy_node_mincer/manifest.js +2 -2
  120. data/test/dummy_rails/README.rdoc +1 -1
  121. data/test/dummy_rails/app/assets/javascripts/application.js +1 -1
  122. data/test/dummy_rails/app/assets/stylesheets/application.css.sass +2 -1
  123. data/test/dummy_rails/app/views/pages/root.html.slim +1 -1
  124. data/test/dummy_rails/config/application.rb +19 -3
  125. data/test/dummy_sass_only/compile.rb +4 -4
  126. data/test/gemfiles/sass_3_2.gemfile +1 -11
  127. data/test/gemfiles/sass_3_3.gemfile +2 -13
  128. data/test/gemfiles/sass_3_4.gemfile +7 -0
  129. data/test/gemfiles/sass_head.gemfile +2 -13
  130. data/test/node_mincer_test.rb +6 -5
  131. data/test/node_sass_test.rb +7 -6
  132. data/test/pages_test.rb +3 -3
  133. data/test/sass_test.rb +9 -6
  134. data/test/sprockets_rails_test.rb +11 -5
  135. data/test/support/dummy_rails_integration.rb +22 -0
  136. data/test/support/integration_test.rb +4 -11
  137. data/test/support/reporting.rb +17 -0
  138. data/test/test_helper.rb +22 -18
  139. data/test/test_helper_rails.rb +6 -0
  140. metadata +231 -151
  141. data/lib/bootstrap-sass/sass_functions.rb +0 -50
  142. data/vendor/assets/javascripts/bootstrap.js +0 -12
  143. data/vendor/assets/stylesheets/bootstrap/bootstrap.scss +0 -50
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: dropdown.js v3.1.1
2
+ * Bootstrap: dropdown.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#dropdowns
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -19,6 +19,8 @@
19
19
  $(element).on('click.bs.dropdown', this.toggle)
20
20
  }
21
21
 
22
+ Dropdown.VERSION = '3.2.0'
23
+
22
24
  Dropdown.prototype.toggle = function (e) {
23
25
  var $this = $(this)
24
26
 
@@ -83,6 +85,7 @@
83
85
  }
84
86
 
85
87
  function clearMenus(e) {
88
+ if (e && e.which === 3) return
86
89
  $(backdrop).remove()
87
90
  $(toggle).each(function () {
88
91
  var $parent = getParent($(this))
@@ -99,7 +102,7 @@
99
102
 
100
103
  if (!selector) {
101
104
  selector = $this.attr('href')
102
- selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
105
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
103
106
  }
104
107
 
105
108
  var $parent = selector && $(selector)
@@ -111,9 +114,7 @@
111
114
  // DROPDOWN PLUGIN DEFINITION
112
115
  // ==========================
113
116
 
114
- var old = $.fn.dropdown
115
-
116
- $.fn.dropdown = function (option) {
117
+ function Plugin(option) {
117
118
  return this.each(function () {
118
119
  var $this = $(this)
119
120
  var data = $this.data('bs.dropdown')
@@ -123,6 +124,9 @@
123
124
  })
124
125
  }
125
126
 
127
+ var old = $.fn.dropdown
128
+
129
+ $.fn.dropdown = Plugin
126
130
  $.fn.dropdown.Constructor = Dropdown
127
131
 
128
132
 
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: modal.js v3.1.1
2
+ * Bootstrap: modal.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#modals
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -30,6 +30,8 @@
30
30
  }
31
31
  }
32
32
 
33
+ Modal.VERSION = '3.2.0'
34
+
33
35
  Modal.DEFAULTS = {
34
36
  backdrop: true,
35
37
  keyboard: true,
@@ -83,7 +85,7 @@
83
85
 
84
86
  transition ?
85
87
  that.$element.find('.modal-dialog') // wait for modal to slide in
86
- .one($.support.transition.end, function () {
88
+ .one('bsTransitionEnd', function () {
87
89
  that.$element.trigger('focus').trigger(e)
88
90
  })
89
91
  .emulateTransitionEnd(300) :
@@ -116,7 +118,7 @@
116
118
 
117
119
  $.support.transition && this.$element.hasClass('fade') ?
118
120
  this.$element
119
- .one($.support.transition.end, $.proxy(this.hideModal, this))
121
+ .one('bsTransitionEnd', $.proxy(this.hideModal, this))
120
122
  .emulateTransitionEnd(300) :
121
123
  this.hideModal()
122
124
  }
@@ -145,7 +147,6 @@
145
147
  var that = this
146
148
  this.$element.hide()
147
149
  this.backdrop(function () {
148
- that.removeBackdrop()
149
150
  that.$element.trigger('hidden.bs.modal')
150
151
  })
151
152
  }
@@ -156,6 +157,7 @@
156
157
  }
157
158
 
158
159
  Modal.prototype.backdrop = function (callback) {
160
+ var that = this
159
161
  var animate = this.$element.hasClass('fade') ? 'fade' : ''
160
162
 
161
163
  if (this.isShown && this.options.backdrop) {
@@ -179,18 +181,22 @@
179
181
 
180
182
  doAnimate ?
181
183
  this.$backdrop
182
- .one($.support.transition.end, callback)
184
+ .one('bsTransitionEnd', callback)
183
185
  .emulateTransitionEnd(150) :
184
186
  callback()
185
187
 
186
188
  } else if (!this.isShown && this.$backdrop) {
187
189
  this.$backdrop.removeClass('in')
188
190
 
191
+ var callbackRemove = function () {
192
+ that.removeBackdrop()
193
+ callback && callback()
194
+ }
189
195
  $.support.transition && this.$element.hasClass('fade') ?
190
196
  this.$backdrop
191
- .one($.support.transition.end, callback)
197
+ .one('bsTransitionEnd', callbackRemove)
192
198
  .emulateTransitionEnd(150) :
193
- callback()
199
+ callbackRemove()
194
200
 
195
201
  } else if (callback) {
196
202
  callback()
@@ -202,8 +208,8 @@
202
208
  this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
203
209
  }
204
210
 
205
- Modal.prototype.setScrollbar = function () {
206
- var bodyPad = parseInt(this.$body.css('padding-right') || 0)
211
+ Modal.prototype.setScrollbar = function () {
212
+ var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
207
213
  if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
208
214
  }
209
215
 
@@ -224,9 +230,7 @@
224
230
  // MODAL PLUGIN DEFINITION
225
231
  // =======================
226
232
 
227
- var old = $.fn.modal
228
-
229
- $.fn.modal = function (option, _relatedTarget) {
233
+ function Plugin(option, _relatedTarget) {
230
234
  return this.each(function () {
231
235
  var $this = $(this)
232
236
  var data = $this.data('bs.modal')
@@ -238,6 +242,9 @@
238
242
  })
239
243
  }
240
244
 
245
+ var old = $.fn.modal
246
+
247
+ $.fn.modal = Plugin
241
248
  $.fn.modal.Constructor = Modal
242
249
 
243
250
 
@@ -256,16 +263,18 @@
256
263
  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
257
264
  var $this = $(this)
258
265
  var href = $this.attr('href')
259
- var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
266
+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
260
267
  var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
261
268
 
262
269
  if ($this.is('a')) e.preventDefault()
263
270
 
264
- $target
265
- .modal(option, this)
266
- .one('hide', function () {
271
+ $target.one('show.bs.modal', function (showEvent) {
272
+ if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
273
+ $target.one('hidden.bs.modal', function () {
267
274
  $this.is(':visible') && $this.trigger('focus')
268
275
  })
276
+ })
277
+ Plugin.call($target, option, this)
269
278
  })
270
279
 
271
280
  }(jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: popover.js v3.1.1
2
+ * Bootstrap: popover.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#popovers
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -19,11 +19,13 @@
19
19
 
20
20
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
21
21
 
22
+ Popover.VERSION = '3.2.0'
23
+
22
24
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
23
25
  placement: 'right',
24
26
  trigger: 'click',
25
27
  content: '',
26
- template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
28
+ template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
27
29
  })
28
30
 
29
31
 
@@ -70,7 +72,7 @@
70
72
  }
71
73
 
72
74
  Popover.prototype.arrow = function () {
73
- return this.$arrow = this.$arrow || this.tip().find('.arrow')
75
+ return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
74
76
  }
75
77
 
76
78
  Popover.prototype.tip = function () {
@@ -82,9 +84,7 @@
82
84
  // POPOVER PLUGIN DEFINITION
83
85
  // =========================
84
86
 
85
- var old = $.fn.popover
86
-
87
- $.fn.popover = function (option) {
87
+ function Plugin(option) {
88
88
  return this.each(function () {
89
89
  var $this = $(this)
90
90
  var data = $this.data('bs.popover')
@@ -96,6 +96,9 @@
96
96
  })
97
97
  }
98
98
 
99
+ var old = $.fn.popover
100
+
101
+ $.fn.popover = Plugin
99
102
  $.fn.popover.Constructor = Popover
100
103
 
101
104
 
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: scrollspy.js v3.1.1
2
+ * Bootstrap: scrollspy.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#scrollspy
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -14,33 +14,44 @@
14
14
  // ==========================
15
15
 
16
16
  function ScrollSpy(element, options) {
17
- var href
18
17
  var process = $.proxy(this.process, this)
19
18
 
20
- this.$element = $(element).is('body') ? $(window) : $(element)
21
19
  this.$body = $('body')
22
- this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process)
20
+ this.$scrollElement = $(element).is('body') ? $(window) : $(element)
23
21
  this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
24
- this.selector = (this.options.target
25
- || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
26
- || '') + ' .nav li > a'
27
- this.offsets = $([])
28
- this.targets = $([])
22
+ this.selector = (this.options.target || '') + ' .nav li > a'
23
+ this.offsets = []
24
+ this.targets = []
29
25
  this.activeTarget = null
26
+ this.scrollHeight = 0
30
27
 
28
+ this.$scrollElement.on('scroll.bs.scrollspy', process)
31
29
  this.refresh()
32
30
  this.process()
33
31
  }
34
32
 
33
+ ScrollSpy.VERSION = '3.2.0'
34
+
35
35
  ScrollSpy.DEFAULTS = {
36
36
  offset: 10
37
37
  }
38
38
 
39
+ ScrollSpy.prototype.getScrollHeight = function () {
40
+ return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
41
+ }
42
+
39
43
  ScrollSpy.prototype.refresh = function () {
40
- var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
44
+ var offsetMethod = 'offset'
45
+ var offsetBase = 0
41
46
 
42
- this.offsets = $([])
43
- this.targets = $([])
47
+ if (!$.isWindow(this.$scrollElement[0])) {
48
+ offsetMethod = 'position'
49
+ offsetBase = this.$scrollElement.scrollTop()
50
+ }
51
+
52
+ this.offsets = []
53
+ this.targets = []
54
+ this.scrollHeight = this.getScrollHeight()
44
55
 
45
56
  var self = this
46
57
 
@@ -54,7 +65,7 @@
54
65
  return ($href
55
66
  && $href.length
56
67
  && $href.is(':visible')
57
- && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
68
+ && [[$href[offsetMethod]().top + offsetBase, href]]) || null
58
69
  })
59
70
  .sort(function (a, b) { return a[0] - b[0] })
60
71
  .each(function () {
@@ -65,15 +76,19 @@
65
76
 
66
77
  ScrollSpy.prototype.process = function () {
67
78
  var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
68
- var scrollHeight = this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
69
- var maxScroll = scrollHeight - this.$scrollElement.height()
79
+ var scrollHeight = this.getScrollHeight()
80
+ var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
70
81
  var offsets = this.offsets
71
82
  var targets = this.targets
72
83
  var activeTarget = this.activeTarget
73
84
  var i
74
85
 
86
+ if (this.scrollHeight != scrollHeight) {
87
+ this.refresh()
88
+ }
89
+
75
90
  if (scrollTop >= maxScroll) {
76
- return activeTarget != (i = targets.last()[0]) && this.activate(i)
91
+ return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
77
92
  }
78
93
 
79
94
  if (activeTarget && scrollTop <= offsets[0]) {
@@ -84,7 +99,7 @@
84
99
  activeTarget != targets[i]
85
100
  && scrollTop >= offsets[i]
86
101
  && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
87
- && this.activate( targets[i] )
102
+ && this.activate(targets[i])
88
103
  }
89
104
  }
90
105
 
@@ -116,9 +131,7 @@
116
131
  // SCROLLSPY PLUGIN DEFINITION
117
132
  // ===========================
118
133
 
119
- var old = $.fn.scrollspy
120
-
121
- $.fn.scrollspy = function (option) {
134
+ function Plugin(option) {
122
135
  return this.each(function () {
123
136
  var $this = $(this)
124
137
  var data = $this.data('bs.scrollspy')
@@ -129,6 +142,9 @@
129
142
  })
130
143
  }
131
144
 
145
+ var old = $.fn.scrollspy
146
+
147
+ $.fn.scrollspy = Plugin
132
148
  $.fn.scrollspy.Constructor = ScrollSpy
133
149
 
134
150
 
@@ -147,7 +163,7 @@
147
163
  $(window).on('load.bs.scrollspy.data-api', function () {
148
164
  $('[data-spy="scroll"]').each(function () {
149
165
  var $spy = $(this)
150
- $spy.scrollspy($spy.data())
166
+ Plugin.call($spy, $spy.data())
151
167
  })
152
168
  })
153
169
 
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: tab.js v3.1.1
2
+ * Bootstrap: tab.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#tabs
4
4
  * ========================================================================
5
5
  * Copyright 2011-2014 Twitter, Inc.
@@ -17,6 +17,8 @@
17
17
  this.element = $(element)
18
18
  }
19
19
 
20
+ Tab.VERSION = '3.2.0'
21
+
20
22
  Tab.prototype.show = function () {
21
23
  var $this = this.element
22
24
  var $ul = $this.closest('ul:not(.dropdown-menu)')
@@ -24,7 +26,7 @@
24
26
 
25
27
  if (!selector) {
26
28
  selector = $this.attr('href')
27
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
29
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
28
30
  }
29
31
 
30
32
  if ($this.parent('li').hasClass('active')) return
@@ -40,7 +42,7 @@
40
42
 
41
43
  var $target = $(selector)
42
44
 
43
- this.activate($this.parent('li'), $ul)
45
+ this.activate($this.closest('li'), $ul)
44
46
  this.activate($target, $target.parent(), function () {
45
47
  $this.trigger({
46
48
  type: 'shown.bs.tab',
@@ -79,7 +81,7 @@
79
81
 
80
82
  transition ?
81
83
  $active
82
- .one($.support.transition.end, next)
84
+ .one('bsTransitionEnd', next)
83
85
  .emulateTransitionEnd(150) :
84
86
  next()
85
87
 
@@ -90,9 +92,7 @@
90
92
  // TAB PLUGIN DEFINITION
91
93
  // =====================
92
94
 
93
- var old = $.fn.tab
94
-
95
- $.fn.tab = function ( option ) {
95
+ function Plugin(option) {
96
96
  return this.each(function () {
97
97
  var $this = $(this)
98
98
  var data = $this.data('bs.tab')
@@ -102,6 +102,9 @@
102
102
  })
103
103
  }
104
104
 
105
+ var old = $.fn.tab
106
+
107
+ $.fn.tab = Plugin
105
108
  $.fn.tab.Constructor = Tab
106
109
 
107
110
 
@@ -119,7 +122,7 @@
119
122
 
120
123
  $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
121
124
  e.preventDefault()
122
- $(this).tab('show')
125
+ Plugin.call($(this), 'show')
123
126
  })
124
127
 
125
128
  }(jQuery);
@@ -1,5 +1,5 @@
1
1
  /* ========================================================================
2
- * Bootstrap: tooltip.js v3.1.1
2
+ * Bootstrap: tooltip.js v3.2.0
3
3
  * http://getbootstrap.com/javascript/#tooltip
4
4
  * Inspired by the original jQuery.tipsy by Jason Frame
5
5
  * ========================================================================
@@ -25,6 +25,8 @@
25
25
  this.init('tooltip', element, options)
26
26
  }
27
27
 
28
+ Tooltip.VERSION = '3.2.0'
29
+
28
30
  Tooltip.DEFAULTS = {
29
31
  animation: true,
30
32
  placement: 'top',
@@ -99,7 +101,12 @@
99
101
 
100
102
  Tooltip.prototype.enter = function (obj) {
101
103
  var self = obj instanceof this.constructor ?
102
- obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
104
+ obj : $(obj.currentTarget).data('bs.' + this.type)
105
+
106
+ if (!self) {
107
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
108
+ $(obj.currentTarget).data('bs.' + this.type, self)
109
+ }
103
110
 
104
111
  clearTimeout(self.timeout)
105
112
 
@@ -114,7 +121,12 @@
114
121
 
115
122
  Tooltip.prototype.leave = function (obj) {
116
123
  var self = obj instanceof this.constructor ?
117
- obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
124
+ obj : $(obj.currentTarget).data('bs.' + this.type)
125
+
126
+ if (!self) {
127
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
128
+ $(obj.currentTarget).data('bs.' + this.type, self)
129
+ }
118
130
 
119
131
  clearTimeout(self.timeout)
120
132
 
@@ -133,12 +145,17 @@
133
145
  if (this.hasContent() && this.enabled) {
134
146
  this.$element.trigger(e)
135
147
 
136
- if (e.isDefaultPrevented()) return
137
- var that = this;
148
+ var inDom = $.contains(document.documentElement, this.$element[0])
149
+ if (e.isDefaultPrevented() || !inDom) return
150
+ var that = this
138
151
 
139
152
  var $tip = this.tip()
140
153
 
154
+ var tipId = this.getUID(this.type)
155
+
141
156
  this.setContent()
157
+ $tip.attr('id', tipId)
158
+ this.$element.attr('aria-describedby', tipId)
142
159
 
143
160
  if (this.options.animation) $tip.addClass('fade')
144
161
 
@@ -154,6 +171,7 @@
154
171
  .detach()
155
172
  .css({ top: 0, left: 0, display: 'block' })
156
173
  .addClass(placement)
174
+ .data('bs.' + this.type, this)
157
175
 
158
176
  this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
159
177
 
@@ -180,15 +198,15 @@
180
198
  var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
181
199
 
182
200
  this.applyPlacement(calculatedOffset, placement)
183
- this.hoverState = null
184
201
 
185
- var complete = function() {
202
+ var complete = function () {
186
203
  that.$element.trigger('shown.bs.' + that.type)
204
+ that.hoverState = null
187
205
  }
188
206
 
189
207
  $.support.transition && this.$tip.hasClass('fade') ?
190
208
  $tip
191
- .one($.support.transition.end, complete)
209
+ .one('bsTransitionEnd', complete)
192
210
  .emulateTransitionEnd(150) :
193
211
  complete()
194
212
  }
@@ -261,6 +279,8 @@
261
279
  var $tip = this.tip()
262
280
  var e = $.Event('hide.bs.' + this.type)
263
281
 
282
+ this.$element.removeAttr('aria-describedby')
283
+
264
284
  function complete() {
265
285
  if (that.hoverState != 'in') $tip.detach()
266
286
  that.$element.trigger('hidden.bs.' + that.type)
@@ -274,7 +294,7 @@
274
294
 
275
295
  $.support.transition && this.$tip.hasClass('fade') ?
276
296
  $tip
277
- .one($.support.transition.end, complete)
297
+ .one('bsTransitionEnd', complete)
278
298
  .emulateTransitionEnd(150) :
279
299
  complete()
280
300
 
@@ -285,7 +305,7 @@
285
305
 
286
306
  Tooltip.prototype.fixTitle = function () {
287
307
  var $e = this.$element
288
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
308
+ if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
289
309
  $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
290
310
  }
291
311
  }
@@ -302,7 +322,7 @@
302
322
  scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
303
323
  width: isBody ? $(window).width() : $element.outerWidth(),
304
324
  height: isBody ? $(window).height() : $element.outerHeight()
305
- }, isBody ? {top: 0, left: 0} : $element.offset())
325
+ }, isBody ? { top: 0, left: 0 } : $element.offset())
306
326
  }
307
327
 
308
328
  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
@@ -352,12 +372,18 @@
352
372
  return title
353
373
  }
354
374
 
375
+ Tooltip.prototype.getUID = function (prefix) {
376
+ do prefix += ~~(Math.random() * 1000000)
377
+ while (document.getElementById(prefix))
378
+ return prefix
379
+ }
380
+
355
381
  Tooltip.prototype.tip = function () {
356
- return this.$tip = this.$tip || $(this.options.template)
382
+ return (this.$tip = this.$tip || $(this.options.template))
357
383
  }
358
384
 
359
385
  Tooltip.prototype.arrow = function () {
360
- return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
386
+ return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
361
387
  }
362
388
 
363
389
  Tooltip.prototype.validate = function () {
@@ -381,7 +407,15 @@
381
407
  }
382
408
 
383
409
  Tooltip.prototype.toggle = function (e) {
384
- var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
410
+ var self = this
411
+ if (e) {
412
+ self = $(e.currentTarget).data('bs.' + this.type)
413
+ if (!self) {
414
+ self = new this.constructor(e.currentTarget, this.getDelegateOptions())
415
+ $(e.currentTarget).data('bs.' + this.type, self)
416
+ }
417
+ }
418
+
385
419
  self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
386
420
  }
387
421
 
@@ -394,9 +428,7 @@
394
428
  // TOOLTIP PLUGIN DEFINITION
395
429
  // =========================
396
430
 
397
- var old = $.fn.tooltip
398
-
399
- $.fn.tooltip = function (option) {
431
+ function Plugin(option) {
400
432
  return this.each(function () {
401
433
  var $this = $(this)
402
434
  var data = $this.data('bs.tooltip')
@@ -408,6 +440,9 @@
408
440
  })
409
441
  }
410
442
 
443
+ var old = $.fn.tooltip
444
+
445
+ $.fn.tooltip = Plugin
411
446
  $.fn.tooltip.Constructor = Tooltip
412
447
 
413
448