Stackedit/js/fileSystem.js

17 lines
551 B
JavaScript
Raw Normal View History

2013-05-28 23:41:09 +00:00
// The fileSystem module is empty when created. It's filled by fileMgr when loading.
// syncLocations and publishLocations are respectively loaded by synchronizer and publisher.
2013-06-16 10:47:35 +00:00
define([
2013-06-19 20:33:46 +00:00
"underscore",
2013-06-16 10:47:35 +00:00
"utils",
"classes/FileDescriptor",
"storage",
2013-06-19 20:33:46 +00:00
], function(_, utils, FileDescriptor) {
2013-06-16 10:47:35 +00:00
var fileSystem = {};
2013-06-19 20:33:46 +00:00
// Retrieve file descriptors from localStorage
2013-06-16 10:47:35 +00:00
_.each(utils.retrieveIndexArray("file.list"), function(fileIndex) {
2013-06-19 20:33:46 +00:00
fileSystem[fileIndex] = new FileDescriptor(fileIndex);
2013-06-16 10:47:35 +00:00
});
return fileSystem;
});