diff options
20 files changed, 350 insertions, 130 deletions
diff --git a/js/components/ui/property-control.reel/property-control.js b/js/components/ui/property-control.reel/property-control.js index 58b1be9f..cd59c02c 100755 --- a/js/components/ui/property-control.reel/property-control.js +++ b/js/components/ui/property-control.reel/property-control.js | |||
@@ -9,7 +9,7 @@ var Montage = require("montage/core/core").Montage, | |||
9 | HotText = require("js/components/hottext.reel").HotText, | 9 | HotText = require("js/components/hottext.reel").HotText, |
10 | HotTextUnit = require("js/components/hottextunit.reel").HotTextUnit, | 10 | HotTextUnit = require("js/components/hottextunit.reel").HotTextUnit, |
11 | Slider = require("js/components/slider.reel").Slider, | 11 | Slider = require("js/components/slider.reel").Slider, |
12 | Button = require("js/components/button.reel").Button, | 12 | Button = require("montage/ui/button.reel").Button, |
13 | Checkbox = require("js/components/checkbox.reel").Checkbox, | 13 | Checkbox = require("js/components/checkbox.reel").Checkbox, |
14 | Combobox = require("js/components/combobox.reel").Combobox, | 14 | Combobox = require("js/components/combobox.reel").Combobox, |
15 | TextField = require("js/components/TextField.reel").TextField, | 15 | TextField = require("js/components/TextField.reel").TextField, |
diff --git a/js/components/ui/tree-basic/treeItem.reel/treeItem.js b/js/components/ui/tree-basic/treeItem.reel/treeItem.js index a67dad43..13e278e9 100755 --- a/js/components/ui/tree-basic/treeItem.reel/treeItem.js +++ b/js/components/ui/tree-basic/treeItem.reel/treeItem.js | |||
@@ -107,8 +107,8 @@ exports.TreeItem = Montage.create(Component, { | |||
107 | //icon or text click sends selection event | 107 | //icon or text click sends selection event |
108 | var contentEls = this.element.querySelectorAll(".atreeItemContent"); | 108 | var contentEls = this.element.querySelectorAll(".atreeItemContent"); |
109 | for(var i=0;i<contentEls.length;i++){ | 109 | for(var i=0;i<contentEls.length;i++){ |
110 | contentEls[i].addEventListener("click", function(evt){that.handleTreeItemContentClick(evt);}, false); | 110 | contentEls[i].addEventListener("click", function(evt){that.handleTreeItemContentClick(evt);}, true); |
111 | contentEls[i].addEventListener("dblclick", function(evt){that.handleTreeItemContentDblclick(evt);}, false); | 111 | contentEls[i].addEventListener("dblclick", function(evt){that.handleTreeItemContentDblclick(evt);}, true); |
112 | } | 112 | } |
113 | 113 | ||
114 | this.element.addEventListener("mouseover", function(evt){that.handleTreeItemMouseover(evt);}, false); | 114 | this.element.addEventListener("mouseover", function(evt){that.handleTreeItemMouseover(evt);}, false); |
@@ -123,7 +123,7 @@ exports.TreeItem = Montage.create(Component, { | |||
123 | if(this.treeItemData.modifiedDate){this.metadata = this.metadata + "<br />" + "Modified date: "+ this.formatTimestamp(this.treeItemData.modifiedDate);} | 123 | if(this.treeItemData.modifiedDate){this.metadata = this.metadata + "<br />" + "Modified date: "+ this.formatTimestamp(this.treeItemData.modifiedDate);} |
124 | 124 | ||
125 | if((this.treeItemData.type === "directory") && (this.expandAfterDraw === true)){ | 125 | if((this.treeItemData.type === "directory") && (this.expandAfterDraw === true)){ |
126 | this.toggleContent(this.treeArrow); | 126 | this.expand(this.treeArrow); |
127 | } | 127 | } |
128 | if(this.treeItemData.uri === this.highlightedUri){ | 128 | if(this.treeItemData.uri === this.highlightedUri){ |
129 | this.itemName.classList.add("selected"); | 129 | this.itemName.classList.add("selected"); |
@@ -171,6 +171,35 @@ exports.TreeItem = Montage.create(Component, { | |||
171 | } | 171 | } |
172 | }, | 172 | }, |
173 | 173 | ||
174 | expand:{ | ||
175 | writable:false, | ||
176 | enumerable:true, | ||
177 | value:function(el){ | ||
178 | //if children already drawn then just hide/show | ||
179 | if(this.element.getElementsByTagName("ul").length > 0){ | ||
180 | var theParent = this.element.getElementsByTagName("ul")[0].parentNode; | ||
181 | if(theParent.classList.contains("hideTree")){//collapsed | ||
182 | theParent.classList.remove("hideTree");//expand | ||
183 | el.innerHTML = "▼"; | ||
184 | } | ||
185 | } | ||
186 | //else send event to draw the children | ||
187 | else{ | ||
188 | var treeClickEvent = document.createEvent("Events"); | ||
189 | treeClickEvent.initEvent("drawTree", false, false); | ||
190 | treeClickEvent.uri = this.treeItemData.uri; | ||
191 | treeClickEvent.uriType = this.treeItemData.type; | ||
192 | var divEl = document.createElement("div"); | ||
193 | this.element.appendChild(divEl); | ||
194 | treeClickEvent.subTreeContainer = divEl; | ||
195 | this.element.dispatchEvent(treeClickEvent); | ||
196 | |||
197 | el.innerHTML = "▼"; | ||
198 | } | ||
199 | } | ||
200 | }, | ||
201 | |||
202 | |||
174 | /** | 203 | /** |
175 | * Event Listeners | 204 | * Event Listeners |
176 | */ | 205 | */ |
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 70aba54e..b35251ad 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js | |||
@@ -228,22 +228,6 @@ var ElementController = exports.ElementController = Montage.create(NJComponent, | |||
228 | mat = this.transformStringToMat( xformStr ); | 228 | mat = this.transformStringToMat( xformStr ); |
229 | if (!mat) | 229 | if (!mat) |
230 | mat = Matrix.I(4); | 230 | mat = Matrix.I(4); |
231 | |||
232 | var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom"); | ||
233 | if (zoom) | ||
234 | { | ||
235 | zoom = Number(zoom); | ||
236 | if (zoom != 1) | ||
237 | { | ||
238 | var zoomMat = Matrix.create( [ | ||
239 | [ zoom, 0, 0, 0], | ||
240 | [ 0, zoom, 0, 0], | ||
241 | [ 0, 0, zoom, 0], | ||
242 | [ 0, 0, 0, 1] | ||
243 | ] ); | ||
244 | glmat4.multiply( zoomMat, mat, mat ); | ||
245 | } | ||
246 | } | ||
247 | } | 231 | } |
248 | 232 | ||
249 | el.elementModel.props3D.matrix3d = mat; | 233 | el.elementModel.props3D.matrix3d = mat; |
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index d72d9c14..b3ac9ddb 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -6,10 +6,9 @@ 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 | CanvasController = require("js/controllers/elements/canvas-controller").CanvasController, | 8 | CanvasController = require("js/controllers/elements/canvas-controller").CanvasController, |
9 | njModule = require("js/lib/NJUtils"); | 9 | njModule = require("js/lib/NJUtils"), |
10 | 10 | World = require("js/lib/drawing/world").World, | |
11 | var World = require("js/lib/drawing/world").World; | 11 | MaterialsModel = require("js/models/materials-model").MaterialsModel; |
12 | var MaterialsModel = require("js/models/materials-model").MaterialsModel; | ||
13 | 12 | ||
14 | exports.ShapesController = Montage.create(CanvasController, { | 13 | exports.ShapesController = Montage.create(CanvasController, { |
15 | 14 | ||
@@ -100,6 +99,12 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
100 | el.elementModel.shapeModel.GLWorld.render(); | 99 | el.elementModel.shapeModel.GLWorld.render(); |
101 | } | 100 | } |
102 | break; | 101 | break; |
102 | case "editStrokeMaterial": | ||
103 | NJevent("showMaterialPopup",{materialId : el.elementModel.shapeModel.strokeMaterial.getName()}); | ||
104 | break; | ||
105 | case "editFillMaterial": | ||
106 | NJevent("showMaterialPopup",{materialId : el.elementModel.shapeModel.fillMaterial.getName()}); | ||
107 | break; | ||
103 | default: | 108 | default: |
104 | CanvasController.setProperty(el, p, value); | 109 | CanvasController.setProperty(el, p, value); |
105 | } | 110 | } |
diff --git a/js/controllers/elements/stage-controller.js b/js/controllers/elements/stage-controller.js index 34bb1fb5..97ea3aa5 100755 --- a/js/controllers/elements/stage-controller.js +++ b/js/controllers/elements/stage-controller.js | |||
@@ -129,5 +129,46 @@ exports.StageController = Montage.create(ElementController, { | |||
129 | value: function(el, rule, selector) { | 129 | value: function(el, rule, selector) { |
130 | el.elementModel.transitionStopRule.selectorText = selector; | 130 | el.elementModel.transitionStopRule.selectorText = selector; |
131 | } | 131 | } |
132 | }, | ||
133 | |||
134 | getMatrix: { | ||
135 | value: function(el) { | ||
136 | if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.matrix3d) | ||
137 | { | ||
138 | return el.elementModel.props3D.matrix3d.slice(0); | ||
139 | } | ||
140 | else | ||
141 | { | ||
142 | var mat; | ||
143 | |||
144 | if (el) | ||
145 | { | ||
146 | var xformStr = this.application.ninja.elementMediator.getProperty(el, "-webkit-transform"); | ||
147 | if (xformStr) | ||
148 | mat = this.transformStringToMat( xformStr ); | ||
149 | if (!mat) | ||
150 | mat = Matrix.I(4); | ||
151 | |||
152 | var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom"); | ||
153 | if (zoom) | ||
154 | { | ||
155 | zoom = Number(zoom); | ||
156 | if (zoom != 1) | ||
157 | { | ||
158 | var zoomMat = Matrix.create( [ | ||
159 | [ zoom, 0, 0, 0], | ||
160 | [ 0, zoom, 0, 0], | ||
161 | [ 0, 0, zoom, 0], | ||
162 | [ 0, 0, 0, 1] | ||
163 | ] ); | ||
164 | glmat4.multiply( zoomMat, mat, mat ); | ||
165 | } | ||
166 |