-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
147 lines (132 loc) · 4.59 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE HTML>
<html lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<title>CommonHealth Data Map</title>
<link rel="shortcut icon" href="assets/exb.ico">
<style>
html, body{
width: 100%;
height: 100%;
margin: 0;
}
#app{
width: 100%;
height: 100%;
}
</style>
<!--
* Be default, we'll use structural URL pattern.
* When download, to simplify the deployment, we'll not use the structural URL, which means will put
app id and page id in URL query parameter. So, when download, we'll:
* Comment out baseURI
* Change to: MOUNT_PATH = getPath();
* Change to: ROOT_PATH = getPath();
* Change to: PACKAGES_IN_APP_FOLDER = true;
* Change to: USE_STRUCTURAL_URL = false;
-->
<!--
This will be commented out when downloaded.
Please change this when you want to use structrual URL, this path should point to the experience folder you deployed
-->
<!-- <base/> is removed when download -->
<script>
/*
Please make sure the script is in <head>, this can help dojo to find the correct "insertPointSibling"
See dojo/dojo.js line 1724-1728
*/
var MOUNT_PATH = getPath();
/**
* experience is designed to be able to be deployed in/out portal/AGOL.
* Whether it's in portal impact how to get the portalUrl.
*
* If it's in portal:
* get portalUrl from window.location, we don't consider the portalUrl in app config
* If it's not in portal/AGOL:
* * If user has signed in, use user signed in portal
* * if not signed in, use portalUrl in app config.
*/
var IS_IN_PORTAL = false;
if(IS_IN_PORTAL){
MOUNT_PATH = getDeployContextFromLocation() + 'apps/experiencebuilder/'
}
/** Please change this when you want to use structrual URL, this path should point to the experience folder you deployed */
var ROOT_PATH = getPath();
/**
* if true, means all packages(widgets, jimu-core, ...) are in app folder.
* if false, means packages and app are in the same root folder
*
* When download, we will change this value to "true" to put all packages in the same folder
* */
var PACKAGES_IN_APP_FOLDER = true;
/**
* true means :appId/page/:pageId
* false means ?id=:appId&page=:pageId
*/
var USE_STRUCTURAL_URL = false;
var ARCGIS_JS_API_URL = 'https://js.arcgis.com/4.16/';
if(IS_IN_PORTAL){
ARCGIS_JS_API_URL = getDeployContextFromLocation() + 'jsapi/jsapi4/'
}
/*
* By default, hostEnv will be set in the build time, but the server can override it.
*/
var HOST_ENV = 'prod';
var IS_DEV_EDITION = false;
var BUILD_NUMBER = '';
var baseUrl = BUILD_NUMBER ? MOUNT_PATH + BUILD_NUMBER + '/' : MOUNT_PATH;
/* for download */
function getPath() {
var fullPath, path;
fullPath = window.location.pathname;
if (fullPath === '/' || fullPath.substr(fullPath.length - 1) === '/') {
path = fullPath;
}else{
var sections = fullPath.split('/');
var lastSection = sections.pop();
if (/\.html$/.test(lastSection) || /\.aspx$/.test(lastSection) ||
/\.jsp$/.test(lastSection) || /\.php$/.test(lastSection)) {
//index.html may be renamed to index.jsp, etc.
path = sections.join('/') + '/';
} else {
return false;
}
}
return path;
}
function getDeployContextFromLocation (){
var keyIndex = window.location.href.indexOf("/home/");
if(keyIndex < 0){
keyIndex = window.location.href.indexOf("/apps/");
}
var context = window.location.href.substring(window.location.href.indexOf(
window.location.host) + window.location.host.length + 1, keyIndex);
if (context !== "/") {
context = "/" + context + "/";
}
return context;
}
</script>
</head>
<body>
<div id="loading">
</div>
<div id="app">
</div>
<!-- When download, the src will be changed to "./jimu-core/systemjs.js" -->
<script type="text/javascript" src="./jimu-core/systemjs.js"></script>
<script type="text/javascript" src="./jimu-core/bowser.js"></script>
<script type="text/javascript" src="./init.js"></script>
<script>
window.jimuUA = bowser.parse(window.navigator.userAgent);
if(window.jimuUA.browser.name === 'Internet Explorer'){
window.location.href = MOUNT_PATH + 'jimu-core/unsupported-browser/index.html';
}else{
SystemJS.import('./index.js');
}
</script>
<script type="text/javascript" src="./service-worker-registration.js"></script>
</body>
</html>