forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopout.ts
More file actions
61 lines (54 loc) · 1.28 KB
/
Copy pathpopout.ts
File metadata and controls
61 lines (54 loc) · 1.28 KB
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
/**
* Pop-out window utilities for recording widgets
*/
interface PopoutOptions {
width: number;
height: number;
title: string;
}
/**
* Opens a new pop-out window with the specified path and options.
* Window appears in the top-right area of the screen.
*/
export function openPopoutWindow(
path: string,
options: PopoutOptions
): Window | null {
const { width, height, title } = options;
// Position in top-right area of screen
const left = window.screenX + window.outerWidth - width - 20;
const top = window.screenY + 100;
const features = [
`width=${width}`,
`height=${height}`,
`left=${left}`,
`top=${top}`,
'menubar=no',
'toolbar=no',
'location=no',
'status=no',
'resizable=yes',
'scrollbars=yes',
].join(',');
return window.open(path, title, features);
}
/**
* Opens the compact recording widget pop-out
*/
export function openRecordingWidget(): Window | null {
return openPopoutWindow('/record/popout', {
width: 280,
height: 100,
title: 'omi-recording-widget',
});
}
/**
* Opens the full transcript pop-out window
*/
export function openTranscriptWindow(): Window | null {
return openPopoutWindow('/record/popout/transcript', {
width: 480,
height: 600,
title: 'omi-recording-transcript',
});
}