aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/site/docs/4.5/assets/js/src/search.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-06-13 10:00:50 +0000
committerMario <mario@mariovavti.com>2020-06-13 10:00:50 +0000
commitdc3b09c8f38872ef8b792a4b551671a6105754cc (patch)
tree554f130cc2d5a00088cad6c9a75ae0a8f2d558f8 /vendor/twbs/bootstrap/site/docs/4.5/assets/js/src/search.js
parentc8c4513af98a9dd2a6d9331ba4b3ab3af0e95a5f (diff)
downloadvolse-hubzilla-dc3b09c8f38872ef8b792a4b551671a6105754cc.tar.gz
volse-hubzilla-dc3b09c8f38872ef8b792a4b551671a6105754cc.tar.bz2
volse-hubzilla-dc3b09c8f38872ef8b792a4b551671a6105754cc.zip
composer update bootstrap
Diffstat (limited to 'vendor/twbs/bootstrap/site/docs/4.5/assets/js/src/search.js')
-rw-r--r--vendor/twbs/bootstrap/site/docs/4.5/assets/js/src/search.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/vendor/twbs/bootstrap/site/docs/4.5/assets/js/src/search.js b/vendor/twbs/bootstrap/site/docs/4.5/assets/js/src/search.js
new file mode 100644
index 000000000..e372d1553
--- /dev/null
+++ b/vendor/twbs/bootstrap/site/docs/4.5/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/'
+
+ hit.url = currentUrl.lastIndexOf(liveUrl, 0) === 0
+ // On production, return the result as is
+ ? hit.url
+ // On development or Netlify, replace `hit.url` with a trailing slash,
+ // so that the result link is relative to the server root
+ : 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
+ })
+}())