mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
39 lines
908 B
HTML
39 lines
908 B
HTML
<body>
|
|
<script src="../modules/emitify/lib/emitify.js"></script>
|
|
<script src="../lib/findit.js"></script>
|
|
<script>
|
|
(function() {
|
|
'use strict';
|
|
|
|
var node = window;
|
|
|
|
node.addEventListener('drop', function (e) {
|
|
var entry,
|
|
finder,
|
|
item = e.dataTransfer.items[0];
|
|
|
|
e.preventDefault();
|
|
|
|
entry = item.webkitGetAsEntry();
|
|
|
|
finder = findit(entry);
|
|
|
|
finder.on('file', function(file, entry) {
|
|
console.log('file: ', file, entry);
|
|
});
|
|
|
|
finder.on('directory', function(file, entry) {
|
|
console.log('directory: ', file, entry);
|
|
})
|
|
|
|
finder.on('end', function() {
|
|
console.log('done');
|
|
})
|
|
});
|
|
|
|
node.addEventListener('dragover', function (e) {
|
|
e.preventDefault();
|
|
});
|
|
})();
|
|
</script>
|
|
</body>
|