dist/flow.js
function (event) {
      var $ = this;
      var queue = event.dataTransfer.items.length;
      var files = [];
      each(event.dataTransfer.items, function (item) {
        var entry = item.webkitGetAsEntry();
        if (!entry) {
          decrement();
          return ;
        }
        if (entry.isFile) {
          // due to a bug in Chrome's File System API impl - #149735
          fileReadSuccess(item.getAsFile(), entry.fullPath);
        } else {
          readDirectory(entry.createReader());
        }
      });
      function readDirectory(reader) {
        reader.readEntries(function (entries) {
          if (entries.length) {
            queue += entries.length;
            each(entries, function(entry) {
              if (entry.isFile) {
                var fullPath = entry.fullPath;
                entry.file(function (file) {
                  fileReadSuccess(file, fullPath);
                }, readError);
              } else if (entry.isDirectory) {
                readDirectory(entry.createReader());
              }
            });
            readDirectory(reader);
          } else {
            decrement();
          }
        }, readError);
      }
      function fileReadSuccess(file, fullPath) {
        // relative path should not start with "/"
        file.relativePath = fullPath.substring(1);
        files.push(file);
        decrement();
      }
      function readError(fileError) {
        throw fileError;
      }
      function decrement() {
        if (--queue == 0) {
          $.addFiles(files, event);
        }
      }
    }
function (event) {
      var $ = this;
      var queue = event.dataTransfer.items.length;
      var files = [];
      each(event.dataTransfer.items, function (item) {
        var entry = item.webkitGetAsEntry();
        if (!entry) {
          decrement();
          return ;
        }
        if (entry.isFile) {
          // due to a bug in Chrome's File System API impl - #149735
          fileReadSuccess(item.getAsFile(), entry.fullPath);
        } else {
          readDirectory(entry.createReader());
        }
      });
      function readDirectory(reader) {
        reader.readEntries(function (entries) {
          if (entries.length) {
            queue += entries.length;
            each(entries, function(entry) {
              if (entry.isFile) {
                var fullPath = entry.fullPath;
                entry.file(function (file) {
                  fileReadSuccess(file, fullPath);
                }, readError);
              } else if (entry.isDirectory) {
                readDirectory(entry.createReader());
              }
            });
            readDirectory(reader);
          } else {
            decrement();
          }
        }, readError);
      }
      function fileReadSuccess(file, fullPath) {
        // relative path should not start with "/"
        file.relativePath = fullPath.substring(1);
        files.push(file);
        decrement();
      }
      function readError(fileError) {
        throw fileError;
      }
      function decrement() {
        if (--queue == 0) {
          $.addFiles(files, event);
        }
      }
    }
function ( event ) { var $ = this ; var queue = event . dataTransfer . items . length ; var files = [ ] ; each ( event . dataTransfer . items , function ( item ) { var entry = item . webkitGetAsEntry ( ) ; if ( ! entry ) { decrement ( ) ; return ; } if ( entry . isFile ) { // due to a bug in Chrome's File System API impl - #149735 fileReadSuccess ( item . getAsFile ( ) , entry . fullPath ) ; } else { readDirectory ( entry . createReader ( ) ) ; } } ) ; function readDirectory ( reader ) { reader . readEntries ( function ( entries ) { if ( entries . length ) { queue += entries . length ; each ( entries , function ( entry ) { if ( entry . isFile ) { var fullPath = entry . fullPath ; entry . file ( function ( file ) { fileReadSuccess ( file , fullPath ) ; } , readError ) ; } else if ( entry . isDirectory ) { readDirectory ( entry . createReader ( ) ) ; } } ) ; readDirectory ( reader ) ; } else { decrement ( ) ; } } , readError ) ; } function fileReadSuccess ( file , fullPath ) { // relative path should not start with "/" file . relativePath = fullPath . substring ( 1 ) ; files . push ( file ) ; decrement ( ) ; } function readError ( fileError ) { throw fileError ; } function decrement ( ) { if ( -- queue == 0 ) { $ . addFiles ( files , event ) ; } } }
Read webkit dataTransfer object
@param event
Read webkit dataTransfer object