MCPcopy
hub / github.com/CodeboxIDE/codebox / callback

Function callback

client/vendors/filer.js:485–511  ·  view source on GitHub ↗
(dirEntry)

Source from the content-addressed store, hash-verified

483 }
484
485 var callback = function(dirEntry) {
486
487 //cwd_ = dirEntry;
488
489 // Read contents of current working directory. According to spec, need to
490 // keep calling readEntries() until length of result array is 0. We're
491 // guarenteed the same entry won't be returned again.
492 var entries_ = [];
493 var reader = dirEntry.createReader();
494
495 var readEntries = function() {
496 reader.readEntries(function(results) {
497 if (!results.length) {
498 // By default, sort the list by name.
499 entries_.sort(function(a, b) {
500 return a.name < b.name ? -1 : b.name < a.name ? 1 : 0;
501 });
502 successCallback(entries_);
503 } else {
504 entries_ = entries_.concat(Util.toArray(results));
505 readEntries();
506 }
507 }, opt_errorHandler);
508 };
509
510 readEntries();
511 };
512
513 if (dirEntryOrPath.isDirectory) { // passed a DirectoryEntry.
514 callback(dirEntryOrPath);

Callers 15

filer.jsFile · 0.70
getEntry_Function · 0.70
idb.filesystem.jsFile · 0.70
_fireCallbackFunction · 0.70
importLoadFunction · 0.50
linkLoadFunction · 0.50
fileParsedFuncFunction · 0.50
lessc.jsFile · 0.50
finishFunction · 0.50
handleResponseFunction · 0.50
doXHRFunction · 0.50
loadFileFunction · 0.50

Calls 1

readEntriesFunction · 0.85

Tested by

no test coverage detected