From c115fdbfca41554cb3f474e759fa6577187e93f8 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 3 Jul 2012 11:16:42 -0700 Subject: Cleanup Keyframe.js Signed-off-by: Jonathan Duran --- js/panels/Timeline/Keyframe.reel/Keyframe.js | 71 +++++++++++++++------------- 1 file changed, 38 insertions(+), 33 deletions(-) (limited to 'js/panels/Timeline/Keyframe.reel') diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index f7c936f7..45a2afd3 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js @@ -9,6 +9,7 @@ var Component = require("montage/ui/component").Component; var Keyframe = exports.Keyframe = Montage.create(Component, { + // ==== Begin models hasTemplate:{ value: true }, @@ -42,7 +43,9 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { this.needsDraw = true; } }, + // ==== End Models + // ==== Begin Draw cycle methods prepareForDraw:{ value:function(){ this.element.addEventListener("click", this, false); @@ -66,57 +69,31 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { this.element.style.left = (this.position - 5) + "px"; } }, + // ==== End Draw cycle methods - deselectKeyframe:{ - value:function(){ - this.isSelected=false; - this.element.style.left = (this.position - 5) + "px"; - } - }, - - selectKeyframe:{ - value:function(){ - if(this.isSelected){ - return; - } - - if(this.parentComponent.parentComponent.parentComponent.trackType == "position"){ - var tweenID = this.parentComponent.tweenID; - var mainTrack = this.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent; - mainTrack.childComponents[0].childComponents[tweenID].childComponents[0].selectKeyframe(); - return; - } - - this.isSelected=true; - this.element.style.left = (this.position - 6) + "px"; - this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; - this.parentComponent.selectTween(); - } - }, - + // ==== Begin Event handlers handleClick:{ value:function(ev){ this.selectKeyframe(); ev.stopPropagation(); } }, - + handleMouseover: { value: function(event) { this.element.draggable = true; } }, + handleMouseout: { value: function(event) { this.element.draggable = false; } }, + handleDragstart: { value: function(event) { - //this.parentComponent.parentComponent.dragLayerID = this.layerID; event.dataTransfer.setData('Text', 'Keyframe'); - - // Get my index in my track's tween array var i = 0, tweenRepetitionLength = this.parentComponent.parentComponent.parentComponent.tweenRepetition.childComponents.length, myIndex = null; @@ -129,10 +106,38 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { this.selectKeyframe(); } }, + handleDragend: { value: function(event) { this.parentComponent.isDragging = false; } - } - + }, + // ==== End Event handlers + + // === Begin Controllers + selectKeyframe:{ + value:function(){ + if(this.isSelected){ + return; + } + if(this.parentComponent.parentComponent.parentComponent.trackType == "position"){ + var tweenID = this.parentComponent.tweenID; + var mainTrack = this.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent; + mainTrack.childComponents[0].childComponents[tweenID].childComponents[0].selectKeyframe(); + return; + } + this.isSelected=true; + this.element.style.left = (this.position - 6) + "px"; + this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; + this.parentComponent.selectTween(); + } + }, + + deselectKeyframe:{ + value:function () { + this.isSelected = false; + this.element.style.left = (this.position - 5) + "px"; + } + } + // ==== End Controllers }); -- cgit v1.2.3 From a869cd3619b783e29cf320f46713b0c790edb15f Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 10:57:37 -0700 Subject: Update copyright boilerplate --- js/panels/Timeline/Keyframe.reel/Keyframe.html | 34 +++++++++++++++++++---- js/panels/Timeline/Keyframe.reel/Keyframe.js | 32 ++++++++++++++++++--- js/panels/Timeline/Keyframe.reel/css/Keyframe.css | 34 +++++++++++++++++++---- 3 files changed, 86 insertions(+), 14 deletions(-) (limited to 'js/panels/Timeline/Keyframe.reel') diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.html b/js/panels/Timeline/Keyframe.reel/Keyframe.html index 4b029874..9f8baf86 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.html +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.html @@ -1,9 +1,33 @@  +Copyright (c) 2012, Motorola Mobility, Inc +All Rights Reserved. +BSD License. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of Motorola Mobility nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + --> @@ -26,4 +50,4 @@ - \ No newline at end of file + diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index f7c936f7..9ded9c76 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js @@ -1,8 +1,32 @@ /* - This file contains proprietary software owned by Motorola Mobility, Inc.
- No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
- (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ +Copyright (c) 2012, Motorola Mobility, Inc +All Rights Reserved. +BSD License. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of Motorola Mobility nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + */ var Montage = require("montage/core/core").Montage; var Component = require("montage/ui/component").Component; diff --git a/js/panels/Timeline/Keyframe.reel/css/Keyframe.css b/js/panels/Timeline/Keyframe.reel/css/Keyframe.css index 5ea236e9..19602e0a 100644 --- a/js/panels/Timeline/Keyframe.reel/css/Keyframe.css +++ b/js/panels/Timeline/Keyframe.reel/css/Keyframe.css @@ -1,8 +1,32 @@ /* - This file contains proprietary software owned by Motorola Mobility, Inc.
- No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
- (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ +Copyright (c) 2012, Motorola Mobility, Inc +All Rights Reserved. +BSD License. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of Motorola Mobility nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + */ .tween_keyframe{ position: absolute; @@ -23,4 +47,4 @@ border-style: solid; border-width: thin; border-color: #d6d1cf; -} \ No newline at end of file +} -- cgit v1.2.3