aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/components/converter/string-units-converter.js31
-rw-r--r--js/components/converter/string-value-converter.js29
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.js2
-rwxr-xr-xjs/controllers/document-controller.js14
-rwxr-xr-xjs/data/pi/pi-data.js18
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js2
-rwxr-xr-xjs/panels/properties.reel/properties.js153
-rwxr-xr-xjs/panels/properties.reel/sections/position-and-size.reel/position-and-size.html30
-rwxr-xr-xjs/panels/properties.reel/sections/position-and-size.reel/position-and-size.js12
9 files changed, 121 insertions, 170 deletions
diff --git a/js/components/converter/string-units-converter.js b/js/components/converter/string-units-converter.js
new file mode 100644
index 00000000..6b97d5c5
--- /dev/null
+++ b/js/components/converter/string-units-converter.js
@@ -0,0 +1,31 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6var Montage = require("montage").Montage,
7 Converter = require("montage/core/converter/converter").Converter,
8 NJUtils = require("js/lib/NJUtils").NJUtils;
9
10exports.StringUnitsConverter = Montage.create(Converter, {
11
12 // convert fahrenheit to celsius (showing our non-metric heritage here)
13 convert: {
14 value: function(value) {
15 if(value) {
16 console.log("convert string to unit ", value);
17 var tmp = NJUtils.getValueAndUnits(value);
18 return tmp[1];
19 }
20 }
21 },
22
23 // revert celsius to fahrenheit
24 revert: {
25 value: function(value) {
26 console.log("revert string to unit ", value);
27 return value;
28 }
29 }
30
31});
diff --git a/js/components/converter/string-value-converter.js b/js/components/converter/string-value-converter.js
new file mode 100644
index 00000000..28d7dd29
--- /dev/null
+++ b/js/components/converter/string-value-converter.js
@@ -0,0 +1,29 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6var Montage = require("montage").Montage,
7 Converter = require("montage/core/converter/converter").Converter,
8 NJUtils = require("js/lib/NJUtils").NJUtils;
9
10exports.StringValueConverter = Montage.create(Converter, {
11
12 // convert fahrenheit to celsius (showing our non-metric heritage here)
13 convert: {
14 value: function(value) {
15 console.log(value);
16 console.log(parseInt(value));
17 return parseInt(value);
18 }
19 },
20
21 // revert celsius to fahrenheit
22 revert: {
23 value: function(value) {
24 console.log("revert string to value ", value);
25 return value;
26 }
27 }
28
29});
diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js
index 9e4110e2..81a63c90 100755
--- a/js/components/layout/document-entry.reel/document-entry.js
+++ b/js/components/layout/document-entry.reel/document-entry.js
@@ -7,8 +7,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
7var Montage = require("montage/core/core").Montage; 7var Montage = require("montage/core/core").Montage;
8var Component = require("montage/ui/component").Component; 8var Component = require("montage/ui/component").Component;
9 9
10//var documentManagerModule = ("js/document/documentManager");
11
12exports.DocumentEntry = Montage.create(Component, { 10exports.DocumentEntry = Montage.create(Component, {
13 11
14 dirty: { value: null }, 12 dirty: { value: null },
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 48033b61..48ceb21b 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -158,13 +158,13 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
158 }, 158 },
159 159
160 handleExecuteNewFile: { 160 handleExecuteNewFile: {
161 value: function(event) { 161 value: function(event) {
162 var newFileSettings = event._event.settings || {}; 162 var newFileSettings = event._event.settings || {};
163 if (this.application.ninja.coreIoApi.cloudAvailable()) { 163 if (this.application.ninja.coreIoApi.cloudAvailable()) {
164 newFileSettings.callback = this.createNewFile.bind(this); 164 newFileSettings.callback = this.createNewFile.bind(this);
165 this.application.ninja.newFileController.showNewFileDialog(newFileSettings); 165 this.application.ninja.newFileController.showNewFileDialog(newFileSettings);
166 }
167 } 166 }
167 }
168 }, 168 },
169 //////////////////////////////////////////////////////////////////// 169 ////////////////////////////////////////////////////////////////////
170 // 170 //
@@ -610,7 +610,7 @@ if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){
610 //hide the iframe when switching to code view 610 //hide the iframe when switching to code view
611 document.getElementById("iframeContainer").style.display = "none"; 611 document.getElementById("iframeContainer").style.display = "none";
612 } 612 }
613 } 613 }
614 } 614 }
615 }, 615 },
616 616
diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js
index d1dc9f34..157cbc64 100755
--- a/js/data/pi/pi-data.js
+++ b/js/data/pi/pi-data.js
@@ -14,25 +14,11 @@ exports.PiData = Montage.create( Montage, {
14 { 14 {
15 label: "Style", 15 label: "Style",
16 16
17 Section: [
18 [
19
20 ]
21 ]
22 }
23 ]
24 },
25
26 stagePi: {
27 value: [
28 {
29 label: "Style",
30
31 Section: [ 17 Section: [
32 [ 18 [
33 { 19 {
34 type : "chip", 20 type: "chip",
35 id : "background", 21 id: "background",
36 prop: "background" 22 prop: "background"
37 } 23 }
38 ] 24 ]
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index d1cab096..94ca9b57 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -994,7 +994,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
994 this.arrLayers.splice(myIndex, 0, thingToPush); 994 this.arrLayers.splice(myIndex, 0, thingToPush);
995 995
996 } 996 }
997 this.selectLayer(myIndex); 997 this.selectLayer(myIndex, false);
998 } 998 }
999 }, 999 },
1000 1000
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index 20f670d9..3ec48687 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -67,15 +67,11 @@ exports.Properties = Montage.create(Component, {
67 } 67 }
68 }, 68 },
69 69
70 // Document is opened - Display the current selection
71 handleOpenDocument: { 70 handleOpenDocument: {
72 value: function() { 71 value: function() {
73
74 this.eventManager.addEventListener( "elementChange", this, false); 72 this.eventManager.addEventListener( "elementChange", this, false);
75 73
76 // For now always assume that the stage is selected by default when opening the old template 74 // Display the default document root PI
77 // TODO: Remove marker for old template: NINJA-STAGE-REWORK
78
79 this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); 75 this.displayElementProperties(this.application.ninja.currentDocument.documentRoot);
80 } 76 }
81 }, 77 },
@@ -173,8 +169,6 @@ exports.Properties = Montage.create(Component, {
173 handleSelectionChange: { 169 handleSelectionChange: {
174 value: function(event) { 170 value: function(event) {
175 if(event.detail.isDocument) { 171 if(event.detail.isDocument) {
176// if(this.application.ninja.currentDocument.documentRoot.nodeName.toLowerCase() === "body") return;
177// this.displayStageProperties();
178 this.displayElementProperties(this.application.ninja.currentDocument.documentRoot); 172 this.displayElementProperties(this.application.ninja.currentDocument.documentRoot);
179 } else { 173 } else {
180 if(this.application.ninja.selectedElements.length === 1) { 174 if(this.application.ninja.selectedElements.length === 1) {
@@ -187,98 +181,23 @@ exports.Properties = Montage.create(Component, {
187 } 181 }
188 }, 182 },
189 183
190 displayStageProperties: {
191 value: function() {
192 var stage = this.application.ninja.currentDocument.documentRoot;
193 //this is test code please remove
194 this.elementName.value = "Stage";
195 this.elementId.value = stage.elementModel.id;
196 this.elementClass.value = "";
197
198 this.positionSize.disablePosition = true;
199 this.threeD.disableTranslation = true;
200
201 this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(stage, "height"));
202 this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width"));
203
204 if(this.threeD.inGlobalMode)
205 {
206 this.threeD.xAngle = ElementsMediator.get3DProperty(stage, "xAngle");
207 this.threeD.yAngle = ElementsMediator.get3