-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
24 lines (22 loc) · 844 Bytes
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import {createReleaseEditorUI, releaseEditorContainerId} from './ui/release-editor-ui';
import {createWorkEditorUI} from './ui/work-editor-ui';
main();
function main() {
VM.observe(document.body, () => {
if (location.pathname.startsWith('/release/')) {
const recordingCheckboxes = document.querySelectorAll<HTMLInputElement>(
'input[type=checkbox].recording, input[type=checkbox].medium-recordings, input[type=checkbox].all-recordings'
);
if (recordingCheckboxes.length > 0 && !document.getElementById(releaseEditorContainerId)) {
createReleaseEditorUI(recordingCheckboxes);
return true;
}
} else {
const workForm = document.querySelector<HTMLFormElement>('form.edit-work');
if (workForm) {
createWorkEditorUI(workForm);
return true;
}
}
});
}