diff options
Diffstat (limited to 'js')
-rwxr-xr-x | js/controllers/elements/body-controller.js | 44 | ||||
-rwxr-xr-x | js/controllers/elements/controller-factory.js | 5 | ||||
-rwxr-xr-x | js/data/pi/pi-data.js | 14 | ||||
-rwxr-xr-x | js/document/document-html.js | 9 | ||||
-rwxr-xr-x | js/document/html-document.js | 10 | ||||
-rwxr-xr-x | js/document/templates/montage-web/default_html.css | 2 | ||||
-rwxr-xr-x | js/document/templates/montage-web/index.html | 2 | ||||
-rwxr-xr-x | js/lib/NJUtils.js | 14 | ||||
-rwxr-xr-x | js/models/element-model.js | 35 | ||||
-rwxr-xr-x | js/models/properties-3d.js | 3 | ||||
-rwxr-xr-x | js/panels/properties.reel/properties.js | 1 |
11 files changed, 106 insertions, 33 deletions
diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js new file mode 100755 index 00000000..fbbb7c6e --- /dev/null +++ b/js/controllers/elements/body-controller.js | |||
@@ -0,0 +1,44 @@ | |||
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> */ | ||
6 | |||
7 | var Montage = require("montage/core/core").Montage, | ||
8 | ElementController = require("js/controllers/elements/element-controller").ElementController; | ||
9 | |||
10 | exports.BodyController = Montage.create(ElementController, { | ||
11 | |||
12 | // TODO - perspective distance needs to be passed in as "dist" and matrix3d needs to be passed in as "mat" | ||
13 | set3DProperties: { | ||
14 | value: function(el, props, update3DModel) { | ||
15 | } | ||
16 | }, | ||
17 | |||
18 | getProperty: { | ||
19 | value: function(el, p) { | ||
20 | } | ||
21 | }, | ||
22 | |||
23 | setProperty: { | ||
24 | value: function(el, p, value) { | ||
25 | } | ||
26 | }, | ||
27 | |||
28 | setAttribute: { | ||
29 | value: function(el, att, value) { | ||
30 | } | ||
31 | }, | ||
32 | |||
33 | getPerspectiveDist: { | ||
34 | value: function(el) { | ||
35 | if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) { | ||
36 | return el.elementModel.props3D.perspectiveDist; | ||
37 | } else { | ||
38 | var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, true); | ||
39 | el.elementModel.props3D.perspectiveDist = dist; | ||
40 | return dist; | ||
41 | } | ||
42 | } | ||
43 | } | ||
44 | }); | ||
diff --git a/js/controllers/elements/controller-factory.js b/js/controllers/elements/controller-factory.js index a772eb16..1bbbbce0 100755 --- a/js/controllers/elements/controller-factory.js +++ b/js/controllers/elements/controller-factory.js | |||
@@ -6,7 +6,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
6 | 6 | ||
7 | var Montage = require("montage/core/core").Montage; | 7 | var Montage = require("montage/core/core").Montage; |
8 | 8 | ||
9 | var BlockController = require("js/controllers/elements/block-controller").BlockController, | 9 | var BodyController = require("js/controllers/elements/body-controller").BodyController, |
10 | BlockController = require("js/controllers/elements/block-controller").BlockController, | ||
10 | StageController = require("js/controllers/elements/stage-controller").StageController, | 11 | StageController = require("js/controllers/elements/stage-controller").StageController, |
11 | ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, | 12 | ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, |
12 | ImageController = require("js/controllers/elements/image-controller").ImageController, | 13 | ImageController = require("js/controllers/elements/image-controller").ImageController, |
@@ -27,6 +28,8 @@ exports.ControllerFactory = Montage.create(Montage, { | |||
27 | return BlockController; | 28 | return BlockController; |
28 | } else if(value.indexOf("stage") !== -1) { | 29 | } else if(value.indexOf("stage") !== -1) { |
29 | return StageController; | 30 | return StageController; |
31 | } else if(value.indexOf("body") !== -1) { | ||
32 | return BodyController; | ||
30 | } else if(value.indexOf("shape") !== -1) { | 33 | } else if(value.indexOf("shape") !== -1) { |
31 | return ShapesController; | 34 | return ShapesController; |
32 | } else if(value.indexOf("canvas") !== -1) { | 35 | } else if(value.indexOf("canvas") !== -1) { |
diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js index 157c54ec..65161b4f 100755 --- a/js/data/pi/pi-data.js +++ b/js/data/pi/pi-data.js | |||
@@ -9,6 +9,20 @@ var Montage = require("montage/core/core").Montage, | |||
9 | 9 | ||
10 | exports.PiData = Montage.create( Montage, { | 10 | exports.PiData = Montage.create( Montage, { |
11 | 11 | ||
12 | bodyPi: { | ||
13 | value: [ | ||
14 | { | ||
15 | label: "Style", | ||
16 | |||
17 | Section: [ | ||
18 | [ | ||
19 | |||
20 | ] | ||
21 | ] | ||
22 | } | ||
23 | ] | ||
24 | }, | ||
25 | |||
12 | stagePi: { | 26 | stagePi: { |
13 | value: [ | 27 | value: [ |
14 | { | 28 | { |
diff --git a/js/document/document-html.js b/js/document/document-html.js index 8cb88516..24eb4f47 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -270,7 +270,8 @@ exports.HtmlDocument = Montage.create(Component, { | |||
270 | 270 | ||
271 | //TODO Finish this implementation once we start caching Core Elements | 271 | //TODO Finish this implementation once we start caching Core Elements |
272 | // Assign a model to the UserContent and add the ViewPort reference to it. | 272 | // Assign a model to the UserContent and add the ViewPort reference to it. |
273 | document.application.njUtils.makeElementModel(this.documentRoot, "Stage", "stage"); | 273 | document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); |
274 | // this.documentRoot.elementModel.props3D.init(this.documentRoot, true); | ||
274 | 275 | ||
275 | for(i = 0; i < this._stylesheets.length; i++) { | 276 | for(i = 0; i < this._stylesheets.length; i++) { |
276 | if(this._stylesheets[i].ownerNode.id === "nj-stage-stylesheet") { | 277 | if(this._stylesheets[i].ownerNode.id === "nj-stage-stylesheet") { |
@@ -309,6 +310,12 @@ exports.HtmlDocument = Montage.create(Component, { | |||
309 | } | 310 | } |
310 | }, | 311 | }, |
311 | 312 | ||
313 | GetElementFromPoint: { | ||
314 | value: function(x, y) { | ||
315 | return this._window.getElement(x,y); | ||
316 | } | ||
317 | }, | ||
318 | |||
312 | // Handler for user content main reel. Gets called once the main reel of the template | 319 | // Handler for user content main reel. Gets called once the main reel of the template |
313 | // gets deserialized. | 320 | // gets deserialized. |
314 | // Setting up the currentSelectedContainer to the document body. | 321 | // Setting up the currentSelectedContainer to the document body. |
diff --git a/js/document/html-document.js b/js/document/html-document.js index 3876670c..3dbf96ce 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js | |||
@@ -759,10 +759,14 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
759 | //TODO Finish this implementation once we start caching Core Elements | 759 | //TODO Finish this implementation once we start caching Core Elements |
760 | // Assign a model to the UserContent and add the ViewPort reference to it. | 760 | // Assign a model to the UserContent and add the ViewPort reference to it. |
761 | NJUtils.makeElementModel(this.documentRoot, "Stage", "stage"); | 761 | NJUtils.makeElementModel(this.documentRoot, "Stage", "stage"); |
762 | //this.documentRoot.elementModel.viewPort = this.iframe.contentWindow.document.getElementById("Viewport"); | 762 | NJUtils.makeElementModel(this.stageBG, "Stage", "stage"); |
763 | NJUtils.makeElementModel(this.stageBG, "Stage", "stage"); | ||
764 | NJUtils.makeElementModel(this.iframe.contentWindow.document.getElementById("Viewport"), "Stage", "stage"); | 763 | NJUtils.makeElementModel(this.iframe.contentWindow.document.getElementById("Viewport"), "Stage", "stage"); |
765 | 764 | ||
765 | // Initialize the 3D properties | ||
766 | this.documentRoot.elementModel.props3D.init(this.documentRoot, true); | ||
767 | this.stageBG.elementModel.props3D.init(this.stageBG, true); | ||
768 | this.iframe.contentWindow.document.getElementById("Viewport").elementModel.props3D.init(this.iframe.contentWindow.document.getElementById("Viewport"), true); | ||
769 | |||
766 | for(i = 0; i < this._stylesheets.length; i++) { | 770 | for(i = 0; i < this._stylesheets.length; i++) { |
767 | if(this._stylesheets[i].ownerNode.id === this._stageStyleSheetId) { | 771 | if(this._stylesheets[i].ownerNode.id === this._stageStyleSheetId) { |
768 | this.documentRoot.elementModel.defaultRule = this._stylesheets[i]; | 772 | this.documentRoot.elementModel.defaultRule = this._stylesheets[i]; |
diff --git a/js/document/templates/montage-web/default_html.css b/js/document/templates/montage-web/default_html.css index db069d4e..08e39f22 100755 --- a/js/document/templates/montage-web/default_html.css +++ b/js/document/templates/montage-web/default_html.css | |||
@@ -11,7 +11,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
11 | } | 11 | } |
12 | 12 | ||
13 | .active-element-outline { | 13 | .active-element-outline { |
14 | outline: #adff2f solid 2px; | 14 | outline: #adff2f solid 2px; |
15 | } | 15 | } |
16 | 16 | ||
17 | .nj-preset-transition { | 17 | .nj-preset-transition { |
diff --git a/js/document/templates/montage-web/index.html b/js/document/templates/montage-web/index.html index 90b0f7fd..c52a5394 100755 --- a/js/document/templates/montage-web/index.html +++ b/js/document/templates/montage-web/index.html | |||
@@ -42,7 +42,7 @@ | |||
42 | 42 | ||
43 | <body> | 43 | <body> |
44 | 44 | ||
45 | <div>IPSUM</div> | 45 | <!--<div>IPSUM</div>--> |
46 | 46 | ||
47 | </body> | 47 | </body> |
48 | 48 | ||
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index 67bb59c4..dae128e4 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js | |||
@@ -94,10 +94,10 @@ exports.NJUtils = Object.create(Object.prototype, { | |||
94 | ///// TODO: find a different place for this function | 94 | ///// TODO: find a different place for this function |
95 | makeElementModel: { | 95 | makeElementModel: { |
96 | value: function(el, selection, controller, isShape) { | 96 | value: function(el, selection, controller, isShape) { |
97 | //el.elementModel = Montage.create(ElementModel).initialize(el.nodeName, selection, controller, isShape); | ||
98 | |||
97 | var p3d = Montage.create(Properties3D); | 99 | var p3d = Montage.create(Properties3D); |
98 | if(selection === "Stage") { | 100 | |
99 | p3d.init(el, true); | ||
100 | } | ||
101 | var shapeProps = null; | 101 | var shapeProps = null; |
102 | var pi = controller + "Pi"; | 102 | var pi = controller + "Pi"; |
103 | 103 | ||
@@ -143,6 +143,7 @@ exports.NJUtils = Object.create(Object.prototype, { | |||
143 | isShape: { value: isShape} | 143 | isShape: { value: isShape} |
144 | }); | 144 | }); |
145 | 145 | ||
146 | |||
146 | } | 147 | } |
147 | }, | 148 | }, |
148 | 149 | ||
@@ -167,15 +168,12 @@ exports.NJUtils = Object.create(Object.prototype, { | |||
167 | break; | 168 | break; |
168 | case "canvas": | 169 | case "canvas": |
169 | isShape = el.getAttribute("data-RDGE-id"); | 170 | isShape = el.getAttribute("data-RDGE-id"); |