Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
12f51086
Commit
12f51086
authored
4 years ago
by
XhmikosR
Browse files
Options
Download
Email Patches
Plain Diff
search.js: remove `window.location.origin` workaround
parent
eaf616c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
site/assets/js/search.js
+1
-15
site/assets/js/search.js
with
1 addition
and
15 deletions
+1
-15
site/assets/js/search.js
+
1
-
15
View file @
12f51086
...
...
@@ -20,19 +20,6 @@
}
})
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
'
,
...
...
@@ -42,10 +29,9 @@
},
transformData
:
function
(
hits
)
{
return
hits
.
map
(
function
(
hit
)
{
var
currentUrl
=
getOrigin
()
var
liveUrl
=
'
https://v5.getbootstrap.com/
'
hit
.
url
=
currentUrl
.
startsWith
(
liveUrl
)
?
hit
.
url
=
window
.
location
.
origin
.
startsWith
(
liveUrl
)
?
// On production, return the result as is
hit
.
url
:
// On development or Netlify, replace `hit.url` with a trailing slash,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment