Skip to content

Instantly share code, notes, and snippets.

@kerrishotts
kerrishotts / FileManager.js
Last active September 21, 2022 10:14
Simple File API wrapper using Q.js. Same code as in http://github.com/photokandyStudios/YASMF-Next/blob/master/lib/yasmf/util/fileManager.js, except wrapped in a global function. The code below will add a FileManager object to `window`, if it is passed in (otherwise it will only return it). It can then be used as seen in this demo: http://jsbin.…
;(
function( Q, BaseObject, globalContext ) {
/**
* Defined by Q, actually, but defined here to make type handling nicer
* @typedef {{}} Promise
*/
var DEBUG = false;
/**
* Requests a quota from the file system
* @method _requestQuota