diff options
author | Mario <mario@mariovavti.com> | 2021-11-09 09:10:19 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-11-09 09:10:19 +0000 |
commit | fe7ecede700fe04631d23f36473e697ce2b364dc (patch) | |
tree | e713fc39dba500a25cb2acf8561e286fb8b41ff0 /vendor/twbs/bootstrap/site/assets/js/application.js | |
parent | 42de18d96d201d74e5df3ed1b8f6132cb00357b6 (diff) | |
parent | 089708ab9f90309a0c27ae633cf8f2604fce1170 (diff) | |
download | volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.gz volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.bz2 volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.zip |
Merge branch '6.4RC'6.4
Diffstat (limited to 'vendor/twbs/bootstrap/site/assets/js/application.js')
-rw-r--r-- | vendor/twbs/bootstrap/site/assets/js/application.js | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/vendor/twbs/bootstrap/site/assets/js/application.js b/vendor/twbs/bootstrap/site/assets/js/application.js index 6ff316056..acf859764 100644 --- a/vendor/twbs/bootstrap/site/assets/js/application.js +++ b/vendor/twbs/bootstrap/site/assets/js/application.js @@ -58,6 +58,22 @@ }) } + var alertPlaceholder = document.getElementById('liveAlertPlaceholder') + var alertTrigger = document.getElementById('liveAlertBtn') + + function alert(message, type) { + var wrapper = document.createElement('div') + wrapper.innerHTML = '<div class="alert alert-' + type + ' alert-dismissible" role="alert">' + message + '<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div>' + + alertPlaceholder.append(wrapper) + } + + if (alertTrigger) { + alertTrigger.addEventListener('click', function () { + alert('Nice, you triggered this alert message!', 'success') + }) + } + // Demos within modals document.querySelectorAll('.tooltip-test') .forEach(function (tooltip) { @@ -78,8 +94,8 @@ // Disable empty links in docs examples document.querySelectorAll('.bd-content [href="#"]') .forEach(function (link) { - link.addEventListener('click', function (e) { - e.preventDefault() + link.addEventListener('click', function (event) { + event.preventDefault() }) }) @@ -101,17 +117,6 @@ }) } - // Activate animated progress bar - var btnToggleAnimatedProgress = document.getElementById('btnToggleAnimatedProgress') - if (btnToggleAnimatedProgress) { - btnToggleAnimatedProgress.addEventListener('click', function () { - btnToggleAnimatedProgress.parentNode - .querySelector('.progress-bar-striped') - .classList - .toggle('progress-bar-animated') - }) - } - // Insert copy to clipboard button before .highlight var btnHtml = '<div class="bd-clipboard"><button type="button" class="btn-clipboard" title="Copy to clipboard">Copy</button></div>' document.querySelectorAll('div.highlight') @@ -137,25 +142,25 @@ } }) - clipboard.on('success', function (e) { - var tooltipBtn = bootstrap.Tooltip.getInstance(e.trigger) + clipboard.on('success', function (event) { + var tooltipBtn = bootstrap.Tooltip.getInstance(event.trigger) - e.trigger.setAttribute('data-bs-original-title', 'Copied!') + event.trigger.setAttribute('data-bs-original-title', 'Copied!') tooltipBtn.show() - e.trigger.setAttribute('data-bs-original-title', 'Copy to clipboard') - e.clearSelection() + event.trigger.setAttribute('data-bs-original-title', 'Copy to clipboard') + event.clearSelection() }) - clipboard.on('error', function (e) { + clipboard.on('error', function (event) { var modifierKey = /mac/i.test(navigator.userAgent) ? '\u2318' : 'Ctrl-' var fallbackMsg = 'Press ' + modifierKey + 'C to copy' - var tooltipBtn = bootstrap.Tooltip.getInstance(e.trigger) + var tooltipBtn = bootstrap.Tooltip.getInstance(event.trigger) - e.trigger.setAttribute('data-bs-original-title', fallbackMsg) + event.trigger.setAttribute('data-bs-original-title', fallbackMsg) tooltipBtn.show() - e.trigger.setAttribute('data-bs-original-title', 'Copy to clipboard') + event.trigger.setAttribute('data-bs-original-title', 'Copy to clipboard') }) anchors.options = { |