diff options
author | Jonathan Duran | 2012-06-15 00:28:24 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-06-15 00:28:24 -0700 |
commit | 85dfdc9d46847d5fdd1b6fc6aaf35e93b09e9935 (patch) | |
tree | 6b73c6854b8b853646e49c10679178c26228b815 /js | |
parent | f25c0450a5f75ee6937147c361aa95d3305a7e6a (diff) | |
download | ninja-85dfdc9d46847d5fdd1b6fc6aaf35e93b09e9935.tar.gz |
F6 support for keyframes
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-x | js/mediators/keyboard-mediator.js | 7 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 10 | ||||
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 41 |
3 files changed, 41 insertions, 17 deletions
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 4fd4bd4c..d1f8e221 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js | |||
@@ -50,6 +50,7 @@ var Keyboard = exports.Keyboard = { | |||
50 | X:88, | 50 | X:88, |
51 | Y:89, | 51 | Y:89, |
52 | Z:90, | 52 | Z:90, |
53 | F6:117, | ||
53 | PLUS:187, | 54 | PLUS:187, |
54 | MINUS:189 | 55 | MINUS:189 |
55 | }; | 56 | }; |
@@ -210,6 +211,12 @@ exports.KeyboardMediator = Montage.create(Component, { | |||
210 | return; | 211 | return; |
211 | } | 212 | } |
212 | 213 | ||
214 | // F6 keyboard shortcut to add a keyframe to the timeline | ||
215 | if (evt.keyCode == Keyboard.F6) { | ||
216 | this.application.ninja.timeline.handleKeyframeShortcut(); | ||
217 | return; | ||
218 | } | ||
219 | |||
213 | // Check if cmd+a/ctrl+a for Select All | 220 | // Check if cmd+a/ctrl+a for Select All |
214 | if((evt.keyCode == Keyboard.A) && (evt.ctrlKey || evt.metaKey)) { | 221 | if((evt.keyCode == Keyboard.A) && (evt.ctrlKey || evt.metaKey)) { |
215 | NJevent("selectAll"); | 222 | NJevent("selectAll"); |
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index b022bd8a..7f8d421d 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -905,6 +905,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
905 | } | 905 | } |
906 | }, | 906 | }, |
907 | 907 | ||
908 | handleKeyframeShortcut:{ | ||
909 | value:function(){ | ||
910 | //console.log(this.currentLayersSelected); | ||
911 | //console.log(this.trackRepetition); | ||
912 | var tempEv = {}; | ||
913 | tempEv.offsetX = this.playheadmarker.offsetLeft; | ||
914 | this.trackRepetition.childComponents[this.currentLayersSelected[0]].handleKeyboardShortcut(tempEv); | ||
915 | } | ||
916 | }, | ||
917 | |||
908 | updateTrackContainerWidth:{ | 918 | updateTrackContainerWidth:{ |
909 | value:function () { | 919 | value:function () { |
910 | this.container_tracks.style.width = (this.end_hottext.value * 80) + "px"; | 920 | this.container_tracks.style.width = (this.end_hottext.value * 80) + "px"; |
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 6d557845..11c27ce3 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | |||
@@ -649,25 +649,32 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
649 | // This needs to move to a keyboard shortcut that is TBD | 649 | // This needs to move to a keyboard shortcut that is TBD |
650 | var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); | 650 | var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); |
651 | if (ev.shiftKey) { | 651 | if (ev.shiftKey) { |
652 | //if (this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList.length == 1) { | 652 | if (this.tweens.length < 1) { |
653 | if (this.tweens.length < 1) { | 653 | this.insertTween(0); |
654 | this.insertTween(0); | 654 | this.addAnimationRuleToElement(ev); |
655 | this.addAnimationRuleToElement(ev); | 655 | this.updateKeyframeRule(); |
656 | } else { | ||
657 | if (ev.target.className === "tracklane") { | ||
658 | this.handleNewTween(ev); | ||
659 | this.updateKeyframeRule(); | ||
660 | } else if (ev.target.className === "tween_span" && ev.target.parentElement.parentElement.className === "tracklane") { | ||
661 | this.handleNewTween(ev); | ||
656 | this.updateKeyframeRule(); | 662 | this.updateKeyframeRule(); |
657 | } else { | ||
658 | //console.log(ev); | ||
659 | if (ev.target.className === "tracklane") { | ||
660 | this.handleNewTween(ev); | ||
661 | this.updateKeyframeRule(); | ||
662 | } else if (ev.target.className === "tween_span" && ev.target.parentElement.parentElement.className === "tracklane"){ | ||
663 | this.handleNewTween(ev); | ||
664 | this.updateKeyframeRule(); | ||
665 | } | ||
666 | } | 663 | } |
667 | //} else { | 664 | } |
668 | // TEMP error check | 665 | } |
669 | //console.log("There must be exactly one element in an animated layer."); | 666 | } |
670 | //} | 667 | }, |
668 | |||
669 | handleKeyboardShortcut:{ | ||
670 | value:function(ev){ | ||
671 | if (this.tweens.length < 1) { | ||
672 | this.insertTween(0); | ||
673 | this.addAnimationRuleToElement(ev); | ||
674 | this.updateKeyframeRule(); | ||
675 | } else { | ||
676 | this.handleNewTween(ev); | ||
677 | this.updateKeyframeRule(); | ||
671 | } | 678 | } |
672 | } | 679 | } |
673 | }, | 680 | }, |