Skip to content

Commit

Permalink
Update vulnerable js libs
Browse files Browse the repository at this point in the history
  • Loading branch information
luki215 authored and mshibuya committed Apr 4, 2021
1 parent 27badc2 commit 973dee0
Show file tree
Hide file tree
Showing 18 changed files with 1,102 additions and 16,649 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/rails_admin/jquery.migrate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions app/assets/javascripts/rails_admin/ra.nested-form-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
$(window.document).trigger('rails_admin.dom_ready', [field, parent_group]);
new_tab.children('a').tab('show');
if (!one_to_one) {
nav.select(':hidden').show('slow');
nav.filter(':hidden').show('slow');
}
content.select(':hidden').show('slow');
content.filter(':hidden').show('slow');
toggler.addClass('active').removeClass('disabled').children('i').addClass('icon-chevron-down').removeClass('icon-chevron-right');
if (one_to_one) {
controls.find('.add_nested_fields').removeClass('add_nested_fields').text(field.children('.object-infos').data('object-label'));
Expand All @@ -45,7 +45,7 @@
(current_li.next().length ? current_li.next() : current_li.prev()).children('a:first').tab('show');
current_li.remove();
if (nav.children().length === 0) {
nav.select(':visible').hide('slow');
nav.filter(':visible').hide('slow');
toggler.removeClass('active').addClass('disabled').children('i').removeClass('icon-chevron-down').addClass('icon-chevron-right');
}
if (one_to_one) {
Expand Down
5 changes: 3 additions & 2 deletions app/assets/javascripts/rails_admin/rails_admin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//= require 'jquery'
//= require 'jquery_ujs'
//= require jquery3
//= require 'rails_admin/jquery.migrate'
//= require jquery_ujs
//= require 'jquery.remotipart'
//= require 'rails_admin/jquery-ui'
//= require 'rails_admin/moment-with-locales'
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/rails_admin/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
if (!$(this).hasClass('disabled')) {
if ($(this).has('i.icon-chevron-down').length) {
$(this).removeClass('active').children('i').toggleClass('icon-chevron-down icon-chevron-right');
$($(this).data('target')).select(':visible').hide('slow');
$($(this).data('target')).filter(':visible').hide('slow');
} else {
if ($(this).has('i.icon-chevron-right').length) {
$(this).addClass('active').children('i').toggleClass('icon-chevron-down icon-chevron-right');
$($(this).data('target')).select(':hidden').show('slow');
$($(this).data('target')).filter(':hidden').show('slow');
}
}
}
Expand Down
78 changes: 50 additions & 28 deletions vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-affix.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* ========================================================================
* Bootstrap: affix.js v3.2.0
* http://getbootstrap.com/javascript/#affix
* Bootstrap: affix.js v3.4.1
* https://getbootstrap.com/docs/3.4/javascript/#affix
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */

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

this.$target = $(this.options.target)
var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target)

this.$target = target
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))

this.$element = $(element)
this.affixed =
this.unpin =
this.affixed = null
this.unpin = null
this.pinnedOffset = null

this.checkPosition()
}

Affix.VERSION = '3.2.0'
Affix.VERSION = '3.4.1'

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

Expand All @@ -37,6 +39,28 @@
target: window
}

Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
var targetHeight = this.$target.height()

if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false

if (this.affixed == 'bottom') {
if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
}

var initializing = this.affixed == null
var colliderTop = initializing ? scrollTop : position.top
var colliderHeight = initializing ? targetHeight : height

if (offsetTop != null && scrollTop <= offsetTop) return 'top'
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'

return false
}

Affix.prototype.getPinnedOffset = function () {
if (this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
Expand All @@ -52,42 +76,40 @@
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return

var scrollHeight = $(document).height()
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
var height = this.$element.height()
var offset = this.options.offset
var offsetTop = offset.top
var offsetBottom = offset.bottom
var scrollHeight = Math.max($(document).height(), $(document.body).height())

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

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

if (this.affixed === affix) return
if (this.unpin != null) this.$element.css('top', '')
if (this.affixed != affix) {
if (this.unpin != null) this.$element.css('top', '')

var affixType = 'affix' + (affix ? '-' + affix : '')
var e = $.Event(affixType + '.bs.affix')
var affixType = 'affix' + (affix ? '-' + affix : '')
var e = $.Event(affixType + '.bs.affix')

this.$element.trigger(e)
this.$element.trigger(e)

if (e.isDefaultPrevented()) return
if (e.isDefaultPrevented()) return

this.affixed = affix
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
this.affixed = affix
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null

this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger($.Event(affixType.replace('affix', 'affixed')))
this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
}

if (affix == 'bottom') {
this.$element.offset({
top: scrollHeight - this.$element.height() - offsetBottom
top: scrollHeight - height - offsetBottom
})
}
}
Expand Down Expand Up @@ -132,8 +154,8 @@

data.offset = data.offset || {}

if (data.offsetBottom) data.offset.bottom = data.offsetBottom
if (data.offsetTop) data.offset.top = data.offsetTop
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
if (data.offsetTop != null) data.offset.top = data.offsetTop

Plugin.call($spy, data)
})
Expand Down
17 changes: 10 additions & 7 deletions vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-alert.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* ========================================================================
* Bootstrap: alert.js v3.2.0
* http://getbootstrap.com/javascript/#alerts
* Bootstrap: alert.js v3.4.1
* https://getbootstrap.com/docs/3.4/javascript/#alerts
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */

Expand All @@ -18,7 +18,9 @@
$(el).on('click', dismiss, this.close)
}

Alert.VERSION = '3.2.0'
Alert.VERSION = '3.4.1'

Alert.TRANSITION_DURATION = 150

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

var $parent = $(selector)
selector = selector === '#' ? [] : selector
var $parent = $(document).find(selector)

if (e) e.preventDefault()

if (!$parent.length) {
$parent = $this.hasClass('alert') ? $this : $this.parent()
$parent = $this.closest('.alert')
}

$parent.trigger(e = $.Event('close.bs.alert'))
Expand All @@ -51,7 +54,7 @@
$.support.transition && $parent.hasClass('fade') ?
$parent
.one('bsTransitionEnd', removeElement)
.emulateTransitionEnd(150) :
.emulateTransitionEnd(Alert.TRANSITION_DURATION) :
removeElement()
}

Expand Down
Loading

0 comments on commit 973dee0

Please sign in to comment.