forked from unisonweb/codebase-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunisonLocal.js
More file actions
41 lines (32 loc) · 926 Bytes
/
Copy pathunisonLocal.js
File metadata and controls
41 lines (32 loc) · 926 Bytes
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
import "./css/ui.css";
import "./css/themes/unison-light.css";
import "./css/code.css";
import "./css/unison-local.css";
import "./UI/CopyOnClick"; // Include web components
import detectOs from "./Lib/detectOs";
import preventDefaultGlobalKeyboardEvents from "./Lib/preventDefaultGlobalKeyboardEvents";
import { Elm } from "./UnisonLocal.elm";
console.log(`
_____ _
| | |___|_|___ ___ ___
| | | | |_ -| . | |
|_____|_|_|_|___|___|_|_|
`);
const basePath = new URL(document.baseURI).pathname;
let apiBasePath;
if (basePath === "/") {
apiBasePath = ["api"];
} else {
apiBasePath = basePath
.replace("ui", "api")
.split("/")
.filter((p) => p !== "");
}
const flags = {
operatingSystem: detectOs(window.navigator),
basePath,
apiBasePath,
};
preventDefaultGlobalKeyboardEvents();
// The main entry point for the `UnisonLocal` target of the Codebase UI.
Elm.UnisonLocal.init({ flags });