From e75223a2c4c1e13d66639841e6418e94fe9b726f Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 31 Jan 2012 15:59:46 -0800 Subject: Cloud IO Prompt Setting up UI for the file IO prompt on initialization of Ninja and whenever a cloud IO call is made and the server is not detected. --- js/io/ui/cloudpopup.reel/cloudpopup.js | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 js/io/ui/cloudpopup.reel/cloudpopup.js (limited to 'js/io/ui/cloudpopup.reel/cloudpopup.js') diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js new file mode 100755 index 00000000..3e104bb7 --- /dev/null +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js @@ -0,0 +1,55 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +//////////////////////////////////////////////////////////////////////// +// +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; +//////////////////////////////////////////////////////////////////////// +// +exports.CloudPopup = Montage.create(Component, { + //////////////////////////////////////////////////////////////////// + // + hasTemplate: { + value: true + }, + //////////////////////////////////////////////////////////////////// + // + prepareForDraw: { + enumerable: false, + value: function () { + // + } + }, + //////////////////////////////////////////////////////////////////// + // + willDraw: { + enumerable: false, + value: function() { + // + } + }, + //////////////////////////////////////////////////////////////////// + // + draw: { + enumerable: false, + value: function() { + // + } + }, + //////////////////////////////////////////////////////////////////// + // + didDraw: { + enumerable: false, + value: function() { + // + } + } + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// +}); +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// \ No newline at end of file -- cgit v1.2.3 From d2ff7026abd7e40b49917491773cba9367221f99 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 31 Jan 2012 22:44:15 -0800 Subject: Hooking cloud popup UI to core Set up the popup UI for cloud to core API to detected cloud API connection. --- js/io/ui/cloudpopup.reel/cloudpopup.js | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'js/io/ui/cloudpopup.reel/cloudpopup.js') diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js index 3e104bb7..f81dc93c 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.js +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js @@ -18,10 +18,21 @@ exports.CloudPopup = Montage.create(Component, { }, //////////////////////////////////////////////////////////////////// // + components: { + enumerable: false, + value: {test_btn: null, ok_btn: null, cancel_btn: null, status: null, url: null} + }, + //////////////////////////////////////////////////////////////////// + // prepareForDraw: { enumerable: false, value: function () { // + this.components.test_btn = this.element.getElementsByClassName('btn_test')[0]; + this.components.ok_btn = this.element.getElementsByClassName('btn_ok')[0]; + this.components.cancel_btn = this.element.getElementsByClassName('btn_cancel')[0]; + this.components.status = this.element.getElementsByClassName('status')[0]; + this.components.url = this.element.getElementsByClassName('cloud_url')[0]; } }, //////////////////////////////////////////////////////////////////// @@ -30,6 +41,7 @@ exports.CloudPopup = Montage.create(Component, { enumerable: false, value: function() { // + } }, //////////////////////////////////////////////////////////////////// @@ -38,6 +50,7 @@ exports.CloudPopup = Montage.create(Component, { enumerable: false, value: function() { // + this.testConnection(); } }, //////////////////////////////////////////////////////////////////// @@ -46,6 +59,36 @@ exports.CloudPopup = Montage.create(Component, { enumerable: false, value: function() { // + this.components.test_btn.addEventListener('click', this.testConnection.bind(this), false); + // + this.components.ok_btn.addEventListener('click', this.closeDialog.bind(this), false); + this.components.cancel_btn.addEventListener('click', this.closeDialog.bind(this), false); + } + }, + //////////////////////////////////////////////////////////////////// + //this.application.ninja.coreIoApi.hideCloudDialog + testConnection: { + enumerable: false, + value: function() { + // + this.application.ninja.coreIoApi.rootUrl = this.components.url.value; + // + if (this.application.ninja.coreIoApi.cloudAvailable()) { + this.components.status.style.color = '#77FF00'; + this.components.status.innerHTML = 'Connected'; + } else { + this.components.status.style.color = '#FF3A3A'; + this.components.status.innerHTML = 'Disconnected'; + } + } + }, + //////////////////////////////////////////////////////////////////// + // + closeDialog: { + enumerable: false, + value: function() { + // + this.application.ninja.coreIoApi.hideCloudDialog(); } } //////////////////////////////////////////////////////////////////// -- cgit v1.2.3 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/ui/cloudpopup.reel/cloudpopup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/io/ui/cloudpopup.reel/cloudpopup.js') 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'; -- cgit v1.2.3 From e824b4901817429231cd9ab6aa068cc0a0849e3a Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 1 Feb 2012 10:16:16 -0800 Subject: Applying global button styles to cloud popup --- js/io/ui/cloudpopup.reel/cloudpopup.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/io/ui/cloudpopup.reel/cloudpopup.js') diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js index d256f226..e8558179 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.js +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js @@ -28,9 +28,9 @@ exports.CloudPopup = Montage.create(Component, { enumerable: false, value: function () { // - this.components.test_btn = this.element.getElementsByClassName('btn_test')[0]; - this.components.ok_btn = this.element.getElementsByClassName('btn_ok')[0]; - this.components.cancel_btn = this.element.getElementsByClassName('btn_cancel')[0]; + this.components.test_btn = this.element.getElementsByClassName('btn_test nj-skinned')[0]; + this.components.ok_btn = this.element.getElementsByClassName('btn_ok nj-skinned')[0]; + this.components.cancel_btn = this.element.getElementsByClassName('btn_cancel nj-skinned')[0]; this.components.status = this.element.getElementsByClassName('status')[0]; this.components.url = this.element.getElementsByClassName('cloud_url')[0]; } -- cgit v1.2.3 From b354ea65f7c53ce05aff6a204853e666f084950f Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 1 Feb 2012 13:56:49 -0800 Subject: Adding cancel functionality to cloud popup Added the functionality to the cloud pupup cancel button to set the rootURL to null if selected, ok button will allow the value to remain as last input. Test button tests the URL, and therefore set it, but does not handling closing the dialog. --- js/io/ui/cloudpopup.reel/cloudpopup.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'js/io/ui/cloudpopup.reel/cloudpopup.js') diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js index e8558179..7f494dcf 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.js +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js @@ -51,6 +51,9 @@ exports.CloudPopup = Montage.create(Component, { value: function() { // this.testConnection(); + if (this.application.ninja.coreIoApi.cloudAvailable()) { + this.closeDialog(); + } } }, //////////////////////////////////////////////////////////////////// @@ -62,7 +65,7 @@ exports.CloudPopup = Montage.create(Component, { this.components.test_btn.addEventListener('click', this.testConnection.bind(this), false); // this.components.ok_btn.addEventListener('click', this.closeDialog.bind(this), false); - this.components.cancel_btn.addEventListener('click', this.closeDialog.bind(this), false); + this.components.cancel_btn.addEventListener('click', this.cancelDialog.bind(this), false); } }, //////////////////////////////////////////////////////////////////// @@ -90,6 +93,16 @@ exports.CloudPopup = Montage.create(Component, { // this.application.ninja.coreIoApi.hideCloudDialog(); } + }, + //////////////////////////////////////////////////////////////////// + // + cancelDialog: { + enumerable: false, + value: function() { + // + this.application.ninja.coreIoApi.rootUrl = null; + this.application.ninja.coreIoApi.hideCloudDialog(); + } } //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From fbe830fabe497d01f4f2eaddb867161a8187c101 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 9 Feb 2012 23:42:04 -0800 Subject: Adding download cloud app UI --- js/io/ui/cloudpopup.reel/cloudpopup.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'js/io/ui/cloudpopup.reel/cloudpopup.js') diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js index 7f494dcf..1344661b 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.js +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js @@ -16,11 +16,16 @@ exports.CloudPopup = Montage.create(Component, { hasTemplate: { value: true }, + //////////////////////////////////////////////////////////////////// + // + _os: { + value: null + }, //////////////////////////////////////////////////////////////////// // components: { enumerable: false, - value: {test_btn: null, ok_btn: null, cancel_btn: null, status: null, url: null} + value: {test_btn: null, ok_btn: null, cancel_btn: null, download_btn: null, status: null, url: null} }, //////////////////////////////////////////////////////////////////// // @@ -33,6 +38,7 @@ exports.CloudPopup = Montage.create(Component, { this.components.cancel_btn = this.element.getElementsByClassName('btn_cancel nj-skinned')[0]; this.components.status = this.element.getElementsByClassName('status')[0]; this.components.url = this.element.getElementsByClassName('cloud_url')[0]; + this.components.download_btn = this.element.getElementsByClassName('btn_download nj-skinned')[0]; } }, //////////////////////////////////////////////////////////////////// @@ -41,7 +47,11 @@ exports.CloudPopup = Montage.create(Component, { enumerable: false, value: function() { // - + if (navigator.appVersion.indexOf("Win")!=-1) { + this._os = 'windows'; + } else if (navigator.appVersion.indexOf("Mac")!=-1) { + this._os = 'mac'; + } } }, //////////////////////////////////////////////////////////////////// @@ -61,6 +71,8 @@ exports.CloudPopup = Montage.create(Component, { didDraw: { enumerable: false, value: function() { + // + this.components.download_btn.addEventListener('click', this.downloadCloudApp.bind(this), false); // this.components.test_btn.addEventListener('click', this.testConnection.bind(this), false); // @@ -69,7 +81,15 @@ exports.CloudPopup = Montage.create(Component, { } }, //////////////////////////////////////////////////////////////////// - //this.application.ninja.coreIoApi.hideCloudDialog + // + downloadCloudApp: { + enumerable: false, + value: function() { + console.log(this._os); + } + }, + //////////////////////////////////////////////////////////////////// + // testConnection: { enumerable: false, value: function() { -- cgit v1.2.3 From 632a5daca17acb774b9344ccc0e9107f1643924c Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 10 Feb 2012 15:29:12 -0800 Subject: File Open Adding the functionality to open a basic file. --- js/io/ui/cloudpopup.reel/cloudpopup.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/io/ui/cloudpopup.reel/cloudpopup.js') diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js index 1344661b..e5bad98e 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.js +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js @@ -51,6 +51,9 @@ exports.CloudPopup = Montage.create(Component, { this._os = 'windows'; } else if (navigator.appVersion.indexOf("Mac")!=-1) { this._os = 'mac'; + } else { + //Alternate message for no OS detected (probably Linux) + this.element.getElementsByTagName('section')[0].style.display = 'none'; } } }, -- cgit v1.2.3