-
Notifications
You must be signed in to change notification settings - Fork 135
moxie.file.FileDrop
Davit Barbakadze edited this page Aug 6, 2017
·
3 revisions
Important! This page is auto-generated from the comments in the source files. All changes will be overwritten! If you are looking to contribute, modify the comment in the corresponding source file instead.
Turn arbitrary DOM element to a drop zone accepting files. Converts selected files to File objects, to be used in conjunction with Image, preloaded in memory with FileReader or uploaded to a server through XMLHttpRequest.
Arguments
-
options
Object|String
If options has typeof string, argument is considered as options.drop_zone-
drop_zone
String|DOMElement
DOM Element to turn into a drop zone -
[accept]
Array
Array of mime types to accept. By default accepts all -
[required_caps]
Object|String
Set of required capabilities, that chosen runtime must support
-
drop_zone
Example
<div id="drop_zone">
Drop files here
</div>
<br />
<div id="filelist"></div>
<script type="text/javascript">
var fileDrop = new moxie.file.FileDrop('drop_zone'), fileList = moxie.utils.Dom.get('filelist');
fileDrop.ondrop = function() {
moxie.utils.Basic.each(this.files, function(file) {
fileList.innerHTML += '<div>' + file.name + '</div>';
});
};
fileDrop.init();
</script>
Dispatched when runtime is connected and drop zone is ready to accept files.
Arguments
-
event
Object
Dispatched when dragging cursor enters the drop zone.
Arguments
-
event
Object
Dispatched when dragging cursor leaves the drop zone.
Arguments
-
event
Object
Dispatched when file is dropped onto the drop zone.
Arguments
-
event
Object
Dispatched if error occurs.
Arguments
-
event
Object