From 42122c5c708769e11b626654bf3d989b6b0eddad Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 1 Feb 2012 13:34:53 -0800 Subject: Updating after merge with other FileIO branch --- js/io/system/coreioapi.js | 1 - js/io/system/fileio.js | 22 +++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'js/io') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 3a007028..e55789c4 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -207,7 +207,6 @@ exports.CoreIoApi = Montage.create(Component, { directoryServiceURL: { enumerable: false, get: function() { - console.log(this); return String(this.rootUrl+this._directoryServiceURL); }, set: function(value) { diff --git a/js/io/system/fileio.js b/js/io/system/fileio.js index ac5812e9..f40aa96b 100755 --- a/js/io/system/fileio.js +++ b/js/io/system/fileio.js @@ -11,7 +11,7 @@ NOTES: empty file will be created. 'contents' should be a string to be saved as the file. 'contentType' is the mime type of the file. - coreIoApi: this.application.ninja.coreIoApi + Core API reference in NINJA: this.application.ninja.coreIoApi //////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// */ @@ -65,24 +65,44 @@ exports.FileIo = Montage.create(Object.prototype, { readFile: { enumerable: true, value: function() { + //Checking for API to be available + if (!this.application.ninja.coreIoApi.cloudAvailable()) { + //API not available, no IO action taken + return null; + } // } }, saveFile: { enumerable: true, value: function() { + //Checking for API to be available + if (!this.application.ninja.coreIoApi.cloudAvailable()) { + //API not available, no IO action taken + return null; + } // } }, copyFile: { enumerable: true, value: function() { + //Checking for API to be available + if (!this.application.ninja.coreIoApi.cloudAvailable()) { + //API not available, no IO action taken + return null; + } // } }, infoFile: { enumerable: true, value: function() { + //Checking for API to be available + if (!this.application.ninja.coreIoApi.cloudAvailable()) { + //API not available, no IO action taken + return null; + } // } } -- cgit v1.2.3