aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.html23
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js98
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js.orig1057
-rw-r--r--js/panels/Timeline/Style.reel/Style.js34
4 files changed, 1200 insertions, 12 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html
index 44022211..717306a0 100644
--- a/js/panels/Timeline/Layer.reel/Layer.html
+++ b/js/panels/Timeline/Layer.reel/Layer.html
@@ -22,7 +22,12 @@
22 "positionCollapser" : {"@" : "positionCollapser"}, 22 "positionCollapser" : {"@" : "positionCollapser"},
23 "styleCollapser" : {"@" : "styleCollapser"}, 23 "styleCollapser" : {"@" : "styleCollapser"},
24 "clickerMain" : {"#" : "clicker-main"}, 24 "clickerMain" : {"#" : "clicker-main"},
25 "myLabel" : {"#" : "myLabel"} 25 "myLabel" : {"#" : "myLabel"},
26 "leftControl": {"@" : "dtext_position_x"},
27 "topControl": {"@" : "dtext_position_y"},
28 "widthControl": {"@" : "dtext_scale_x"},
29 "heightControl": {"@" : "dtext_scale_y"},
30 "styleType":{"@" : "style"}
26 } 31 }
27 }, 32 },
28 "dtext1" : { 33 "dtext1" : {
@@ -148,10 +153,10 @@
148 "prototype": "js/components/hottextunit.reel[HotTextUnit]", 153 "prototype": "js/components/hottextunit.reel[HotTextUnit]",
149 "properties": { 154 "properties": {
150 "element": {"#": "scale-x"}, 155 "element": {"#": "scale-x"},
151 "maxValue" : 100, 156 "maxValue" : 100000,
152 "minValue" : 0, 157 "minValue" : -100000,
153 "acceptableUnits" : "%", 158 "acceptableUnits" : "px",
154 "units" : "%", 159 "units" : "px",
155 "value" : 0 160 "value" : 0
156 }, 161 },
157 "bindings": { 162 "bindings": {
@@ -166,10 +171,10 @@
166 "prototype": "js/components/hottextunit.reel[HotTextUnit]", 171 "prototype": "js/components/hottextunit.reel[HotTextUnit]",
167 "properties": { 172 "properties": {
168 "element": {"#": "scale-y"}, 173 "element": {"#": "scale-y"},
169 "maxValue" : 100, 174 "maxValue" : 100000,
170 "minValue" : 0, 175 "minValue" : -100000,
171 "acceptableUnits" : "%", 176 "acceptableUnits" : "px",
172 "units" : "%", 177 "units" : "px",
173 "value" : 0 178 "value" : 0
174 }, 179 },
175 "bindings": { 180 "bindings": {
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index db4ad712..77db9b64 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -12,6 +12,7 @@ var LayerStyle = require("js/panels/Timeline/Style.reel").LayerStyle;
12var DynamicText = require("montage/ui/dynamic-text.reel").DynamicText; 12var DynamicText = require("montage/ui/dynamic-text.reel").DynamicText;
13var defaultEventManager = require("montage/core/event/event-manager").defaultEventManager; 13var defaultEventManager = require("montage/core/event/event-manager").defaultEventManager;
14var nj = require("js/lib/NJUtils").NJUtils; 14var nj = require("js/lib/NJUtils").NJUtils;
15var ElementsMediator = require("js/mediators/element-mediator").ElementMediator;
15 16
16var Layer = exports.Layer = Montage.create(Component, { 17var Layer = exports.Layer = Montage.create(Component, {
17 18
@@ -203,7 +204,6 @@ var Layer = exports.Layer = Montage.create(Component, {
203 this._dtextPositionX = value; 204 this._dtextPositionX = value;
204 this.layerData.dtextPositionX = value; 205 this.layerData.dtextPositionX = value;
205 } 206 }
206
207 } 207 }
208 }, 208 },
209 209
@@ -526,6 +526,7 @@ var Layer = exports.Layer = Montage.create(Component, {
526 this.element.addEventListener("drop", this.handleDrop.bind(this), false); 526 this.element.addEventListener("drop", this.handleDrop.bind(this), false);
527 } 527 }
528 }, 528 },
529
529 draw: { 530 draw: {
530 value: function() { 531 value: function() {
531 var boolHasClass = this.element.classList.contains("layerSelected"); 532 var boolHasClass = this.element.classList.contains("layerSelected");
@@ -636,6 +637,7 @@ var Layer = exports.Layer = Montage.create(Component, {
636 defaultEventManager.dispatchEvent(newEvent); 637 defaultEventManager.dispatchEvent(newEvent);
637 } 638 }
638 }, 639 },
640
639 deleteStyle : { 641 deleteStyle : {
640 value: function() { 642 value: function() {
641 var newEvent = document.createEvent("CustomEvent"), 643 var newEvent = document.createEvent("CustomEvent"),
@@ -884,6 +886,100 @@ var Layer = exports.Layer = Montage.create(Component, {
884 return false; 886 return false;
885 } 887 }
886 }, 888 },
889
890 handleLeftChange:{
891 value:function(){
892 this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "left", [this.dtextPositionX + "px"] , "Change", "timeline");
893 }
894 },
895
896 handleTopChange:{
897 value:function(){
898 this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "top", [this.dtextPositionY + "px"] , "Change", "timeline");
899 }
900 },
901
902 handleWidthChange:{
903 value:function(){
904 this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "width", [this.dtextScaleX + "px"] , "Change", "timeline");
905 }
906 },
907
908 handleHeightChange:{
909 value:function(){
910 this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "height", [this.dtextScaleY + "px"] , "Change", "timeline");
911 }
912 },
913
914 handleLeftChanging:{
915 value:function(){
916 this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "left", [this.dtextPositionX + "px"] , "Changing", "timeline");
917 }
918 },
919
920 handleTopChanging:{
921 value:function(){
922 this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "top", [this.dtextPositionY + "px"] , "Changing", "timeline");
923 }
924 },
925
926 handleWidthChanging:{
927 value:function(){
928 this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "width", [this.dtextScaleX + "px"] , "Changing", "timeline");
929 }
930 },
931
932 handleHeightChanging:{
933 value:function(){
934 this.application.ninja.elementMediator.setProperty(this.layerData.elementsList, "height", [this.dtextScaleY + "px"] , "Changing", "timeline");
935 }
936 },
937
938
939 handleElementChange:{
940 value:function(event){
941 var el = this.layerData.elementsList[0];
942 var length = this.arrLayerStyles.length , i;
943
944 if(event.detail.source && event.detail.source!== "timeline"){
945 this.dtextPositionX = parseFloat(ElementsMediator.getProperty(el, "left"));
946 this.dtextPositionY = parseFloat(ElementsMediator.getProperty(el, "top"));
947 this.dtextScaleY = parseFloat(ElementsMediator.getProperty(el, "height"));
948 this.dtextScaleX= parseFloat(ElementsMediator.getProperty(el, "width"));
949
950 for(i=0; i<length; i++){
951 if(event.detail.data.prop === this.arrLayerStyles[i].editorProperty){
952 this.arrLayerStyles[i].editorValue = parseFloat(ElementsMediator.getProperty(el, this.arrLayerStyles[i].editorProperty));
953 break;
954 }
955 }
956 }
957
958 }
959 },
960
961 handleUpdatedID:{
962 value:function(event){
963 var i= this.application.ninja.timeline.arrLayers.length;
964 if(event.detail.id){
965 for(var k=0;k<i;k++){
966 if(this.application.ninja.timeline.arrLayers[k].layerData.layerID=== this.application.ninja.timeline.currentLayerSelected.layerData.layerID){
967 this.application.ninja.timeline.currentLayerSelected.layerData.layerName = event.detail.id;
968 this.application.ninja.timeline.triggerLayerBinding(k);
969 this.needsDraw=true;
970 }
971 }
972
973 }
974 }
975 },
976
977 handleChanging:{
978 value:function(){
979 console.log("in layer.js")
980 }
981 },
982
887 /* End: Event handlers */ 983 /* End: Event handlers */
888 984
889 /* Begin: Logging routines */ 985 /* Begin: Logging routines */
diff --git a/js/panels/Timeline/Layer.reel/Layer.js.orig b/js/panels/Timeline/Layer.reel/Layer.js.orig
new file mode 100644
index 00000000..d3301014
--- /dev/null
+++ b/js/panels/Timeline/Layer.reel/Layer.js.orig
@@ -0,0 +1,1057 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No 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 Collapser = require("js/panels/Timeline/Collapser").Collapser;
10var Hintable = require("js/components/hintable.reel").Hintable;
11var LayerStyle = require("js/panels/Timeline/Style.reel").LayerStyle;
12var DynamicText = require("montage/ui/dynamic-text.reel").DynamicText;
13var defaultEventManager = require("montage/core/event/event-manager").defaultEventManager;
14var nj = require("js/lib/NJUtils").NJUtils;
15var ElementsMediator = require("js/mediators/element-mediator").ElementMediator;
16
17var Layer = exports.Layer = Montage.create(Component, {