From 8974ecd564563a991ff96f9cb6d47da172174242 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 22 Feb 2012 00:49:47 -0800 Subject: local storage integration and versioning - Fixed the splitters Signed-off-by: Valerio Virgillito --- js/controllers/local-storage-controller.js | 51 +++++++++++++++++++++++------- js/data/settings.js | 17 ---------- js/ninja.reel/ninja.html | 13 +++++--- js/panels/Splitter.js | 22 +++++++++---- 4 files changed, 64 insertions(+), 39 deletions(-) (limited to 'js') diff --git a/js/controllers/local-storage-controller.js b/js/controllers/local-storage-controller.js index 6963b245..ea763cff 100755 --- a/js/controllers/local-storage-controller.js +++ b/js/controllers/local-storage-controller.js @@ -7,7 +7,46 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component; -exports.LocalStorage = Montage.create( Montage, { +exports.LocalStorage = Montage.create( Component, { + + canStore: { + value: null + }, + + deserializedFromTemplate: { + value: function() { + this.canStore = window.localStorage; + this.application.localStorage = this; + + // Redefine setItem and getItem if local storage is not available. + if(!this.canStore) { + this._getItem = function() { + console.log("Local Storage is not supported on your browser"); + return ""; + }; + + this._setItem = function() { + console.log("Local Storage is not supported on your browser"); + return false; + } + } + } + }, + + _getItem: { + value: function(key) { + var value = window.localStorage.getItem("ninja-" + key); + if(value !== null) value = JSON.parse(value); + + return value; + } + }, + + _setItem: { + value: function(key, value) { + window.localStorage.setItem("ninja-" + key, JSON.stringify(value)); + } + }, getItem: { value: function(item) { @@ -22,16 +61,6 @@ exports.LocalStorage = Montage.create( Montage, { return null; } - /* - if (window.localStorage) { - this.getItem = function(item) { - return window.localStorage.getItem(item); - }(item); - } else { - alert("Local Storage is not supported on your browser"); - - } - */ } }, diff --git a/js/data/settings.js b/js/data/settings.js index ffea2075..6b1af3fc 100755 --- a/js/data/settings.js +++ b/js/data/settings.js @@ -10,10 +10,6 @@ var Montage = require("montage/core/core").Montage, exports.Settings = Montage.create( Component, { - version: { - value: "11.1213" - }, - _settings: { value: null }, @@ -54,18 +50,5 @@ exports.Settings = Montage.create( Component, { return null; } } - }, - - deserializedFromSerialization: { - value: function() { - - if (LocalStorage.getItem("version") != this.version) { - this.settings = {} - LocalStorage.setItem("version",this.version); - } else { - this.settings = LocalStorage.getItem("settings"); - } - - } } }); \ No newline at end of file diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index 022b3f0a..43774d30 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -22,6 +22,11 @@ "name": "Preloader" }, + "localStorage": { + "module": "js/controllers/local-storage-controller", + "name": "LocalStorage" + }, + "settings1": { "module": "js/data/settings", "name": "Settings" @@ -324,12 +329,12 @@ -
+
-
+
-
+
@@ -392,7 +397,7 @@
-
+
diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js index 9f5b4de7..cb05104d 100755 --- a/js/panels/Splitter.js +++ b/js/panels/Splitter.js @@ -9,6 +9,10 @@ var Component = require("montage/ui/component").Component; exports.Splitter = Montage.create(Component, { + version: { + value: "1.0" + }, + hasTemplate: { value: false }, @@ -49,19 +53,23 @@ exports.Splitter = Montage.create(Component, { get: function() { return this._collapsed; }, - set: function(value) - { + set: function(value) { this._collapsed = value; - this.application.ninja.settings.setSetting(this.element.id, "collapsed", this.collapsed); + + this.application.localStorage._setItem(this.element.getAttribute("data-montage-id"), {"version": this.version, "value": value}); } }, prepareForDraw: { value: function() { - //Get Setting from SettingManager - this.application.ninja.settings.getSetting(this.element.id, "collapsed"); - lapsed = false; - if (lapsed != null) this._collapsed = lapsed; + //Get splitter initial value from SettingManager + var storedData = this.application.localStorage._getItem(this.element.getAttribute("data-montage-id")); + if(storedData && this.element.getAttribute("data-montage-id") !== null) { + this._collapsed = storedData.value; + } else { + this._collapsed = false; + } + this.element.addEventListener("click", this, false); } }, -- cgit v1.2.3 From 3a1821d6c14f9f06c81f7e74b3da27bf998c4b6f Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Thu, 23 Feb 2012 14:06:12 -0800 Subject: Move element selection to click handler Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 62ae625f..89d14c17 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -312,6 +312,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { value:function (event) { this._isLayer = true; this.needsDraw = true; + this.application.ninja.selectionController.executeSelectElement(); } }, @@ -513,9 +514,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this._LayerUndoIndex = thingToPush.layerID; this._LayerUndoStatus = true; this._TrackUndoObject = newTrack; -// if(_firstLayerDraw){ -// this.application.ninja.selectionController.executeSelectElement(); -// } + } } @@ -840,9 +839,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.trackRepetition.selectedIndexes = [layerIndex]; this.currentLayerSelected = this.arrLayers[layerIndex]; this.currentTrackSelected = this.arrTracks[layerIndex]; - /*if(this._captureSelection){ - this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList) - }*/ + if(this._captureSelection){ + this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList) + } this._captureSelection = true; } else { this.layerRepetition.selectedIndexes = null; -- cgit v1.2.3 From 19ac6739162c6ad007429ec34204f0589b4e11cc Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Thu, 23 Feb 2012 14:11:36 -0800 Subject: Remove unneeded selection code Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 89d14c17..2ca32de9 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -839,10 +839,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.trackRepetition.selectedIndexes = [layerIndex]; this.currentLayerSelected = this.arrLayers[layerIndex]; this.currentTrackSelected = this.arrTracks[layerIndex]; - if(this._captureSelection){ - this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList) - } - this._captureSelection = true; } else { this.layerRepetition.selectedIndexes = null; this.trackRepetition.selectedIndexes = null; -- cgit v1.2.3 From 0327073eff62d4b800206ba0f3ba2140ae5da8bc Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Thu, 23 Feb 2012 14:11:53 -0800 Subject: add back layer selection Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 2ca32de9..3171cf3c 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -494,7 +494,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.arrTracks.splice(myIndex, 0, newTrack); this.arrLayers.splice(myIndex, 0, thingToPush); this._LayerUndoPosition = myIndex; -// this.selectLayer(myIndex); + this.selectLayer(myIndex); this.hashLayerNumber.setItem(this._hashKey, thingToPush); this.hashInstance.setItem(this._hashKey, thingToPush, myIndex); this.hashTrackInstance.setItem(this._hashKey, newTrack, myIndex); @@ -507,7 +507,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.hashLayerNumber.setItem(this._hashKey, thingToPush); this.hashInstance.setItem(this._hashKey, thingToPush, thingToPush.layerPosition); this.hashTrackInstance.setItem(this._hashKey, newTrack, newTrack.trackPosition); -// this.selectLayer(0); + this.selectLayer(0); } this._LayerUndoObject = thingToPush; -- cgit v1.2.3 From 0b18fb2fef124a26204d5dba90cd82c975b69df3 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Thu, 23 Feb 2012 17:06:48 -0800 Subject: Timeline: Add hottext fields to layers and serialize them throughout. --- js/panels/Timeline/Layer.reel/Layer.html | 153 +++++++++++++++++++-- js/panels/Timeline/Layer.reel/Layer.js | 134 ++++++++++++++++++ js/panels/Timeline/Layer.reel/css/Layer.css | 29 ++-- js/panels/Timeline/Layer.reel/scss/Layer.scss | 6 + .../Timeline/TimelinePanel.reel/TimelinePanel.html | 35 +++++ .../Timeline/TimelineTrack.reel/TimelineTrack.js | 12 +- 6 files changed, 336 insertions(+), 33 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html index e262afe2..df03cbb3 100644 --- a/js/panels/Timeline/Layer.reel/Layer.html +++ b/js/panels/Timeline/Layer.reel/Layer.html @@ -87,7 +87,140 @@ "oneway" : false } } - } + }, + "dtext-position-x" : { + "module": "js/components/hottextunit.reel", + "name": "HotTextUnit", + "properties": { + "element": {"#": "position-x"}, + "maxValue" : 100000, + "minValue" : -100000, + "acceptableUnits" : "px", + "units" : "px", + "value" : 0 + }, + "bindings": { + "value": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "dtextPositionX", + "oneway": false + } + } + }, + "dtext-position-y" : { + "module": "js/components/hottextunit.reel", + "name": "HotTextUnit", + "properties": { + "element": {"#": "position-y"}, + "maxValue" : 100000, + "minValue" : -100000, + "acceptableUnits" : "px", + "units" : "px", + "value" : 0 + }, + "bindings": { + "value": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "dtextPositionY", + "oneway": false + } + } + }, + "dtext-scale-x" : { + "module": "js/components/hottextunit.reel", + "name": "HotTextUnit", + "properties": { + "element": {"#": "scale-x"}, + "maxValue" : 100, + "minValue" : 0, + "acceptableUnits" : "%", + "units" : "%", + "value" : 0 + }, + "bindings": { + "value": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "dtextScaleX", + "oneway": false + } + } + }, + "dtext-scale-y" : { + "module": "js/components/hottextunit.reel", + "name": "HotTextUnit", + "properties": { + "element": {"#": "scale-y"}, + "maxValue" : 100, + "minValue" : 0, + "acceptableUnits" : "%", + "units" : "%", + "value" : 0 + }, + "bindings": { + "value": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "dtextScaleY", + "oneway": false + } + } + }, + "dtext-skew-x" : { + "module": "js/components/hottextunit.reel", + "name": "HotTextUnit", + "properties": { + "element": {"#": "skew-x"}, + "maxValue" : 100, + "minValue" : 0, + "acceptableUnits" : "%", + "units" : "%", + "value" : 0 + }, + "bindings": { + "value": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "dtextSkewX", + "oneway": false + } + } + }, + "dtext-skew-y" : { + "module": "js/components/hottextunit.reel", + "name": "HotTextUnit", + "properties": { + "element": {"#": "skew-y"}, + "maxValue" : 100, + "minValue" : 0, + "acceptableUnits" : "%", + "units" : "%", + "value" : 0 + }, + "bindings": { + "value": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "dtextSkewY", + "oneway": false + } + } + }, + "dtext-rotate" : { + "module": "js/components/hottextunit.reel", + "name": "HotTextUnit", + "properties": { + "element": {"#": "rotation"}, + "maxValue" : 360, + "minValue" : -360, + "acceptableUnits" : "degrees", + "units" : "degrees", + "value" : 0 + }, + "bindings": { + "value": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "dtextRotate", + "oneway": false + } + } + } } @@ -109,15 +242,11 @@
X
-
100px
+
Y
-
100px
-
-
-
Z
-
100px
+
@@ -129,23 +258,23 @@
Scale X
-
100px
+
Scale Y
-
100px
+
Skew X
-
100px
+
Skew Y
-
100px
+
Rotation
-
100px
+
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 2e9a8f1a..bc1dfb7f 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -101,6 +101,140 @@ var Layer = exports.Layer = Montage.create(Component, { } }, + /* Position and Transform hottext values */ + _dtextPositionX : { + value:null, + serializable: true, + }, + + dtextPositionX:{ + serializable: true, + get:function(){ + return this._dtextPositionX; + }, + set:function(value){ + if (this._dtextPositionX !== value) { + this._dtextPositionX = value; + this.needsDraw = true; + } + + } + }, + + _dtextPositionY : { + value:null, + serializable: true, + }, + + dtextPositionY:{ + serializable: true, + get:function(){ + return this._dtextPositionY; + }, + set:function(value){ + if (this._dtextPositionY !== value) { + this._dtextPositionY = value; + this.needsDraw = true; + } + + } + }, + + _dtextScaleX : { + value:null, + serializable: true, + }, + + dtextScaleX:{ + serializable: true, + get:function(){ + return this._dtextScaleX; + }, + set:function(value){ + if (this._dtextScaleX !== value) { + this._dtextScaleX = value; + this.needsDraw = true; + } + + } + }, + + _dtextScaleY : { + value:null, + serializable: true, + }, + + dtextScaleY:{ + serializable: true, + get:function(){ + return this._dtextScaleY; + }, + set:function(value){ + if (this._dtextScaleY !== value) { + this._dtextScaleY = value; + this.needsDraw = true; + } + + } + }, + + _dtextSkewX : { + value:null, + serializable: true, + }, + + dtextSkewX:{ + serializable: true, + get:function(){ + return this._dtextSkewX; + }, + set:function(value){ + if (this._dtextSkewX !== value) { + this._dtextSkewX = value; + this.needsDraw = true; + } + + } + }, + + _dtextSkewY : { + value:null, + serializable: true, + }, + + dtextSkewY:{ + serializable: true, + get:function(){ + return this._dtextSkewY; + }, + set:function(value){ + if (this._dtextSkewY !== value) { + this._dtextSkewY = value; + this.needsDraw = true; + } + + } + }, + + _dtextRotate : { + value:null, + serializable: true, + }, + + dtextRotate:{ + serializable: true, + get:function(){ + return this._dtextRotate; + }, + set:function(value){ + if (this._dtextRotate !== value) { + this._dtextRotate = value; + this.needsDraw = true; + } + + } + }, + /* isSelected: whether or not the layer is currently selected. */ _isSelected:{ value: false, diff --git a/js/panels/Timeline/Layer.reel/css/Layer.css b/js/panels/Timeline/Layer.reel/css/Layer.css index 3547a15e..3d7ba963 100644 --- a/js/panels/Timeline/Layer.reel/css/Layer.css +++ b/js/panels/Timeline/Layer.reel/css/Layer.css @@ -229,14 +229,19 @@ border-top: 1px solid #505050; } -/* line 194, ../scss/Layer.scss */ +/* line 195, ../scss/Layer.scss */ +.collapsible-content .hottextunit { + width: auto; +} + +/* line 198, ../scss/Layer.scss */ .collapsible-transition { -webkit-transition-property: height; -webkit-transition-duration: 200ms; -webkit-transition-timing-function: ease-in; } -/* line 200, ../scss/Layer.scss */ +/* line 206, ../scss/Layer.scss */ .editable2 { height: 20px; background-color: #242424 !important; @@ -248,32 +253,24 @@ text-overflow: clip; } -<<<<<<< .mine=======/* line 210, ../scss/Layer.scss */ -.label-style .disabled { - cursor: default; -} - -/* styles elements */ ->>>>>>> .theirs/* line 215, ../scss/Layer.scss */ +/* line 217, ../scss/Layer.scss */ .label-style .disabled { cursor: default; } /* styles elements */ -/* line 216, ../scss/Layer.scss */ +/* line 222, ../scss/Layer.scss */ .content-style .item-template { display: none; } -<<<<<<< .mine/* line 219, ../scss/Layer.scss */ -=======/* line 218, ../scss/Layer.scss */ ->>>>>>> .theirs.content-style .layout-row.selected .layout-cell { +/* line 225, ../scss/Layer.scss */ +.content-style .layout-row.selected .layout-cell { background-color: #b2b2b2; color: #242424; } -<<<<<<< .mine/* line 223, ../scss/Layer.scss */ -=======/* line 222, ../scss/Layer.scss */ ->>>>>>> .theirs.style-row { +/* line 229, ../scss/Layer.scss */ +.style-row { height: 20px; } diff --git a/js/panels/Timeline/Layer.reel/scss/Layer.scss b/js/panels/Timeline/Layer.reel/scss/Layer.scss index c66a6267..0a83028b 100644 --- a/js/panels/Timeline/Layer.reel/scss/Layer.scss +++ b/js/panels/Timeline/Layer.reel/scss/Layer.scss @@ -191,12 +191,18 @@ .collapsible-content .layout-table:first-child { border-top: 1px solid $color-menu-divider; } + +.collapsible-content .hottextunit { + width: auto; +} .collapsible-transition { -webkit-transition-property: height; -webkit-transition-duration: 200ms; -webkit-transition-timing-function: ease-in; } + + .editable2 { height: 20px; background-color: $color-panel-hilite-text !IMPORTANT; diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html index 33145028..c964936c 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html @@ -110,6 +110,41 @@ "boundObject" : {"@" : "repetition1"}, "boundObjectPropertyPath" : "objectAtCurrentIteration.isStyleCollapsed", "oneway" : false + }, + "dtextPositionX" : { + "boundObject" : {"@" : "repetition1"}, + "boundObjectPropertyPath" : "objectAtCurrentIteration.dtextPositionX", + "oneway" : false + }, + "dtextPositionY" : { + "boundObject" : {"@" : "repetition1"}, + "boundObjectPropertyPath" : "objectAtCurrentIteration.dtextPositionY", + "oneway" : false + }, + "dtextSkewX" : { + "boundObject" : {"@" : "repetition1"}, + "boundObjectPropertyPath" : "objectAtCurrentIteration.dtextSkewX", + "oneway" : false + }, + "dtextSkewY" : { + "boundObject" : {"@" : "repetition1"}, + "boundObjectPropertyPath" : "objectAtCurrentIteration.dtextSkewY", + "oneway" : false + }, + "dtextScaleX" : { + "boundObject" : {"@" : "repetition1"}, + "boundObjectPropertyPath" : "objectAtCurrentIteration.dtextScaleX", + "oneway" : false + }, + "dtextScaleY" : { + "boundObject" : {"@" : "repetition1"}, + "boundObjectPropertyPath" : "objectAtCurrentIteration.dtextScaleY", + "oneway" : false + }, + "dtextRotate" : { + "boundObject" : {"@" : "repetition1"}, + "boundObjectPropertyPath" : "objectAtCurrentIteration.dtextRotate", + "oneway" : false } } }, diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index fddfd170..67dbbced 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -358,10 +358,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { didDraw:{ value:function () { - if (this._openDocRedrawCheck) { - this.retrieveStoredTweens(); - this._openDocRedrawCheck = false; - } + if(this.application.ninja.currentDocument.documentRoot.children[0]){ + if (this._openDocRedrawCheck) { + this.retrieveStoredTweens(); + this._openDocRedrawCheck = false; + } + } } }, @@ -542,7 +544,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { value:function () { var that = this; - this.arrPositionTracks = [0, 1, 2]; + this.arrPositionTracks = [0, 1]; this.arrTransformTracks = [0, 1, 2, 3, 4]; this.label = this.element.querySelector(".label-main"); -- cgit v1.2.3 From 8dd707776024ff067064e7841810d04f2f7a1df7 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 24 Feb 2012 11:55:15 -0800 Subject: Adjusting fill and ink bottle cursors to match the tips of the icons. Signed-off-by: Nivesh Rajbhandari --- js/tools/FillTool.js | 4 ++-- js/tools/InkBottleTool.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js index 46d76a19..4b07ae83 100755 --- a/js/tools/FillTool.js +++ b/js/tools/FillTool.js @@ -22,14 +22,14 @@ exports.FillTool = Montage.create(ModifierToolBase, { value : function (event) { var obj = this.application.ninja.stage.GetElement(event); - var cursor = "url('images/cursors/fill.png') 17 12, default"; + var cursor = "url('images/cursors/fill.png') 14 14, default"; var canColor = true; if (obj) { var name = obj.nodeName; if ((name !== 'CANVAS') && (name !== 'DIV')) { - cursor = "url('images/cursors/nofill.png') 17 12, default"; + cursor = "url('images/cursors/nofill.png') 14 14, default"; canColor = false; } } diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index 2be74ada..8340ef50 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js @@ -16,14 +16,14 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { value : function (event) { var obj = this.application.ninja.stage.GetElement(event); - var cursor = "url('images/cursors/ink.png') 17 12, default"; + var cursor = "url('images/cursors/ink.png') 6 11, default"; var canColor = true; if (obj) { var name = obj.nodeName; if ((name !== 'CANVAS') && (name !== 'DIV')) { - cursor = "url('images/cursors/ink_no.png') 17 12, default"; + cursor = "url('images/cursors/ink_no.png') 6 11, default"; canColor = false; } } -- cgit v1.2.3 From 9dabdd11b7fc8a042e139457748547ffe2232468 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 24 Feb 2012 12:58:12 -0800 Subject: - added flag for timeline to identify new file flow - added switchDocument event for timeline Signed-off-by: Ananya Sen Signed-off-by: Jonathan Duran --- js/controllers/document-controller.js | 6 ++++++ js/stage/stage-view.reel/stage-view.js | 2 ++ 2 files changed, 8 insertions(+) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 1c9d9d59..843db87c 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -169,6 +169,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, value:function(doc){ var response = doc || null;//default just for testing if(!!response && response.success && (response.status!== 500) && !!response.uri){ + this.creatingNewFile = true;//flag for timeline to identify new file flow this.application.ninja.ioMediator.fileOpen(response.uri, this.openFileCallback.bind(this)); }else if(!!response && !response.success){ //Todo: restrict directory path to the sandbox, in the dialog itself @@ -196,6 +197,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component, value:function(response){ //TODO: Add UI to handle error codes, shouldn't be alert windows if(!!response && (response.status === 204)) { + + if((typeof this.creatingNewFile === 'undefined') || (this.creatingNewFile !== true)){//not from new file flow + this.creatingNewFile = false; + } + //Sending full response object this.openDocument(response); } else if (!!response && (response.status === 404)){ diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index dc9980f0..c6427317 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -149,6 +149,8 @@ exports.StageView = Montage.create(Component, { // appDelegateModule.MyAppDelegate.onSetActiveDocument(); } + NJevent("switchDocument"); + } }, -- cgit v1.2.3 From 2b672f6508a849b8023b0bc114ad15e9ddca5adc Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 24 Feb 2012 13:27:04 -0800 Subject: prefixing the local storage and using the new local-storage object. Signed-off-by: Valerio Virgillito --- js/io/system/coreioapi.js | 6 +++--- js/io/ui/cloudpopup.reel/cloudpopup.js | 4 ++-- js/panels/presets/content.reel/content.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'js') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 2051da43..f428a229 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -28,9 +28,9 @@ exports.CoreIoApi = Montage.create(Component, { value: function () { //////////////////////////////////////////////////////////// //Checking for local storage of URL for IO - if (window.localStorage['ioRootUrl']) { + if (this.application.localStorage.getItem("ioRootUrl")) { //Getting URL from local storage - this.rootUrl = window.localStorage['ioRootUrl']; + this.rootUrl = this.application.localStorage.getItem("ioRootUrl"); //Checks for IO API to be active this.ioServiceDetected = this.cloudAvailable(); } else { @@ -156,7 +156,7 @@ exports.CoreIoApi = Montage.create(Component, { return this._rootUrl; }, set: function(value) { - this._rootUrl = window.localStorage["ioRootUrl"] = value; + this._rootUrl = this.application.localStorage.setItem("ioRootUrl", value); } }, //////////////////////////////////////////////////////////////////// diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js index d2e82662..a4656bb5 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.js +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js @@ -63,8 +63,8 @@ exports.CloudPopup = Montage.create(Component, { enumerable: false, value: function() { // - if (window.localStorage['ioRootUrl']) { - this.components.url.value = window.localStorage['ioRootUrl']; + if (this.application.localStorage.getItem("ioRootUrl")) { + this.components.url.value = this.application.localStorage.getItem("ioRootUrl"); } // this.testConnection(); diff --git a/js/panels/presets/content.reel/content.js b/js/panels/presets/content.reel/content.js index c43c593c..1ede7246 100644 --- a/js/panels/presets/content.reel/content.js +++ b/js/panels/presets/content.reel/content.js @@ -16,7 +16,7 @@ exports.content = Montage.create(Component, { }, templateDidLoad : { value: function() { - var storedTabIndex = window.localStorage.presetsTabIndex; + var storedTabIndex = this.application.localStorage.getItem("presetsTabIndex"); if(storedTabIndex) { this.activeTabIndex = storedTabIndex; } @@ -50,7 +50,7 @@ exports.content = Montage.create(Component, { }, set: function(tabObject) { this.contentPanel = tabObject.key; - window.localStorage.presetsTabIndex = this.tabs.indexOf(tabObject); + this.application.localStorage.setItem("presetsTabIndex", this.tabs.indexOf(tabObject)); this._tabToDeactivate = this._activeTab; this._activeTab = tabObject; -- cgit v1.2.3 From f97080989ee988c1e613915c2d246dc17b104b3b Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 24 Feb 2012 13:27:33 -0800 Subject: clearing the old local setting and using the new version/prefix local settings. Signed-off-by: Valerio Virgillito --- js/controllers/local-storage-controller.js | 42 ++++++---------------- js/ninja.reel/ninja.html | 4 +-- .../CSSPanel/CSSPanelBase.reel/CSSPanelBase.html | 2 +- js/panels/Panel.reel/Panel.html | 9 ++++- js/panels/Panel.reel/Panel.js | 4 ++- js/panels/PanelBase.js | 23 +++++++++--- .../PanelContainer.reel/PanelContainer.js | 8 +++-- js/panels/Resizer.js | 14 +++++--- js/panels/Splitter.js | 4 +-- .../Timeline/TimelinePanel.reel/TimelinePanel.html | 2 +- 10 files changed, 60 insertions(+), 52 deletions(-) (limited to 'js') diff --git a/js/controllers/local-storage-controller.js b/js/controllers/local-storage-controller.js index ea763cff..1388f3e5 100755 --- a/js/controllers/local-storage-controller.js +++ b/js/controllers/local-storage-controller.js @@ -20,20 +20,25 @@ exports.LocalStorage = Montage.create( Component, { // Redefine setItem and getItem if local storage is not available. if(!this.canStore) { - this._getItem = function() { + this.getItem = function() { console.log("Local Storage is not supported on your browser"); return ""; }; - this._setItem = function() { + this.setItem = function() { console.log("Local Storage is not supported on your browser"); return false; } } + + // Temporary clear the local storage if we find the version key + if(window.localStorage.version) { + window.localStorage.clear(); + } } }, - _getItem: { + getItem: { value: function(key) { var value = window.localStorage.getItem("ninja-" + key); if(value !== null) value = JSON.parse(value); @@ -42,38 +47,11 @@ exports.LocalStorage = Montage.create( Component, { } }, - _setItem: { + setItem: { value: function(key, value) { window.localStorage.setItem("ninja-" + key, JSON.stringify(value)); - } - }, - - getItem: { - value: function(item) { - var item; - if (window.localStorage) { - item = window.localStorage.getItem(item); - if(item !== null) return JSON.parse(item) - return null; - } else { - alert("Local Storage is not supported on your browser"); - return null; - } - - } - }, - - setItem: { - value: function(item, value) { - if (window.localStorage) { - window.localStorage.setItem(item, JSON.stringify(value)); - return true; - } else { - alert("Local Storage is not supported on your browser"); - return false; - } + return value; } } - }); \ No newline at end of file diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index 9cf27504..953e560c 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -374,7 +374,7 @@ -
+
@@ -386,7 +386,7 @@ -
+
diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.html b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.html index db630934..98b2b61d 100755 --- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.html +++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.html @@ -53,7 +53,7 @@ -
+

diff --git a/js/panels/Panel.reel/Panel.html b/js/panels/Panel.reel/Panel.html index dc76d871..46c8fb91 100755 --- a/js/panels/Panel.reel/Panel.html +++ b/js/panels/Panel.reel/Panel.html @@ -15,6 +15,13 @@ "element": {"#": "resizeBar"}, "panel": {"#": "panel"}, "isVertical": true + }, + "bindings": { + "ownerId": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "panelBase.panelName", + "oneway": true + } } }, @@ -55,7 +62,7 @@ -
+
diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js index efa287c5..c8dd0456 100755 --- a/js/panels/Panel.reel/Panel.js +++ b/js/panels/Panel.reel/Panel.js @@ -188,6 +188,8 @@ exports.Panel = Montage.create(Component, { //Resized Event if(typeof this.resizer.value == "number") this.panelBase.contentHeight = this.resizer.value; this.resizer.element.addEventListener("mouseup",this.resized.bind(this),false); + + this.panelContent.content = this.panelBase.content; } } }, @@ -226,7 +228,7 @@ exports.Panel = Montage.create(Component, { else pContentDiv.style.overflow = "hidden"; this.element.getElementsByClassName("panelTitle")[0].innerHTML = this.panelBase.panelName; //pContentDiv.appendChild(this.panelBase.content); - this.panelContent.content = this.panelBase.content; + //this.panelContent.content = this.panelBase.content; } } diff --git a/js/panels/PanelBase.js b/js/panels/PanelBase.js index b7b6945c..03dcd0ee 100755 --- a/js/panels/PanelBase.js +++ b/js/panels/PanelBase.js @@ -32,11 +32,14 @@ exports.PanelBase = Montage.create(Component, { contentHeight: { get: function() { if(this._contentHeight == null) { + // Old settings + /* if(this.application.ninja.settings.getSetting(this.panelName, "contentHeight")) { this._contentHeight = this.application.ninja.settings.getSetting(this.panelName, "contentHeight"); } else { this._contentHeight = this.defaultHeight; - } + }*/ + this._contentHeight = this.defaultHeight; } return this._contentHeight; }, @@ -44,50 +47,60 @@ exports.PanelBase = Montage.create(Component, { if (this.minHeight > value) value = this._minHeight; if (this.maxHeight != null) if(this.maxHeight < value) value = this.maxHeight; this._contentHeight = value; - this.application.ninja.settings.setSetting(this.panelName, "contentHeight", value); +// this.application.ninja.settings.setSetting(this.panelName, "contentHeight", value); } }, forcedCollapse: { get: function() { if(this._forcedCollapse == null) { + /* if(this.application.Ninja.SettingsManager.getSetting(this.panelName, "isPanelForceCollapsed")) { this._forcedCollapse = this.application.Ninja.SettingsManager.getSetting(this.panelName, "isPanelForceCollapsed"); } else { this._forcedCollapse = false; } + */ + this._forcedCollapse = false; } return this._forcedCollapse; }, set: function(value) { this._forcedCollapse = value; - this.application.Ninja.SettingsManager.setSetting(this.panelName, "isPanelForceCollapsed", value); + //this.application.Ninja.SettingsManager.setSetting(this.panelName, "isPanelForceCollapsed", value); } }, collapsed: { get: function() { if(this._collapsed == null) { + /* if(this.application.ninja.settings.getSetting(this.panelName, "isPanelCollapsed")) { this._collapsed = this.application.ninja.settings.getSetting(this.panelName, "isPanelCollapsed"); } else { this._collapsed = false; } + */ + this._collapsed = false; } return this._collapsed; }, set: function(value) { this._collapsed = value; - this.application.ninja.settings.setSetting(this.panelName, "isPanelCollapsed", value); + //this.application.ninja.settings.setSetting(this.panelName, "isPanelCollapsed", value); } }, visible: { get: function() { if(this._visible === null) { + /* if(typeof(this.application.ninja.settings.getSetting(this.panelName, "visible")) !== "undefined") { this._visible = this.application.ninja.settings.getSetting(this.panelName, "visible"); } else { this._visible = true; } + */ + this._visible = true; + } return this._visible; @@ -95,7 +108,7 @@ exports.PanelBase = Montage.create(Component, { set: function(value) { this._visible = value; - this.application.ninja.settings.setSetting(this.panelName, "visible", value); + //this.application.ninja.settings.setSetting(this.panelName, "visible", value); } } diff --git a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js index b8223471..bdd112c6 100755 --- a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js @@ -63,14 +63,16 @@ exports.PanelContainer = Montage.create(Component, { value: function() { //Panels Loading this.lastOffset = this.element.offsetHeight; + /* if( this.application.ninja.settings.getSetting(this.element.id, "panelOrder") != null) { this.initPanelOrder = this.application.ninja.settings.getSetting(this.element.id, "panelOrder") } + */ // if Panels already loaded no need to load again. for(var i = 0; i < this.initPanelOrder.length; i++) { this.addPanel(eval(this.initPanelOrder[i])); this.panelOrder.push(this.initPanelOrder[i]); - this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder); +// this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder); } var hideSplitter = true; @@ -221,7 +223,7 @@ exports.PanelContainer = Montage.create(Component, { } minHeights -= this._panels[lastPanel].minHeight - this._collapsedHeight; this._panels[lastPanel].collapsed = true; - this.repeater.childComponents[lastPanel].needsDraw = true; + //this.repeater.childComponents[lastPanel].needsDraw = true; } @@ -329,7 +331,7 @@ exports.PanelContainer = Montage.create(Component, { this._panels.splice(overed,0, panelRemoved[0]); var panelOrderRemoved = this.panelOrder.splice(selected,1); this.panelOrder.splice(overed,0, panelOrderRemoved[0]); - this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder); + //this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder); } } }, diff --git a/js/panels/Resizer.js b/js/panels/Resizer.js index 3afe5d5b..e9bd4fc0 100755 --- a/js/panels/Resizer.js +++ b/js/panels/Resizer.js @@ -12,6 +12,10 @@ exports.Resizer = Montage.create(Component, { hasTemplate: { value: false }, + + ownerId: { + value: "" + }, _isInversed: { value: false @@ -74,7 +78,6 @@ exports.Resizer = Montage.create(Component, { e.preventDefault(); this.panel.addEventListener("webkitTransitionEnd", this, true); if (this.isVertical) { - //console.log("y: " + e.y + " startPosition: " + this._startPosition + " initDimension: " + this._initDimension); this._startPosition = e.y; this._initDimension = this.panel.offsetHeight; } @@ -98,7 +101,7 @@ exports.Resizer = Montage.create(Component, { } else { this.panel.style.width = ""; } - this.application.ninja.settings.setSetting(this.element.id,"value", ""); +// this.application.ninja.settings.setSetting(this.element.id,"value", ""); } }, @@ -113,6 +116,8 @@ exports.Resizer = Montage.create(Component, { prepareForDraw: { value: function() { +// console.log("owner id: ", this.ownerId); + console.log("resizer for ", this.element.getAttribute("data-montage-id") + this.ownerId); if(this.value != null) { if (this.isVertical) { this.panel.style.height = this.value + "px"; @@ -142,7 +147,7 @@ exports.Resizer = Montage.create(Component, { } else { this.panel.style.width = this.panel.offsetWidth; } - this.application.ninja.settings.setSetting(this.element.id,"value", this.value); +// this.application.ninja.settings.setSetting(this.element.id,"value", this.value); if(this.redrawStage) { this.application.ninja.stage.resizeCanvases = true; } @@ -154,7 +159,6 @@ exports.Resizer = Montage.create(Component, { value: function(e) { if(this.isVertical) { this.value = this._isInversed ? this._initDimension + (this._startPosition - e.y) : this._initDimension + (e.y - this._startPosition); - //console.log("y: " + e.y + " startPosition: " + this._startPosition + " initDimension: " + this._initDimension + " finalPosition: " + pos); this.panel.style.height = this.value + "px"; } else { @@ -184,12 +188,14 @@ exports.Resizer = Montage.create(Component, { value: { get: function() { + /* if(this.application.ninja.settings) { var gottenValue = this.application.ninja.settings.getSetting(this.id, "value"); if (this._value == null && gottenValue !=null) { this.value = gottenValue; } } + */ return this._value; }, set: function(val) { diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js index cb05104d..3215e928 100755 --- a/js/panels/Splitter.js +++ b/js/panels/Splitter.js @@ -56,14 +56,14 @@ exports.Splitter = Montage.create(Component, { set: function(value) { this._collapsed = value; - this.application.localStorage._setItem(this.element.getAttribute("data-montage-id"), {"version": this.version, "value": value}); + this.application.localStorage.setItem(this.element.getAttribute("data-montage-id"), {"version": this.version, "value": value}); } }, prepareForDraw: { value: function() { //Get splitter initial value from SettingManager - var storedData = this.application.localStorage._getItem(this.element.getAttribute("data-montage-id")); + var storedData = this.application.localStorage.getItem(this.element.getAttribute("data-montage-id")); if(storedData && this.element.getAttribute("data-montage-id") !== null) { this._collapsed = storedData.value; } else { diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html index 0c302436..0fd5b05d 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html @@ -264,7 +264,7 @@ -
+
-- cgit v1.2.3 From 818ec3b66d4394d80fcffbfcee82b40fe1477319 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 24 Feb 2012 11:56:42 -0800 Subject: Distinguish between border top/right/bottom/left colors. Also, fall back to snapping routine when selecting only if the active tool allows snapping. Signed-off-by: Nivesh Rajbhandari --- js/stage/stage.reel/stage.js | 2 +- js/tools/EyedropperTool.js | 81 +++++++++++++++++++++++++++----------------- 2 files changed, 50 insertions(+), 33 deletions(-) (limited to 'js') diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 641ac247..922abc33 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -519,7 +519,7 @@ exports.Stage = Montage.create(Component, { elt = this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop); // workaround Chrome 3d bug - if(this.application.ninja.currentDocument.inExclusion(elt) !== -1) + if(this.application.ninja.toolsData.selectedToolInstance._canSnap && this.application.ninja.currentDocument.inExclusion(elt) !== -1) { return this._getElementUsingSnapping(point); } else { diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js index d007da39..710c96ef 100755 --- a/js/tools/EyedropperTool.js +++ b/js/tools/EyedropperTool.js @@ -18,6 +18,7 @@ exports.EyedropperTool = Montage.create(toolBase, { _elementUnderMouse: { value: null }, _imageDataCanvas: { value: null }, _imageDataContext: { value: null }, + _canSnap: { value: false }, Configure: { value: function ( doActivate ) @@ -143,10 +144,14 @@ exports.EyedropperTool = Montage.create(toolBase, { { this._deleteImageDataCanvas(); - c = ElementsMediator.getColor(obj, this._isOverBackground(obj, event)); - if(c) + c = this._getColorFromElement(obj, event); + if(typeof(c) === "string") + { + color = this.application.ninja.colorController.getColorObjFromCss(c); + } + else { - color = this.application.ninja.colorController.getColorObjFromCss(c.color.css); + color = c; } } @@ -202,51 +207,63 @@ exports.EyedropperTool = Montage.create(toolBase, { }, // TODO - We don't want to calculate this repeatedly - _isOverBackground: { + _getColorFromElement: { value: function(elt, event) { - var border = ElementsMediator.getProperty(elt, "border", parseFloat); - + var border = ElementsMediator.getProperty(elt, "border"), + borderWidth, + bounds3D, + innerBounds, + pt, + bt, + br, + bb, + bl, + xAdj, + yAdj, + tmpPt, + x, + y; if(border) { - var bounds3D, - innerBounds = [], - pt = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY)), - bt = ElementsMediator.getProperty(elt, "border-top", parseFloat), - br = ElementsMediator.getProperty(elt, "border-right", parseFloat), - bb = ElementsMediator.getProperty(elt, "border-bottom", parseFloat), - bl = ElementsMediator.getProperty(elt, "border-left", parseFloat); - -// this.application.ninja.stage.viewUtils.setViewportObj( elt ); bounds3D = this.application.ninja.stage.viewUtils.getElementViewBounds3D( elt ); -// console.log("bounds"); -// console.dir(bounds3D); + innerBounds = []; + pt = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, + new WebKitPoint(event.pageX, event.pageY)); + borderWidth = parseFloat(border); + if(isNaN(borderWidth)) + { + bt = ElementsMediator.getProperty(elt, "border-top", parseFloat); + br = ElementsMediator.getProperty(elt, "border-right", parseFloat); + bb = ElementsMediator.getProperty(elt, "border-bottom", parseFloat); + bl = ElementsMediator.getProperty(elt, "border-left", parseFloat); + borderWidth = 0; + } + xAdj = bl || borderWidth; + yAdj = bt || borderWidth; - var xAdj = bl || border, - yAdj = bt || border; innerBounds.push([bounds3D[0][0] + xAdj, bounds3D[0][1] + yAdj, 0]); - yAdj += bb || border; + yAdj = bb || borderWidth; innerBounds.push([bounds3D[1][0] + xAdj, bounds3D[1][1] - yAdj, 0]); - xAdj += br || border; + xAdj = br || borderWidth; innerBounds.push([bounds3D[2][0] - xAdj, bounds3D[2][1] - yAdj, 0]); - yAdj = bt || border; + yAdj = bt || borderWidth; innerBounds.push([bounds3D[3][0] - xAdj, bounds3D[3][1] + yAdj, 0]); -// console.log("innerBounds"); -// console.dir(innerBounds); - var tmpPt = this.application.ninja.stage.viewUtils.globalToLocal([pt.x, pt.y], elt); - var x = tmpPt[0], - y = tmpPt[1]; + tmpPt = this.application.ninja.stage.viewUtils.globalToLocal([pt.x, pt.y], elt); + x = tmpPt[0]; + y = tmpPt[1]; - if(x < innerBounds[0][0]) return false; - if(x > innerBounds[2][0]) return false; - if(y < innerBounds[0][1]) return false; - if(y > innerBounds[1][1]) return false; + if(x < innerBounds[0][0]) return ElementsMediator.getProperty(elt, "border-left-color"); + if(x > innerBounds[2][0]) return ElementsMediator.getProperty(elt, "border-right-color"); + if(y < innerBounds[0][1]) return ElementsMediator.getProperty(elt, "border-top-color"); + if(y > innerBounds[1][1]) return ElementsMediator.getProperty(elt, "border-bottom-color"); } - return true; + + return ElementsMediator.getColor(elt, true); } }, -- cgit v1.2.3 From 1c4e8fbab587e589f348223847d6aac5c2df416b Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 24 Feb 2012 14:06:57 -0800 Subject: Timeline: Bug fixes: Delete corresponding track when a style is deleted from a layer, and fix serialization variable problem. --- js/panels/Timeline/Layer.reel/Layer.html | 14 +++++++------- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html index d30ef0e3..0bd448f7 100644 --- a/js/panels/Timeline/Layer.reel/Layer.html +++ b/js/panels/Timeline/Layer.reel/Layer.html @@ -93,7 +93,7 @@ } } }, - "dtext-position-x" : { + "dtext_position_x" : { "module": "js/components/hottextunit.reel", "name": "HotTextUnit", "properties": { @@ -112,7 +112,7 @@ } } }, - "dtext-position-y" : { + "dtext_position_y" : { "module": "js/components/hottextunit.reel", "name": "HotTextUnit", "properties": { @@ -131,7 +131,7 @@ } } }, - "dtext-scale-x" : { + "dtext_scale_x" : { "module": "js/components/hottextunit.reel", "name": "HotTextUnit", "properties": { @@ -150,7 +150,7 @@ } } }, - "dtext-scale-y" : { + "dtext_scale_y" : { "module": "js/components/hottextunit.reel", "name": "HotTextUnit", "properties": { @@ -169,7 +169,7 @@ } } }, - "dtext-skew-x" : { + "dtext_skew_x" : { "module": "js/components/hottextunit.reel", "name": "HotTextUnit", "properties": { @@ -188,7 +188,7 @@ } } }, - "dtext-skew-y" : { + "dtext_skew_y" : { "module": "js/components/hottextunit.reel", "name": "HotTextUnit", "properties": { @@ -207,7 +207,7 @@ } } }, - "dtext-rotate" : { + "dtext_rotate" : { "module": "js/components/hottextunit.reel", "name": "HotTextUnit", "properties": { diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 27177a69..30280727 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -652,6 +652,8 @@ var TimelineT