diff options
Diffstat (limited to 'js/io/system/coreioapi.js')
-rwxr-xr-x | js/io/system/coreioapi.js | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 73d9fa76..3fb9374a 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js | |||
@@ -26,15 +26,6 @@ exports.CoreIoApi = Montage.create(Component, { | |||
26 | enumerable: false, | 26 | enumerable: false, |
27 | value: function () { | 27 | value: function () { |
28 | //////////////////////////////////////////////////////////// | 28 | //////////////////////////////////////////////////////////// |
29 | //Getting reference of chrome file system API | ||
30 | this.chromeFileSystem = ChromeApi; | ||
31 | //Sending size in MBs for file system storage | ||
32 | if (this.chromeFileSystem.init(20)) { | ||
33 | //Available | ||
34 | } else { | ||
35 | //Not available | ||
36 | } | ||
37 | //////////////////////////////////////////////////////////// | ||
38 | //Checking for local storage of URL for IO | 29 | //Checking for local storage of URL for IO |
39 | if (window.localStorage['ioRootUrl']) { | 30 | if (window.localStorage['ioRootUrl']) { |
40 | //Getting URL from local storage | 31 | //Getting URL from local storage |
@@ -46,8 +37,45 @@ exports.CoreIoApi = Montage.create(Component, { | |||
46 | this.ioServiceDetected = false; | 37 | this.ioServiceDetected = false; |
47 | } | 38 | } |
48 | //////////////////////////////////////////////////////////// | 39 | //////////////////////////////////////////////////////////// |
40 | //Getting reference of chrome file system API | ||
41 | this.chromeFileSystem = ChromeApi; | ||
42 | //Sending size in MBs for file system storage | ||
43 | var chromeFs = this.chromeFileSystem.init(20); | ||
44 | //Checking for availability of API | ||
45 | if (chromeFs) { | ||
46 | this.chromeFileSystem.addEventListener('ready', this, false); | ||
47 | } else { | ||
48 | //Error, Chrome File System API not detected | ||
49 | } | ||
50 | //////////////////////////////////////////////////////////// | ||
49 | } | 51 | } |
50 | }, | 52 | }, |
53 | //////////////////////////////////////////////////////////////////// | ||
54 | // | ||
55 | handleReady: { | ||
56 | enumerable: false, | ||
57 | value: function (e) { | ||
58 | this.chromeFileSystem.removeEventListener('ready', this, false); | ||
59 | this.chromeNinjaLibrary = this.chromeFileSystem.getLocalLibrary(); | ||
60 | } | ||
61 | }, | ||
62 | //////////////////////////////////////////////////////////////////// | ||
63 | // | ||
64 | _chromeNinjaLibrary: { | ||
65 | enumerable: false, | ||
66 | value: null | ||
67 | }, | ||
68 | //////////////////////////////////////////////////////////////////// | ||
69 | // | ||
70 | chromeNinjaLibrary: { | ||
71 | enumerable: false, | ||
72 | get: function() { | ||
73 | return this._chromeNinjaLibrary; | ||
74 | }, | ||
75 | set: function(value) { | ||
76 | this._chromeNinjaLibrary = value; | ||
77 | } | ||
78 | }, | ||
51 | //////////////////////////////////////////////////////////////////// | 79 | //////////////////////////////////////////////////////////////////// |
52 | // | 80 | // |
53 | _chromeFileSystem: { | 81 | _chromeFileSystem: { |