From 544ef3bc588d4180d7ecad15bdacd43813a7c5c5 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 12 Dec 2019 14:51:10 +0000 Subject: update composer libs and minor notifications display fixes --- .../site/docs/4.4/assets/js/src/search.js | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 vendor/twbs/bootstrap/site/docs/4.4/assets/js/src/search.js (limited to 'vendor/twbs/bootstrap/site/docs/4.4/assets/js/src/search.js') diff --git a/vendor/twbs/bootstrap/site/docs/4.4/assets/js/src/search.js b/vendor/twbs/bootstrap/site/docs/4.4/assets/js/src/search.js new file mode 100644 index 000000000..dd2a90e58 --- /dev/null +++ b/vendor/twbs/bootstrap/site/docs/4.4/assets/js/src/search.js @@ -0,0 +1,59 @@ +// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT +// IT'S ALL JUST JUNK FOR OUR DOCS! +// ++++++++++++++++++++++++++++++++++++++++++ + +(function () { + 'use strict' + + if (!window.docsearch) { + return + } + + var inputElement = document.getElementById('search-input') + var siteDocsVersion = inputElement.getAttribute('data-docs-version') + + function getOrigin() { + var location = window.location + var origin = location.origin + + if (!origin) { + var port = location.port ? ':' + location.port : '' + + origin = location.protocol + '//' + location.hostname + port + } + + return origin + } + + window.docsearch({ + apiKey: '5990ad008512000bba2cf951ccf0332f', + indexName: 'bootstrap', + inputSelector: '#search-input', + algoliaOptions: { + facetFilters: ['version:' + siteDocsVersion] + }, + transformData: function (hits) { + return hits.map(function (hit) { + var currentUrl = getOrigin() + var liveUrl = 'https://getbootstrap.com' + + // When in production, return the result as is, + // otherwise remove our url from it. + // eslint-disable-next-line no-negated-condition + hit.url = currentUrl.indexOf(liveUrl) !== -1 + ? hit.url + : hit.url.replace(liveUrl, '') + + // Prevent jumping to first header + if (hit.anchor === 'content') { + hit.url = hit.url.replace(/#content$/, '') + hit.anchor = null + } + + return hit + }) + }, + // Set debug to `true` if you want to inspect the dropdown + debug: false + }) +}()) -- cgit v1.2.3