From fc878b72ea5ba9f623701a95ffcd01ea18be6272 Mon Sep 17 00:00:00 2001 From: "Julia.Radzhabova" Date: Mon, 9 Jun 2025 19:24:10 +0300 Subject: [PATCH] [PE] Add new features tips --- .../main/lib/component/SynchronizeTip.js | 2 +- .../main/app/controller/Animation.js | 10 ++++- .../main/app/controller/Toolbar.js | 45 ++++++++++++------- .../main/app/view/Animation.js | 3 ++ apps/presentationeditor/main/locale/en.json | 4 ++ 5 files changed, 46 insertions(+), 18 deletions(-) diff --git a/apps/common/main/lib/component/SynchronizeTip.js b/apps/common/main/lib/component/SynchronizeTip.js index 90a15a56a1..d5794102bf 100644 --- a/apps/common/main/lib/component/SynchronizeTip.js +++ b/apps/common/main/lib/component/SynchronizeTip.js @@ -136,7 +136,7 @@ define([ var showxy = Common.Utils.getOffset(target), offset = this.offset || {x: 0, y: 0}; if (this.placement=='target' && !this.position) { - this.cmpEl.css({top : showxy.top + 5 + 'px', left: showxy.left + 5 + 'px'}); + this.cmpEl.css({top : showxy.top + 5 + offset.y + 'px', left: showxy.left + 5 + offset.x + 'px'}); return; } diff --git a/apps/presentationeditor/main/app/controller/Animation.js b/apps/presentationeditor/main/app/controller/Animation.js index bff10a7d18..8c307db80d 100644 --- a/apps/presentationeditor/main/app/controller/Animation.js +++ b/apps/presentationeditor/main/app/controller/Animation.js @@ -546,6 +546,8 @@ define([ item.set('disabled', !!me._state.lockEmphasis); }); this.setLocked(); + if (this.view && this.view.listEffects && !this.view.listEffects.isDisabled() && this._state.onactivetab) + Common.UI.TooltipManager.showTip('animText'); }, setTriggerList: function (){ @@ -591,8 +593,14 @@ define([ if (tab == 'animate') { this._state.onactivetab = true; this.setSettings(); + if (this.view && this.view.listEffects && !this.view.listEffects.isDisabled()) + setTimeout(function() { + Common.UI.TooltipManager.showTip('animText'); + }, 10); + } else { + this._state.onactivetab = false; + Common.UI.TooltipManager.closeTip('animText'); } - else this._state.onactivetab = false; this.api && this.api.asc_onShowAnimTab(!!this._state.onactivetab); }, diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index e2068d6e07..701437f5a2 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -312,12 +312,15 @@ define([ this.mode = mode; this.toolbar.applyLayout(mode); Common.UI.FeaturesManager.isFeatureEnabled('featuresTips', true) && Common.UI.TooltipManager.addTips({ - 'tabDesign' : {name: 'pe-help-tip-tab-design', placement: 'bottom-right', text: this.helpTabDesign, header: this.helpTabDesignHeader, target: 'li.ribtab #design', automove: true, closable: false, - callback: function() { - if (!me.toolbar.btnShapesMerge.isDisabled() && me.toolbar.isTabActive('home')) - Common.UI.TooltipManager.showTip('mergeShapes'); - }}, - 'mergeShapes' : {name: 'help-tip-merge-shapes', placement: 'bottom-left', text: this.helpMergeShapes, header: this.helpMergeShapesHeader, target: '#slot-btn-shapes-merge', closable: false, prev: 'tabDesign'} + 'rtlDirection' : {name: 'pe-help-tip-rtl-dir', placement: 'bottom-left', text: this.helpRtlDir, header: this.helpRtlDirHeader, target: '#slot-btn-direction', automove: true, isNewFeature: true}, + 'animText' : {name: 'pe-help-tip-anim-text', placement: 'target', offset: {x: 5, y: 60}, text: this.helpAnimText, header: this.helpAnimTextHeader, + target: '#animation-field-effects', isNewFeature: true, maxwidth: 300}, + // 'tabDesign' : {name: 'pe-help-tip-tab-design', placement: 'bottom-right', text: this.helpTabDesign, header: this.helpTabDesignHeader, target: 'li.ribtab #design', automove: true, closable: false, + // callback: function() { + // if (!me.toolbar.btnShapesMerge.isDisabled() && me.toolbar.isTabActive('home')) + // Common.UI.TooltipManager.showTip('mergeShapes'); + // }}, + // 'mergeShapes' : {name: 'help-tip-merge-shapes', placement: 'bottom-left', text: this.helpMergeShapes, header: this.helpMergeShapesHeader, target: '#slot-btn-shapes-merge', closable: false, prev: 'tabDesign'} }); Common.UI.TooltipManager.addTips({ 'refreshFile' : {text: _main.textUpdateVersion, header: _main.textUpdating, target: '#toolbar', maxwidth: 'none', showButton: false, automove: true, noHighlight: true, multiple: true}, @@ -1009,8 +1012,8 @@ define([ this._state.in_slide_master = in_slide_master; } - if (!this.toolbar.btnShapesMerge.isDisabled() && this.toolbar.isTabActive('home')) - Common.UI.TooltipManager.showTip('mergeShapes'); + if (!this.toolbar.btnTextDir.isDisabled() && this.toolbar.isTabActive('home')) + Common.UI.TooltipManager.showTip('rtlDirection'); }, onApiStyleChange: function(v) { @@ -1812,7 +1815,7 @@ define([ }, onBeforeShapesMerge: function() { - Common.UI.TooltipManager.closeTip('mergeShapes', true); + // Common.UI.TooltipManager.closeTip('mergeShapes', true); this.toolbar.btnShapesMerge.menu.getItems(true).forEach(function (item) { item.setDisabled(!this.api.asc_canMergeSelectedShapes(item.value)); }, this); @@ -2905,7 +2908,9 @@ define([ } Common.Utils.asyncCall(function () { if ( config.isEdit ) { - Common.UI.TooltipManager.showTip('tabDesign'); + if (me.toolbar.btnTextDir && !me.toolbar.btnTextDir.isDisabled() && me.toolbar.isTabActive('home')) + Common.UI.TooltipManager.showTip('rtlDirection'); + // Common.UI.TooltipManager.showTip('tabDesign'); } }); }, @@ -3167,13 +3172,20 @@ define([ }, onActiveTab: function(tab) { - if (tab !== 'home') { - Common.UI.TooltipManager.closeTip('tabDesign'); - Common.UI.TooltipManager.closeTip('mergeShapes'); - } else if (this.toolbar && this.toolbar.btnShapesMerge && !this.toolbar.btnShapesMerge.isDisabled()) + if (tab !== 'home') + Common.UI.TooltipManager.closeTip('rtlDirection'); + else if (this.toolbar && this.toolbar.btnTextDir && !this.toolbar.btnTextDir.isDisabled()) setTimeout(function() { - Common.UI.TooltipManager.showTip('mergeShapes'); + Common.UI.TooltipManager.showTip('rtlDirection'); }, 10); + + // if (tab !== 'home') { + // Common.UI.TooltipManager.closeTip('tabDesign'); + // Common.UI.TooltipManager.closeTip('mergeShapes'); + // } else if (this.toolbar && this.toolbar.btnShapesMerge && !this.toolbar.btnShapesMerge.isDisabled()) + // setTimeout(function() { + // Common.UI.TooltipManager.showTip('mergeShapes'); + // }, 10); }, onBeforeActiveTab: function(tab) { @@ -3182,7 +3194,8 @@ define([ }, onTabCollapse: function(tab) { - Common.UI.TooltipManager.closeTip('mergeShapes'); + Common.UI.TooltipManager.closeTip('rtlDirection'); + // Common.UI.TooltipManager.closeTip('mergeShapes'); }, showStaticElements: function() { diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index c4ce76a82c..2d825b7d79 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -59,6 +59,7 @@ define([ var me = this; if (me.listEffects) { me.listEffects.on('click', _.bind(function (combo, record) { + Common.UI.TooltipManager.closeTip('animText'); me.fireEvent('animation:selecteffect', [combo, record]); }, me)); me.listEffectsMore.on('click', _.bind(function () { @@ -241,6 +242,8 @@ define([ }); } cmp.removeTips(); + + Common.UI.TooltipManager.closeTip('animText'); } }); this.lockedControls.push(this.listEffects); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index aaa9556669..fa74c8029d 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1741,6 +1741,10 @@ "PE.Controllers.Toolbar.txtSymbol_vdots": "Vertical ellipsis", "PE.Controllers.Toolbar.txtSymbol_xsi": "Xi", "PE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", + "PE.Controllers.Toolbar.helpRtlDir": "Set paragraph direction in the presentation editor.", + "PE.Controllers.Toolbar.helpRtlDirHeader": "Paragraph direction", + "PE.Controllers.Toolbar.helpAnimText": "You can now view text animations directly in the presentation editor.", + "PE.Controllers.Toolbar.helpAnimTextHeader": "Animation preview with text", "PE.Controllers.Viewport.textFitPage": "Fit to slide", "PE.Controllers.Viewport.textFitWidth": "Fit to width", "PE.Views.Animation.str0_5": "0.5 s (Very Fast)",