From 20803c71179bcffeaeaba4375bd06155d21dafe6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Sun, 5 Feb 2012 22:46:24 -0800 Subject: Setting up Chrome IO class --- js/io/system/chromeapi.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'js/io/system/chromeapi.js') diff --git a/js/io/system/chromeapi.js b/js/io/system/chromeapi.js index 04e62b11..6bf6b9fe 100644 --- a/js/io/system/chromeapi.js +++ b/js/io/system/chromeapi.js @@ -25,8 +25,14 @@ exports.ChromeApi = Montage.create(Object.prototype, { if (window.webkitRequestFileSystem) { //Current way to init Chrome's fileSystem API window.webkitRequestFileSystem(window.PERSISTENT, size*1024*1024, function (fs) { + //Storing reference to instance this.fileSystem = fs; - }.bind(this)); + //Dispatching action ready event + var readyEvent = document.createEvent("CustomEvent"); + readyEvent.initEvent('ready', true, true); + this.dispatchEvent(readyEvent); + }.bind(this), function (e) {return false}); //Returns false on error (not able to init) + // return true; } else { //No fileSystem API @@ -93,6 +99,15 @@ exports.ChromeApi = Montage.create(Object.prototype, { enumerable: true, value: function() { } + }, + //////////////////////////////////////////////////////////////////// + // + getLocalLibrary: { + enumerable: false, + value: function () { + // + return {}; + } } //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// -- cgit v1.2.3