-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorigin.html
46 lines (37 loc) · 1.12 KB
/
origin.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
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
<head>
<title>SNS</title>
</head>
<body id='sns'>
<script type="text/javascript">
function loadError(oError) {
throw new URIError("The script " + oError.target.src + " didn't load correctly.");
}
function prefixScript(url, onloadFunction) {
var newScript = document.createElement("script");
newScript.onerror = loadError;
if (onloadFunction) { newScript.onload = onloadFunction; }
document.currentScript.parentNode.insertBefore(newScript, document.currentScript);
newScript.src = url;
}
const init = () => {
let snsElem = document.querySelector('#sns')
window.SNS = {}
snsElem.style = 'height: ' + window.screen.height + 'px;'
prefixScript("../facilities/droppable/dist/droppable.umd.js", () => {
window.SNS.droppable = new Droppable({
element: snsElem
})
window.SNS.droppable.onFilesDropped((files) => {
console.log('Stuff were dropped:', files);
files.forEach((item, index, array) => {
console.log('Processing ' + item.name + '[' + item.type + '] ...')
})
})
})
}
init()
</script>
</body>
</html>