bootstrap-sass 3.3.5 → 3.4.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 (114) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.travis.yml +8 -12
  4. data/CHANGELOG.md +20 -0
  5. data/Gemfile +1 -4
  6. data/LICENSE +2 -1
  7. data/README.md +79 -74
  8. data/Rakefile +46 -11
  9. data/assets/javascripts/bootstrap/affix.js +7 -5
  10. data/assets/javascripts/bootstrap/alert.js +6 -5
  11. data/assets/javascripts/bootstrap/button.js +14 -9
  12. data/assets/javascripts/bootstrap/carousel.js +16 -7
  13. data/assets/javascripts/bootstrap/collapse.js +7 -6
  14. data/assets/javascripts/bootstrap/dropdown.js +7 -7
  15. data/assets/javascripts/bootstrap/modal.js +44 -23
  16. data/assets/javascripts/bootstrap/popover.js +25 -10
  17. data/assets/javascripts/bootstrap/scrollspy.js +4 -4
  18. data/assets/javascripts/bootstrap/tab.js +10 -10
  19. data/assets/javascripts/bootstrap/tooltip.js +177 -14
  20. data/assets/javascripts/bootstrap/transition.js +5 -5
  21. data/assets/javascripts/bootstrap-sprockets.js +2 -2
  22. data/assets/javascripts/bootstrap.js +326 -109
  23. data/assets/javascripts/bootstrap.min.js +3 -4
  24. data/assets/stylesheets/_bootstrap-mincer.scss +2 -2
  25. data/assets/stylesheets/_bootstrap.scss +2 -2
  26. data/assets/stylesheets/bootstrap/_alerts.scss +3 -3
  27. data/assets/stylesheets/bootstrap/_badges.scss +3 -3
  28. data/assets/stylesheets/bootstrap/_breadcrumbs.scss +3 -1
  29. data/assets/stylesheets/bootstrap/_button-groups.scss +8 -8
  30. data/assets/stylesheets/bootstrap/_buttons.scss +4 -4
  31. data/assets/stylesheets/bootstrap/_carousel.scss +33 -31
  32. data/assets/stylesheets/bootstrap/_close.scss +1 -0
  33. data/assets/stylesheets/bootstrap/_code.scss +3 -3
  34. data/assets/stylesheets/bootstrap/_component-animations.scss +1 -0
  35. data/assets/stylesheets/bootstrap/_dropdowns.scss +20 -23
  36. data/assets/stylesheets/bootstrap/_forms.scss +56 -60
  37. data/assets/stylesheets/bootstrap/_glyphicons.scss +11 -11
  38. data/assets/stylesheets/bootstrap/_grid.scss +10 -0
  39. data/assets/stylesheets/bootstrap/_input-groups.scss +9 -5
  40. data/assets/stylesheets/bootstrap/_jumbotron.scss +5 -3
  41. data/assets/stylesheets/bootstrap/_labels.scss +1 -1
  42. data/assets/stylesheets/bootstrap/_list-group.scss +30 -32
  43. data/assets/stylesheets/bootstrap/_media.scss +1 -1
  44. data/assets/stylesheets/bootstrap/_modals.scss +8 -8
  45. data/assets/stylesheets/bootstrap/_navbar.scss +75 -81
  46. data/assets/stylesheets/bootstrap/_navs.scss +4 -4
  47. data/assets/stylesheets/bootstrap/_normalize.scss +5 -2
  48. data/assets/stylesheets/bootstrap/_pager.scss +2 -2
  49. data/assets/stylesheets/bootstrap/_pagination.scss +13 -16
  50. data/assets/stylesheets/bootstrap/_panels.scss +5 -5
  51. data/assets/stylesheets/bootstrap/_popovers.scss +47 -52
  52. data/assets/stylesheets/bootstrap/_print.scss +90 -92
  53. data/assets/stylesheets/bootstrap/_progress-bars.scss +3 -3
  54. data/assets/stylesheets/bootstrap/_responsive-embed.scss +2 -2
  55. data/assets/stylesheets/bootstrap/_responsive-utilities.scss +3 -3
  56. data/assets/stylesheets/bootstrap/_scaffolding.scss +7 -7
  57. data/assets/stylesheets/bootstrap/_tables.scss +23 -23
  58. data/assets/stylesheets/bootstrap/_theme.scss +21 -17
  59. data/assets/stylesheets/bootstrap/_thumbnails.scss +1 -1
  60. data/assets/stylesheets/bootstrap/_tooltip.scss +38 -27
  61. data/assets/stylesheets/bootstrap/_type.scss +11 -11
  62. data/assets/stylesheets/bootstrap/_variables.scss +9 -7
  63. data/assets/stylesheets/bootstrap/_wells.scss +2 -2
  64. data/assets/stylesheets/bootstrap/mixins/_alerts.scss +2 -1
  65. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +4 -4
  66. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +7 -14
  67. data/assets/stylesheets/bootstrap/mixins/_center-block.scss +1 -1
  68. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +1 -1
  69. data/assets/stylesheets/bootstrap/mixins/_forms.scss +4 -4
  70. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +6 -8
  71. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +1 -1
  72. data/assets/stylesheets/bootstrap/mixins/_grid.scss +7 -7
  73. data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +1 -1
  74. data/assets/stylesheets/bootstrap/mixins/_image.scss +5 -10
  75. data/assets/stylesheets/bootstrap/mixins/_opacity.scss +2 -3
  76. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +4 -4
  77. data/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
  78. data/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -4
  79. data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +3 -3
  80. data/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +3 -3
  81. data/bootstrap-sass.gemspec +10 -9
  82. data/bower.json +4 -3
  83. data/composer.json +2 -2
  84. data/eyeglass-exports.js +7 -0
  85. data/lib/bootstrap-sass/engine.rb +6 -1
  86. data/lib/bootstrap-sass/version.rb +2 -2
  87. data/lib/bootstrap-sass.rb +17 -10
  88. data/package-lock.json +1611 -0
  89. data/package.json +20 -6
  90. data/sache.json +1 -1
  91. data/tasks/converter/less_conversion.rb +12 -8
  92. data/tasks/converter/network.rb +2 -2
  93. data/templates/project/_bootstrap-variables.sass +10 -8
  94. data/test/compilation_test.rb +24 -12
  95. data/test/dummy_rails/config/application.rb +2 -1
  96. data/test/dummy_rails/config/boot.rb +1 -1
  97. data/test/dummy_sass_only/Gemfile +1 -1
  98. data/test/dummy_sass_only/compile.rb +14 -7
  99. data/test/dummy_sass_only/import_all.scss +2 -0
  100. data/test/gemfiles/default.gemfile +3 -0
  101. data/test/node_mincer_test.rb +2 -3
  102. data/test/node_sass_compile_test.sh +4 -3
  103. data/test/sass_test.rb +10 -7
  104. data/test/sprockets_rails_test.rb +12 -8
  105. data/test/support/dummy_rails_integration.rb +1 -1
  106. data/test/support/reporting.rb +10 -0
  107. data/test/test_helper.rb +3 -2
  108. metadata +37 -28
  109. data/test/compass_test.rb +0 -9
  110. data/test/dummy_sass_only/import_all.sass +0 -2
  111. data/test/gemfiles/sass_3_2.gemfile +0 -6
  112. data/test/gemfiles/sass_3_3.gemfile +0 -6
  113. data/test/gemfiles/sass_3_4.gemfile +0 -7
  114. data/test/gemfiles/sass_head.gemfile +0 -6
@@ -1,11 +1,12 @@
1
1
  /* ========================================================================
2
- * Bootstrap: collapse.js v3.3.5
3
- * http://getbootstrap.com/javascript/#collapse
2
+ * Bootstrap: collapse.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#collapse
4
4
  * ========================================================================
5
- * Copyright 2011-2015 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
9
+ /* jshint latedef: false */
9
10
 
10
11
  +function ($) {
11
12
  'use strict';
@@ -29,7 +30,7 @@
29
30
  if (this.options.toggle) this.toggle()
30
31
  }
31
32
 
32
- Collapse.VERSION = '3.3.5'
33
+ Collapse.VERSION = '3.4.1'
33
34
 
34
35
  Collapse.TRANSITION_DURATION = 350
35
36
 
@@ -136,7 +137,7 @@
136
137
  }
137
138
 
138
139
  Collapse.prototype.getParent = function () {
139
- return $(this.options.parent)
140
+ return $(document).find(this.options.parent)
140
141
  .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
141
142
  .each($.proxy(function (i, element) {
142
143
  var $element = $(element)
@@ -159,7 +160,7 @@
159
160
  var target = $trigger.attr('data-target')
160
161
  || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
161
162
 
162
- return $(target)
163
+ return $(document).find(target)
163
164
  }
164
165
 
165
166
 
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: dropdown.js v3.3.5
3
- * http://getbootstrap.com/javascript/#dropdowns
2
+ * Bootstrap: dropdown.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#dropdowns
4
4
  * ========================================================================
5
- * Copyright 2011-2015 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -19,7 +19,7 @@
19
19
  $(element).on('click.bs.dropdown', this.toggle)
20
20
  }
21
21
 
22
- Dropdown.VERSION = '3.3.5'
22
+ Dropdown.VERSION = '3.4.1'
23
23
 
24
24
  function getParent($this) {
25
25
  var selector = $this.attr('data-target')
@@ -29,7 +29,7 @@
29
29
  selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
30
30
  }
31
31
 
32
- var $parent = selector && $(selector)
32
+ var $parent = selector !== '#' ? $(document).find(selector) : null
33
33
 
34
34
  return $parent && $parent.length ? $parent : $this.parent()
35
35
  }
@@ -51,7 +51,7 @@
51
51
  if (e.isDefaultPrevented()) return
52
52
 
53
53
  $this.attr('aria-expanded', 'false')
54
- $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
54
+ $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
55
55
  })
56
56
  }
57
57
 
@@ -85,7 +85,7 @@
85
85
 
86
86
  $parent
87
87
  .toggleClass('open')
88
- .trigger('shown.bs.dropdown', relatedTarget)
88
+ .trigger($.Event('shown.bs.dropdown', relatedTarget))
89
89
  }
90
90
 
91
91
  return false
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: modal.js v3.3.5
3
- * http://getbootstrap.com/javascript/#modals
2
+ * Bootstrap: modal.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#modals
4
4
  * ========================================================================
5
- * Copyright 2011-2015 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -14,15 +14,16 @@
14
14
  // ======================
15
15
 
16
16
  var Modal = function (element, options) {
17
- this.options = options
18
- this.$body = $(document.body)
19
- this.$element = $(element)
20
- this.$dialog = this.$element.find('.modal-dialog')
21
- this.$backdrop = null
22
- this.isShown = null
23
- this.originalBodyPad = null
24
- this.scrollbarWidth = 0
17
+ this.options = options
18
+ this.$body = $(document.body)
19
+ this.$element = $(element)
20
+ this.$dialog = this.$element.find('.modal-dialog')
21
+ this.$backdrop = null
22
+ this.isShown = null
23
+ this.originalBodyPad = null
24
+ this.scrollbarWidth = 0
25
25
  this.ignoreBackdropClick = false
26
+ this.fixedContent = '.navbar-fixed-top, .navbar-fixed-bottom'
26
27
 
27
28
  if (this.options.remote) {
28
29
  this.$element
@@ -33,7 +34,7 @@
33
34
  }
34
35
  }
35
36
 
36
- Modal.VERSION = '3.3.5'
37
+ Modal.VERSION = '3.4.1'
37
38
 
38
39
  Modal.TRANSITION_DURATION = 300
39
40
  Modal.BACKDROP_TRANSITION_DURATION = 150
@@ -50,7 +51,7 @@
50
51
 
51
52
  Modal.prototype.show = function (_relatedTarget) {
52
53
  var that = this
53
- var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
54
+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
54
55
 
55
56
  this.$element.trigger(e)
56
57
 
@@ -140,7 +141,9 @@
140
141
  $(document)
141
142
  .off('focusin.bs.modal') // guard against infinite focus loop
142
143
  .on('focusin.bs.modal', $.proxy(function (e) {
143
- if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
144
+ if (document !== e.target &&
145
+ this.$element[0] !== e.target &&
146
+ !this.$element.has(e.target).length) {
144
147
  this.$element.trigger('focus')
145
148
  }
146
149
  }, this))
@@ -242,7 +245,7 @@
242
245
  var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
243
246
 
244
247
  this.$element.css({
245
- paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
248
+ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
246
249
  paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
247
250
  })
248
251
  }
@@ -267,11 +270,26 @@
267
270
  Modal.prototype.setScrollbar = function () {
268
271
  var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
269
272
  this.originalBodyPad = document.body.style.paddingRight || ''
270
- if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
273
+ var scrollbarWidth = this.scrollbarWidth
274
+ if (this.bodyIsOverflowing) {
275
+ this.$body.css('padding-right', bodyPad + scrollbarWidth)
276
+ $(this.fixedContent).each(function (index, element) {
277
+ var actualPadding = element.style.paddingRight
278
+ var calculatedPadding = $(element).css('padding-right')
279
+ $(element)
280
+ .data('padding-right', actualPadding)
281
+ .css('padding-right', parseFloat(calculatedPadding) + scrollbarWidth + 'px')
282
+ })
283
+ }
271
284
  }
272
285
 
273
286
  Modal.prototype.resetScrollbar = function () {
274
287
  this.$body.css('padding-right', this.originalBodyPad)
288
+ $(this.fixedContent).each(function (index, element) {
289
+ var padding = $(element).data('padding-right')
290
+ $(element).removeData('padding-right')
291
+ element.style.paddingRight = padding ? padding : ''
292
+ })
275
293
  }
276
294
 
277
295
  Modal.prototype.measureScrollbar = function () { // thx walsh
@@ -289,8 +307,8 @@
289
307
 
290
308
  function Plugin(option, _relatedTarget) {
291
309
  return this.each(function () {
292
- var $this = $(this)
293
- var data = $this.data('bs.modal')
310
+ var $this = $(this)
311
+ var data = $this.data('bs.modal')
294
312
  var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
295
313
 
296
314
  if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
@@ -301,7 +319,7 @@
301
319
 
302
320
  var old = $.fn.modal
303
321
 
304
- $.fn.modal = Plugin
322
+ $.fn.modal = Plugin
305
323
  $.fn.modal.Constructor = Modal
306
324
 
307
325
 
@@ -318,10 +336,13 @@
318
336
  // ==============
319
337
 
320
338
  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
321
- var $this = $(this)
322
- var href = $this.attr('href')
323
- var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
324
- var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
339
+ var $this = $(this)
340
+ var href = $this.attr('href')
341
+ var target = $this.attr('data-target') ||
342
+ (href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
343
+
344
+ var $target = $(document).find(target)
345
+ var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
325
346
 
326
347
  if ($this.is('a')) e.preventDefault()
327
348
 
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: popover.js v3.3.5
3
- * http://getbootstrap.com/javascript/#popovers
2
+ * Bootstrap: popover.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#popovers
4
4
  * ========================================================================
5
- * Copyright 2011-2015 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -19,7 +19,7 @@
19
19
 
20
20
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
21
21
 
22
- Popover.VERSION = '3.3.5'
22
+ Popover.VERSION = '3.4.1'
23
23
 
24
24
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
25
25
  placement: 'right',
@@ -45,10 +45,25 @@
45
45
  var title = this.getTitle()
46
46
  var content = this.getContent()
47
47
 
48
- $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
49
- $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
50
- this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
51
- ](content)
48
+ if (this.options.html) {
49
+ var typeContent = typeof content
50
+
51
+ if (this.options.sanitize) {
52
+ title = this.sanitizeHtml(title)
53
+
54
+ if (typeContent === 'string') {
55
+ content = this.sanitizeHtml(content)
56
+ }
57
+ }
58
+
59
+ $tip.find('.popover-title').html(title)
60
+ $tip.find('.popover-content').children().detach().end()[
61
+ typeContent === 'string' ? 'html' : 'append'
62
+ ](content)
63
+ } else {
64
+ $tip.find('.popover-title').text(title)
65
+ $tip.find('.popover-content').children().detach().end().text(content)
66
+ }
52
67
 
53
68
  $tip.removeClass('fade top bottom left right in')
54
69
 
@@ -67,8 +82,8 @@
67
82
 
68
83
  return $e.attr('data-content')
69
84
  || (typeof o.content == 'function' ?
70
- o.content.call($e[0]) :
71
- o.content)
85
+ o.content.call($e[0]) :
86
+ o.content)
72
87
  }
73
88
 
74
89
  Popover.prototype.arrow = function () {
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: scrollspy.js v3.3.5
3
- * http://getbootstrap.com/javascript/#scrollspy
2
+ * Bootstrap: scrollspy.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#scrollspy
4
4
  * ========================================================================
5
- * Copyright 2011-2015 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -28,7 +28,7 @@
28
28
  this.process()
29
29
  }
30
30
 
31
- ScrollSpy.VERSION = '3.3.5'
31
+ ScrollSpy.VERSION = '3.4.1'
32
32
 
33
33
  ScrollSpy.DEFAULTS = {
34
34
  offset: 10
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: tab.js v3.3.5
3
- * http://getbootstrap.com/javascript/#tabs
2
+ * Bootstrap: tab.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#tabs
4
4
  * ========================================================================
5
- * Copyright 2011-2015 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -19,7 +19,7 @@
19
19
  // jscs:enable requireDollarBeforejQueryAssignment
20
20
  }
21
21
 
22
- Tab.VERSION = '3.3.5'
22
+ Tab.VERSION = '3.4.1'
23
23
 
24
24
  Tab.TRANSITION_DURATION = 150
25
25
 
@@ -48,7 +48,7 @@
48
48
 
49
49
  if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
50
50
 
51
- var $target = $(selector)
51
+ var $target = $(document).find(selector)
52
52
 
53
53
  this.activate($this.closest('li'), $ul)
54
54
  this.activate($target, $target.parent(), function () {
@@ -73,15 +73,15 @@
73
73
  $active
74
74
  .removeClass('active')
75
75
  .find('> .dropdown-menu > .active')
76
- .removeClass('active')
76
+ .removeClass('active')
77
77
  .end()
78
78
  .find('[data-toggle="tab"]')
79
- .attr('aria-expanded', false)
79
+ .attr('aria-expanded', false)
80
80
 
81
81
  element
82
82
  .addClass('active')
83
83
  .find('[data-toggle="tab"]')
84
- .attr('aria-expanded', true)
84
+ .attr('aria-expanded', true)
85
85
 
86
86
  if (transition) {
87
87
  element[0].offsetWidth // reflow for transition
@@ -93,10 +93,10 @@
93
93
  if (element.parent('.dropdown-menu').length) {
94
94
  element
95
95
  .closest('li.dropdown')
96
- .addClass('active')
96
+ .addClass('active')
97
97
  .end()
98
98
  .find('[data-toggle="tab"]')
99
- .attr('aria-expanded', true)
99
+ .attr('aria-expanded', true)
100
100
  }
101
101
 
102
102
  callback && callback()
@@ -1,16 +1,146 @@
1
1
  /* ========================================================================
2
- * Bootstrap: tooltip.js v3.3.5
3
- * http://getbootstrap.com/javascript/#tooltip
2
+ * Bootstrap: tooltip.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#tooltip
4
4
  * Inspired by the original jQuery.tipsy by Jason Frame
5
5
  * ========================================================================
6
- * Copyright 2011-2015 Twitter, Inc.
6
+ * Copyright 2011-2019 Twitter, Inc.
7
7
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
8
8
  * ======================================================================== */
9
9
 
10
-
11
10
  +function ($) {
12
11
  'use strict';
13
12
 
13
+ var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']
14
+
15
+ var uriAttrs = [
16
+ 'background',
17
+ 'cite',
18
+ 'href',
19
+ 'itemtype',
20
+ 'longdesc',
21
+ 'poster',
22
+ 'src',
23
+ 'xlink:href'
24
+ ]
25
+
26
+ var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
27
+
28
+ var DefaultWhitelist = {
29
+ // Global attributes allowed on any supplied element below.
30
+ '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
31
+ a: ['target', 'href', 'title', 'rel'],
32
+ area: [],
33
+ b: [],
34
+ br: [],
35
+ col: [],
36
+ code: [],
37
+ div: [],
38
+ em: [],
39
+ hr: [],
40
+ h1: [],
41
+ h2: [],
42
+ h3: [],
43
+ h4: [],
44
+ h5: [],
45
+ h6: [],
46
+ i: [],
47
+ img: ['src', 'alt', 'title', 'width', 'height'],
48
+ li: [],
49
+ ol: [],
50
+ p: [],
51
+ pre: [],
52
+ s: [],
53
+ small: [],
54
+ span: [],
55
+ sub: [],
56
+ sup: [],
57
+ strong: [],
58
+ u: [],
59
+ ul: []
60
+ }
61
+
62
+ /**
63
+ * A pattern that recognizes a commonly useful subset of URLs that are safe.
64
+ *
65
+ * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
66
+ */
67
+ var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
68
+
69
+ /**
70
+ * A pattern that matches safe data URLs. Only matches image, video and audio types.
71
+ *
72
+ * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
73
+ */
74
+ var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i
75
+
76
+ function allowedAttribute(attr, allowedAttributeList) {
77
+ var attrName = attr.nodeName.toLowerCase()
78
+
79
+ if ($.inArray(attrName, allowedAttributeList) !== -1) {
80
+ if ($.inArray(attrName, uriAttrs) !== -1) {
81
+ return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
82
+ }
83
+
84
+ return true
85
+ }
86
+
87
+ var regExp = $(allowedAttributeList).filter(function (index, value) {
88
+ return value instanceof RegExp
89
+ })
90
+
91
+ // Check if a regular expression validates the attribute.
92
+ for (var i = 0, l = regExp.length; i < l; i++) {
93
+ if (attrName.match(regExp[i])) {
94
+ return true
95
+ }
96
+ }
97
+
98
+ return false
99
+ }
100
+
101
+ function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
102
+ if (unsafeHtml.length === 0) {
103
+ return unsafeHtml
104
+ }
105
+
106
+ if (sanitizeFn && typeof sanitizeFn === 'function') {
107
+ return sanitizeFn(unsafeHtml)
108
+ }
109
+
110
+ // IE 8 and below don't support createHTMLDocument
111
+ if (!document.implementation || !document.implementation.createHTMLDocument) {
112
+ return unsafeHtml
113
+ }
114
+
115
+ var createdDocument = document.implementation.createHTMLDocument('sanitization')
116
+ createdDocument.body.innerHTML = unsafeHtml
117
+
118
+ var whitelistKeys = $.map(whiteList, function (el, i) { return i })
119
+ var elements = $(createdDocument.body).find('*')
120
+
121
+ for (var i = 0, len = elements.length; i < len; i++) {
122
+ var el = elements[i]
123
+ var elName = el.nodeName.toLowerCase()
124
+
125
+ if ($.inArray(elName, whitelistKeys) === -1) {
126
+ el.parentNode.removeChild(el)
127
+
128
+ continue
129
+ }
130
+
131
+ var attributeList = $.map(el.attributes, function (el) { return el })
132
+ var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
133
+
134
+ for (var j = 0, len2 = attributeList.length; j < len2; j++) {
135
+ if (!allowedAttribute(attributeList[j], whitelistedAttributes)) {
136
+ el.removeAttribute(attributeList[j].nodeName)
137
+ }
138
+ }
139
+ }
140
+
141
+ return createdDocument.body.innerHTML
142
+ }
143
+
14
144
  // TOOLTIP PUBLIC CLASS DEFINITION
15
145
  // ===============================
16
146
 
@@ -26,7 +156,7 @@
26
156
  this.init('tooltip', element, options)
27
157
  }
28
158
 
29
- Tooltip.VERSION = '3.3.5'
159
+ Tooltip.VERSION = '3.4.1'
30
160
 
31
161
  Tooltip.TRANSITION_DURATION = 150
32
162
 
@@ -43,7 +173,10 @@
43
173
  viewport: {
44
174
  selector: 'body',
45
175
  padding: 0
46
- }
176
+ },
177
+ sanitize : true,
178
+ sanitizeFn : null,
179
+ whiteList : DefaultWhitelist
47
180
  }
48
181
 
49
182
  Tooltip.prototype.init = function (type, element, options) {
@@ -51,7 +184,7 @@
51
184
  this.type = type
52
185
  this.$element = $(element)
53
186
  this.options = this.getOptions(options)
54
- this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
187
+ this.$viewport = this.options.viewport && $(document).find($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
55
188
  this.inState = { click: false, hover: false, focus: false }
56
189
 
57
190
  if (this.$element[0] instanceof document.constructor && !this.options.selector) {
@@ -84,7 +217,15 @@
84
217
  }
85
218
 
86
219
  Tooltip.prototype.getOptions = function (options) {
87
- options = $.extend({}, this.getDefaults(), this.$element.data(), options)
220
+ var dataAttributes = this.$element.data()
221
+
222
+ for (var dataAttr in dataAttributes) {
223
+ if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {
224
+ delete dataAttributes[dataAttr]
225
+ }
226
+ }
227
+
228
+ options = $.extend({}, this.getDefaults(), dataAttributes, options)
88
229
 
89
230
  if (options.delay && typeof options.delay == 'number') {
90
231
  options.delay = {
@@ -93,6 +234,10 @@
93
234
  }
94
235
  }
95
236
 
237
+ if (options.sanitize) {
238
+ options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn)
239
+ }
240
+
96
241
  return options
97
242
  }
98
243
 
@@ -204,7 +349,7 @@
204
349
  .addClass(placement)
205
350
  .data('bs.' + this.type, this)
206
351
 
207
- this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
352
+ this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element)
208
353
  this.$element.trigger('inserted.bs.' + this.type)
209
354
 
210
355
  var pos = this.getPosition()
@@ -306,7 +451,16 @@
306
451
  var $tip = this.tip()
307
452
  var title = this.getTitle()
308
453
 
309
- $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
454
+ if (this.options.html) {
455
+ if (this.options.sanitize) {
456
+ title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn)
457
+ }
458
+
459
+ $tip.find('.tooltip-inner').html(title)
460
+ } else {
461
+ $tip.find('.tooltip-inner').text(title)
462
+ }
463
+
310
464
  $tip.removeClass('fade in top bottom left right')
311
465
  }
312
466
 
@@ -317,9 +471,11 @@
317
471
 
318
472
  function complete() {
319
473
  if (that.hoverState != 'in') $tip.detach()
320
- that.$element
321
- .removeAttr('aria-describedby')
322
- .trigger('hidden.bs.' + that.type)
474
+ if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
475
+ that.$element
476
+ .removeAttr('aria-describedby')
477
+ .trigger('hidden.bs.' + that.type)
478
+ }
323
479
  callback && callback()
324
480
  }
325
481
 
@@ -362,7 +518,10 @@
362
518
  // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
363
519
  elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
364
520
  }
365
- var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
521
+ var isSvg = window.SVGElement && el instanceof window.SVGElement
522
+ // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
523
+ // See https://github.com/twbs/bootstrap/issues/20280
524
+ var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
366
525
  var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
367
526
  var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
368
527
 
@@ -478,9 +637,13 @@
478
637
  that.$tip = null
479
638
  that.$arrow = null
480
639
  that.$viewport = null
640
+ that.$element = null
481
641
  })
482
642
  }
483
643
 
644
+ Tooltip.prototype.sanitizeHtml = function (unsafeHtml) {
645
+ return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn)
646
+ }
484
647
 
485
648
  // TOOLTIP PLUGIN DEFINITION
486
649
  // =========================
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: transition.js v3.3.5
3
- * http://getbootstrap.com/javascript/#transitions
2
+ * Bootstrap: transition.js v3.4.1
3
+ * https://getbootstrap.com/docs/3.4/javascript/#transitions
4
4
  * ========================================================================
5
- * Copyright 2011-2015 Twitter, Inc.
5
+ * Copyright 2011-2019 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -10,7 +10,7 @@
10
10
  +function ($) {
11
11
  'use strict';
12
12
 
13
- // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
13
+ // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/)
14
14
  // ============================================================
15
15
 
16
16
  function transitionEnd() {
@@ -32,7 +32,7 @@
32
32
  return false // explicit for ie8 ( ._.)
33
33
  }
34
34
 
35
- // http://blog.alexmaccaw.com/css-transitions
35
+ // https://blog.alexmaccaw.com/css-transitions
36
36
  $.fn.emulateTransitionEnd = function (duration) {
37
37
  var called = false
38
38
  var $el = this