From 0ced8a0c39fad4968fa92124133cd6cd59f1050e Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 20 Apr 2022 17:49:38 +0300 Subject: [PATCH 1/3] [PE] For Bug 55541: hide preview option --- .../main/app/view/AnimationDialog.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/presentationeditor/main/app/view/AnimationDialog.js b/apps/presentationeditor/main/app/view/AnimationDialog.js index d8f051f78..852c1b5b6 100644 --- a/apps/presentationeditor/main/app/view/AnimationDialog.js +++ b/apps/presentationeditor/main/app/view/AnimationDialog.js @@ -44,7 +44,7 @@ define([ PE.Views.AnimationDialog = Common.UI.Window.extend(_.extend({ options: { width: 350, - height: 426, + height: 396, header: true, cls: 'animation-dlg', buttons: ['ok', 'cancel'] @@ -57,8 +57,8 @@ define([ '
', '
', '
', - '
', - '
', + '
', + // '
', '
' ].join(''); this.allEffects = Common.define.effectData.getEffectFullData(); @@ -125,11 +125,11 @@ define([ }); this.lstEffectList.on('item:select', _.bind(this.onEffectListItem,this)); - this.chPreview = new Common.UI.CheckBox({ - el : $('#animation-setpreview'), - labelText : this.textPreviewEffect, - value: !Common.Utils.InternalSettings.get("pe-animation-no-preview") - }).on('change', _.bind(this.onPreviewChange, this)); + // this.chPreview = new Common.UI.CheckBox({ + // el : $('#animation-setpreview'), + // labelText : this.textPreviewEffect, + // value: !Common.Utils.InternalSettings.get("pe-animation-no-preview") + // }).on('change', _.bind(this.onPreviewChange, this)); this.cmbGroup.setValue(this._state.activeGroupValue); this.fillLevel(); @@ -138,7 +138,7 @@ define([ }, getFocusedComponents: function() { - return [ this.cmbGroup, this.cmbLevel, this.lstEffectList, this.chPreview]; + return [ this.cmbGroup, this.cmbLevel, this.lstEffectList/*, this.chPreview*/]; }, getDefaultFocusableComponent: function () { From 27839caa262245b856c06b4b2718c3b2c7f711ab Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 20 Apr 2022 17:56:30 +0300 Subject: [PATCH 2/3] [PE] Fix Bug 55958: add autopreview option --- .../main/app/controller/Animation.js | 4 ++-- .../main/app/view/Animation.js | 21 +++++++++++++++++-- apps/presentationeditor/main/locale/en.json | 1 + apps/presentationeditor/main/locale/ru.json | 1 + 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Animation.js b/apps/presentationeditor/main/app/controller/Animation.js index b1edcf2ba..c82c014c2 100644 --- a/apps/presentationeditor/main/app/controller/Animation.js +++ b/apps/presentationeditor/main/app/controller/Animation.js @@ -174,7 +174,7 @@ define([ handler : function(result, value) { if (result == 'ok') { if (me.api) { - me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined, !Common.Utils.InternalSettings.get("pe-animation-no-preview")); + me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined); } } } @@ -189,7 +189,7 @@ define([ addNewEffect: function (type, group, groupName, replace, parametr, preview) { var parameter = this.view.setMenuParameters(type, groupName, parametr); - this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, preview); + this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview")); }, onDurationChange: function(before,combo, record, e) { diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index e2b4e7386..054b104bb 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -76,6 +76,12 @@ define([ me.btnPreview.on('click', _.bind(function(btn) { me.fireEvent('animation:preview', [me.btnPreview]); }, me)); + me.btnPreview.menu.on('item:click', _.bind(function(menu, item, e) { + if (item.value === 'preview') + me.fireEvent('animation:preview', [me.btnPreview]); + else if (item.value === 'auto') + Common.Utils.InternalSettings.set("pe-animation-no-auto-preview", !item.checked); + }, me)); } if(me.cmbTrigger) @@ -239,7 +245,8 @@ define([ this.btnPreview = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', // x-huge icon-top', caption: this.txtPreview, - split: false, + split: true, + menu: true, iconCls: 'toolbar__icon animation-preview-start', lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview, _set.timingLock], dataHint: '1', @@ -513,6 +520,15 @@ define([ me.btnAddAnimation.menu.setInnerMenu([{menu: picker, index: 0}]); }; me.btnAddAnimation.menu.on('show:before', onShowBefore); + + me.btnPreview.setMenu( new Common.UI.Menu({ + style: "min-width: auto;", + items: [ + {caption: me.txtPreview, value: 'preview'}, + {caption: me.textAutoPreview, value: 'auto', checkable: true, checked: !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview")} + ] + })); + setEvents.call(me); }); }, @@ -625,7 +641,8 @@ define([ str3: '3 s (Slow)', str2: '2 s (Medium)', str1: '1 s (Fast)', - str0_5: '0.5 s (Very Fast)' + str0_5: '0.5 s (Very Fast)', + textAutoPreview: 'AutoPreview' } }()), PE.Views.Animation || {})); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index a069edf6d..355bdb240 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1321,6 +1321,7 @@ "PE.Views.Animation.txtParameters": "Parameters", "PE.Views.Animation.txtPreview": "Preview", "PE.Views.Animation.txtSec": "s", + "PE.Views.Animation.textAutoPreview": "AutoPreview", "PE.Views.AnimationDialog.textPreviewEffect": "Preview Effect", "PE.Views.AnimationDialog.textTitle": "More Effects", "PE.Views.ChartSettings.textAdvanced": "Show advanced settings", diff --git a/apps/presentationeditor/main/locale/ru.json b/apps/presentationeditor/main/locale/ru.json index 42f5e198d..29cff409f 100644 --- a/apps/presentationeditor/main/locale/ru.json +++ b/apps/presentationeditor/main/locale/ru.json @@ -1320,6 +1320,7 @@ "PE.Views.Animation.txtAnimationPane": "Область анимации", "PE.Views.Animation.txtParameters": "Параметры", "PE.Views.Animation.txtPreview": "Просмотр", + "PE.Views.Animation.textAutoPreview": "Автопросмотр", "PE.Views.Animation.txtSec": "сек", "PE.Views.AnimationDialog.textPreviewEffect": "Просмотр эффекта", "PE.Views.AnimationDialog.textTitle": "Другие эффекты", From 4166bff1672ee8430d0b9ea78537718501c0fd31 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 20 Apr 2022 17:58:33 +0300 Subject: [PATCH 3/3] [PE] Change max delay --- apps/presentationeditor/main/app/view/Animation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index 054b104bb..e2e856c91 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -356,7 +356,7 @@ define([ width: 55, value: '', defaultUnit: this.txtSec, - maxValue: 300, + maxValue: 60, minValue: 0, lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock], dataHint: '1',