Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function Input(opt={}) {
EventEmitter.call(this);
this._createBase();
this._defaultValue = opt.defaultValue || '';
this._value = opt.value || this._defaultValue;
if ('flex' in opt) this.domElem.style.flex = opt.flex;
if ('parent' in opt) opt.parent.appendChild(this.domElem);
if (opt.onChange) this.on('change', opt.onChange);
}
function Download(opt) {
EventEmitter.call(this);
opt = opt || {};
this._root = opt.root || '_Download/';
this.icon = 'download';
this.tooltip = 'Download';
}
function Input(opt) {
EventEmitter.call(this);
this._onChangeInput = this._onChangeInput.bind(this);
this._onChangeParam = this._onChangeParam.bind(this);
this._onSelect = this._onSelect.bind(this);
this._onClickStepPrevKey = this._onClickStepPrevKey.bind(this);
this._onClickStepNextKey = this._onClickStepNextKey.bind(this);
this._onClickTgglKey = this._onClickTgglKey.bind(this);
this._name = '';
if ('name' in opt) this.name = opt.name;
this._createBase();
}
function Toolbar(opt) {
EventEmitter.call(this);
opt = opt || {};
this._height = opt.height || 24;
this._icons = [];
this._separators = {};
this.domElem = document.createElement('div');
this.domElem.style.position = 'fixed';
this.domElem.style.display = 'flex';
this.domElem.style.backgroundColor = opt.bgColor || amgui.color.bg0;
this.domElem.style.pointerEvents = 'auto';
this.domElem.style.height = this._height + 'px';
this.addSeparator({name: 'first'});
this.addSeparator({name: 'tools'});
function Track(opt, timeline) {
EventEmitter.call(this);
this.timeline = timeline;
this._selectors = [];
this._endParams = [];
this._selectedElems = [];
this._isHidingSelectedElems = false;
this._isPlaying = false;
if (!this._paramFactory) this._paramFactory = new ParamFactory({}, this.timeline);
this._onSelectClick = this._onSelectClick.bind(this);
this._onChangeSelectors = this._onChangeSelectors.bind(this);
this._onWindowResize = this._onWindowResize.bind(this);
this._onWindowScroll = this._onWindowScroll.bind(this);
function Project(save = {}) {
EventEmitter.call(this);
this._timelines = [];
this.inputs = {};
this.useSave(save);
}
function Transformer(transhand) {
EventEmitter.call(this);
this._th = transhand;
this._params = _.clone(INIT_PARAMS);
this._base = _.clone(INIT_BASE);
this._points = [{}, {}, {}, {}];
this._pOrigin = {};
this._originRadius = 6;
this._rotateFingerDist = 16;
this._onDrag = this._onDrag.bind(this);
this._onMouseUp = this._onMouseUp.bind(this);
this._onMouseMove = this._onMouseMove.bind(this);
this._onMouseDown = this._onMouseDown.bind(this);
this._rafOnDrag = this._rafOnDrag.bind(this);
this._onOverHitbox = this._onOverHitbox.bind(this);
function Transformer(transhand) {
EventEmitter.call(this);
this._th = transhand;
this._params = _.clone(INIT_PARAMS);
this._base = _.clone(INIT_BASE);
this._points = [{}, {}, {}, {}];
this._pOrigin = {};
this._originRadius = 6;
this._rotateFingerDist = 16;
this._onDrag = this._onDrag.bind(this);
this._onMouseUp = this._onMouseUp.bind(this);
this._onMouseMove = this._onMouseMove.bind(this);
this._onMouseDown = this._onMouseDown.bind(this);
this._rafOnDrag = this._rafOnDrag.bind(this);
this._onOverHitbox = this._onOverHitbox.bind(this);
function Param (opt={}, timeline) {
EventEmitter.call(this);
this.timeline = timeline;
this._lineH = amgui.LINE_HEIGHT;
this._inputs = [];
this._defaultValue = opt.defaultValue || 0;
this._onChangeInput = this._onChangeInput.bind(this);
this._onClickTgglKey = this._onClickTgglKey.bind(this);
this._onClickStepPrevKey = this._onClickStepPrevKey.bind(this);
this._onClickStepNextKey = this._onClickStepNextKey.bind(this);
this._createKeyline(opt.keyLine);
this._createOptions(opt.optionLine);
this.keyLine.parentParam = this;
function Branch() {
EventEmitter.call(this);
this._onClick = this._onClick.bind(this);
this._createBase();
}