From 24a5f2b497fd3e78d5342e7566838e78dcfa8746 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 23 Feb 2012 14:58:03 -0800 Subject: fixing the tools shortcuts - IKNINJA 1199 Signed-off-by: Valerio Virgillito --- js/mediators/keyboard-mediator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 0282060f..a4bf9baa 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -162,15 +162,17 @@ exports.KeyboardMediator = Montage.create(Component, { return; } + // Hand tool if(evt.keyCode === Keyboard.H ) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[15]}); + this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[13]}); return; } + // Zoom tool if(evt.keyCode === Keyboard.Z ) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[16]}); + this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[14]}); return; } -- cgit v1.2.3 From d2cf980bece41594ac0756b5974a4414ca78a84c Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 23 Feb 2012 15:01:10 -0800 Subject: Fix to read back colors when re-opening files. Signed-off-by: Nivesh Rajbhandari --- js/panels/properties/content.reel/content.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 9b6416c7..8fa33a75 100755 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -255,6 +255,12 @@ exports.Content = Montage.create(Component, { if(currentValue) { + if(currentValue.color) + { + currentValue.color.wasSetByCode = true; + currentValue.color.type = "change"; + } + if(currentValue.mode === "gradient") { this.application.ninja.colorController.colorModel["gradient"] = @@ -267,7 +273,14 @@ exports.Content = Montage.create(Component, { this.application.ninja.colorController.colorModel.alpha = {value: currentValue.color.a, wasSetByCode: true, type: 'change'}; } - this.application.ninja.colorController.colorModel[currentValue.color.mode] = currentValue.color; + if(currentValue.color.mode) + { + this.application.ninja.colorController.colorModel[currentValue.color.mode] = currentValue.color; + } + else + { + this.application.ninja.colorController.colorModel["rgb"] = currentValue.color; + } } } else -- cgit v1.2.3 From 41b69af7c0be3dd5fe4f772668862696af8b917a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 23 Feb 2012 15:07:28 -0800 Subject: Fixing app mode check. Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index fa611de4..1c9d9d59 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -84,8 +84,13 @@ var DocumentController = exports.DocumentController = Montage.create(Component, // handleAppLoaded: { value: function() { - //Adding an intercept to resources loaded to ensure user assets load from cloud simulator - if (window.chrome.app.isInstalled) { + //Checking for app to be loaded through extension + var check; + if (chrome && chrome.app) { + check = chrome.app.getDetails(); + } + if (check !== null) { + //Adding an intercept to resources loaded to ensure user assets load from cloud simulator chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: [""]}, ["blocking"]); } } -- cgit v1.2.3 From abb3e1bdc15e8ba74ffad4cca63c656b718f7890 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 23 Feb 2012 15:55:15 -0800 Subject: Fixing the selection tool properties icons. Signed-off-by: Valerio Virgillito --- css/ninja.css | 75 +++++++++++++++-------------------- scss/imports/scss/_toolbar.scss | 87 ++++++++++++++++++++--------------------- 2 files changed, 75 insertions(+), 87 deletions(-) diff --git a/css/ninja.css b/css/ninja.css index 4d450208..f085f6be 100755 --- a/css/ninja.css +++ b/css/ninja.css @@ -212,6 +212,10 @@ body { position: absolute; margin: 0px; width: 100%; height: 100%; background-co #mainContent .CodeMirror-scroll { height: 100%; overflow: scroll; overflow-x: auto; overflow-y: auto; } +.montage-editor-frame { position: absolute; z-index: 7; top: 0; left: 0; display: none; -webkit-user-select: initial; } + +.montage-editor { padding: 0px; word-wrap: normal; } + .panelContainer { margin: 0px; padding: 0px 0px; position: relative; overflow: auto; } .panelDisclosureIcon { background-image: url("../images/panels/panelDisclosureIcon.png"); background-repeat: no-repeat; width: 16px; height: 16px; float: left; -webkit-transition-property: rotate; -webkit-transition-duration: 0.2s; -webkit-transition-timing-function: linear; padding-right: 2px; } @@ -888,49 +892,34 @@ input[type="radio"]:disabled { opacity: .3; background: #282828; border-width: 1 /*width: 26px;*/ /*opacity: 0.7;*/ /*}*/ -/*// Selection Tool Options */ -/*.topAlignUp {*/ -/*@include background-pos(8,2,26px,23px);*/ -/*}*/ -/*.rightAlignUp {*/ -/*@include background-pos(9,2,26px,23px);*/ -/*}*/ -/*.bottomAlignUp {*/ -/*@include background-pos(10,2,26px,23px);*/ -/*}*/ -/*.verticalLeftUp {*/ -/*@include background-pos(11,2,26px,23px);*/ -/*}*/ -/*.verticalCenterUp {*/ -/*@include background-pos(12,2,26px,23px);*/ -/*}*/ -/*.verticalRightUp {*/ -/*@include background-pos(13,2,26px,23px);*/ -/*}*/ -/*.distRightUp {*/ -/*@include background-pos(0,3,26px,23px);*/ -/*}*/ -/*.distLeftUp {*/ -/*@include background-pos(14,2,26px,23px);*/ -/*}*/ -/*.distCenterUp {*/ -/*@include background-pos(2,3,26px,23px);*/ -/*}*/ -/*.distTopUp {*/ -/*@include background-pos(1,3,26px,23px);*/ -/*}*/ -/*.distBottomUp {*/ -/*@include background-pos(3,3,26px,23px);*/ -/*}*/ -/*.distVCenterUp {*/ -/*@include background-pos(15,2,26px,23px);*/ -/*}*/ -/*.bucketToolUp {*/ -/*@include background-pos(11,0,26px,23px);*/ -/*}*/ -/*.pencilToolUp {*/ -/*@include background-pos(9,1,26px,23px);*/ -/*}*/ +.topAlignUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -240px -54px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.rightAlignUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -270px -54px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.bottomAlignUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -300px -54px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.verticalLeftUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -330px -54px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.verticalCenterUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -360px -54px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.verticalRightUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -390px -54px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.distRightUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: 0px -81px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.distLeftUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -420px -54px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.distCenterUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -60px -81px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.distTopUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -30px -81px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.distBottomUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -90px -81px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.distVCenterUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -450px -54px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.bucketToolUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -330px 0px; background-repeat: no-repeat; height: 23px; width: 26px; } + +.pencilToolUp { background-image: url("../images/SpriteSheets/NinjaSpriteSheet2_5.png"); background-position: -270px -27px; background-repeat: no-repeat; height: 23px; width: 26px; } + .blueDiv { background: blue; opacity: 0.2; } ::-webkit-scrollbar { width: 11px; height: 11px; } diff --git a/scss/imports/scss/_toolbar.scss b/scss/imports/scss/_toolbar.scss index 00d8b5f0..9bf540cd 100755 --- a/scss/imports/scss/_toolbar.scss +++ b/scss/imports/scss/_toolbar.scss @@ -186,72 +186,71 @@ /*opacity: 0.7;*/ /*}*/ -/*// Selection Tool Options */ -/*.topAlignUp {*/ +// Selection Tool Options +.topAlignUp { - /*@include background-pos(8,2,26px,23px);*/ -/*}*/ + @include background-pos(8,2,26px,23px); +} -/*.rightAlignUp {*/ +.rightAlignUp { - /*@include background-pos(9,2,26px,23px);*/ -/*}*/ + @include background-pos(9,2,26px,23px); +} -/*.bottomAlignUp {*/ +.bottomAlignUp { - /*@include background-pos(10,2,26px,23px);*/ -/*}*/ + @include background-pos(10,2,26px,23px); +} -/*.verticalLeftUp {*/ +.verticalLeftUp { - /*@include background-pos(11,2,26px,23px);*/ -/*}*/ + @include background-pos(11,2,26px,23px); +} -/*.verticalCenterUp {*/ +.verticalCenterUp { - /*@include background-pos(12,2,26px,23px);*/ -/*}*/ + @include background-pos(12,2,26px,23px); +} -/*.verticalRightUp {*/ +.verticalRightUp { - /*@include background-pos(13,2,26px,23px);*/ -/*}*/ + @include background-pos(13,2,26px,23px); +} -/*.distRightUp {*/ +.distRightUp { - /*@include background-pos(0,3,26px,23px);*/ -/*}*/ + @include background-pos(0,3,26px,23px); +} -/*.distLeftUp {*/ +.distLeftUp { - /*@include background-pos(14,2,26px,23px);*/ -/*}*/ + @include background-pos(14,2,26px,23px); +} -/*.distCenterUp {*/ +.distCenterUp { - /*@include background-pos(2,3,26px,23px);*/ -/*}*/ + @include background-pos(2,3,26px,23px); +} -/*.distTopUp {*/ +.distTopUp { - /*@include background-pos(1,3,26px,23px);*/ -/*}*/ - -/*.distBottomUp {*/ + @include background-pos(1,3,26px,23px); +} - /*@include background-pos(3,3,26px,23px);*/ -/*}*/ +.distBottomUp { -/*.distVCenterUp {*/ + @include background-pos(3,3,26px,23px); +} - /*@include background-pos(15,2,26px,23px);*/ -/*}*/ +.distVCenterUp { -/*.bucketToolUp {*/ - /*@include background-pos(11,0,26px,23px);*/ -/*}*/ + @include background-pos(15,2,26px,23px); +} -/*.pencilToolUp {*/ - /*@include background-pos(9,1,26px,23px);*/ -/*}*/ +.bucketToolUp { + @include background-pos(11,0,26px,23px); +} +.pencilToolUp { + @include background-pos(9,1,26px,23px); +} -- cgit v1.2.3 From 2d4c8ea72223dfbf556d9ba63eb45475523e0f0d Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Thu, 23 Feb 2012 16:08:40 -0800 Subject: Timeline : Fix for the split and element model error Timeline Signed-off-by: Kruti Shah --- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 78 ++++++++++++---------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index fddfd170..61da9e36 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -358,9 +358,11 @@ 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; + } } } }, @@ -459,42 +461,48 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.animatedElement = this.application.ninja.timeline.arrLayers[this.trackID - 1].elementsList[0]; this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); this.animationDuration = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); - this.trackDuration = this.animationDuration.split("s"); - this.currentMilliSec = this.trackDuration[0] * 1000; - this.currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); - this.clickPos = this.currentMilliSec / this.currentMillisecPerPixel; - this.nextKeyframe = 0; - - this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document); - while (this.currentKeyframeRule[i]) { - var newTween = {}; - if (this.currentKeyframeRule[i].keyText === "0%") { - newTween.spanWidth = 0; - newTween.keyFramePosition = 0; - newTween.keyFrameMillisec = 0; - newTween.tweenID = 0; - newTween.spanPosition = 0; - this.tweens.push(newTween); + if(this.animationDuration){ + this.trackDuration = this.animationDuration.split("s"); + this.currentMilliSec = this.trackDuration[0] * 1000; + this.currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); + this.clickPos = this.currentMilliSec / this.currentMillisecPerPixel; + this.nextKeyframe = 0; + + this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document); + while (this.currentKeyframeRule[i]) { + var newTween = {}; + + if (this.currentKeyframeRule[i].keyText === "0%") { + newTween.spanWidth = 0; + newTween.keyFramePosition = 0; + newTween.keyFrameMillisec = 0; + newTween.tweenID = 0; + newTween.spanPosition = 0; + this.tweens.push(newTween); - } - else { - percentValue = this.currentKeyframeRule[i].keyText; - splitValue = percentValue.split("%"); - fraction = splitValue[0] / 100; - this.currentMilliSec = fraction * this.trackDuration[0] * 1000; - this.currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); - this.clickPos = this.currentMilliSec / this.currentMillisecPerPixel; - newTween.spanWidth = this.clickPos - this.tweens[this.tweens.length - 1].keyFramePosition; - newTween.keyFramePosition = this.clickPos; - newTween.keyFrameMillisec = this.currentMilliSec; - newTween.tweenID = this.nextKeyframe; - newTween.spanPosition = this.clickPos - newTween.spanWidth; - this.tweens.push(newTween); + } + else { + percentValue = this.currentKeyframeRule[i].keyText; + splitValue = percentValue.split("%"); + fraction = splitValue[0] / 100; + this.currentMilliSec = fraction * this.trackDuration[0] * 1000; + this.currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); + this.clickPos = this.currentMilliSec / this.currentMillisecPerPixel; + newTween.spanWidth = this.clickPos - this.tweens[this.tweens.length - 1].keyFramePosition; + newTween.keyFramePosition = this.clickPos; + newTween.keyFrameMillisec = this.currentMilliSec; + newTween.tweenID = this.nextKeyframe; + newTween.spanPosition = this.clickPos - newTween.spanWidth; + this.tweens.push(newTween); + } + i++; + this.nextKeyframe += 1; } - i++; - this.nextKeyframe += 1; + } + else{ + return; } } }, -- cgit v1.2.3