diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-26 06:08:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-26 06:08:41 +0300 |
commit | 2761bde409dbde6b674bdf76f48e8c57635277e4 (patch) | |
tree | 9bade0fe04e28f8745d59a8bdf8380bff342b8fe /app/assets/javascripts/sourcegraph | |
parent | a13d121380db52a0332b2c64fcbb27c6a3dcffa6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/sourcegraph')
-rw-r--r-- | app/assets/javascripts/sourcegraph/index.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/assets/javascripts/sourcegraph/index.js b/app/assets/javascripts/sourcegraph/index.js index 27b63a217d3..796e90bf08e 100644 --- a/app/assets/javascripts/sourcegraph/index.js +++ b/app/assets/javascripts/sourcegraph/index.js @@ -1,5 +1,3 @@ -import { joinPaths } from '~/lib/utils/url_utility'; - function loadScript(path) { const script = document.createElement('script'); script.type = 'application/javascript'; @@ -19,11 +17,10 @@ export default function initSourcegraph() { return; } - const base = gon.asset_host || gon.gitlab_url; - const assetsUrl = joinPaths(base, '/assets/webpack/sourcegraph/'); - const scriptPath = joinPaths(assetsUrl, 'scripts/integration.bundle.js'); + const assetsUrl = new URL('/assets/webpack/sourcegraph/', window.location.href); + const scriptPath = new URL('scripts/integration.bundle.js', assetsUrl).href; - window.SOURCEGRAPH_ASSETS_URL = assetsUrl; + window.SOURCEGRAPH_ASSETS_URL = assetsUrl.href; window.SOURCEGRAPH_URL = url; window.SOURCEGRAPH_INTEGRATION = 'gitlab-integration'; |