From 372604713c2f7ac5c0b0ef475cf4043ba3194fec Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 31 Jan 2012 23:34:44 -0800 Subject: Cloud API Popup Fixes Minor layout fixes, adjusted functionality slightly, need to check into adjusting the file and directory URL constructs for API changes. --- js/io/system/coreioapi.js | 21 ++++++++++++++------- js/io/ui/cloudpopup.reel/cloudpopup.js | 2 +- js/io/ui/cloudpopup.reel/css/cloudpopup.css | 2 +- js/io/ui/cloudpopup.reel/css/cloudpopup.scss | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-) (limited to 'js') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 6b803f22..74b066ac 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -27,12 +27,9 @@ exports.CoreIoApi = Montage.create(Component, { this.rootUrl = window.localStorage['ioRootUrl']; //Checks for IO API to be active this.ioServiceDetected = this.cloudAvailable(); - // - console.log('Cloud Status: URL detected in localStorage as '+this.rootUrl); } else { - // + //IO API to be inactive this.ioServiceDetected = false; - console.log('Cloud Status: No URL detected in localStorage'); } } }, @@ -41,9 +38,12 @@ exports.CoreIoApi = Montage.create(Component, { cloudAvailable: { enumerable: false, value: function () { + var cloud = this.getCloudStatus(); // - if (this.rootUrl && this.getCloudStatus().status === 200) { + if (this.rootUrl && cloud.status === 200) { //Active + this.cloudData.name = cloud.response['name']; + this.cloudData.root = cloud.response['server-root']; return true; } else { //Inactive @@ -62,6 +62,12 @@ exports.CoreIoApi = Montage.create(Component, { }, //////////////////////////////////////////////////////////////////// // + cloudData: { + enumerable: false, + value: {name: null, root: ''} + }, + //////////////////////////////////////////////////////////////////// + // _cloudDialogComponents: { enumerable: false, value: {blackout: null, popup: null, dialog: null} @@ -223,8 +229,8 @@ exports.CoreIoApi = Montage.create(Component, { if((urlOut.length > 1) && (urlOut.charAt(urlOut.length - 1) === "/")){ urlOut = urlOut.substring(0, (urlOut.length - 1)); } - - return serviceURL + urlOut; + // + return String(serviceURL+urlOut); } }, //////////////////////////////////////////////////////////////////// @@ -1009,6 +1015,7 @@ exports.CoreIoApi = Montage.create(Component, { // if (xhr.readyState === 4) { retValue.status = xhr.status; + eval('retValue.response = '+xhr.response); retValue.success = true; } } diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js index f81dc93c..d256f226 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.js +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js @@ -75,7 +75,7 @@ exports.CloudPopup = Montage.create(Component, { // if (this.application.ninja.coreIoApi.cloudAvailable()) { this.components.status.style.color = '#77FF00'; - this.components.status.innerHTML = 'Connected'; + this.components.status.innerHTML = 'Connected to '+this.application.ninja.coreIoApi.cloudData.name; } else { this.components.status.style.color = '#FF3A3A'; this.components.status.innerHTML = 'Disconnected'; diff --git a/js/io/ui/cloudpopup.reel/css/cloudpopup.css b/js/io/ui/cloudpopup.reel/css/cloudpopup.css index 81e0742f..b42263b9 100644 --- a/js/io/ui/cloudpopup.reel/css/cloudpopup.css +++ b/js/io/ui/cloudpopup.reel/css/cloudpopup.css @@ -116,5 +116,5 @@ width: 80px; text-align: center; float: right; - margin: 4px 0px 0px 8px; + margin: 8px 0px 0px 8px; } diff --git a/js/io/ui/cloudpopup.reel/css/cloudpopup.scss b/js/io/ui/cloudpopup.reel/css/cloudpopup.scss index ec03eb01..1ae5579b 100755 --- a/js/io/ui/cloudpopup.reel/css/cloudpopup.scss +++ b/js/io/ui/cloudpopup.reel/css/cloudpopup.scss @@ -121,5 +121,5 @@ $grey_light: #494949; width: 80px; text-align: center; float: right; - margin: 4px 0px 0px 8px; + margin: 8px 0px 0px 8px; } \ No newline at end of file -- cgit v1.2.3