
timeline.scripts.TweenTime.Editor.min.js Maven / Gradle / Ivy
The newest version!
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require(void 0),require("lodash"),require("d3"),require("jquery"),require("DraggableNumber"),require("spectrum")):"function"==typeof define&&define.amd?define(["signals","lodash","d3","jquery","DraggableNumber","spectrum"],e):"object"==typeof exports?exports.Editor=e(require("./signals"),require("lodash"),require("d3"),require("jquery"),require("DraggableNumber"),require("spectrum")):(t.TweenTime=t.TweenTime||{},t.TweenTime.Editor=e(t.signals,t._,t.d3,t.$,t.DraggableNumber,t.spectrum))}(this,function(t,e,i,n,r,a){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function(){function t(t,e){for(var i=0;ie.time?1:0};return t.sort(e)}},{key:"guid",value:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}}]),t}();e["default"]=r,t.exports=e["default"]},,function(e,i){e.exports=t},,,function(t,i){t.exports=e},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;ithis.timer.getCurrentTime()&&(this.timer.time[0]=this.initialDomain[0]);var a={top:6,right:20,bottom:0,left:265};this.margin=a;var s=window.innerWidth-a.left-a.right,l=270-a.top-a.bottom-40;this.lineHeight=20,this.label_position_x=-a.left+20,this.x=T.time.scale().domain(this.initialDomain).range([0,s]),this.xAxis=T.svg.axis().scale(this.x).orient("top").tickSize(-l,0).tickFormat(o["default"].formatMinutes),this.svg=T.select(e.$timeline.get(0)).select(".timeline__main").append("svg").attr("width",s+a.left+a.right).attr("height",600),this.svgContainer=this.svg.append("g").attr("transform","translate("+a.left+","+a.top+")"),this.svgContainerTime=this.svg.append("g").attr("transform","translate("+a.left+",0)"),this.linesContainer=this.svg.append("g").attr("transform","translate("+a.left+","+a.top+")"),this.header=new u["default"](e,this.timer,this.initialDomain,this.tweenTime,s,a),this.timeIndicator=new h["default"](this,this.svgContainerTime),this.selection=new x["default"](this,this.svg,a),this.items=new p["default"](this,this.linesContainer),this.items.onUpdate.add(this.onUpdate),this.keysPreview=new m["default"](this,this.linesContainer),this.properties=new g["default"](this),this.properties.onKeyAdded.add(function(t,e){n._isDirty=!0,n.render(0,!1),n.keys.selectNewKey(t,e)}),this.errors=new k["default"](this),this.keys=new b["default"](this),this.keys.onKeyUpdated.add(function(){n.onUpdate()}),this.xAxisGrid=T.svg.axis().scale(this.x).ticks(100).tickSize(-this.items.dy,0).tickFormat("").orient("top"),this.xGrid=this.svgContainer.append("g").attr("class","x axis grid").attr("transform","translate(0,"+a.top+")").call(this.xAxisGrid),this.xAxisElement=this.svgContainer.append("g").attr("class","x axis").attr("transform","translate(0,"+a.top+")").call(this.xAxis),this.header.onBrush.add(function(t){n.x.domain(t),n.xGrid.call(n.xAxisGrid),n.xAxisElement.call(n.xAxis),n._isDirty=!0}),window.requestAnimationFrame(function(){n.render()}),window.onresize=function(){var t=window.innerWidth,e=t-a.left-a.right;n.svg.attr("width",e+a.left+a.right),n.svg.selectAll(".timeline__right-mask").attr("width",t),n.x.range([0,e]),n._isDirty=!0,n.header.resize(t),n.render()}}return a(t,[{key:"onUpdate",value:function(){this.editor.render(!1,!1,!0)}},{key:"render",value:function(t,e){if(e){var i,n=16;this.timer.getCurrentTime()>this.initialDomain[1]&&(i=this.initialDomain[1]-this.initialDomain[0],this.initialDomain[0]+=i-n,this.initialDomain[1]+=i-n,this.header.setDomain(this.initialDomain)),this.timer.getCurrentTime()=n.timeStart&&t.time<=n.timeEnd&&(a>=n.y&&a<=n.y+n.height||a+10>=n.y&&a+10<=n.y+n.height)&&(d3.select(this).classed("key--selected",!0),o.push(i))}}),t.timeline.selectionManager.select(o)}}),$(window).on("mouseup",this.onMouseUp)}}]),t}();e["default"]=r,t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i