1
0
Fork 0

Merging upstream version 5.3.0+dfsg.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-17 07:08:19 +01:00
parent a87fc4fcc7
commit e92720b6a7
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
605 changed files with 15320 additions and 9495 deletions

View file

@ -4,8 +4,7 @@
/*!
* JavaScript for Bootstrap's docs (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors
* Copyright 2011-2022 Twitter, Inc.
* Copyright 2011-2023 The Bootstrap Authors
* Licensed under the Creative Commons Attribution 3.0 Unported License.
* For details, see https://creativecommons.org/licenses/by/3.0/.
*/
@ -14,6 +13,7 @@
(() => {
'use strict'
// Insert copy to clipboard button before .highlight
const btnTitle = 'Copy to clipboard'
const btnEdit = 'Edit on StackBlitz'
@ -28,7 +28,7 @@
'</div>'
].join('')
// wrap programmatically code blocks and add copy btn.
// Wrap programmatically code blocks and add copy btn.
document.querySelectorAll('.highlight')
.forEach(element => {
if (!element.closest('.bd-example-snippet')) { // Ignore examples made be shortcode
@ -52,11 +52,12 @@
snippetButtonTooltip('.btn-edit', btnEdit)
const clipboard = new ClipboardJS('.btn-clipboard', {
target: trigger => trigger.closest('.bd-code-snippet').querySelector('.highlight')
target: trigger => trigger.closest('.bd-code-snippet').querySelector('.highlight'),
text: trigger => trigger.closest('.bd-code-snippet').querySelector('.highlight').textContent.trimEnd()
})
clipboard.on('success', event => {
const iconFirstChild = event.trigger.querySelector('.bi').firstChild
const iconFirstChild = event.trigger.querySelector('.bi').firstElementChild
const tooltipBtn = bootstrap.Tooltip.getInstance(event.trigger)
const namespace = 'http://www.w3.org/1999/xlink'
const originalXhref = iconFirstChild.getAttributeNS(namespace, 'href')