-
Notifications
You must be signed in to change notification settings - Fork 147
Expand file tree
/
Copy pathlib.js
More file actions
22 lines (17 loc) · 744 Bytes
/
lib.js
File metadata and controls
22 lines (17 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* global location, document */
function isTestEnv() {
const hostname = location.hostname.toLowerCase();
return hostname === 'localhost' || hostname === '127.0.0.1' || hostname.startsWith('192.168.');
}
function embedScript(url) {
document.write(`<script src="${url}"></script>`);
}
function embedStylesheet(url) {
document.write(`<link href="${url}" rel="stylesheet">`);
}
const baseUrl = isTestEnv() ? '../designer' : '//cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.5';
embedScript(`${baseUrl}/dist/index.umd.js`);
embedStylesheet(`${baseUrl}/css/designer.css`);
embedStylesheet(`${baseUrl}/css/designer-light.css`);
embedStylesheet(`${baseUrl}/css/designer-soft.css`);
embedStylesheet(`${baseUrl}/css/designer-dark.css`);