aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/site/assets/js/search.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-02-15 18:42:21 +0000
committerMario <mario@mariovavti.com>2021-02-15 18:42:21 +0000
commitad0b0364b81c04423e02edd596ebbb5b9b748624 (patch)
tree84cf18667bbb416b088fdba9eec90679c74418d8 /vendor/twbs/bootstrap/site/assets/js/search.js
parente8c2e17bc901ab139377e759f5ef931f8649b8c1 (diff)
downloadvolse-hubzilla-ad0b0364b81c04423e02edd596ebbb5b9b748624.tar.gz
volse-hubzilla-ad0b0364b81c04423e02edd596ebbb5b9b748624.tar.bz2
volse-hubzilla-ad0b0364b81c04423e02edd596ebbb5b9b748624.zip
missing files
Diffstat (limited to 'vendor/twbs/bootstrap/site/assets/js/search.js')
-rw-r--r--vendor/twbs/bootstrap/site/assets/js/search.js60
1 files changed, 60 insertions, 0 deletions
diff --git a/vendor/twbs/bootstrap/site/assets/js/search.js b/vendor/twbs/bootstrap/site/assets/js/search.js
new file mode 100644
index 000000000..724c6aa33
--- /dev/null
+++ b/vendor/twbs/bootstrap/site/assets/js/search.js
@@ -0,0 +1,60 @@
+// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
+// IT'S ALL JUST JUNK FOR OUR DOCS!
+// ++++++++++++++++++++++++++++++++++++++++++
+
+(function () {
+ 'use strict'
+
+ var inputElement = document.getElementById('search-input')
+
+ if (!window.docsearch || !inputElement) {
+ return
+ }
+
+ 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
+ })
+})()