aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAnanya Sen2012-02-01 12:00:04 -0800
committerAnanya Sen2012-02-01 12:00:04 -0800
commitcac299b27fcd9e317a391236502f513f215e8d2d (patch)
treefc2fb9e341b04694ef7966d84b26e7707ee53f1b /js
parent553fce7721cacfd13b6013fdcdd0243c90083b5e (diff)
parentd74910a897f2db920f6f67d922532d245074c8f7 (diff)
downloadninja-cac299b27fcd9e317a391236502f513f215e8d2d.tar.gz
Merge branch 'FileIO' of github.com:joseeight/ninja-internal into FileIO
Diffstat (limited to 'js')
-rwxr-xr-xjs/components/combobox.reel/combobox.js2
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.css1
-rwxr-xr-xjs/components/popup-manager.reel/popup-manager.js3
-rwxr-xr-xjs/components/radio.reel/radio.js6
-rwxr-xr-xjs/io/system/coreioapi.js105
-rwxr-xr-xjs/io/system/fileio.js11
-rwxr-xr-xjs/io/ui/cloudpopup.reel/cloudpopup.html54
-rwxr-xr-xjs/io/ui/cloudpopup.reel/cloudpopup.js98
-rwxr-xr-xjs/io/ui/cloudpopup.reel/config.rb9
-rw-r--r--js/io/ui/cloudpopup.reel/css/cloudpopup.css99
-rwxr-xr-xjs/io/ui/cloudpopup.reel/css/cloudpopup.scss103
-rwxr-xr-xjs/ninja.reel/ninja.js4
12 files changed, 470 insertions, 25 deletions
diff --git a/js/components/combobox.reel/combobox.js b/js/components/combobox.reel/combobox.js
index f262bb06..a68a7d6b 100755
--- a/js/components/combobox.reel/combobox.js
+++ b/js/components/combobox.reel/combobox.js
@@ -67,7 +67,7 @@ exports.Combobox = Montage.create(Component, {
67 var e = document.createEvent("CustomEvent"); 67 var e = document.createEvent("CustomEvent");
68 e.initEvent("change", true, true); 68 e.initEvent("change", true, true);
69 e.type = "change"; 69 e.type = "change";
70 e._wasSetByCode = this._wasSetByCode; 70 e.wasSetByCode = this._wasSetByCode;
71 e.value = this._value; 71 e.value = this._value;
72 this.dispatchEvent(e); 72 this.dispatchEvent(e);
73 73
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.css b/js/components/layout/bread-crumb.reel/bread-crumb.css
index f84c6e80..cc984609 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.css
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.css
@@ -5,6 +5,7 @@
5 </copyright> */ 5 </copyright> */
6 6
7.bread_crumb{ 7.bread_crumb{
8 background-color: #282828;
8 border-style: double; 9 border-style: double;
9 height: 26px; 10 height: 26px;
10} 11}
diff --git a/js/components/popup-manager.reel/popup-manager.js b/js/components/popup-manager.reel/popup-manager.js
index be3c1e8d..bc755f74 100755
--- a/js/components/popup-manager.reel/popup-manager.js
+++ b/js/components/popup-manager.reel/popup-manager.js
@@ -32,7 +32,8 @@ exports.PopupMananger = Montage.create(Component, {
32 addPopup: { 32 addPopup: {
33 enumerable: true, 33 enumerable: true,
34 value: function (popup, depth, blackout) { 34 value: function (popup, depth, blackout) {
35 // 35 //Fix to ensure always highest
36 this.element.style.zIndex = this._getNextHighestZindex(document.body); // Highest z-index in body
36 //TODO: Add blackout background 37 //TODO: Add blackout background
37 //Checking for manual or setting auto to next highest depth 38 //Checking for manual or setting auto to next highest depth
38 if (depth) { 39 if (depth) {
diff --git a/js/components/radio.reel/radio.js b/js/components/radio.reel/radio.js
index 954da3c4..c661ec11 100755
--- a/js/components/radio.reel/radio.js
+++ b/js/components/radio.reel/radio.js
@@ -41,7 +41,7 @@ exports.RadioGroup = Montage.create(Component, {
41 e = document.createEvent("CustomEvent"); 41 e = document.createEvent("CustomEvent");
42 e.initEvent("change", true, true); 42 e.initEvent("change", true, true);
43 e.type = "change"; 43 e.type = "change";
44 e._wasSetByCode = this._wasSetByCode; 44 e.wasSetByCode = this._wasSetByCode;
45 e.selectedIndex = i; 45 e.selectedIndex = i;
46 e.selectedItem = value; 46 e.selectedItem = value;
47 this.dispatchEvent(e); 47 this.dispatchEvent(e);
@@ -77,7 +77,7 @@ exports.RadioGroup = Montage.create(Component, {
77 { 77 {
78 value:function(event) 78 value:function(event)
79 { 79 {
80 this._wasSetByCode = event._event._wasSetByCode; 80 this._wasSetByCode = event._event.wasSetByCode;
81 this.selectedItem = event._event.value; 81 this.selectedItem = event._event.value;
82 } 82 }
83 } 83 }
@@ -126,7 +126,7 @@ exports.Radio = Montage.create(Component, {
126 var e = document.createEvent("CustomEvent"); 126 var e = document.createEvent("CustomEvent");
127 e.initEvent("change", true, true); 127 e.initEvent("change", true, true);
128 e.type = "change"; 128 e.type = "change";
129 e._wasSetByCode = this._wasSetByCode; 129 e.wasSetByCode = this._wasSetByCode;
130 e.value = this; 130 e.value = this;
131 this.dispatchEvent(e); 131 this.dispatchEvent(e);
132 132
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js
index 43812b3c..3a007028 100755
--- a/js/io/system/coreioapi.js
+++ b/js/io/system/coreioapi.js
@@ -10,7 +10,9 @@ NOTES:
10//////////////////////////////////////////////////////////////////////// 10////////////////////////////////////////////////////////////////////////
11///////////////////////////////////////////////////////////////////// */ 11///////////////////////////////////////////////////////////////////// */
12var Montage = require("montage/core/core").Montage, 12var Montage = require("montage/core/core").Montage,
13 Component = require("montage/ui/component").Component; 13 Component = require("montage/ui/component").Component,
14 Popup = require("js/components/popup.reel").Popup,
15 CloudPopup = require("js/io/ui/cloudpopup.reel").CloudPopup;
14//////////////////////////////////////////////////////////////////////// 16////////////////////////////////////////////////////////////////////////
15//Exporting as Project I/O 17//Exporting as Project I/O
16exports.CoreIoApi = Montage.create(Component, { 18exports.CoreIoApi = Montage.create(Component, {
@@ -25,17 +27,9 @@ exports.CoreIoApi = Montage.create(Component, {
25 this.rootUrl = window.localStorage['ioRootUrl']; 27 this.rootUrl = window.localStorage['ioRootUrl'];
26 //Checks for IO API to be active 28 //Checks for IO API to be active
27 this.ioServiceDetected = this.cloudAvailable(); 29 this.ioServiceDetected = this.cloudAvailable();
28 //
29 console.log('FileIO: localStorage URL detected | IO Service Detected: '+ this.ioServiceDetected);
30 //
31 } else { 30 } else {
32 //TODO: Remove, automatically prompt user on welcome 31 //IO API to be inactive
33 this.rootUrl = 'http://localhost:16380'; 32 this.ioServiceDetected = false;
34 //TODO: Changed to false, welcome screen prompts user
35 this.ioServiceDetected = this.cloudAvailable();
36 //
37 console.log('FileIO: localStorage URL NOT detected | IO Service Detected: '+ this.ioServiceDetected);
38 //
39 } 33 }
40 } 34 }
41 }, 35 },
@@ -44,19 +38,98 @@ exports.CoreIoApi = Montage.create(Component, {
44 cloudAvailable: { 38 cloudAvailable: {
45 enumerable: false, 39 enumerable: false,
46 value: function () { 40 value: function () {
41 var cloud = this.getCloudStatus();
47 // 42 //
48 if (this.getCloudStatus().status === 200) { 43 if (this.rootUrl && cloud.status === 200) {
49 //Active 44 //Active
45 this.cloudData.name = cloud.response['name'];
46 this.cloudData.root = cloud.response['server-root'];
50 return true; 47 return true;
51 } else { 48 } else {
52 //Inactive 49 //Inactive
53 //TODO: Logic to prompt the user for cloud, otherwise return false 50 if (!this._cloudDialogOpen && this.application.ninja) {
51 this.showCloudDialog();
52 }
54 return false; 53 return false;
55 } 54 }
56 } 55 }
57 }, 56 },
58 //////////////////////////////////////////////////////////////////// 57 ////////////////////////////////////////////////////////////////////
59 // 58 //
59 _cloudDialogOpen: {
60 enumerable: false,
61 value: false
62 },
63 ////////////////////////////////////////////////////////////////////
64 //
65 cloudData: {
66 enumerable: false,
67 value: {name: null, root: ''}
68 },
69 ////////////////////////////////////////////////////////////////////
70 //
71 _cloudDialogComponents: {
72 enumerable: false,
73 value: {blackout: null, popup: null, dialog: null}
74 },
75 ////////////////////////////////////////////////////////////////////
76 //
77 showCloudDialog: {
78 enumerable: false,
79 value: function () {
80 //
81 this._cloudDialogOpen = true;
82 //
83 this._cloudDialogComponents.blackout = document.createElement('div');
84 this._cloudDialogComponents.blackout.style.width = '100%';
85 this._cloudDialogComponents.blackout.style.height = '100%';
86 this._cloudDialogComponents.blackout.style.background = '-webkit-radial-gradient(center, ellipse cover, rgba(0,0,0,.65) 0%, rgba(0,0,0,0.8) 80%)';
87 this.application.ninja.popupManager.addPopup(this._cloudDialogComponents.blackout);
88 //
89 ////////////////////////////////////////////////////
90 //Creating popup from m-js component
91 var popup = document.createElement('div');
92 //
93 this._cloudDialogComponents.dialog = CloudPopup.create();
94 //
95 document.body.appendChild(popup);
96 //
97 this._cloudDialogComponents.dialog.element = popup;
98 this._cloudDialogComponents.dialog.needsDraw = true;
99 this._cloudDialogComponents.dialog.element.style.opacity = 0;
100 //
101 this._cloudDialogComponents.dialog.addEventListener('firstDraw', this, false);
102 }
103 },
104 ////////////////////////////////////////////////////////////////////
105 //
106 handleFirstDraw: {
107 value: function (e) {
108 if (e._target._element.className === 'cloud_popup') {
109 this._cloudDialogComponents.dialog.removeEventListener('firstDraw', this, false);
110 //
111 this._cloudDialogComponents.popup = this.application.ninja.popupManager.createPopup(this._cloudDialogComponents.dialog.element, {x: '50%', y: '50%'});
112 this._cloudDialogComponents.popup.addEventListener('firstDraw', this, false);
113 } else {
114 //
115 this._cloudDialogComponents.dialog.element.style.opacity = 1;
116 this._cloudDialogComponents.popup.element.style.opacity = 1;
117 this._cloudDialogComponents.popup.element.style.margin = '-100px 0px 0px -190px';
118 }