-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.js
More file actions
45 lines (37 loc) · 1.02 KB
/
index.js
File metadata and controls
45 lines (37 loc) · 1.02 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
/**
* Iframe Alert
*
* Displays a custom UI within the space.
*
* @license MIT
* @author jjv360
*/
module.exports = class IframeAlert extends BasePlugin {
/** Plugin info */
static get id() { return 'iframe-alert' }
static get name() { return 'Custom UI Popup' }
static get description() { return 'Tests the ability to display custom UI within the app.' }
/** Called when the plugin is loaded */
async onLoad() {
// Allow message to be configured
this.menus.register({
id: 'btn',
section: 'controls',
text: 'MyAlert',
icon: this.paths.absolute('icon.svg'),
action: e => this.showPopup()
})
}
/* Show alert custom UI */
showPopup() {
// Show it
this.menus.displayPopup({
title: 'My Popup',
panel: {
iframeURL: this.paths.absolute('popup.html'),
width: 500,
height: 400
}
})
}
}