Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-22 21:09:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-22 21:09:01 +0300
commitb3c281c8c7109b3286a505d29330926e59139009 (patch)
treeccad33a8106da31a7f1ad6ea71250e2a80719674 /app/assets/javascripts/sourcegraph
parent9ed2b33fff06f930bd7445b3316cbe9933c48ea0 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/sourcegraph')
-rw-r--r--app/assets/javascripts/sourcegraph/index.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/assets/javascripts/sourcegraph/index.js b/app/assets/javascripts/sourcegraph/index.js
index 796e90bf08e..27b63a217d3 100644
--- a/app/assets/javascripts/sourcegraph/index.js
+++ b/app/assets/javascripts/sourcegraph/index.js
@@ -1,3 +1,5 @@
+import { joinPaths } from '~/lib/utils/url_utility';
+
function loadScript(path) {
const script = document.createElement('script');
script.type = 'application/javascript';
@@ -17,10 +19,11 @@ export default function initSourcegraph() {
return;
}
- const assetsUrl = new URL('/assets/webpack/sourcegraph/', window.location.href);
- const scriptPath = new URL('scripts/integration.bundle.js', assetsUrl).href;
+ const base = gon.asset_host || gon.gitlab_url;
+ const assetsUrl = joinPaths(base, '/assets/webpack/sourcegraph/');
+ const scriptPath = joinPaths(assetsUrl, 'scripts/integration.bundle.js');
- window.SOURCEGRAPH_ASSETS_URL = assetsUrl.href;
+ window.SOURCEGRAPH_ASSETS_URL = assetsUrl;
window.SOURCEGRAPH_URL = url;
window.SOURCEGRAPH_INTEGRATION = 'gitlab-integration';