All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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
');return e&&i.append('

'+e+"

"),i}},{key:"getContainer",value:function(t){var e=!1;return t.id&&(e=$("#property--"+t.id),e.length||(e=e=$('
'),this.$el.append(e),t.label&&e.append('

'+t.label+"

"))),e===!1&&(e=$('
'),this.$el.append(e)),e}},{key:"remove",value:function(){this.items.forEach(function(t){t.remove()}),this.keyAdded&&this.keyAdded.dispose(),delete this.editor,delete this.$el,delete this.timeline,delete this.timer,delete this.selectionManager,delete this.keyAdded,delete this.items,delete this.numberProp,delete this.tweenProp}},{key:"addNumberProperty",value:function(t,e,i,n){var r=o["default"];t.type&&"color"===t.type&&(r=u["default"]);var a=new r(t,e,this.editor,i);return a.keyAdded.add(this.onKeyAdded),n.append(a.$el),a}},{key:"addTweenProperty",value:function(t,e,i,n,r){var a=this,s=new h["default"](t,e,this.editor,i,this.timeline);return n.append(s.$el),s.$el.find("[data-action-remove]").click(function(t){t.preventDefault();var n=r.keys.indexOf(i);n>-1&&(r.keys.splice(n,1),i._dom&&a.editor.propertiesEditor.keyRemoved.dispatch(i._dom),e._isDirty=!0)}),s}},{key:"update",value:function(){for(var t=0;t'),n.b("\n"+i),n.b(' '),n.b("\n"+i),n.b(' "),n.b("\n"+i),n.b(' '),n.b("\n"+i),n.b("
"),n.b("\n"),n.fl()},partials:{},subs:{}},'
\n \n \n \n
\n',n);return t.render.apply(t,arguments)}},function(t,e,i){var n=i(26);n.Template=i(27).Template,n.template=n.Template,t.exports=n},function(t,e,i){!function(t){function e(t){"}"===t.n.substr(t.n.length-1)&&(t.n=t.n.substring(0,t.n.length-1))}function i(t){return t.trim?t.trim():t.replace(/^\s*|\s*$/g,"")}function n(t,e,i){if(e.charAt(i)!=t.charAt(0))return!1;for(var n=1,r=t.length;r>n;n++)if(e.charAt(i+n)!=t.charAt(n))return!1;return!0}function r(e,i,n,o){var l=[],u=null,c=null,h=null;for(c=n[n.length-1];e.length>0;){if(h=e.shift(),c&&"<"==c.tag&&!(h.tag in k))throw new Error("Illegal content in < super tag.");if(t.tags[h.tag]<=t.tags.$||a(h,o))n.push(h),h.nodes=r(e,h.tag,n,o);else{if("/"==h.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+h.n);if(u=n.pop(),h.n!=u.n&&!s(h.n,u.n,o))throw new Error("Nesting error: "+u.n+" vs. "+h.n);return u.end=h.i,l}"\n"==h.tag&&(h.last=0==e.length||"\n"==e[0].tag)}l.push(h)}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return l}function a(t,e){for(var i=0,n=e.length;n>i;i++)if(e[i].o==t.n)return t.tag="#",!0}function s(t,e,i){for(var n=0,r=i.length;r>n;n++)if(i[n].c==t&&i[n].o==e)return!0}function o(t){var e=[];for(var i in t)e.push('"'+u(i)+'": function(c,p,t,i) {'+t[i]+"}");return"{ "+e.join(",")+" }"}function l(t){var e=[];for(var i in t.partials)e.push('"'+u(i)+'":{name:"'+u(t.partials[i].name)+'", '+l(t.partials[i])+"}");return"partials: {"+e.join(",")+"}, subs: "+o(t.subs)}function u(t){return t.replace(y,"\\\\").replace(m,'\\"').replace(v,"\\n").replace(g,"\\r").replace(b,"\\u2028").replace(_,"\\u2029")}function c(t){return~t.indexOf(".")?"d":"f"}function h(t,e){var i="<"+(e.prefix||""),n=i+t.n+w++;return e.partials[n]={name:t.n,partials:{}},e.code+='t.b(t.rp("'+u(n)+'",c,p,"'+(t.indent||"")+'"));',n}function d(t,e){e.code+="t.b(t.t(t."+c(t.n)+'("'+u(t.n)+'",c,p,0)));'}function p(t){return"t.b("+t+");"}var f=/\S/,m=/\"/g,v=/\n/g,g=/\r/g,y=/\\/g,b=/\u2028/,_=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(r,a){function s(){y.length>0&&(b.push({tag:"_t",text:new String(y)}),y="")}function o(){for(var e=!0,i=w;i"==i.tag&&(i.indent=b[n].text.toString()),b.splice(n,1));else e||b.push({tag:"\n"});_=!1,w=b.length}function u(t,e){var n="="+T,r=t.indexOf(n,e),a=i(t.substring(t.indexOf("=",e)+1,r)).split(" ");return x=a[0],T=a[a.length-1],r+n.length-1}var c=r.length,h=0,d=1,p=2,m=h,v=null,g=null,y="",b=[],_=!1,k=0,w=0,x="{{",T="}}";for(a&&(a=a.split(" "),x=a[0],T=a[1]),k=0;c>k;k++)m==h?n(x,r,k)?(--k,s(),m=d):"\n"==r.charAt(k)?l(_):y+=r.charAt(k):m==d?(k+=x.length-1,g=t.tags[r.charAt(k+1)],v=g?r.charAt(k+1):"_v","="==v?(k=u(r,k),m=h):(g&&k++,m=p),_=k):n(T,r,k)?(b.push({tag:v,n:i(y),otag:x,ctag:T,i:"/"==v?_-x.length:k+T.length}),y="",k+=T.length-1,m=h,"{"==v&&("}}"==T?k++:e(b[b.length-1]))):y+=r.charAt(k);return l(_,!0),b};var k={_t:!0,"\n":!0,$:!0,"/":!0};t.stringify=function(e,i,n){return"{code: function (c,p,i) { "+t.wrapMain(e.code)+" },"+l(e)+"}"};var w=0;t.generate=function(e,i,n){w=0;var r={code:"",subs:{},partials:{}};return t.walk(e,r),n.asString?this.stringify(r,i,n):this.makeTemplate(r,i,n)},t.wrapMain=function(t){return'var t=this;t.b(i=i||"");'+t+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(t,e,i){var n=this.makePartials(t);return n.code=new Function("c","p","i",this.wrapMain(t.code)),new this.template(n,e,this,i)},t.makePartials=function(t){var e,i={subs:{},partials:t.partials,name:t.name};for(e in i.partials)i.partials[e]=this.makePartials(i.partials[e]);for(e in t.subs)i.subs[e]=new Function("c","p","t","i",t.subs[e]);return i},t.codegen={"#":function(e,i){i.code+="if(t.s(t."+c(e.n)+'("'+u(e.n)+'",c,p,1),c,p,0,'+e.i+","+e.end+',"'+e.otag+" "+e.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(e.nodes,i),i.code+="});c.pop();}"},"^":function(e,i){i.code+="if(!t.s(t."+c(e.n)+'("'+u(e.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(e.nodes,i),i.code+="};"},">":h,"<":function(e,i){var n={partials:{},code:"",subs:{},inPartial:!0};t.walk(e.nodes,n);var r=i.partials[h(e,i)];r.subs=n.subs,r.partials=n.partials},$:function(e,i){var n={subs:{},code:"",partials:i.partials,prefix:e.n};t.walk(e.nodes,n),i.subs[e.n]=n.code,i.inPartial||(i.code+='t.sub("'+u(e.n)+'",c,p,i);')},"\n":function(t,e){e.code+=p('"\\n"'+(t.last?"":" + i"))},_v:function(t,e){e.code+="t.b(t.v(t."+c(t.n)+'("'+u(t.n)+'",c,p,0)));'},_t:function(t,e){e.code+=p('"'+u(t.text)+'"')},"{":d,"&":d},t.walk=function(e,i){for(var n,r=0,a=e.length;a>r;r++)n=t.codegen[e[r].tag],n&&n(e[r],i);return i},t.parse=function(t,e,i){return i=i||{},r(t,"",[],i.sectionTags||[])},t.cache={},t.cacheKey=function(t,e){return[t,!!e.asString,!!e.disableLambda,e.delimiters,!!e.modelGet].join("||")},t.compile=function(e,i){i=i||{};var n=t.cacheKey(e,i),r=this.cache[n];if(r){var a=r.partials;for(var s in a)delete a[s].instance;return r}return r=this.generate(this.parse(this.scan(e,i.delimiters),e,i),e,i),this.cache[n]=r}}(e)},function(t,e,i){!function(t){function e(t,e,i){var n;return e&&"object"==typeof e&&(void 0!==e[t]?n=e[t]:i&&e.get&&"function"==typeof e.get&&(n=e.get(t))),n}function i(t,e,i,n,r,a){function s(){}function o(){}s.prototype=t,o.prototype=t.subs;var l,u=new s;u.subs=new o,u.subsText={},u.buf="",n=n||{},u.stackSubs=n,u.subsText=a;for(l in e)n[l]||(n[l]=e[l]);for(l in n)u.subs[l]=n[l];r=r||{},u.stackPartials=r;for(l in i)r[l]||(r[l]=i[l]);for(l in r)u.partials[l]=r[l];return u}function n(t){return String(null===t||void 0===t?"":t)}function r(t){return t=n(t),c.test(t)?t.replace(a,"&").replace(s,"<").replace(o,">").replace(l,"'").replace(u,"""):t}t.Template=function(t,e,i,n){t=t||{},this.r=t.code||this.r,this.c=i,this.options=n||{},this.text=e||"",this.partials=t.partials||{},this.subs=t.subs||{},this.buf=""},t.Template.prototype={r:function(t,e,i){return""},v:r,t:n,render:function(t,e,i){return this.ri([t],e||{},i)},ri:function(t,e,i){return this.r(t,e,i)},ep:function(t,e){var n=this.partials[t],r=e[n.name];if(n.instance&&n.base==r)return n.instance;if("string"==typeof r){if(!this.c)throw new Error("No compiler available.");r=this.c.compile(r,this.options)}if(!r)return null;if(this.partials[t].base=r,n.subs){e.stackText||(e.stackText={});for(key in n.subs)e.stackText[key]||(e.stackText[key]=void 0!==this.activeSub&&e.stackText[this.activeSub]?e.stackText[this.activeSub]:this.text);r=i(r,n.subs,n.partials,this.stackSubs,this.stackPartials,e.stackText)}return this.partials[t].instance=r,r},rp:function(t,e,i,n){var r=this.ep(t,i);return r?r.ri(e,i,n):""},rs:function(t,e,i){var n=t[t.length-1];if(!h(n))return void i(t,e,this);for(var r=0;r=0;u--)if(s=i[u],a=e(t,s,l),void 0!==a){o=!0;break}return o?(r||"function"!=typeof a||(a=this.mv(a,i,n)),a):r?!1:""},ls:function(t,e,i,r,a){var s=this.options.delimiters;return this.options.delimiters=a,this.b(this.ct(n(t.call(e,r)),e,i)),this.options.delimiters=s,!1},ct:function(t,e,i){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(t,this.options).render(e,i)},b:function(t){this.buf+=t},fl:function(){var t=this.buf;return this.buf="",t},ms:function(t,e,i,n,r,a,s){var o,l=e[e.length-1],u=t.call(l);return"function"==typeof u?n?!0:(o=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,l,i,o.substring(r,a),s)):u},mv:function(t,e,i){var r=e[e.length-1],a=t.call(r);return"function"==typeof a?this.ct(n(a.call(r)),r,i):a},sub:function(t,e,i,n){var r=this.subs[t];r&&(this.activeSub=t,r(e,i,this,n),this.activeSub=!1)}};var a=/&/g,s=//g,l=/\'/g,u=/\"/g,c=/[&<>\"\']/,h=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}}(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")}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i'),n.b("\n"+i),n.b(' '),n.b("\n"+i),n.b(' "),n.b("\n"+i),n.b(' '),n.b("\n"+i),n.b(""),n.b("\n"),n.fl()},partials:{},subs:{}},'
\n \n \n \n
\n',n);return t.render.apply(t,arguments)}},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;i'),n.b("\n"+i),n.b(' '),n.b("\n"+i),n.b('
'),n.b("\n"+i),n.b('
'),n.b("\n"+i),n.b(' "),n.b("\n"+i),n.b("
"),n.b("\n"+i),n.b("
"),n.b("\n"+i),n.b(""),n.b("\n"+i),n.b('
'),n.b("\n"+i),n.b(' key at '),n.b(n.v(n.f("time",t,e,0))),n.b(" seconds"),n.b("\n"+i),n.b(' Remove key'),n.b("\n"+i),n.b("
"),n.fl()},partials:{},subs:{}},'
\n \n
\n
\n \n
\n
\n
\n
\n key at {{time}} seconds\n Remove key\n
',n);return t.render.apply(t,arguments)}},function(t,e,i){var n=i(25);t.exports=function(){var t=new n.Template({code:function(t,e,i){var n=this;return n.b(i=i||""),n.b('
'),n.b("\n"+i),n.b(' '),n.b("\n"+i),n.b('
'),n.b("\n"+i),n.b("
"),n.b("\n"),n.fl()},partials:{},subs:{}},'
\n \n
\n
\n',n);return t.render.apply(t,arguments)}},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;i-1&&this.selection.splice(e,1)}},{key:"sortSelection",value:function(){var t=function(t,e){return t.time&&e.time?t.timee.time?1:0:0};this.selection=this.selection.sort(t)}},{key:"reset",value:function(){this.selection=[],this.highlightItems(),this.onSelect.dispatch(this.selection,!1)}},{key:"triggerSelect",value:function(){this.onSelect.dispatch(this.selection,!1)}},{key:"addDataRelations",value:function(){for(var t=this.tweenTime.data,e=0;e=this.history.length-1?!1:(this.current_index+=1,void this.setState(this.current_index))}},{key:"addState",value:function(){var t=JSON.parse(this.editor.exporter.getJSON());this.current_index+1this.history_max&&this.history.shift(),this.current_index=this.history.length-1}},{key:"setState",value:function(t){for(var e=this.history[t],i=e.data,n=this.editor.tweenTime,r=0;r'),n.b("\n"+i),n.b(' "),n.b("\n"+i),n.b('
'),n.b("\n"+i),n.b(' '),n.b("\n"+i),n.b(' '),n.b("\n"+i),n.b(' '),n.b("\n"+i),n.b(' / '),n.b("\n"+i),n.b("
"),n.b("\n"+i),n.b('
'),n.b("\n"),n.b("\n"+i),n.b("
"),n.b("\n"+i),n.b('
'),n.b("\n"),n.b("\n"+i),n.b("
"),n.b("\n"+i),n.b(""),n.b("\n"),n.fl()},partials:{},subs:{}},'
\n \n
\n \n \n \n / \n
\n
\n\n
\n
\n\n
\n
\n',n);return t.render.apply(t,arguments)}}])}); //# sourceMappingURL=TweenTime.Editor.min.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy