Skip to content

Commit 973dee0

Browse files
LukBrezinamshibuya
authored andcommitted
Update vulnerable js libs
1 parent 27badc2 commit 973dee0

18 files changed

Lines changed: 1102 additions & 16649 deletions

app/assets/javascripts/rails_admin/jquery.migrate.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/javascripts/rails_admin/ra.nested-form-hooks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
$(window.document).trigger('rails_admin.dom_ready', [field, parent_group]);
2525
new_tab.children('a').tab('show');
2626
if (!one_to_one) {
27-
nav.select(':hidden').show('slow');
27+
nav.filter(':hidden').show('slow');
2828
}
29-
content.select(':hidden').show('slow');
29+
content.filter(':hidden').show('slow');
3030
toggler.addClass('active').removeClass('disabled').children('i').addClass('icon-chevron-down').removeClass('icon-chevron-right');
3131
if (one_to_one) {
3232
controls.find('.add_nested_fields').removeClass('add_nested_fields').text(field.children('.object-infos').data('object-label'));
@@ -45,7 +45,7 @@
4545
(current_li.next().length ? current_li.next() : current_li.prev()).children('a:first').tab('show');
4646
current_li.remove();
4747
if (nav.children().length === 0) {
48-
nav.select(':visible').hide('slow');
48+
nav.filter(':visible').hide('slow');
4949
toggler.removeClass('active').addClass('disabled').children('i').removeClass('icon-chevron-down').addClass('icon-chevron-right');
5050
}
5151
if (one_to_one) {

app/assets/javascripts/rails_admin/rails_admin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
//= require 'jquery'
2-
//= require 'jquery_ujs'
1+
//= require jquery3
2+
//= require 'rails_admin/jquery.migrate'
3+
//= require jquery_ujs
34
//= require 'jquery.remotipart'
45
//= require 'rails_admin/jquery-ui'
56
//= require 'rails_admin/moment-with-locales'

app/assets/javascripts/rails_admin/ui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
if (!$(this).hasClass('disabled')) {
4545
if ($(this).has('i.icon-chevron-down').length) {
4646
$(this).removeClass('active').children('i').toggleClass('icon-chevron-down icon-chevron-right');
47-
$($(this).data('target')).select(':visible').hide('slow');
47+
$($(this).data('target')).filter(':visible').hide('slow');
4848
} else {
4949
if ($(this).has('i.icon-chevron-right').length) {
5050
$(this).addClass('active').children('i').toggleClass('icon-chevron-down icon-chevron-right');
51-
$($(this).data('target')).select(':hidden').show('slow');
51+
$($(this).data('target')).filter(':hidden').show('slow');
5252
}
5353
}
5454
}

vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-affix.js

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* ========================================================================
2-
* Bootstrap: affix.js v3.2.0
3-
* http://getbootstrap.com/javascript/#affix
2+
* Bootstrap: affix.js v3.4.1
3+
* https://getbootstrap.com/docs/3.4/javascript/#affix
44
* ========================================================================
5-
* Copyright 2011-2014 Twitter, Inc.
5+
* Copyright 2011-2019 Twitter, Inc.
66
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
77
* ======================================================================== */
88

@@ -16,19 +16,21 @@
1616
var Affix = function (element, options) {
1717
this.options = $.extend({}, Affix.DEFAULTS, options)
1818

19-
this.$target = $(this.options.target)
19+
var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target)
20+
21+
this.$target = target
2022
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
2123
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
2224

2325
this.$element = $(element)
24-
this.affixed =
25-
this.unpin =
26+
this.affixed = null
27+
this.unpin = null
2628
this.pinnedOffset = null
2729

2830
this.checkPosition()
2931
}
3032

31-
Affix.VERSION = '3.2.0'
33+
Affix.VERSION = '3.4.1'
3234

3335
Affix.RESET = 'affix affix-top affix-bottom'
3436

@@ -37,6 +39,28 @@
3739
target: window
3840
}
3941

42+
Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
43+
var scrollTop = this.$target.scrollTop()
44+
var position = this.$element.offset()
45+
var targetHeight = this.$target.height()
46+
47+
if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
48+
49+
if (this.affixed == 'bottom') {
50+
if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
51+
return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
52+
}
53+
54+
var initializing = this.affixed == null
55+
var colliderTop = initializing ? scrollTop : position.top
56+
var colliderHeight = initializing ? targetHeight : height
57+
58+
if (offsetTop != null && scrollTop <= offsetTop) return 'top'
59+
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
60+
61+
return false
62+
}
63+
4064
Affix.prototype.getPinnedOffset = function () {
4165
if (this.pinnedOffset) return this.pinnedOffset
4266
this.$element.removeClass(Affix.RESET).addClass('affix')
@@ -52,42 +76,40 @@
5276
Affix.prototype.checkPosition = function () {
5377
if (!this.$element.is(':visible')) return
5478

55-
var scrollHeight = $(document).height()
56-
var scrollTop = this.$target.scrollTop()
57-
var position = this.$element.offset()
79+
var height = this.$element.height()
5880
var offset = this.options.offset
5981
var offsetTop = offset.top
6082
var offsetBottom = offset.bottom
83+
var scrollHeight = Math.max($(document).height(), $(document.body).height())
6184

6285
if (typeof offset != 'object') offsetBottom = offsetTop = offset
6386
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
6487
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
6588

66-
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
67-
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
68-
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
89+
var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
6990

70-
if (this.affixed === affix) return
71-
if (this.unpin != null) this.$element.css('top', '')
91+
if (this.affixed != affix) {
92+
if (this.unpin != null) this.$element.css('top', '')
7293

73-
var affixType = 'affix' + (affix ? '-' + affix : '')
74-
var e = $.Event(affixType + '.bs.affix')
94+
var affixType = 'affix' + (affix ? '-' + affix : '')
95+
var e = $.Event(affixType + '.bs.affix')
7596

76-
this.$element.trigger(e)
97+
this.$element.trigger(e)
7798

78-
if (e.isDefaultPrevented()) return
99+
if (e.isDefaultPrevented()) return
79100

80-
this.affixed = affix
81-
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
101+
this.affixed = affix
102+
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
82103

83-
this.$element
84-
.removeClass(Affix.RESET)
85-
.addClass(affixType)
86-
.trigger($.Event(affixType.replace('affix', 'affixed')))
104+
this.$element
105+
.removeClass(Affix.RESET)
106+
.addClass(affixType)
107+
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
108+
}
87109

88110
if (affix == 'bottom') {
89111
this.$element.offset({
90-
top: scrollHeight - this.$element.height() - offsetBottom
112+
top: scrollHeight - height - offsetBottom
91113
})
92114
}
93115
}
@@ -132,8 +154,8 @@
132154

133155
data.offset = data.offset || {}
134156

135-
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
136-
if (data.offsetTop) data.offset.top = data.offsetTop
157+
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
158+
if (data.offsetTop != null) data.offset.top = data.offsetTop
137159

138160
Plugin.call($spy, data)
139161
})

vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-alert.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* ========================================================================
2-
* Bootstrap: alert.js v3.2.0
3-
* http://getbootstrap.com/javascript/#alerts
2+
* Bootstrap: alert.js v3.4.1
3+
* https://getbootstrap.com/docs/3.4/javascript/#alerts
44
* ========================================================================
5-
* Copyright 2011-2014 Twitter, Inc.
5+
* Copyright 2011-2019 Twitter, Inc.
66
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
77
* ======================================================================== */
88

@@ -18,7 +18,9 @@
1818
$(el).on('click', dismiss, this.close)
1919
}
2020

21-
Alert.VERSION = '3.2.0'
21+
Alert.VERSION = '3.4.1'
22+
23+
Alert.TRANSITION_DURATION = 150
2224

2325
Alert.prototype.close = function (e) {
2426
var $this = $(this)
@@ -29,12 +31,13 @@
2931
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
3032
}
3133

32-
var $parent = $(selector)
34+
selector = selector === '#' ? [] : selector
35+
var $parent = $(document).find(selector)
3336

3437
if (e) e.preventDefault()
3538

3639
if (!$parent.length) {
37-
$parent = $this.hasClass('alert') ? $this : $this.parent()
40+
$parent = $this.closest('.alert')
3841
}
3942

4043
$parent.trigger(e = $.Event('close.bs.alert'))
@@ -51,7 +54,7 @@
5154
$.support.transition && $parent.hasClass('fade') ?
5255
$parent
5356
.one('bsTransitionEnd', removeElement)
54-
.emulateTransitionEnd(150) :
57+
.emulateTransitionEnd(Alert.TRANSITION_DURATION) :
5558
removeElement()
5659
}
5760

0 commit comments

Comments
 (0)