aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/site/docs/4.3/assets/js/src/search.js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-05-10 14:21:36 +0200
committerMario Vavti <mario@mariovavti.com>2019-05-10 14:21:36 +0200
commit9866053f0ce44721c11990c9f9407e7428757c99 (patch)
tree6e414efa36c3bda00205918cecb9122f951427e3 /vendor/twbs/bootstrap/site/docs/4.3/assets/js/src/search.js
parent89a2c1a09c896ac3a23df26a1783f5c682188a56 (diff)
downloadvolse-hubzilla-9866053f0ce44721c11990c9f9407e7428757c99.tar.gz
volse-hubzilla-9866053f0ce44721c11990c9f9407e7428757c99.tar.bz2
volse-hubzilla-9866053f0ce44721c11990c9f9407e7428757c99.zip
update bootstrap to version 4.3.1
Diffstat (limited to 'vendor/twbs/bootstrap/site/docs/4.3/assets/js/src/search.js')
-rw-r--r--vendor/twbs/bootstrap/site/docs/4.3/assets/js/src/search.js55
1 files changed, 55 insertions, 0 deletions
diff --git a/vendor/twbs/bootstrap/site/docs/4.3/assets/js/src/search.js b/vendor/twbs/bootstrap/site/docs/4.3/assets/js/src/search.js
new file mode 100644
index 000000000..459d412df
--- /dev/null
+++ b/vendor/twbs/bootstrap/site/docs/4.3/assets/js/src/search.js
@@ -0,0 +1,55 @@
+// 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 siteurl = getOrigin()
+ var urlRE = /^https?:\/\/getbootstrap\.com/
+
+ // When in production, return the result as is,
+ // otherwise remove our url from it.
+ hit.url = siteurl.match(urlRE) ? hit.url : hit.url.replace(urlRE, '')
+
+ // Prevent jumping to first header
+ if (hit.anchor === 'content') {
+ hit.url = hit.url.replace(/#content$/, '')
+ hit.anchor = null
+ }
+
+ return hit
+ })
+ },
+ debug: false // Set debug to true if you want to inspect the dropdown
+ })
+}())