-
-
Notifications
You must be signed in to change notification settings - Fork 506
/
openurldialog.js
31 lines (31 loc) · 978 Bytes
/
openurldialog.js
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
OV.ShowOpenUrlDialog = function (onOk)
{
let dialog = new OV.ButtonDialog ();
let urlsTextArea = OV.CreateDomElement ('textarea', 'ov_dialog_textarea');
let contentDiv = dialog.Init ('Open Model from Url', [
{
name : 'Cancel',
subClass : 'outline',
onClick () {
dialog.Hide ();
}
},
{
name : 'OK',
onClick () {
let urls = [];
OV.ReadLines (urlsTextArea.value, (line) => {
urls.push (line);
});
dialog.Hide ();
onOk (urls);
}
}
]);
let text = 'Here you can load models based on their urls. You can add more lines if your model builds up from multiple files.';
OV.AddDiv (contentDiv, 'ov_dialog_section', text);
contentDiv.appendChild (urlsTextArea);
dialog.Show ();
urlsTextArea.focus ();
return dialog;
};