From 54fa28441c5f0bdcd9687615f4a6b7a0fab024a3 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 7 Sep 2018 11:26:02 +0200 Subject: install bootstrap via composer --- .../site/docs/4.1/assets/js/src/search.js | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 vendor/twbs/bootstrap/site/docs/4.1/assets/js/src/search.js (limited to 'vendor/twbs/bootstrap/site/docs/4.1/assets/js/src/search.js') diff --git a/vendor/twbs/bootstrap/site/docs/4.1/assets/js/src/search.js b/vendor/twbs/bootstrap/site/docs/4.1/assets/js/src/search.js new file mode 100644 index 000000000..2e91fcf21 --- /dev/null +++ b/vendor/twbs/bootstrap/site/docs/4.1/assets/js/src/search.js @@ -0,0 +1,42 @@ +// 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') + + window.docsearch({ + apiKey: '5990ad008512000bba2cf951ccf0332f', + indexName: 'bootstrap', + inputSelector: '#search-input', + algoliaOptions: { + facetFilters: ['version:' + siteDocsVersion] + }, + handleSelected: function (input, event, suggestion) { + var url = suggestion.url + url = suggestion.isLvl1 ? url.split('#')[0] : url + // If it's a title we remove the anchor so it does not jump. + window.location.href = url + }, + transformData: function (hits) { + return hits.map(function (hit) { + // When in production, return the result as is, + // otherwise remove our url from it. + var siteurl = inputElement.getAttribute('data-siteurl') + var urlRE = /^https?:\/\/getbootstrap\.com/ + + hit.url = siteurl.match(urlRE) ? hit.url : hit.url.replace(urlRE, '') + + return hit + }) + }, + debug: false // Set debug to true if you want to inspect the dropdown + }) +}()) -- cgit v1.2.3