-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.html
63 lines (60 loc) · 2 KB
/
template.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
function loadScript(urls) {
var head = document.querySelector('head');
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = urls.shift();
var callback = function() {
if(urls.length)
loadScript(urls);
};
script.onreadystatechange = callback;
script.onload = callback;
head.appendChild(script);
}
function loadHtml() {
var cssId = 'materialDesignIcon';
if (!document.getElementById(cssId)) {
var head = document.querySelector('head');
var link = document.createElement('link');
link.id = cssId;
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css';
link.media = 'all';
head.appendChild(link);
}
if (!document.getElementById('template-wrapper')) {
var body = document.querySelector('body');
var html = document.createElement('template-wrapper');
html.id = "template-wrapper";
body.appendChild(html);
}
}
function getBotEnvUrl() {
return '';
}
if (typeof window.injectTemplateScript === "undefined") {
window.injectTemplateScript = function () {
window.injectTemplateScript = function() {};
var sctipts = [
<% for (var index in htmlWebpackPlugin.files.js) { %>
"<%= htmlWebpackPlugin.files.js[index] %>",
<% } %>
];
loadHtml();
var isIE = /*@cc_on!@*/false || !!document.documentMode;
var isEdge = !isIE && !!window.StyleMedia;
if(isIE || isEdge) {
sctipts.unshift(getBotEnvUrl()+'/static/js/app-isolations-sd.js');
sctipts.unshift(getBotEnvUrl()+'/static/js/iePolyfills.js');
}
loadScript(sctipts);
}
}
if (document.readyState === 'complete') {
window.injectTemplateScript();
} else {
window.addEventListener('load', function() {
window.injectTemplateScript();
});
}