From da03585a0b03220281f6d54d9acf0ae0fafaef16 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 22 Mar 2012 11:53:21 -0700 Subject: Presets Panel - Adding presets controller to serialization --- js/ninja.reel/ninja.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index f9e1efdd..a4779ee3 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -267,6 +267,11 @@ "name": "StylesController" }, + "presetsController": { + "module": "js/controllers/presets-controller", + "name": "PresetsController" + }, + "filePickerController": { "module": "js/io/ui/file-picker/file-picker-controller", "name": "FilePickerController" @@ -315,6 +320,7 @@ "popupManager": {"@": "popupManager1"}, "colorController": {"@": "colorController1"}, "stylesController": {"@": "stylesController"}, + "presetsController": {"@": "presetsController"}, "filePickerController": {"@": "filePickerController"}, "newFileController": {"@": "newFileController"}, "coreIoApi": {"@": "coreIoApi1"}, -- cgit v1.2.3 From 49596f2a6b518ed0ee945006787d3c69e40a5757 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Thu, 22 Mar 2012 14:31:12 -0700 Subject: Updated Resizers for Panels and timeline Signed-off-by: Armen Kesablyan --- js/ninja.reel/ninja.html | 97 ++++++++++++++++++++++++++++++------------ js/ninja.reel/ninja.js | 107 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+), 27 deletions(-) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index f9e1efdd..b3545329 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -77,34 +77,79 @@ "name": "Splitter", "properties": { "element": {"#": "bottomSplitter"}, - "panel": {"#": "bottomPanelContainer"}, - "resizeBar": {"#": "timelineResizer"} + "panel": {"@": "timeline"} } }, "resizer1": { - "module": "js/panels/Resizer", - "name": "Resizer", + "module": "js/panels/resize-composer", + "name": "ResizeComposer", "properties": { "element": {"#": "rightPanelResizer"}, - "id": "rightPanelResizer", - "panel": {"#": "rightPanelContainer"}, - "isVertical": false, - "redrawStage": true - } + "component": {"@": "owner"}, + "yAxis": false + }, + "listeners": [ + { + "type": "resizeStart", + "listener": {"@": "owner"} + }, + { + "type": "resizeMove", + "listener": {"@": "owner"} + }, + { + "type": "resizeEnd", + "listener": {"@": "owner"} + } + ] }, "resizer2": { - "module": "js/panels/Resizer", - "name": "Resizer", + "module": "js/panels/resize-composer", + "name": "ResizeComposer", "properties": { "element": {"#": "timelineResizer"}, - "id": "timelineResizer", - "panel": {"#": "bottomPanelContainer"}, - "isVertical": true, - "isInversed": true, - "redrawStage": true - } + "component": {"@": "owner"}, + "xAxis": false + }, + "listeners": [ + { + "type": "resizeStart", + "listener": {"@": "owner"} + }, + { + "type": "resizeMove", + "listener": {"@": "owner"} + }, + { + "type": "resizeEnd", + "listener": {"@": "owner"} + } + ] + }, + + "Resizer": { + "module": "js/panels/resize-composer", + "name": "ResizeComposer", + "properties": { + "element": {"#": "pasteboardResizer"}, + "component": {"@": "owner"} + }, + "listeners": [ + { + "type": "resizeStart", + "listener": {"@": "owner"} + }, + { + "type": "resizeMove", + "listener": {"@": "owner"} + }, + { + "type": "resizeEnd", + "listener": {"@": "owner"} + } + ] }, "stageMode": { @@ -321,7 +366,10 @@ "documentBar": {"@": "documentBar"}, "ioMediator": {"@": "ioMediator"}, "timeline": {"@": "timeline"}, - "mainMenuController": {"@": "mainMenuController"} + "mainMenuController": {"@": "mainMenuController"}, + "rightPanelContainer": {"#": "rightPanelContainer" }, + "panelSplitter": {"@": "splitter3"}, + "timelineSplitter": {"@": "splitter4"} } } } @@ -374,7 +422,9 @@
+
+
@@ -382,20 +432,13 @@
- -
- -
-
-
-
-
+
-
+
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 2a6e49f7..e29c5057 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -23,6 +23,80 @@ exports.Ninja = Montage.create(Component, { value: null }, + _isResizing: { + value: false + }, + _resizedHeight : { + value: 0 + }, + _height: { + value: null + }, + + height: { + get: function() { + return this._height; + }, + set: function(val) { + if(this._height != val) { + this._height = val; + this.needsDraw = true; + } + + } + }, + + _resizedWidth : { + value: 0 + }, + _width: { + value: null + }, + + width: { + get: function() { + return this._width; + }, + set: function(val) { + if(this._width != val) { + this._width = val; + this.needsDraw = true; + } + + } + }, + + handleResizeStart: { + value:function(e) { + this.isResizing = true; + this.height = parseInt(this.timeline.element.offsetHeight); + this.width = parseInt(this.rightPanelContainer.offsetWidth); + this.needsDraw = true; + } + }, + + handleResizeMove: { + value:function(e) { + this._resizedHeight = e._event.dY; + this._resizedWidth = e._event.dX; + console.log("resizing"); + this.stage.resizeCanvases = true; + this.needsDraw = true; + } + }, + + handleResizeEnd: { + value: function(e) { + this.height -= this._resizedHeight; + this.width -= this._resizedWidth; + this.stage.resizeCanvases = true; + this._resizedHeight = 0; + this._resizedWidth = 0; + this.isResizing = false; + this.needsDraw = true; + } + }, + selectedElements: { value: [] }, @@ -78,12 +152,45 @@ exports.Ninja = Montage.create(Component, { } }, + willDraw: { + value: function() { + if (this.height === null) { + this.height = parseInt(this.timeline.element.offsetHeight); + } + if (this.width === null) { + this.width = parseInt(this.rightPanelContainer.offsetWidth); + } + } + }, + + draw: { + value: function() { + if (this.height - this._resizedHeight < 30) { + this.timelineSplitter.collapsed = true; + } else { + this.timelineSplitter.collapsed = false; + } + if (this.width - this._resizedWidth < 30) { + this.panelSplitter.collapsed = true; + } else { + this.panelSplitter.collapsed = false; + } + + this.timeline.element.style.height = (this.height - this._resizedHeight) + "px"; + this.rightPanelContainer.style.width = (this.width - this._resizedWidth) + "px"; + } + }, + _didDraw: { value: false }, didDraw: { value: function() { + if (!this.isResizing) { + this.height = this.timeline.element.offsetHeight; + this.width = this.rightPanelContainer.offsetWidth; + } if(!this._didDraw) { if (!this.application.ninja.coreIoApi.ioServiceDetected) { var check = this.application.ninja.coreIoApi.cloudAvailable(); -- cgit v1.2.3 From ccbbf1318fcf21409f0b1841119b49fadd92f83d Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 22 Mar 2012 16:53:23 -0700 Subject: Start WebGL animation during live preview. And set WebGL animation back to user preference when closing live preview. Signed-off-by: Nivesh Rajbhandari --- js/ninja.reel/ninja.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 2a6e49f7..7db2a82c 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -166,6 +166,25 @@ exports.Ninja = Montage.create(Component, { this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); + this._toggleWebGlAnimation(this.appModel.livePreview); + } + }, + + // Turn on WebGL animation during preview + _toggleWebGlAnimation: { + value: function(inLivePreview) { + var glCanvases = this.currentDocument.iframe.contentWindow.document.querySelectorAll('[data-RDGE-id]'), + glShapeModel; + if(glCanvases) { + for(var i = 0, len = glCanvases.length; i --- js/ninja.reel/ninja.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 7db2a82c..c76c7d46 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -179,8 +179,10 @@ exports.Ninja = Montage.create(Component, { for(var i = 0, len = glCanvases.length; i --- js/ninja.reel/ninja.html | 4 ++++ js/ninja.reel/ninja.js | 13 +++++++++++++ 2 files changed, 17 insertions(+) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index b3545329..7b5a6e52 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -148,6 +148,10 @@ { "type": "resizeEnd", "listener": {"@": "owner"} + }, + { + "type": "resizeReset", + "listener": {"@": "owner"} } ] }, diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index e29c5057..b432755f 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -97,6 +97,19 @@ exports.Ninja = Montage.create(Component, { } }, + handleResizeReset: { + value: function(e) { + this.width = 253; + this.height = 140; + this._resizedHeight = 0; + this._resizedWidth = 0; + this.needsDraw = true; + this.timelineSplitter.collapsed = false; + this.panelSplitter.collapsed = false; + } + }, + + selectedElements: { value: [] }, -- cgit v1.2.3 From 28b7e870ac4cd023ddf1ffee7a1b122257f57190 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Fri, 23 Mar 2012 15:30:17 -0700 Subject: minor glitch in calculations in snap code Signed-off-by: Armen Kesablyan --- js/ninja.reel/ninja.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index b432755f..50343a18 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -178,7 +178,7 @@ exports.Ninja = Montage.create(Component, { draw: { value: function() { - if (this.height - this._resizedHeight < 30) { + if (this.height - this._resizedHeight < 46) { this.timelineSplitter.collapsed = true; } else { this.timelineSplitter.collapsed = false; -- cgit v1.2.3