2021-10-15 01:15:43 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* (c) Copyright Ascensio System SIA 2010-2019
|
|
|
|
*
|
|
|
|
* This program is a free software product. You can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
|
|
|
* version 3 as published by the Free Software Foundation. In accordance with
|
|
|
|
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
|
|
|
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
|
|
|
* of any third-party rights.
|
|
|
|
*
|
|
|
|
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
|
|
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
|
|
|
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
|
|
|
*
|
|
|
|
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
|
|
|
* street, Riga, Latvia, EU, LV-1050.
|
|
|
|
*
|
|
|
|
* The interactive user interfaces in modified source and object code versions
|
|
|
|
* of the Program must display Appropriate Legal Notices, as required under
|
|
|
|
* Section 5 of the GNU AGPL version 3.
|
|
|
|
*
|
|
|
|
* Pursuant to Section 7(b) of the License you must retain the original Product
|
|
|
|
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
|
|
|
* grant you any rights under trademark law for use of our trademarks.
|
|
|
|
*
|
|
|
|
* All the Product's GUI elements, including illustrations and icon sets, as
|
|
|
|
* well as technical writing content are licensed under the terms of the
|
|
|
|
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
|
|
|
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* Animation.js
|
|
|
|
*
|
|
|
|
* View
|
|
|
|
*
|
|
|
|
* Created by Olga.Sharova on 13.10.21
|
|
|
|
* Copyright (c) 2021 Ascensio System SIA. All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
define([
|
|
|
|
'common/main/lib/util/utils',
|
|
|
|
'common/main/lib/component/Button',
|
|
|
|
'common/main/lib/component/DataView',
|
|
|
|
'common/main/lib/component/ComboDataView',
|
|
|
|
'common/main/lib/component/Layout',
|
|
|
|
'presentationeditor/main/app/view/SlideSettings',
|
|
|
|
'common/main/lib/component/MetricSpinner',
|
|
|
|
'common/main/lib/component/Window'
|
|
|
|
], function () {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
PE.Views.Animation = Common.UI.BaseView.extend(_.extend((function() {
|
|
|
|
function setEvents() {
|
|
|
|
var me = this;
|
|
|
|
if (me.listEffects) {
|
|
|
|
me.listEffects.on('click', _.bind(function (combo, record) {
|
|
|
|
me.fireEvent('animation:selecteffect', [combo, record]);
|
|
|
|
}, me));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (me.btnPreview) {
|
|
|
|
me.btnPreview.on('click', _.bind(function(btn) {
|
|
|
|
me.fireEvent('animation:preview', [me.btnPreview]);
|
|
|
|
}, me));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (me.btnParameters) {
|
|
|
|
me.btnParameters.menu.on('item:click', function (menu, item, e) {
|
2021-10-24 00:14:52 +00:00
|
|
|
me.fireEvent('animation:parameters', [item.value]);
|
2021-10-15 01:15:43 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (me.btnAnimationPane) {
|
|
|
|
me.btnAnimationPane.on('click', _.bind(function(btn) {
|
|
|
|
me.fireEvent('animation:animationpane', [me.btnAnimationPane]);
|
|
|
|
}, me));
|
|
|
|
}
|
2021-10-24 00:14:52 +00:00
|
|
|
if (me.btnAddAnimation) {
|
|
|
|
me.btnAddAnimation.on('click', _.bind(function(btn) {
|
|
|
|
me.fireEvent('animation:addanimation', [me.btnAddAnimation]);
|
2021-10-15 01:15:43 +00:00
|
|
|
}, me));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (me.numDuration) {
|
|
|
|
me.numDuration.on('change', function(bth) {
|
|
|
|
me.fireEvent('animation:duration', [me.numDuration]);
|
|
|
|
}, me);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (me.numDelay) {
|
|
|
|
me.numDelay.on('change', function(bth) {
|
|
|
|
me.fireEvent('animation:delay', [me.numDelay]);
|
|
|
|
}, me);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(me.cmbStart) {
|
|
|
|
me.cmbStart.on('selected',function (combo, record)
|
|
|
|
{
|
|
|
|
me.fireEvent('animation:startselect',[combo, record])
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2021-10-24 00:14:52 +00:00
|
|
|
if (me.numRepeat) {
|
|
|
|
me.numRepeat.on('change', function(bth) {
|
|
|
|
me.fireEvent('animation:repeat', [me.numRepeat]);
|
|
|
|
}, me);
|
|
|
|
}
|
|
|
|
|
2021-11-29 08:40:47 +00:00
|
|
|
if (me.chRewind) {
|
|
|
|
me.chRewind.on('change', _.bind(function (e) {
|
|
|
|
me.fireEvent('animation:checkrewind', [me.chRewind, me.chRewind.value, me.chRewind.lastValue]);
|
|
|
|
}, me));
|
|
|
|
}
|
|
|
|
|
2021-10-15 01:15:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
// el: '#transitions-panel',
|
|
|
|
|
|
|
|
options: {},
|
|
|
|
|
|
|
|
initialize: function (options) {
|
|
|
|
|
|
|
|
Common.UI.BaseView.prototype.initialize.call(this, options);
|
|
|
|
this.toolbar = options.toolbar;
|
|
|
|
this.appConfig = options.mode;
|
|
|
|
this.$el = this.toolbar.toolbar.$el.find('#animation-panel');
|
|
|
|
var _set = PE.enumLock;
|
|
|
|
this.lockedControls = [];
|
|
|
|
|
2021-11-22 08:54:14 +00:00
|
|
|
this._arrEffectName = [{group:'none', value: -10, iconCls: 'transition-none', caption: this.textNone}];
|
|
|
|
Array.prototype.push.apply( this._arrEffectName, Common.define.effectData.getEffectData());
|
|
|
|
this._arrEffectOptions = [];
|
2021-10-15 01:15:43 +00:00
|
|
|
this.listEffects = new Common.UI.ComboDataView({
|
|
|
|
cls: 'combo-styles',
|
|
|
|
itemWidth: 87,
|
|
|
|
itemHeight: 40,
|
|
|
|
enableKeyEvents: true,
|
|
|
|
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: '-16, 0',
|
|
|
|
beforeOpenHandler: function (e) {
|
|
|
|
var cmp = this,
|
|
|
|
menu = cmp.openButton.menu;
|
|
|
|
|
|
|
|
if (menu.cmpEl) {
|
|
|
|
menu.menuAlignEl = cmp.cmpEl;
|
|
|
|
menu.menuAlign = 'tl-tl';
|
|
|
|
menu.cmpEl.css({
|
|
|
|
'width': cmp.cmpEl.width() - cmp.openButton.$el.width(),
|
|
|
|
'min-height': cmp.cmpEl.height()
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cmp.menuPicker.scroller) {
|
|
|
|
cmp.menuPicker.scroller.update({
|
|
|
|
includePadding: true,
|
|
|
|
suppressScrollX: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
cmp.removeTips();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this.lockedControls.push(this.listEffects);
|
|
|
|
this.listEffects.menuPicker.store.add(this._arrEffectName);
|
|
|
|
|
|
|
|
this.listEffects.fieldPicker.itemTemplate = _.template([
|
|
|
|
'<div class = "btn_item x-huge" id = "<%= id %>" style = "width: ' + (this.listEffects.itemWidth) + 'px;height: ' + (this.listEffects.itemHeight) + 'px;">',
|
2021-11-22 08:54:14 +00:00
|
|
|
'<div class = "icon toolbar__icon <%= iconCls %>"></div>',
|
|
|
|
'<div class = "caption"><%= caption %></div>',
|
2021-10-15 01:15:43 +00:00
|
|
|
'</div>'
|
|
|
|
].join(''));
|
|
|
|
this.listEffects.menuPicker.itemTemplate = this.listEffects.fieldPicker.itemTemplate;
|
|
|
|
|
|
|
|
this.btnPreview = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar', // x-huge icon-top',
|
|
|
|
caption: this.txtPreview,
|
|
|
|
split: false,
|
|
|
|
iconCls: 'toolbar__icon preview-transitions',
|
|
|
|
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'medium'
|
|
|
|
});
|
|
|
|
this.lockedControls.push(this.btnPreview);
|
|
|
|
|
|
|
|
this.btnParameters = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
caption: this.txtParameters,
|
|
|
|
iconCls: 'toolbar__icon icon transition-none',
|
2021-11-22 08:54:14 +00:00
|
|
|
menu: new Common.UI.Menu({items: []}),
|
2021-10-15 01:15:43 +00:00
|
|
|
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
this.lockedControls.push(this.btnParameters);
|
|
|
|
|
|
|
|
this.btnAnimationPane = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar',
|
|
|
|
caption: this.txtAnimationPane,
|
|
|
|
split: true,
|
|
|
|
iconCls: 'toolbar__icon transition-apply-all',
|
|
|
|
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'medium'
|
|
|
|
});
|
|
|
|
this.lockedControls.push(this.btnAnimationPane);
|
|
|
|
|
2021-10-24 00:14:52 +00:00
|
|
|
this.btnAddAnimation = new Common.UI.Button({
|
2021-10-29 01:15:38 +00:00
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
2021-10-15 01:15:43 +00:00
|
|
|
caption: this.txtAddEffect,
|
|
|
|
split: true,
|
2021-10-29 01:15:38 +00:00
|
|
|
iconCls: 'toolbar__icon icon btn-addslide',
|
|
|
|
menu: true,
|
2021-10-15 01:15:43 +00:00
|
|
|
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
|
|
|
dataHint: '1',
|
2021-10-29 01:15:38 +00:00
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
2021-10-15 01:15:43 +00:00
|
|
|
});
|
2021-10-24 00:14:52 +00:00
|
|
|
this.lockedControls.push(this.btnAddAnimation);
|
2021-10-15 01:15:43 +00:00
|
|
|
|
|
|
|
this.numDuration = new Common.UI.MetricSpinner({
|
|
|
|
el: this.$el.find('#animation-spin-duration'),
|
|
|
|
step: 1,
|
2021-10-19 15:00:09 +00:00
|
|
|
width: 52,
|
2021-10-15 01:15:43 +00:00
|
|
|
value: '',
|
|
|
|
defaultUnit: this.txtSec,
|
|
|
|
maxValue: 300,
|
|
|
|
minValue: 0,
|
|
|
|
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'top',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
this.lockedControls.push(this.numDuration);
|
|
|
|
|
2021-10-29 01:15:38 +00:00
|
|
|
this.cmbTrigger = new Common.UI.ComboBox({
|
|
|
|
cls: 'input-group-nr',
|
|
|
|
menuStyle: 'width: 150px;',
|
|
|
|
//lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
|
|
|
|
data: [
|
|
|
|
{value: 0, displayValue: '1-1'},
|
|
|
|
{value: 1, displayValue: '2-2'},
|
|
|
|
{value: 2, displayValue: '3-3'}
|
|
|
|
],
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'top'
|
|
|
|
});
|
|
|
|
this.lockedControls.push(this.cmbTrigger);
|
|
|
|
|
2021-10-15 01:15:43 +00:00
|
|
|
this.numDelay = new Common.UI.MetricSpinner({
|
|
|
|
el: this.$el.find('#animation-spin-delay'),
|
|
|
|
step: 1,
|
2021-10-19 15:00:09 +00:00
|
|
|
width: 52,
|
2021-10-15 01:15:43 +00:00
|
|
|
value: '',
|
|
|
|
defaultUnit: this.txtSec,
|
|
|
|
maxValue: 300,
|
|
|
|
minValue: 0,
|
|
|
|
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'big'
|
|
|
|
});
|
|
|
|
this.lockedControls.push(this.numDelay);
|
|
|
|
|
|
|
|
this.cmbStart = new Common.UI.ComboBox({
|
|
|
|
cls: 'input-group-nr',
|
|
|
|
menuStyle: 'width: 150px;',
|
2021-10-29 01:15:38 +00:00
|
|
|
//lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
|
2021-10-15 01:15:43 +00:00
|
|
|
data: [
|
2021-11-29 08:40:47 +00:00
|
|
|
{value: AscFormat.NODE_TYPE_CLICKEFFECT, displayValue: this.textStartOnClick},
|
|
|
|
{value: AscFormat.NODE_TYPE_WITHEFFECT, displayValue: this.textStartWithPrevious},
|
|
|
|
{value: AscFormat.NODE_TYPE_AFTEREFFECT, displayValue: this.textStartAfterPrevious}
|
2021-10-15 01:15:43 +00:00
|
|
|
],
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'top'
|
|
|
|
});
|
|
|
|
this.lockedControls.push(this.cmbStart);
|
|
|
|
|
2021-10-24 00:14:52 +00:00
|
|
|
this.chRewind = new Common.UI.CheckBox({
|
|
|
|
el: this.$el.find('#animation-checkbox-rewind'),
|
|
|
|
labelText: this.strRewind,
|
|
|
|
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
this.lockedControls.push(this.chRewind);
|
|
|
|
|
|
|
|
this.numRepeat = new Common.UI.MetricSpinner({
|
|
|
|
el: this.$el.find('#animation-spin-repeat'),
|
|
|
|
step: 1,
|
2021-10-29 01:15:38 +00:00
|
|
|
width: 88,
|
2021-10-24 00:14:52 +00:00
|
|
|
value: '',
|
2021-10-29 01:15:38 +00:00
|
|
|
maxValue: 1000,
|
2021-10-24 00:14:52 +00:00
|
|
|
minValue: 0,
|
|
|
|
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'big'
|
|
|
|
});
|
2021-10-29 01:15:38 +00:00
|
|
|
this.lockedControls.push(this.numRepeat);
|
|
|
|
|
2021-10-15 01:15:43 +00:00
|
|
|
Common.Utils.lockControls(PE.enumLock.disableOnStart, true, {array: this.lockedControls});
|
|
|
|
|
|
|
|
this.$el.find('#animation-duration').text(this.strDuration);
|
|
|
|
this.$el.find('#animation-delay').text(this.strDelay);
|
|
|
|
this.$el.find('#animation-label-start').text(this.strStart);
|
2021-10-24 00:14:52 +00:00
|
|
|
this.$el.find('#animation-repeat').text(this.strRepeat);
|
2021-10-29 01:15:38 +00:00
|
|
|
this.$el.find('#animation-label-trigger').text(this.strTrigger);
|
2021-10-15 01:15:43 +00:00
|
|
|
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
|
|
|
},
|
|
|
|
|
|
|
|
render: function (el) {
|
|
|
|
this.boxSdk = $('#editor_sdk');
|
|
|
|
if (el) el.html(this.getPanel());
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
|
|
|
createParametersMenuItems: function()
|
|
|
|
{
|
|
|
|
var arrEffectType = [
|
|
|
|
{caption: this.textSmoothly, value: Asc.c_oAscSlideTransitionParams.Fade_Smoothly},
|
|
|
|
{caption: this.textBlack, value: Asc.c_oAscSlideTransitionParams.Fade_Through_Black},
|
|
|
|
{caption: this.textLeft, value: Asc.c_oAscSlideTransitionParams.Param_Left},
|
|
|
|
{caption: this.textTop, value: Asc.c_oAscSlideTransitionParams.Param_Top},
|
|
|
|
{caption: this.textRight, value: Asc.c_oAscSlideTransitionParams.Param_Right},
|
|
|
|
{caption: this.textBottom, value: Asc.c_oAscSlideTransitionParams.Param_Bottom},
|
|
|
|
{caption: this.textTopLeft, value: Asc.c_oAscSlideTransitionParams.Param_TopLeft},
|
|
|
|
{caption: this.textTopRight, value: Asc.c_oAscSlideTransitionParams.Param_TopRight},
|
|
|
|
{caption: this.textBottomLeft, value: Asc.c_oAscSlideTransitionParams.Param_BottomLeft},
|
|
|
|
{caption: this.textBottomRight, value: Asc.c_oAscSlideTransitionParams.Param_BottomRight},
|
|
|
|
{caption: this.textVerticalIn, value: Asc.c_oAscSlideTransitionParams.Split_VerticalIn},
|
|
|
|
{caption: this.textVerticalOut, value: Asc.c_oAscSlideTransitionParams.Split_VerticalOut},
|
|
|
|
{caption: this.textHorizontalIn, value: Asc.c_oAscSlideTransitionParams.Split_HorizontalIn},
|
|
|
|
{caption: this.textHorizontalOut, value: Asc.c_oAscSlideTransitionParams.Split_HorizontalOut},
|
|
|
|
{caption: this.textClockwise, value: Asc.c_oAscSlideTransitionParams.Clock_Clockwise},
|
|
|
|
{caption: this.textCounterclockwise, value: Asc.c_oAscSlideTransitionParams.Clock_Counterclockwise},
|
|
|
|
{caption: this.textWedge, value: Asc.c_oAscSlideTransitionParams.Clock_Wedge},
|
|
|
|
{caption: this.textZoomIn, value: Asc.c_oAscSlideTransitionParams.Zoom_In},
|
|
|
|
{caption: this.textZoomOut, value: Asc.c_oAscSlideTransitionParams.Zoom_Out},
|
|
|
|
{caption: this.textZoomRotate, value: Asc.c_oAscSlideTransitionParams.Zoom_AndRotate}
|
|
|
|
];
|
|
|
|
|
|
|
|
var itemsMenu = [];
|
|
|
|
_.each(arrEffectType, function (item) {
|
|
|
|
itemsMenu.push({
|
|
|
|
caption: item.caption,
|
|
|
|
value: item.value,
|
|
|
|
checkable: true,
|
|
|
|
toggleGroup: 'effects'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return itemsMenu;
|
|
|
|
},
|
|
|
|
|
|
|
|
onAppReady: function (config) {
|
|
|
|
var me = this;
|
|
|
|
(new Promise(function (accept, reject) {
|
|
|
|
accept();
|
|
|
|
})).then(function() {
|
|
|
|
|
|
|
|
setEvents.call(me);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
getPanel: function () {
|
|
|
|
this.listEffects && this.listEffects.render(this.$el.find('#animation-field-effects'));
|
|
|
|
this.btnPreview && this.btnPreview.render(this.$el.find('#animation-button-preview'));
|
|
|
|
this.btnParameters && this.btnParameters.render(this.$el.find('#animation-button-parameters'));
|
|
|
|
this.btnAnimationPane && this.btnAnimationPane.render(this.$el.find('#animation-button-pane'));
|
2021-10-24 00:14:52 +00:00
|
|
|
this.btnAddAnimation && this.btnAddAnimation.render(this.$el.find('#animation-button-add-effect'));
|
2021-10-29 01:15:38 +00:00
|
|
|
this.cmbStart && this.cmbStart.render(this.$el.find('#animation-start'));
|
|
|
|
this.cmbTrigger && this.cmbTrigger.render(this.$el.find('#animation-trigger'));
|
2021-10-15 01:15:43 +00:00
|
|
|
this.renderComponent('#animation-spin-duration', this.numDuration);
|
|
|
|
this.renderComponent('#animation-spin-delay', this.numDelay);
|
2021-10-24 00:14:52 +00:00
|
|
|
this.renderComponent('#animation-spin-repeat', this.numRepeat);
|
2021-10-15 01:15:43 +00:00
|
|
|
this.$el.find("#animation-duration").innerText = this.strDuration;
|
|
|
|
this.$el.find("#animation-delay").innerText = this.strDelay;
|
|
|
|
this.$el.find("#animation-label-start").innerText = this.strStart;
|
2021-10-29 01:15:38 +00:00
|
|
|
this.$el.find("#animation-label-trigger").innerText = this.strTrigger;
|
2021-10-24 00:14:52 +00:00
|
|
|
this.$el.find("#animation-repeat").innerText = this.strRepeat;
|
2021-10-29 01:15:38 +00:00
|
|
|
this.widthRow(this.$el.find("#animation-label-start"), this.$el.find("#animation-delay"));
|
2021-10-15 01:15:43 +00:00
|
|
|
return this.$el;
|
|
|
|
},
|
|
|
|
|
2021-10-29 01:15:38 +00:00
|
|
|
renderComponent: function (compid, obj) {
|
2021-10-15 01:15:43 +00:00
|
|
|
var element = this.$el.find(compid);
|
|
|
|
element.parent().append(obj.el);
|
|
|
|
},
|
|
|
|
|
2021-10-29 01:15:38 +00:00
|
|
|
widthRow: function (obj1, obj2, wd) {
|
|
|
|
if(wd) return wd;
|
|
|
|
var w1 = obj1.width(),
|
|
|
|
w2 = obj2.width();
|
|
|
|
if(!w1 || !w2) return 0;
|
|
|
|
if(w1>w2) {
|
|
|
|
obj2.css('width', w1);
|
|
|
|
return w1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
obj1.css('width', w2);
|
|
|
|
return w2;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-10-15 01:15:43 +00:00
|
|
|
show: function () {
|
|
|
|
Common.UI.BaseView.prototype.show.call(this);
|
|
|
|
this.fireEvent('show', this);
|
|
|
|
},
|
|
|
|
|
|
|
|
getButtons: function (type) {
|
|
|
|
if (type === undefined)
|
|
|
|
return this.lockedControls;
|
|
|
|
return [];
|
|
|
|
},
|
|
|
|
|
|
|
|
setDisabled: function (state) {
|
|
|
|
this.lockedControls && this.lockedControls.forEach(function (button) {
|
|
|
|
button.setDisabled(state);
|
|
|
|
}, this);
|
|
|
|
},
|
|
|
|
|
2021-10-29 01:15:38 +00:00
|
|
|
setWidthRow: function () {
|
|
|
|
this.widthStart = this.widthRow(this.$el.find("#animation-label-start"), this.$el.find("#animation-delay"),this.widthStart);
|
|
|
|
this.widthDuration = this.widthRow(this.$el.find("#animation-duration"), this.$el.find("#animation-label-trigger"),this.widthDuration);
|
|
|
|
},
|
|
|
|
|
2021-11-22 08:54:14 +00:00
|
|
|
setMenuParameters: function (effectId, option, reload)
|
2021-10-15 01:15:43 +00:00
|
|
|
{
|
2021-11-22 08:54:14 +00:00
|
|
|
var effect = this.listEffects.store.findWhere({value: effectId}).attributes;
|
|
|
|
if(reload) {
|
|
|
|
this._arrEffectOptions = Common.define.effectData.getEffectOptionsData(effect.group);
|
2021-10-15 01:15:43 +00:00
|
|
|
}
|
2021-11-22 08:54:14 +00:00
|
|
|
if (!this.listEffects.isDisabled()) {
|
|
|
|
this.btnParameters.setDisabled(effect.group === 'none' || !this._arrEffectOptions);
|
|
|
|
this.btnPreview.setDisabled(effect.group === 'none');
|
|
|
|
this.numDuration.setDisabled(effect.group === 'none');
|
|
|
|
}
|
|
|
|
if(!this._arrEffectOptions)
|
|
|
|
return undefined;
|
2021-10-15 01:15:43 +00:00
|
|
|
|
|
|
|
var selectedElement;
|
2021-11-22 08:54:14 +00:00
|
|
|
this.btnParameters.menu.removeAll();
|
|
|
|
if(this._arrEffectOptions[effect.value]) {
|
2021-11-29 08:40:47 +00:00
|
|
|
var i=0;
|
|
|
|
this._arrEffectOptions[effect.value].forEach(function (opt, index) {
|
2021-11-22 08:54:14 +00:00
|
|
|
this.btnParameters.menu.addItem(opt);
|
2021-11-29 08:40:47 +00:00
|
|
|
this.btnParameters.menu.items[index].checkable=true;
|
|
|
|
if((option!=undefined)&&(opt.value==option))
|
|
|
|
i = index;
|
2021-11-22 08:54:14 +00:00
|
|
|
}, this);
|
2021-11-29 08:40:47 +00:00
|
|
|
selectedElement = this.btnParameters.menu.items[i];
|
|
|
|
selectedElement.setChecked(true);
|
2021-11-22 08:54:14 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
selectedElement = undefined;
|
|
|
|
}
|
2021-10-15 01:15:43 +00:00
|
|
|
|
|
|
|
if (!this.listEffects.isDisabled()) {
|
2021-11-22 08:54:14 +00:00
|
|
|
this.btnParameters.setDisabled(!selectedElement);
|
2021-10-15 01:15:43 +00:00
|
|
|
}
|
2021-11-22 08:54:14 +00:00
|
|
|
|
2021-11-29 08:40:47 +00:00
|
|
|
return (selectedElement)?selectedElement.value:undefined;
|
2021-10-15 01:15:43 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
txtSec: 's',
|
|
|
|
txtPreview: 'Preview',
|
|
|
|
txtParameters: 'Parameters',
|
|
|
|
txtAnimationPane: 'Animation Pane',
|
2021-10-24 00:14:52 +00:00
|
|
|
txtAddEffect: 'Add animation',
|
2021-10-15 01:15:43 +00:00
|
|
|
strDuration: 'Duration',
|
|
|
|
strDelay: 'Delay',
|
|
|
|
strStart: 'Start',
|
2021-10-24 00:14:52 +00:00
|
|
|
strRewind: 'Rewind',
|
|
|
|
strRepeat: 'Repeat',
|
2021-10-29 01:15:38 +00:00
|
|
|
strTrigger: 'Trigger',
|
2021-10-15 01:15:43 +00:00
|
|
|
|
|
|
|
textStartOnClick: 'On Click',
|
2021-11-29 08:40:47 +00:00
|
|
|
textStartWithPrevious: 'With Previous',
|
2021-10-15 01:15:43 +00:00
|
|
|
textStartAfterPrevious: 'After Previous',
|
|
|
|
|
|
|
|
textNone: 'None',
|
|
|
|
textFade: 'Fade',
|
|
|
|
textPush: 'Push',
|
|
|
|
textWipe: 'Wipe',
|
|
|
|
textSplit: 'Split',
|
|
|
|
textUnCover: 'UnCover',
|
|
|
|
textCover: 'Cover',
|
|
|
|
textClock: 'Clock',
|
|
|
|
textZoom: 'Zoom',
|
|
|
|
|
|
|
|
textSmoothly: 'Smoothly',
|
|
|
|
textBlack: 'Through Black',
|
|
|
|
textLeft: 'Left',
|
|
|
|
textTop: 'Top',
|
|
|
|
textRight: 'Right',
|
|
|
|
textBottom: 'Bottom',
|
|
|
|
textTopLeft: 'Top-Left',
|
|
|
|
textTopRight: 'Top-Right',
|
|
|
|
textBottomLeft: 'Bottom-Left',
|
|
|
|
textBottomRight: 'Bottom-Right',
|
|
|
|
textVerticalIn: 'Vertical In',
|
|
|
|
textVerticalOut: 'Vertical Out',
|
|
|
|
textHorizontalIn: 'Horizontal In',
|
|
|
|
textHorizontalOut: 'Horizontal Out',
|
|
|
|
textClockwise: 'Clockwise',
|
|
|
|
textCounterclockwise: 'Counterclockwise',
|
|
|
|
textWedge: 'Wedge',
|
|
|
|
textZoomIn: 'Zoom In',
|
|
|
|
textZoomOut: 'Zoom Out',
|
|
|
|
textZoomRotate: 'Zoom and Rotate'
|
|
|
|
}
|
|
|
|
}()), PE.Views.Animation || {}));
|
|
|
|
|
|
|
|
});
|