aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/data/pi/pi-data.js4
-rw-r--r--js/panels/Components/Components.xml22
-rw-r--r--js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js36
-rw-r--r--user-document-templates/montage-application-cloud/appdelegate.js48
4 files changed, 50 insertions, 60 deletions
diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js
index f162e919..189d1dae 100644
--- a/js/data/pi/pi-data.js
+++ b/js/data/pi/pi-data.js
@@ -505,6 +505,10 @@ exports.PiData = Montage.create( Montage, {
505 ] 505 ]
506 } 506 }
507 ] 507 ]
508 },
509
510 componentPi: {
511 value: []
508 } 512 }
509}); 513});
510 514
diff --git a/js/panels/Components/Components.xml b/js/panels/Components/Components.xml
index b3056330..e076602e 100644
--- a/js/panels/Components/Components.xml
+++ b/js/panels/Components/Components.xml
@@ -2,27 +2,5 @@
2<tree id="Components"> 2<tree id="Components">
3 <folder id="montageComponents" label="Montage Components"> 3 <folder id="montageComponents" label="Montage Components">
4 <leaf id="Button" label="Button" /> 4 <leaf id="Button" label="Button" />
5 <leaf id="Checkbox" label="Checkbox" />
6 <leaf id="DynamicText" label="Dynamic Text" />
7 <leaf id="FlowController" label="FlowController" />
8 <leaf id="HotText" label="HotText" />
9 <leaf id="HotTextUnit" label="HotTextUnit" />
10 <leaf id="ImageContainer" label="Image Container" />
11 <leaf id="Progress" label="Progress" />
12 <leaf id="Scrollview" label="Scrollview" />
13 <leaf id="Slider" label="Slider" />
14 <leaf id="TextArea" label="TextArea" />
15 <leaf id="Textfield" label="Textfield" />
16 <leaf id="Toggle" label="Toggle" />
17 </folder>
18 <folder id="metaComponents" label="Meta Components">
19 <leaf id="Condition" label="Condition" />
20 <leaf id="Repetition" label="Repetition" />
21 <leaf id="Slot" label="Slot" />
22 <leaf id="Substitution" label="Substitution" />
23 </folder>
24 <folder id="htmlPresets" label="HTML Components">
25 <leaf id="html_button" label="Button" />
26 <leaf id="html_input" label="Text Input" />
27 </folder> 5 </folder>
28</tree> \ No newline at end of file 6</tree> \ No newline at end of file
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
index 41afefa5..c8624b29 100644
--- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
+++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
@@ -59,15 +59,20 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
59 59
60 addComponentToStage:{ 60 addComponentToStage:{
61 value:function(componentType, dropX, dropY){ 61 value:function(componentType, dropX, dropY){
62 var compW = 100, 62// var compW = 100,
63 compH = 100, 63// compH = 100,
64 elementType = "div", 64// elementType = "div",
65 componentContainer, 65// componentContainer,
66 componentElement; 66// componentElement;
67 var componentEl;
67 68
68 if(componentType == "Button"){ 69 if(componentType == "Button"){
69 compW = 118; 70 componentEl = NJUtils.makeNJElement("button", componentType, "component");//, {"type": "button"});
70 compH = 52; 71 componentEl.setAttribute("type", "button");
72 componentEl.innerHTML = "Button";
73 console.log(componentEl);
74// compW = 118;
75// compH = 52;
71 }else if(componentType == "Checkbox"){ 76 }else if(componentType == "Checkbox"){
72 compW = 53; 77 compW = 53;
73 compH = 53; 78 compH = 53;
@@ -117,28 +122,31 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
117 compH = 25; 122 compH = 25;
118 } 123 }
119 124
125
126 /*
120 componentContainer = NJUtils.makeNJElement("div", componentType, "component"); 127 componentContainer = NJUtils.makeNJElement("div", componentType, "component");
121 componentContainer.elementModel.isComponent = true; 128 componentContainer.elementModel.isComponent = true;
122 129 */
123 var styles = { 130 var styles = {
124 'position': 'absolute', 131 'position': 'absolute',
125 'top' : dropY + 'px', 132 'top' : dropY + 'px',
126 'left' : dropX + 'px', 133 'left' : dropX + 'px',
127 'width' : compW + 'px', 134// 'width' : compW + 'px',
128 'height' : compH + 'px', 135// 'height' : compH + 'px',
129 '-webkit-transform-style' : 'preserve-3d', 136 '-webkit-transform-style' : 'preserve-3d',
130 '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)' 137 '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)'
131 }; 138 };
132 139
133 140
134 componentElement = NJUtils.makeNJElement(elementType, "ComponentDiv", "block"); 141 //componentElement = NJUtils.makeNJElement(elementType, "ComponentDiv", "block");
135
136 componentContainer.appendChild(componentElement);
137 142
138 NJevent("elementAdding", {"el": componentContainer, "data":styles}); 143 //componentContainer.appendChild(componentElement);
139 144
145 NJevent("elementAdding", {"el": componentEl, "data":styles});
146 /*
140 var componentRef = this.application.ninja.currentDocument._window.addComponent(componentElement, componentType); 147 var componentRef = this.application.ninja.currentDocument._window.addComponent(componentElement, componentType);
141 this.application.ninja.currentDocument._userComponentSet[componentContainer.uuid] = componentRef; 148 this.application.ninja.currentDocument._userComponentSet[componentContainer.uuid] = componentRef;
149 */
142 150
143 } 151 }
144 } 152 }
diff --git a/user-document-templates/montage-application-cloud/appdelegate.js b/user-document-templates/montage-application-cloud/appdelegate.js
index 64ce6f59..fad60394 100644
--- a/user-document-templates/montage-application-cloud/appdelegate.js
+++ b/user-document-templates/montage-application-cloud/appdelegate.js
@@ -7,30 +7,30 @@ 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,
8 Component = require("montage/ui/component").Component; 8 Component = require("montage/ui/component").Component;
9 9
10var Button = require("montage/ui/button.reel").Button, 10//var Button = ("montage/ui/button.reel").Button,
11 Checkbox = require("montage/ui/checkbox.reel").Checkbox, 11// Checkbox = ("montage/ui/checkbox.reel").Checkbox,
12 Condition = require("montage/ui/condition.reel").Condition, 12// Condition = ("montage/ui/condition.reel").Condition,
13 DynamicText = require("montage/ui/dynamic-text.reel").DynamicText, 13// DynamicText = ("montage/ui/dynamic-text.reel").DynamicText,
14 14//
15 FlowController = require("montage/ui/flow-controller.reel").FlowController, 15// FlowController = ("montage/ui/flow-controller.reel").FlowController,
16 16//
17 HotText = require("montage/ui/hottext.reel").HotText, 17// HotText = ("montage/ui/hottext.reel").HotText,
18 HotTextUnit = require("montage/ui/hottextunit.reel").HotTextUnit, 18// HotTextUnit = ("montage/ui/hottextunit.reel").HotTextUnit,
19 19//
20 ImageContainer = require("montage/ui/photo-editor.reel").PhotoEditor, 20// ImageContainer = ("montage/ui/photo-editor.reel").PhotoEditor,
21 Progress = require("montage/ui/progress.reel").Progress, 21// Progress = ("montage/ui/progress.reel").Progress,
22 22//
23 Repetition = require("montage/ui/repetition.reel").Repetition, 23// Repetition = ("montage/ui/repetition.reel").Repetition,
24 Scrollview = require("montage/ui/scrollview.reel").Scrollview, 24// Scrollview = ("montage/ui/scrollview.reel").Scrollview,
25 Slider = require("montage/ui/slider.reel").Slider, 25// Slider = ("montage/ui/slider.reel").Slider,
26 Slot = require("montage/ui/slot.reel").Slot, 26// Slot = ("montage/ui/slot.reel").Slot,
27 Substitution = require("montage/ui/substitution.reel").Substitution, 27// Substitution = ("montage/ui/substitution.reel").Substitution,
28 28//
29 TextArea = require("montage/ui/textarea.reel").TextArea, 29// TextArea = ("montage/ui/textarea.reel").TextArea,
30 Textfield = require("montage/ui/textfield.reel").Textfield, 30// Textfield = ("montage/ui/textfield.reel").Textfield,
31 31//
32 Toggle = require("montage/ui/toggle.reel").Toggle, 32// Toggle = ("montage/ui/toggle.reel").Toggle,
33 ToggleButton = require("montage/ui/button.reel").ToggleButton; 33// ToggleButton = ("montage/ui/button.reel").ToggleButton;
34 34
35exports.MyAppDelegate = Montage.create(Component, { 35exports.MyAppDelegate = Montage.create(Component, {
36 templateDidLoad: { 36 templateDidLoad: {