Refactoring: rename timing to transition

This commit is contained in:
Sergey Luzyanin 2020-12-02 13:11:49 +03:00
parent 847945c6a1
commit 6339b19437
6 changed files with 83 additions and 83 deletions

View file

@ -137,8 +137,8 @@ define([
if (settingsType==Common.Utils.documentSettingsType.Slide) {
this._settings[settingsType].locked = value.get_LockDelete();
this._settings[settingsType].lockedBackground = value.get_LockBackground();
this._settings[settingsType].lockedEffects = value.get_LockTranzition();
this._settings[settingsType].lockedTiming = value.get_LockTiming();
this._settings[settingsType].lockedEffects = value.get_LockTransition();
this._settings[settingsType].lockedTransition = value.get_LockTransition();
this._settings[settingsType].lockedHeader = !!value.get_LockHeader && value.get_LockHeader();
} else {
this._settings[settingsType].locked = value.get_Locked();
@ -183,7 +183,7 @@ define([
if (pnl.locked!==undefined)
this.rightmenu.slideSettings.setLocked(this._state.no_slides || pnl.lockedBackground || pnl.locked,
this._state.no_slides || pnl.lockedEffects || pnl.locked,
this._state.no_slides || pnl.lockedTiming || pnl.locked,
this._state.no_slides || pnl.lockedTransition || pnl.locked,
this._state.no_slides || pnl.lockedHeader || pnl.locked);
} else
pnl.panel.setLocked(pnl.locked);

View file

@ -892,9 +892,9 @@ define([
for (var i=0; i<selectedElements.length; i++) {
if (Asc.c_oAscTypeSelectElement.Slide == selectedElements[i].get_ObjectType()) {
var elValue = selectedElements[i].get_ObjectValue(),
timing = elValue.get_timing();
if (timing)
loop = timing.get_ShowLoop();
transition = elValue.get_transition();
if (transition)
loop = transition.get_ShowLoop();
}
}
}
@ -904,9 +904,9 @@ define([
loop = dlg.getSettings();
if (me.api) {
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_ShowLoop(loop);
props.put_timing(timing);
var transition = new Asc.CAscSlideTransition();
transition.put_ShowLoop(loop);
props.put_transition(transition);
me.api.SetSlideProps(props);
}
}

View file

@ -80,7 +80,7 @@ define([
this._locked = {
background: false,
effects: false,
timing: false,
transition: false,
header: false
};
this._stateDisabled = {};
@ -261,7 +261,7 @@ define([
disabled: true
});
this.btnApplyToAll.on('click', _.bind(function(btn){
if (this.api) this.api.SlideTimingApplyToAll();
if (this.api) this.api.SlideTransitionApplyToAll();
this.fireEvent('editcomplete', this);
}, this));
@ -1074,10 +1074,10 @@ define([
this.Effect = type;
if (this.api && !this._noApply) {
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_TransitionType(type);
timing.put_TransitionOption(this.EffectType);
props.put_timing(timing);
var transition = new Asc.CAscSlideTransition();
transition.put_TransitionType(type);
transition.put_TransitionOption(this.EffectType);
props.put_transition(transition);
this.api.SetSlideProps(props);
}
this.fireEvent('editcomplete', this);
@ -1087,10 +1087,10 @@ define([
this.EffectType = record.value;
if (this.api && !this._noApply) {
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_TransitionType(this.Effect);
timing.put_TransitionOption(this.EffectType);
props.put_timing(timing);
var transition = new Asc.CAscSlideTransition();
transition.put_TransitionType(this.Effect);
transition.put_TransitionOption(this.EffectType);
props.put_transition(transition);
this.api.SetSlideProps(props);
}
this.fireEvent('editcomplete', this);
@ -1099,9 +1099,9 @@ define([
onDurationChange: function(field, newValue, oldValue, eOpts){
if (this.api && !this._noApply) {
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_TransitionDuration(field.getNumberValue()*1000);
props.put_timing(timing);
var transition = new Asc.CAscSlideTransition();
transition.put_TransitionDuration(field.getNumberValue()*1000);
props.put_transition(transition);
this.api.SetSlideProps(props);
}
},
@ -1109,9 +1109,9 @@ define([
onDelayChange: function(field, newValue, oldValue, eOpts){
if (this.api && !this._noApply) {
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_SlideAdvanceDuration(field.getNumberValue()*1000);
props.put_timing(timing);
var transition = new Asc.CAscSlideTransition();
transition.put_SlideAdvanceDuration(field.getNumberValue()*1000);
props.put_transition(transition);
this.api.SetSlideProps(props);
}
},
@ -1119,9 +1119,9 @@ define([
onStartOnClickChange: function(field, newValue, oldValue, eOpts){
if (this.api && !this._noApply) {
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_SlideAdvanceOnMouseClick(field.getValue()=='checked');
props.put_timing(timing);
var transition = new Asc.CAscSlideTransition();
transition.put_SlideAdvanceOnMouseClick(field.getValue()=='checked');
props.put_transition(transition);
this.api.SetSlideProps(props);
}
this.fireEvent('editcomplete', this);
@ -1131,9 +1131,9 @@ define([
this.numDelay.setDisabled(field.getValue()!=='checked');
if (this.api && !this._noApply) {
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_SlideAdvanceAfter(field.getValue()=='checked');
props.put_timing(timing);
var transition = new Asc.CAscSlideTransition();
transition.put_SlideAdvanceAfter(field.getValue()=='checked');
props.put_transition(transition);
this.api.SetSlideProps(props);
}
this.fireEvent('editcomplete', this);
@ -1196,7 +1196,7 @@ define([
ChangeSettings: function(props) {
if (this._initSettings)
this.createDelayedElements();
this.SetSlideDisabled(this._locked.background, this._locked.effects, this._locked.timing, this._locked.header);
this.SetSlideDisabled(this._locked.background, this._locked.effects, this._locked.transition, this._locked.header);
if (props)
{
@ -1382,9 +1382,9 @@ define([
this._state.SlideColor = this.SlideColor.Color;
}
var timing = props.get_timing();
if (timing) {
var value = timing.get_TransitionType();
var transition = props.get_transition();
if (transition) {
var value = transition.get_TransitionType();
var found = false;
if (this._state.Effect !== value) {
var item = this.cmbEffectName.store.findWhere({value: value});
@ -1399,7 +1399,7 @@ define([
this._state.Effect = value;
}
value = timing.get_TransitionOption();
value = transition.get_TransitionOption();
if (this._state.EffectType !== value || found) {
found = false;
item = this.cmbEffectType.store.findWhere({value: value});
@ -1412,7 +1412,7 @@ define([
this._state.EffectType = value;
}
value = timing.get_TransitionDuration();
value = transition.get_TransitionDuration();
if ( Math.abs(this._state.Duration-value)>0.001 ||
(this._state.Duration===null || value===null)&&(this._state.Duration!==value) ||
(this._state.Duration===undefined || value===undefined)&&(this._state.Duration!==value) ) {
@ -1420,7 +1420,7 @@ define([
this._state.Duration=value;
}
value = timing.get_SlideAdvanceDuration();
value = transition.get_SlideAdvanceDuration();
if ( Math.abs(this._state.Delay-value)>0.001 ||
(this._state.Delay===null || value===null)&&(this._state.Delay!==value) ||
(this._state.Delay===undefined || value===undefined)&&(this._state.Delay!==value) ) {
@ -1428,12 +1428,12 @@ define([
this._state.Delay=value;
}
value = timing.get_SlideAdvanceOnMouseClick();
value = transition.get_SlideAdvanceOnMouseClick();
if ( this._state.OnMouseClick!==value ) {
this.chStartOnClick.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true);
this._state.OnMouseClick=value;
}
value = timing.get_SlideAdvanceAfter();
value = transition.get_SlideAdvanceAfter();
if ( this._state.AdvanceAfter!==value ) {
this.chDelay.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true);
this.numDelay.setDisabled(this.chDelay.getValue()!=='checked');
@ -1527,15 +1527,15 @@ define([
}
},
setLocked: function (background, effects, timing, header) {
setLocked: function (background, effects, transition, header) {
this._locked = {
background: background, effects: effects, timing: timing, header: header
background: background, effects: effects, transition: transition, header: header
};
},
SetSlideDisabled: function(background, effects, timing, header) {
SetSlideDisabled: function(background, effects, transition, header) {
this._locked = {
background: background, effects: effects, timing: timing, header: header
background: background, effects: effects, transition: transition, header: header
};
if (this._initSettings) return;
@ -1555,12 +1555,12 @@ define([
this.btnPreview.setDisabled(length<1 || effects);
this._stateDisabled.effects = effects;
}
if (timing !== this._stateDisabled.timing) {
this.chStartOnClick.setDisabled(timing);
this.chDelay.setDisabled(timing);
this.numDelay.setDisabled(timing || this.chDelay.getValue()!=='checked');
this.btnApplyToAll.setDisabled(timing);
this._stateDisabled.timing = timing;
if (transition !== this._stateDisabled.transition) {
this.chStartOnClick.setDisabled(transition);
this.chDelay.setDisabled(transition);
this.numDelay.setDisabled(transition || this.chDelay.getValue()!=='checked');
this.btnApplyToAll.setDisabled(transition);
this._stateDisabled.transition = transition;
}
if (header !== this._stateDisabled.header) {
this.chSlideNum.setDisabled(header);

View file

@ -166,7 +166,7 @@ define([
objectValue = object.get_ObjectValue();
if (type == Asc.c_oAscTypeSelectElement.Slide) {
slide_deleted = objectValue.get_LockDelete();
slide_lock = objectValue.get_LockLayout() || objectValue.get_LockBackground() || objectValue.get_LockTranzition() || objectValue.get_LockTiming();
slide_lock = objectValue.get_LockLayout() || objectValue.get_LockBackground() || objectValue.get_LockTransition() || objectValue.get_LockTiming();
} else if (objectValue && _.isFunction(objectValue.get_Locked)) {
no_object = false;
objectLocked = objectLocked || objectValue.get_Locked();

View file

@ -345,7 +345,7 @@ define([
no_text = false;
}
} else if (Asc.c_oAscTypeSelectElement.Slide == type) {
if ( !(objectValue.get_LockLayout() || objectValue.get_LockBackground() || objectValue.get_LockTranzition() || objectValue.get_LockTiming() ))
if ( !(objectValue.get_LockLayout() || objectValue.get_LockBackground() || objectValue.get_LockTransition() || objectValue.get_LockTiming() ))
_settings.push('slide');
} else if (Asc.c_oAscTypeSelectElement.Image == type) {
if ( !objectValue.get_Locked() )

View file

@ -180,25 +180,25 @@ define([
_initTransitionView: function () {
var me = this;
var timing = _slideObject.get_timing();
if (timing) {
_effect = timing.get_TransitionType();
var transition = _slideObject.get_transition();
if (transition) {
_effect = transition.get_TransitionType();
me.getView('EditSlide').fillEffectTypes(_effect);
$('#edit-slide-effect .item-after').text(me.getView('EditSlide').getEffectName(_effect));
$('#edit-slide-effect-type').toggleClass('disabled', _effect == Asc.c_oAscSlideTransitionTypes.None);
$('#edit-slide-duration').toggleClass('disabled', _effect == Asc.c_oAscSlideTransitionTypes.None);
_effectType = timing.get_TransitionOption();
_effectType = transition.get_TransitionOption();
$('#edit-slide-effect-type .item-after').text((_effect != Asc.c_oAscSlideTransitionTypes.None) ? me.getView('EditSlide').getEffectTypeName(_effectType) : '');
_effectDuration = timing.get_TransitionDuration();
_effectDuration = transition.get_TransitionDuration();
$('#edit-slide-duration .item-after label').text((_effectDuration!==null && _effectDuration!==undefined) ? (parseInt(_effectDuration/1000.) + ' ' + me.textSec) : '');
$('#edit-slide-start-click input:checkbox').prop('checked', !!timing.get_SlideAdvanceOnMouseClick());
$('#edit-slide-delay input:checkbox').prop('checked', !!timing.get_SlideAdvanceAfter());
$('#edit-slide-delay .item-content:nth-child(2)').toggleClass('disabled',!timing.get_SlideAdvanceAfter());
$('#edit-slide-start-click input:checkbox').prop('checked', !!transition.get_SlideAdvanceOnMouseClick());
$('#edit-slide-delay input:checkbox').prop('checked', !!transition.get_SlideAdvanceAfter());
$('#edit-slide-delay .item-content:nth-child(2)').toggleClass('disabled',!transition.get_SlideAdvanceAfter());
_effectDelay = timing.get_SlideAdvanceDuration();
_effectDelay = transition.get_SlideAdvanceDuration();
$('#edit-slide-delay .item-content:nth-child(2) .item-after').text((_effectDelay!==null && _effectDelay!==undefined) ? (parseInt(_effectDelay/1000.) + ' ' + me.textSec) : '');
$('#edit-slide-delay .item-content:nth-child(2) input').val([(_effectDelay!==null && _effectDelay!==undefined) ? parseInt(_effectDelay/1000.) : 0]);
}
@ -266,10 +266,10 @@ define([
_effectType = this.getView('EditSlide').fillEffectTypes(_effect);
var props = new Asc.CAscSlideProps(),
timing = new Asc.CAscSlideTiming();
timing.put_TransitionType(_effect);
timing.put_TransitionOption(_effectType);
props.put_timing(timing);
transition = new Asc.CAscSlideTransition();
transition.put_TransitionType(_effect);
transition.put_TransitionOption(_effectType);
props.put_transition(transition);
this.api.SetSlideProps(props);
}
},
@ -281,10 +281,10 @@ define([
_effectType = parseFloat($target.prop('value'));
var props = new Asc.CAscSlideProps(),
timing = new Asc.CAscSlideTiming();
timing.put_TransitionType(_effect);
timing.put_TransitionOption(_effectType);
props.put_timing(timing);
transition = new Asc.CAscSlideTransition();
transition.put_TransitionType(_effect);
transition.put_TransitionOption(_effectType);
props.put_transition(transition);
this.api.SetSlideProps(props);
}
},
@ -302,9 +302,9 @@ define([
$('#edit-slide-duration .item-after label').text(duration + ' ' + this.textSec);
var props = new Asc.CAscSlideProps(),
timing = new Asc.CAscSlideTiming();
timing.put_TransitionDuration(_effectDuration);
props.put_timing(timing);
transition = new Asc.CAscSlideTransition();
transition.put_TransitionDuration(_effectDuration);
props.put_transition(transition);
this.api.SetSlideProps(props);
},
@ -312,9 +312,9 @@ define([
var $checkbox = $(e.currentTarget);
var props = new Asc.CAscSlideProps(),
timing = new Asc.CAscSlideTiming();
timing.put_SlideAdvanceOnMouseClick($checkbox.is(':checked'));
props.put_timing(timing);
transition = new Asc.CAscSlideTransition();
transition.put_SlideAdvanceOnMouseClick($checkbox.is(':checked'));
props.put_transition(transition);
this.api.SetSlideProps(props);
},
@ -324,10 +324,10 @@ define([
$('#edit-slide-delay .item-content:nth-child(2)').toggleClass('disabled',!$checkbox.is(':checked'));
var props = new Asc.CAscSlideProps(),
timing = new Asc.CAscSlideTiming();
timing.put_SlideAdvanceAfter($checkbox.is(':checked'));
timing.put_SlideAdvanceDuration(_effectDelay);
props.put_timing(timing);
transition = new Asc.CAscSlideTransition();
transition.put_SlideAdvanceAfter($checkbox.is(':checked'));
transition.put_SlideAdvanceDuration(_effectDelay);
props.put_transition(transition);
this.api.SetSlideProps(props);
},
@ -339,9 +339,9 @@ define([
$('#edit-slide-delay .item-content:nth-child(2) .item-after').text(delay + ' ' + this.textSec);
var props = new Asc.CAscSlideProps(),
timing = new Asc.CAscSlideTiming();
timing.put_SlideAdvanceDuration(_effectDelay);
props.put_timing(timing);
transition = new Asc.CAscSlideTransition();
transition.put_SlideAdvanceDuration(_effectDelay);
props.put_transition(transition);
this.api.SetSlideProps(props);
},
@ -351,7 +351,7 @@ define([
},
onApplyAll: function (e) {
this.api.SlideTimingApplyToAll();
this.api.SlideTransitionApplyToAll();
},
// API handlers