Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 40 additions & 6 deletions website/www/site/assets/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ if (typeof jQuery === 'undefined') {
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}

var $parent = $(selector)
var $parent
try {
$parent = selector ? $(document).find(selector) : $()
} catch (e) {
$parent = $()
}

if (e) e.preventDefault()

Expand Down Expand Up @@ -502,7 +507,14 @@ if (typeof jQuery === 'undefined') {
var clickHandler = function (e) {
var href
var $this = $(this)
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
var selector = $this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
var $target
try {
$target = selector ? $(document).find(selector) : $()
} catch (e) {
$target = $()
}

if (!$target.hasClass('carousel')) return
var options = $.extend({}, $target.data(), $this.data())
var slideIndex = $this.attr('data-slide-to')
Expand Down Expand Up @@ -691,7 +703,11 @@ if (typeof jQuery === 'undefined') {
var target = $trigger.attr('data-target')
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7

return $(target)
try {
return target ? $(document).find(target) : $()
} catch (e) {
return $()
}
}


Expand Down Expand Up @@ -773,7 +789,12 @@ if (typeof jQuery === 'undefined') {
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}

var $parent = selector && $(selector)
var $parent
try {
$parent = selector && $(document).find(selector)
} catch (e) {
$parent = $()
}

return $parent && $parent.length ? $parent : $this.parent()
}
Expand Down Expand Up @@ -1230,7 +1251,13 @@ if (typeof jQuery === 'undefined') {
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
var selector = $this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
var $target
try {
$target = selector ? $(document).find(selector) : $()
} catch (e) {
$target = $()
}
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())

if ($this.is('a')) e.preventDefault()
Expand Down Expand Up @@ -1550,11 +1577,18 @@ if (typeof jQuery === 'undefined') {
.css(isVertical ? 'top' : 'left', '')
}

function sanitizeHtml(string) {
if (typeof DOMPurify !== 'undefined' && typeof string === 'string') {
return DOMPurify.sanitize(string)
}
return string
}
Comment thread
derrickaw marked this conversation as resolved.
Comment thread
derrickaw marked this conversation as resolved.
Comment thread
derrickaw marked this conversation as resolved.

Tooltip.prototype.setContent = function () {
var $tip = this.tip()
var title = this.getTitle()

$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](this.options.html ? sanitizeHtml(title) : title)
$tip.removeClass('fade in top bottom left right')
}

Expand Down
7 changes: 6 additions & 1 deletion website/www/site/assets/js/bootstrap/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}

var $parent = $(selector)
var $parent
try {
$parent = selector ? $(document).find(selector) : $()
} catch (e) {
$parent = $()
}

if (e) e.preventDefault()

Expand Down
9 changes: 8 additions & 1 deletion website/www/site/assets/js/bootstrap/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,14 @@
var clickHandler = function (e) {
var href
var $this = $(this)
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
var selector = $this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
var $target
try {
$target = selector ? $(document).find(selector) : $()
} catch (e) {
$target = $()
}

if (!$target.hasClass('carousel')) return
var options = $.extend({}, $target.data(), $this.data())
var slideIndex = $this.attr('data-slide-to')
Expand Down
6 changes: 5 additions & 1 deletion website/www/site/assets/js/bootstrap/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@
var target = $trigger.attr('data-target')
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7

return $(target)
try {
return target ? $(document).find(target) : $()
} catch (e) {
return $()
}
}


Expand Down
7 changes: 6 additions & 1 deletion website/www/site/assets/js/bootstrap/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}

var $parent = selector && $(selector)
var $parent
try {
$parent = selector && $(document).find(selector)
} catch (e) {
$parent = $()
}

return $parent && $parent.length ? $parent : $this.parent()
}
Expand Down
8 changes: 7 additions & 1 deletion website/www/site/assets/js/bootstrap/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,13 @@
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
var selector = $this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
var $target
try {
$target = selector ? $(document).find(selector) : $()
} catch (e) {
$target = $()
}
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())

if ($this.is('a')) e.preventDefault()
Expand Down
9 changes: 8 additions & 1 deletion website/www/site/assets/js/bootstrap/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,18 @@
.css(isVertical ? 'top' : 'left', '')
}

function sanitizeHtml(string) {
if (typeof DOMPurify !== 'undefined' && typeof string === 'string') {
return DOMPurify.sanitize(string)
}
return string
}
Comment thread
derrickaw marked this conversation as resolved.
Comment thread
derrickaw marked this conversation as resolved.
Comment thread
derrickaw marked this conversation as resolved.

Tooltip.prototype.setContent = function () {
var $tip = this.tip()
var title = this.getTitle()

$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](this.options.html ? sanitizeHtml(title) : title)
$tip.removeClass('fade in top bottom left right')
}

Expand Down
Loading