aboutsummaryrefslogtreecommitdiff
path: root/user-document-templates/montage-application-cloud
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-15 16:09:47 -0800
committerValerio Virgillito2012-02-15 16:09:47 -0800
commitd366c0bd1af6471511217ed574083e15059519b5 (patch)
treec8c9f9af761457e3c5f4c6774fb0fbba851df0c4 /user-document-templates/montage-application-cloud
parent997ce3fb65f27b3d6f331f63b5dc22d3c7fb8f1e (diff)
parentb85bfb54aaca3ccca3c1ef09115de925cd67f4e9 (diff)
downloadninja-d366c0bd1af6471511217ed574083e15059519b5.tar.gz
Merge branch 'refs/heads/integration'
Diffstat (limited to 'user-document-templates/montage-application-cloud')
-rw-r--r--user-document-templates/montage-application-cloud/appdelegate.js162
-rwxr-xr-x[-rw-r--r--]user-document-templates/montage-application-cloud/default_html.css0
-rwxr-xr-x[-rw-r--r--]user-document-templates/montage-application-cloud/index.html15
-rw-r--r--user-document-templates/montage-application-cloud/main.reel/main.js55
-rwxr-xr-x[-rw-r--r--]user-document-templates/montage-application-cloud/package.json0
-rwxr-xr-x[-rw-r--r--]user-document-templates/montage-application-cloud/styles.css0
6 files changed, 63 insertions, 169 deletions
diff --git a/user-document-templates/montage-application-cloud/appdelegate.js b/user-document-templates/montage-application-cloud/appdelegate.js
deleted file mode 100644
index 3c21b46e..00000000
--- a/user-document-templates/montage-application-cloud/appdelegate.js
+++ /dev/null
@@ -1,162 +0,0 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No 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
7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component;
9
10exports.MyAppDelegate = Montage.create(Component, {
11 templateDidLoad: {
12 value: function(){
13 window.addComponent = this.addComponentToUserDocument;
14 window.addBinding = this.addBindingToUserDocument;
15
16 var newEvent = document.createEvent( "CustomEvent" );
17 newEvent.initCustomEvent( "userTemplateDidLoad", false, true );
18
19 document.body.dispatchEvent( newEvent );
20
21 }
22 },
23
24 addComponentToUserDocument:{
25 value:function(containerElement, componentType){
26 var component = null;
27 switch(componentType){
28 case "Button":
29 component = Button.create();
30 component.element = containerElement;
31 component.element.classList.add("text");
32 component.value = "Button";
33 component.needsDraw = true;
34 break;
35 case "Checkbox":
36 component = Checkbox.create();
37 component.element = containerElement;
38 component.needsDraw = true;
39 break;
40 case "Condition":
41 component = Condition.create();
42 component.element = containerElement;
43 component.needsDraw = true;
44 break;
45 case "DynamicText":
46 component = DynamicText.create();
47 component.element = containerElement;
48 component.value = "Label";
49 component.needsDraw = true;
50 break;
51 case "HotText":
52 component = HotText.create();
53 component.element = containerElement;
54 component.needsDraw = true;
55 break;
56 case "HotTextUnit":
57 component = HotTextUnit.create();
58 component.element = containerElement;
59 component.needsDraw = true;
60 break;
61 case "FlowController":
62 component = FlowController.create();
63 component.element = containerElement;
64 component.needsDraw = true;
65 break;
66 case "ImageContainer":
67 component = ImageContainer.create();
68 component.element = containerElement;
69 component.element.style.width = "285px";
70 component.element.style.height = "235px";
71 component.src = "placeholder.jpg";
72 component.needsDraw = true;
73 break;
74 case "Progress":
75 component = Progress.create();
76 component.element = containerElement;
77 component.loading = true;
78 component.needsDraw = true;
79 break;
80 case "Repetition":
81 component = Repetition.create();
82 component.element = containerElement;
83 component.needsDraw = true;
84 break;
85 case "Scrollview":
86 component = Scrollview.create();
87 component.element = containerElement;
88 component.element.style.width = "200px";
89 component.element.style.height = "200px";
90 var dummyContent = document.createElement("div");
91 dummyContent.innerHTML = "<img src='image3.jpg'/>";
92 component.element.appendChild(dummyContent);
93 component.needsDraw = true;
94 break;
95 case "Slider":
96 component = Slider.create();
97 component.element = containerElement;
98// component.value = 0;
99// component._minValue = 0;
100// component._maxValue = 100;
101 component.needsDraw = true;
102 break;
103 case "Slot":
104 component = Slot.create();
105 component.element = containerElement;
106 component.needsDraw = true;
107 break;
108 case "Substitution":
109 component = Substitution.create();
110 component.element = containerElement;
111 component.needsDraw = true;
112 break;
113 case "TextArea":
114 component = TextArea.create();
115 component.element = containerElement;
116 component.needsDraw = true;
117 break;
118 case "Textfield":
119 component = Textfield.create();
120 component.element = containerElement;
121 component.needsDraw = true;
122 break;
123 case "Toggle":
124 component = Toggle.create();
125 component.element = containerElement;
126 component.needsDraw = true;
127 break;
128 case "ToggleButton":
129 component = ToggleButton.create();
130 component.element = containerElement;
131 component.element.classList.add("text");
132 component.needsDraw = true;
133 break;
134 default:
135 console.log("Unrecognized component type");
136 }
137 //console.log(component);
138 return component;
139 }
140 },
141 addBindingToUserDocument:{
142 value:function(boundComponent, boundValue, targetComponent, targetValue){
143 if(targetComponent[targetValue] != undefined && boundComponent[boundValue] != undefined){
144 Object.defineBinding(boundComponent, boundValue, {
145 boundObject: targetComponent,
146 boundObjectPropertyPath: targetValue,
147 boundValueMutator: function(value) {
148 return(value);
149 }
150 });
151 } else {
152 if(targetComponent[targetValue] == undefined){
153 console.log("Binding Fail - Component Property Not Found: " + targetValue);
154 alert("Binding Failed - Component Property Not Found: " + targetValue)
155 } else if(boundComponent[boundValue] == undefined){
156 console.log("Binding Fail - Component Property Not Found: " + boundValue);
157 alert("Binding Failed - Component Property Not Found: " + boundValue);
158 }
159 }
160 }
161 }
162}); \ No newline at end of file
diff --git a/user-document-templates/montage-application-cloud/default_html.css b/user-document-templates/montage-application-cloud/default_html.css
index 68300edf..68300edf 100644..100755
--- a/user-document-templates/montage-application-cloud/default_html.css
+++ b/user-document-templates/montage-application-cloud/default_html.css
diff --git a/user-document-templates/montage-application-cloud/index.html b/user-document-templates/montage-application-cloud/index.html
index d1f9634d..49931969 100644..100755
--- a/user-document-templates/montage-application-cloud/index.html
+++ b/user-document-templates/montage-application-cloud/index.html
@@ -4,6 +4,7 @@
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/>
5 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 5 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
6 </copyright> --> 6 </copyright> -->
7
7<html> 8<html>
8 9
9 <head> 10 <head>
@@ -24,8 +25,8 @@
24 <script type="text/montage-serialization"> 25 <script type="text/montage-serialization">
25 { 26 {
26 "owner": { 27 "owner": {
27 "module": "./appdelegate", 28 "module": "main.reel",
28 "name": "MyAppDelegate" 29 "name": "Main"
29 } 30 }
30 } 31 }</