-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.html
38 lines (38 loc) · 1.38 KB
/
app.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<script id="miro-sdk2" src="https://miro.com/app/static/sdk/v2/miro.js"></script>
<link rel="icon" href="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=">
</head>
<body>
<script>
async function scanBoard() {
let uploads = false;
let allDocuments = await miro.board.get({type: 'document'});
let allImages = await miro.board.get({type: 'image'});
if (allDocuments.length > 0){
uploads = true;
for(let a=0; a < allDocuments.length; a++) {
miro.board.remove(allDocuments[a]);
}
}
if (allImages.length > 0){
uploads = true;
for(let b=0; b < allImages.length; b++) {
miro.board.remove(allImages[b]);
}
}
if (uploads) {
miro.board.notifications.showError('Your organization\'s security policies do not allow document uploads');
miro.board.ui.openModal({url: 'upload-warning.html', width: 700, height: 400, fullscreen: false});
}
}
async function init() {
miro.board.ui.on('items:create', scanBoard);
miro.board.ui.on('selection:update', scanBoard);
await scanBoard();
}
init()
</script>
</body>
</html>