aboutsummaryrefslogtreecommitdiff
path: root/js/panels/properties/sections/custom.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/properties/sections/custom.reel')
-rwxr-xr-xjs/panels/properties/sections/custom.reel/custom.html61
-rwxr-xr-xjs/panels/properties/sections/custom.reel/custom.js351
2 files changed, 0 insertions, 412 deletions
diff --git a/js/panels/properties/sections/custom.reel/custom.html b/js/panels/properties/sections/custom.reel/custom.html
deleted file mode 100755
index 6d4cf0cd..00000000
--- a/js/panels/properties/sections/custom.reel/custom.html
+++ /dev/null
@@ -1,61 +0,0 @@
1<!DOCTYPE HTML>
2<!-- <copyright>
3This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4No 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.
6</copyright> -->
7<html>
8<head>
9 <title></title>
10 <script type="text/montage-serialization">
11 {
12 "owner": {
13 "module" : "js/panels/properties/sections/custom.reel",
14 "name" : "CustomSection",
15 "properties" : {
16 "element" : {"#": "section"},
17 "repeat" : {"@": "repeat"}
18 }
19 },
20
21 "repeat": {
22 "module": "montage/ui/repetition.reel",
23 "name": "Repetition",
24 "properties": {
25 "element" : {"#": "repetitionContainer"}
26 },
27 "bindings": {
28 "objects": {
29 "boundObject": {"@": "owner"},
30 "boundObjectPropertyPath": "rows",
31 "oneway": true
32 }
33 }
34 },
35
36 "slot": {
37 "module": "montage/ui/slot.reel",
38 "name": "Slot",
39 "properties": {
40 "element": { "#": "repeitionContent" }
41 },
42 "bindings": {
43 "content": {
44 "boundObject": {"@": "repeat"},
45 "boundObjectPropertyPath": "objectAtCurrentIteration",
46 "oneway": true
47 }
48 }
49 }
50
51 }
52 </script>
53</head>
54<body>
55 <div id="section" class="sectional">
56 <div id="repetitionContainer">
57 <div id="repeitionContent"></div>
58 </div>
59 </div>
60</body>
61</html> \ No newline at end of file
diff --git a/js/panels/properties/sections/custom.reel/custom.js b/js/panels/properties/sections/custom.reel/custom.js
deleted file mode 100755
index a2b9b9fa..00000000
--- a/js/panels/properties/sections/custom.reel/custom.js
+++ /dev/null
@@ -1,351 +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;
8var Component = require("montage/ui/component").Component;
9var ElementsMediator = require("js/mediators/element-mediator").ElementMediator;
10
11//Custom Rows
12var SingleRow = require("js/panels/properties/sections/custom-rows/single-row.reel").SingleRow;
13var DualRow = require("js/panels/properties/sections/custom-rows/dual-row.reel").DualRow;
14var ColorSelect = require("js/panels/properties/sections/custom-rows/color-select.reel").ColorSelect;
15
16// Components Needed to make this work
17var Hottext = require("js/components/hottextunit.reel").HotTextUnit;
18var Dropdown = require("js/components/combobox.reel").Combobox;
19var TextField = require("js/components/textfield.reel").TextField;
20var FileInput = require("js/components/ui/file-input.reel").FileInput;
21var Checkbox = require("js/components/checkbox.reel").Checkbox;
22var ColorChip = require("js/components/ui/color-chip.reel").ColorChip;
23
24exports.CustomSection = Montage.create(Component, {
25
26 repeat: {
27 value: null
28 },
29
30 _fields: {
31
32 },
33
34 fields: {
35 get: function() {
36 return this._fields;
37 },
38 set: function(val) {
39 this.controls = {};
40 this.rows = [];
41 this._fields = val;
42 for(var i=0; i < this._fields.length; i++) {
43 var tmpRow, fields;
44 if(this._fields[i].length === 1) {
45 fields = this._fields[i][0];
46 tmpRow = SingleRow.create();
47 tmpRow.content = this.generateObject(fields);
48 if (fields.label) tmpRow.label = fields.label;
49 if (fields.divider) tmpRow.divider = fields.divider;
50 this.rows.push(tmpRow);
51 } else if(this._fields[i].length === 2) {
52
53 var obj1 = this._fields[i][0];
54 var obj2 = this._fields[i][1];
55
56
57 if (obj1.type == "color" && obj2.type == "color") {
58 tmpRow = Montage.create(ColorSelect);
59 if(obj1.visible === false) tmpRow.colorVisible = obj1.visible;
60 if(obj2.visible === false) tmpRow.color2Visible = obj2.visible;
61
62 }
63 else
64 {
65 tmpRow = DualRow.create();
66 if (obj1.label) tmpRow.label = obj1.label;
67 if (obj2.label) tmpRow.label2 = obj2.label;
68 tmpRow.content = this.generateObject(obj1);
69 tmpRow.content2 = this.generateObject(obj2);
70 }
71
72 if (obj1.divider === true || obj2.divider === true) tmpRow.divider = true;
73 this.rows.push(tmpRow);
74
75 } else if(this._fields[i].length === 3) {
76
77 }
78
79 }
80 }
81
82 },
83
84 rows: {
85 value: []
86 },
87
88 controls: {
89 value:{}
90 },
91
92 handleChanging: {
93 value:function(event) {
94 var obj = event.currentTarget;
95 this._dispatchPropEvent({"type": "changing", "id": obj.id, "prop": obj.prop, "value": obj.value, "control": obj});
96 }
97 },
98
99 handleChange: {
100 value:function(event) {
101 if(event._event.wasSetByCode) return;
102
103 var obj = event.currentTarget;
104 this._dispatchPropEvent({"type": "change", "id": obj.id, "prop": obj.prop, "value": obj.value, "control": obj});
105 }
106 },
107
108 /**
109 * Color change handler. Hard coding the stage for now since only the stage PI uses this color chip
110 */
111 handleColorChange: {
112 value: function(event) {
113 // Change the stage color for now
114 //console.log(this, event);
115 ElementsMediator.setProperty([this.application.ninja.currentDocument.documentRoot], this.id, [event._event.color.css], "Change", "pi", '');
116 /*
117 var propEvent = document.createEvent("CustomEvent");
118 propEvent.initEvent("propertyChange", true, true);
119 propEvent.type = "propertyChange";
120
121 propEvent.prop = "background";//event.prop;
122 propEvent.value = event._event.color.css;
123
124 this.dispatchEvent(propEvent);
125 */
126 }
127 },
128
129 _dispatchPropEvent: {
130 value: function(event) {
131// console.log(event);
132 var propEvent = document.createEvent("CustomEvent");
133 if(event.type === "changing")
134 {
135 propEvent.initEvent("propertyChanging", true, true);
136 propEvent.type = "propertyChanging";
137 }
138 else
139 {
140 propEvent.initEvent("propertyChange", true, true);
141 propEvent.type = "propertyChange";
142 }
143
144 propEvent.id = event.id;
145 propEvent.prop = event.prop;
146 propEvent.text = event.text;
147 propEvent.value = event.value;
148
149 event.control.units ? propEvent.units = event.control.units : propEvent.units = "";
150
151 this.dispatchEvent(propEvent);
152 }