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