diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel')
3 files changed, 2204 insertions, 7 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html index 9e2bacd5..eac361a8 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | |||
@@ -35,7 +35,9 @@ | |||
35 | "container_tracks" : {"#" : "container-tracks"}, | 35 | "container_tracks" : {"#" : "container-tracks"}, |
36 | "timeline_disabler" : {"#" : "timeline-disabler"}, | 36 | "timeline_disabler" : {"#" : "timeline-disabler"}, |
37 | "checkable_animated" : {"#" : "checkable_animated"}, | 37 | "checkable_animated" : {"#" : "checkable_animated"}, |
38 | "tl_configbutton" : {"#" : "tl-configbutton"} | 38 | "tl_configbutton" : {"#" : "tl-configbutton"}, |
39 | "checkable_lock" : {"#" : "checkable_lock"}, | ||
40 | "checkable_visible":{"#" : "checkable_visible"} | ||
39 | } | 41 | } |
40 | }, | 42 | }, |
41 | 43 | ||
@@ -178,6 +180,8 @@ | |||
178 | <div class="tl-configbutton" data-montage-id="tl-configbutton"> | 180 | <div class="tl-configbutton" data-montage-id="tl-configbutton"> |
179 | <div class="tl-dropdown"> | 181 | <div class="tl-dropdown"> |
180 | <div class="checkable" data-montage-id="checkable_animated">Show only animated layers</div> | 182 | <div class="checkable" data-montage-id="checkable_animated">Show only animated layers</div> |
183 | <div class="checkable" data-montage-id="checkable_lock">Lock Layers</div> | ||
184 | <div class="checkable" data-montage-id="checkable_visible">Visibility of Layers</div> | ||
181 | </div> | 185 | </div> |
182 | </div> | 186 | </div> |
183 | 187 | ||
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 89389469..2cbd9e2b 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -747,6 +747,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
747 | this.application.ninja.currentDocument.tlCurrentLayerSelected = false; | 747 | this.application.ninja.currentDocument.tlCurrentLayerSelected = false; |
748 | this.application.ninja.currentDocument.tlCurrentLayersSelected = false; | 748 | this.application.ninja.currentDocument.tlCurrentLayersSelected = false; |
749 | this.application.ninja.currentDocument.tlCurrentElementsSelected = []; | 749 | this.application.ninja.currentDocument.tlCurrentElementsSelected = []; |
750 | this.application.ninja.currentDocument.lockedElements = []; | ||
750 | } | 751 | } |
751 | }, | 752 | }, |
752 | 753 | ||
@@ -865,6 +866,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
865 | document.addEventListener("keydown", this.timelineLeftPaneKeydown.bind(this), false); | 866 | document.addEventListener("keydown", this.timelineLeftPaneKeydown.bind(this), false); |
866 | document.addEventListener("keyup", this.timelineLeftPaneKeyup.bind(this), false); | 867 | document.addEventListener("keyup", this.timelineLeftPaneKeyup.bind(this), false); |
867 | this.eventManager.addEventListener("updatedID", this.handleLayerIdUpdate.bind(this), false); | 868 | this.eventManager.addEventListener("updatedID", this.handleLayerIdUpdate.bind(this), false); |
869 | this.checkable_lock.addEventListener("click",this.handleLockLayerClick.bind(this),false); | ||
870 | this.checkable_visible.addEventListener("click",this.handleLayerVisibleClick.bind(this),false); | ||
868 | 871 | ||
869 | // Bind some bindings | 872 | // Bind some bindings |
870 | Object.defineBinding(this, "currentSelectedContainer", { | 873 | Object.defineBinding(this, "currentSelectedContainer", { |
@@ -1139,7 +1142,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
1139 | for (i = 0; i < arrLayersLength; i++) { | 1142 | for (i = 0; i < arrLayersLength; i++) { |
1140 | if (this.arrLayers[i].layerData.isSelected === true) { | 1143 | if (this.arrLayers[i].layerData.isSelected === true) { |
1141 | if (arrSelectedIndexes.indexOf(i) < 0) { | 1144 | if (arrSelectedIndexes.indexOf(i) < 0) { |
1142 | |||
1143 | this.arrLayers[i].layerData.isSelected = false; | 1145 | this.arrLayers[i].layerData.isSelected = false; |
1144 | this.triggerLayerBinding(i); | 1146 | this.triggerLayerBinding(i); |
1145 | } | 1147 | } |
@@ -1157,11 +1159,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
1157 | // Loop through arrLayers and do the selection. | 1159 | // Loop through arrLayers and do the selection. |
1158 | for (i = 0; i < arrLayersLength; i++) { | 1160 | for (i = 0; i < arrLayersLength; i++) { |
1159 | if (arrSelectedIndexes.indexOf(i) > -1) { | 1161 | if (arrSelectedIndexes.indexOf(i) > -1) { |
1160 | this.arrLayers[i].layerData.isSelected = true; | 1162 | if(!this.arrLayers[i].layerData.isLock){ |
1161 | this.arrLayers[i].isSelected = true; | 1163 | this.arrLayers[i].layerData.isSelected = true; |
1162 | this.triggerLayerBinding(i); | 1164 | this.arrLayers[i].isSelected = true; |
1163 | arrSelectedLayers.push(i); | 1165 | this.triggerLayerBinding(i); |
1164 | arrCurrentElementsSelected.push(this.arrLayers[i].layerData.stageElement); | 1166 | arrSelectedLayers.push(i); |
1167 | arrCurrentElementsSelected.push(this.arrLayers[i].layerData.stageElement); | ||
1168 | }else{ | ||
1169 | this.arrLayers[i].layerData.isSelected = false; | ||
1170 | this.triggerLayerBinding(i); | ||
1171 | } | ||
1165 | } | 1172 | } |
1166 | } | 1173 | } |
1167 | 1174 | ||
@@ -1415,6 +1422,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
1415 | thingToPush.layerData._isFirstDraw = true; | 1422 | thingToPush.layerData._isFirstDraw = true; |
1416 | thingToPush.layerData.created = true; | 1423 | thingToPush.layerData.created = true; |
1417 | thingToPush.layerData.stageElement = object; | 1424 | thingToPush.layerData.stageElement = object; |
1425 | thingToPush.layerData.isLock = false; | ||
1426 | thingToPush.layerData.isHidden = false; | ||
1427 | |||
1418 | 1428 | ||
1419 | if (this.checkable_animated.classList.contains("checked")) { | 1429 | if (this.checkable_animated.classList.contains("checked")) { |
1420 | thingToPush.layerData.isVisible = false; | 1430 | thingToPush.layerData.isVisible = false; |
@@ -1732,6 +1742,74 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
1732 | } | 1742 | } |
1733 | }, | 1743 | }, |
1734 | 1744 | ||
1745 | handleLockLayerClick:{ | ||
1746 | value:function(event){ | ||
1747 | |||
1748 | var arrLayersLength = this.arrLayers.length; | ||
1749 | var lockElementArrLength = this.application.ninja.currentDocument.lockedElements.length; | ||
1750 | var i = 0; | ||
1751 | |||
1752 | if(event.currentTarget.classList.contains("checked")){ | ||
1753 | event.currentTarget.classList.remove("checked"); | ||
1754 | for(i=0;i<arrLayersLength;i++){ | ||
1755 | this.arrLayers[i].layerData.isLock = false; | ||
1756 | this.arrLayers[i].layerData.isSelected = true; | ||
1757 | for(var k = 0; k<lockElementArrLength; k++){ | ||
1758 | if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.stageElement){ | ||
1759 | this.application.ninja.currentDocument.lockedElements.splice(k,1); | ||
1760 | break; | ||
1761 | } | ||
1762 | } | ||
1763 | |||
1764 | } | ||
1765 | } else { | ||
1766 | for(i = 0;i < arrLayersLength;i++){ | ||
1767 | if(!this.arrLayers[i].layerData.isLock){ | ||
1768 | this.arrLayers[i].layerData.isLock = true; | ||
1769 | this.arrLayers[i].layerData.isSelected = false; | ||
1770 | this.application.ninja.currentDocument.lockedElements.push(this.arrLayers[i].layerData.stageElement); | ||
1771 | } | ||
1772 | this.selectLayers([]); | ||
1773 | |||
1774 | } | ||
1775 | event.currentTarget.classList.add("checked"); | ||
1776 | } | ||
1777 | } | ||
1778 | }, | ||
1779 | |||
1780 | handleLayerVisibleClick:{ | ||
1781 | value:function(event){ | ||
1782 | var arrLayersLength = this.arrLayers.length; | ||
1783 | var lockElementArrLength = this.application.ninja.currentDocument.lockedElements.length; | ||
1784 | var i = 0; | ||
1785 | |||
1786 | if(event.currentTarget.classList.contains("checked")){ | ||
1787 | event.currentTarget.classList.remove("checked"); | ||
1788 | for(i = 0; i < arrLayersLength; i++){ | ||
1789 | this.arrLayers[i].layerData.isHidden = false; | ||
1790 | this.arrLayers[i].layerData.stageElement.style.visibility = "visible"; | ||
1791 | for(var k=0;k<lockElementArrLength;k++){ | ||
1792 | if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.stageElement){ | ||
1793 | this.application.ninja.currentDocument.lockedElements.splice(k,1); | ||
1794 | break; | ||
1795 | } | ||
1796 | } | ||
1797 | |||
1798 | } | ||
1799 | } else { | ||
1800 | for(i = 0; i < arrLayersLength; i++){ | ||
1801 | if(!this.arrLayers[i].layerData.isHidden){ | ||
1802 | this.arrLayers[i].layerData.isHidden = true; | ||
1803 | this.arrLayers[i].layerData.stageElement.style.visibility = "hidden"; | ||
1804 | this.application.ninja.currentDocument.lockedElements.push(this.arrLayers[i].layerData.stageElement); | ||
1805 | } | ||
1806 | |||
1807 | } | ||
1808 | event.currentTarget.classList.add("checked"); | ||
1809 | } | ||
1810 | } | ||
1811 | }, | ||
1812 | |||
1735 | // A layer's ID has been updated in the property panel. We need to update | 1813 | // A layer's ID has been updated in the property panel. We need to update |
1736 | // our layer. | 1814 | // our layer. |
1737 | handleLayerIdUpdate: { | 1815 | handleLayerIdUpdate: { |
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js.orig b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js.orig new file mode 100644 index 00000000..59263fc3 --- /dev/null +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js.orig | |||
@@ -0,0 +1,2115 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage/core/core").Montage, | ||
8 | Component = require("montage/ui/component").Component, | ||
9 | nj = require("js/lib/NJUtils").NJUtils, | ||
10 | EasingMenuPopup = require("js/panels/Timeline/EasingMenu.reel").EasingMenu; | ||
11 | |||
12 | var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | ||
13 | |||
14 | user_layers: { | ||
15 | value: null, | ||
16 | serializable: true | ||
17 | }, | ||
18 | |||
19 | track_container: { | ||
20 | value: null, | ||