diff options
Diffstat (limited to 'js/panels/components-panel.reel')
-rwxr-xr-x | js/panels/components-panel.reel/components-panel.html | 18 | ||||
-rwxr-xr-x | js/panels/components-panel.reel/components-panel.js | 64 |
2 files changed, 37 insertions, 45 deletions
diff --git a/js/panels/components-panel.reel/components-panel.html b/js/panels/components-panel.reel/components-panel.html index f598a1ee..1a257957 100755 --- a/js/panels/components-panel.reel/components-panel.html +++ b/js/panels/components-panel.reel/components-panel.html | |||
@@ -1,4 +1,4 @@ | |||
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <!-- <copyright> | 2 | <!-- <copyright> |
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | 3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> |
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> |
@@ -12,8 +12,7 @@ | |||
12 | <script type="text/montage-serialization"> | 12 | <script type="text/montage-serialization"> |
13 | { | 13 | { |
14 | "owner": { | 14 | "owner": { |
15 | "module": "js/panels/components-panel.reel", | 15 | "prototype": "js/panels/components-panel.reel", |
16 | "name": "ComponentsPanel", | ||
17 | "properties": { | 16 | "properties": { |
18 | "element": {"#": "components_panel"}, | 17 | "element": {"#": "components_panel"}, |
19 | "controller": {"@": "componentsTree"} | 18 | "controller": {"@": "componentsTree"} |
@@ -21,8 +20,7 @@ | |||
21 | }, | 20 | }, |
22 | 21 | ||
23 | "componentsController" : { | 22 | "componentsController" : { |
24 | "module": "js/components/controllers/tree-controller", | 23 | "prototype": "js/components/controllers/tree-controller", |
25 | "name": "TreeController", | ||
26 | "properties" : { | 24 | "properties" : { |
27 | "branchKey" : "children", | 25 | "branchKey" : "children", |
28 | "labelKey" : "text", | 26 | "labelKey" : "text", |
@@ -37,8 +35,7 @@ | |||
37 | }, | 35 | }, |
38 | 36 | ||
39 | "componentsTree" : { | 37 | "componentsTree" : { |
40 | "module" : "js/components/treeview/treeview.reel", | 38 | "prototype" : "js/components/treeview/treeview.reel", |
41 | "name" : "Treeview", | ||
42 | "properties" : { | 39 | "properties" : { |
43 | "element" : {"#": "componentsContainer"}, | 40 | "element" : {"#": "componentsContainer"}, |
44 | "branchComponent" : {"@": "branch" }, | 41 | "branchComponent" : {"@": "branch" }, |
@@ -48,8 +45,7 @@ | |||
48 | }, | 45 | }, |
49 | 46 | ||
50 | "branch" : { | 47 | "branch" : { |
51 | "module" : "js/components/treeview/ninja-branch.reel", | 48 | "prototype" : "js/components/treeview/ninja-branch.reel[Branch]" |
52 | "name" : "Branch" | ||
53 | } | 49 | } |
54 | } | 50 | } |
55 | </script> | 51 | </script> |
@@ -57,8 +53,8 @@ | |||
57 | </head> | 53 | </head> |
58 | <body> | 54 | <body> |
59 | 55 | ||
60 | <div id="components_panel" class="components_panel"> | 56 | <div data-montage-id="components_panel" class="components_panel"> |
61 | <div id="componentsContainer"></div> | 57 | <div data-montage-id="componentsContainer"></div> |
62 | </div> | 58 | </div> |
63 | 59 | ||
64 | </body> | 60 | </body> |
diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 79eac37b..4169423b 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js | |||
@@ -317,81 +317,77 @@ exports.ComponentsPanel = Montage.create(Component, { | |||
317 | 317 | ||
318 | switch(name) { | 318 | switch(name) { |
319 | case "anchor": | 319 | case "anchor": |
320 | el = NJUtils.makeNJElement("a", "Anchor", "component"); | 320 | el = document.application.njUtils.make("a", null, this.application.ninja.currentDocument); |
321 | el.elementModel.pi = "AnchorPi"; | 321 | document.application.njUtils.createModelForComponent(el, "Anchor"); |
322 | el.setAttribute("href", "http://www.motorola.com"); | 322 | el.setAttribute("href", "http://www.motorola.com"); |
323 | el.innerHTML = "link"; | 323 | el.innerHTML = "link"; |
324 | break; | 324 | break; |
325 | case "button": | 325 | case "button": |
326 | el = NJUtils.makeNJElement(name, "Button", "component"); | 326 | el = document.application.njUtils.make(name, null, this.application.ninja.currentDocument); |
327 | el.elementModel.pi = "ButtonPi"; | 327 | document.application.njUtils.createModelForComponent(el, "Button"); |
328 | el.setAttribute("type", "button"); | 328 | el.setAttribute("type", "button"); |
329 | el.innerHTML = "Button"; | 329 | el.innerHTML = "Button"; |
330 | break; | 330 | break; |
331 | case "checkbox": | 331 | case "checkbox": |
332 | el = NJUtils.makeNJElement("input", "Checkbox", "component"); | 332 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
333 | el.elementModel.pi = "CheckboxPi"; | 333 | document.application.njUtils.createModelForComponent(el, "Checkbox"); |
334 | el.setAttribute("type", "checkbox"); | 334 | el.setAttribute("type", "checkbox"); |
335 | break; | 335 | break; |
336 | case "imageComponent": | 336 | case "imageComponent": |
337 | el = NJUtils.makeNJElement("image", "Image", "component"); | 337 | el = document.application.njUtils.make("image", null, this.application.ninja.currentDocument); |
338 | el.elementModel.pi = "ImagePi"; | 338 | document.application.njUtils.createModelForComponent(el, "Image"); |
339 | el.setAttribute("width", 200); | 339 | el.setAttribute("width", 200); |
340 | el.setAttribute("height", 200); | 340 | el.setAttribute("height", 200); |
341 | break; | 341 | break; |
342 | case "numberInput": | 342 | case "numberInput": |
343 | el = NJUtils.makeNJElement("input", "Number Input", "component"); | 343 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
344 | el.elementModel.pi = "NumberInputPi"; | 344 | document.application.njUtils.createModelForComponent(el, "Number Input"); |
345 | el.setAttribute("type", "number"); | 345 | el.setAttribute("type", "number"); |
346 | break; | 346 | break; |
347 | case "select": | 347 | case "select": |
348 | el = NJUtils.makeNJElement("select", "Select", "component"); | 348 | el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument); |
349 | el.elementModel.pi = "SelectInputPi"; | 349 | document.application.njUtils.createModelForComponent(el, "Select"); |
350 | break; | 350 | break; |
351 | case "radioButton": | 351 | case "radioButton": |
352 | el = NJUtils.makeNJElement("input", "Radio Button", "component"); | 352 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
353 | el.elementModel.pi = "RadioButtonPi"; | 353 | document.application.njUtils.createModelForComponent(el, "Radio Button"); |
354 | el.setAttribute("type", "radio"); | 354 | el.setAttribute("type", "radio"); |
355 | break; | 355 | break; |
356 | case "rangeInput": | 356 | case "rangeInput": |
357 | el = NJUtils.makeNJElement("input", "Range Input", "component"); | 357 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
358 | el.elementModel.pi = "RangeInputPi"; | 358 | document.application.njUtils.createModelForComponent(el, "Range Input"); |
359 | el.setAttribute("type", "range"); | 359 | el.setAttribute("type", "range"); |
360 | break; | 360 | break; |
361 | case "textfield": | 361 | case "textfield": |
362 | case "searchfield": | 362 | case "searchfield": |
363 | el = NJUtils.makeNJElement("input", "Textfield", "component"); | 363 | el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); |
364 | el.elementModel.pi = "TextfieldPi"; | 364 | document.application.njUtils.createModelForComponent(el, "Textfield"); |
365 | el.setAttribute("type", "text"); | 365 | el.setAttribute("type", "text"); |
366 | break; | 366 | break; |
367 | case "textarea": | 367 | case "textarea": |
368 | el = NJUtils.makeNJElement("textarea", "TextArea", "component"); | 368 | el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument); |
369 | el.elementModel.pi = "TextareaPi"; | 369 | document.application.njUtils.createModelForComponent(el, "TextArea"); |
370 | break; | 370 | break; |
371 | case "toggleButton": | 371 | case "toggleButton": |
372 | el = NJUtils.makeNJElement("button", "Toggle Button", "component"); | 372 | el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument); |
373 | el.elementModel.pi = "ToggleButtonPi"; | 373 | document.application.njUtils.createModelForComponent(el, "Toggle Button"); |
374 | el.innerHTML = "Off"; | 374 | el.innerHTML = "Off"; |
375 | break; | 375 | break; |
376 | case "map": | 376 | case "map": |
377 | el = NJUtils.makeNJElement("div", "Map", "component"); | 377 | el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); |
378 | el.elementModel.pi = "MapPi"; | 378 | document.application.njUtils.createModelForComponent(el, "Map"); |
379 | el.elementModel.isComponent = true; | ||
380 | break; | 379 | break; |
381 | case "feedreader": | 380 | case "feedreader": |
382 | el = NJUtils.makeNJElement("div", "Feed Reader", "component"); | 381 | el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); |