From 2e7235cb1052846fbac1d811c69e4430fd9cb369 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 23 Jan 2025 17:09:28 +0300 Subject: [PATCH] Show tips for new features --- apps/common/main/lib/controller/History.js | 1 - .../main/app/controller/FormsTab.js | 2 -- .../main/app/controller/Toolbar.js | 16 -------------- .../main/app/controller/ViewTab.js | 3 --- apps/documenteditor/main/app/view/FileMenu.js | 3 --- apps/documenteditor/main/app/view/FormsTab.js | 1 - apps/documenteditor/main/app/view/LeftMenu.js | 1 - apps/pdfeditor/main/app/controller/Toolbar.js | 6 ++--- .../main/app/controller/Main.js | 2 ++ .../main/app/controller/PivotTable.js | 14 ++++++++++++ .../main/app/controller/Toolbar.js | 22 +++++++++---------- .../main/app/view/FileMenu.js | 3 --- .../main/app/view/ViewTab.js | 3 --- apps/spreadsheeteditor/main/locale/en.json | 16 +++++++++----- 14 files changed, 39 insertions(+), 54 deletions(-) diff --git a/apps/common/main/lib/controller/History.js b/apps/common/main/lib/controller/History.js index a841c5d0ba..0ffd247ff1 100644 --- a/apps/common/main/lib/controller/History.js +++ b/apps/common/main/lib/controller/History.js @@ -291,7 +291,6 @@ define([ onShowBeforeButtonMenu: function() { if(this.api && this.panelHistory.chHighlightDeleted) { this.panelHistory.chHighlightDeleted.setChecked(this.api.asc_isShowedDeletedTextInVersionHistory(), true); - Common.UI.TooltipManager.closeTip('textDeleted'); } }, diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index cf25536f2c..b017b2c2a2 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -287,7 +287,6 @@ define([ var me = this; if (!this._state.formCount) { // add first form this.closeHelpTip('create'); - Common.UI.TooltipManager.showTip('signatureField'); } else if (this._state.formCount===1) { setTimeout(function() { // me.showHelpTip('roles'); @@ -632,7 +631,6 @@ define([ this.closeHelpTip('create'); this.closeHelpTip('roles'); this.closeHelpTip('save'); - Common.UI.TooltipManager.closeTip('signatureField'); }, onChangeProtectDocument: function(props) { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index e169092a13..e30b25afd9 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -259,15 +259,7 @@ define([ var _main = this.getApplication().getController('Main'); this.mode = mode; this.toolbar.applyLayout(mode); - // this.mode.isPDFForm ? Common.UI.TooltipManager.addTips({ - // 'signatureField' : {name: 'de-help-tip-signature-field', placement: 'bottom-right', text: this.helpSignField, header: this.helpSignFieldHeader, target: '#slot-btn-form-signature', automove: true, maxwidth: 320} - // }) : Common.UI.TooltipManager.addTips({ - // 'textFromFile' : {name: 'de-help-tip-text-from-file', placement: 'bottom-left', text: this.helpTextFromFile, header: this.helpTextFromFileHeader, target: '#slot-btn-text-from-file', automove: true, maxwidth: 270}, - // 'textDeleted' : {name: 'de-help-tip-text-deleted', placement: 'right-bottom', text: this.helpTextDeleted, header: this.helpTextDeletedHeader, target: '#history-btn-menu', automove: true, maxwidth: 320}, - // 'customInfo' : {name: 'help-tip-custom-info', placement: 'right', text: this.helpCustomInfo, header: this.helpCustomInfoHeader, target: '#fm-btn-info', automove: true, extCls: 'inc-index'} - // }); Common.UI.TooltipManager.addTips({ - // 'grayTheme' : {name: 'help-tip-gray-theme', placement: 'bottom-right', text: this.helpGrayTheme, header: this.helpGrayThemeHeader, target: '#slot-btn-interface-theme', automove: true, maxwidth: 320}, 'refreshFile' : {text: _main.textUpdateVersion, header: _main.textUpdating, target: '#toolbar', maxwidth: 'none', showButton: false, automove: true, noHighlight: true, multiple: true}, 'disconnect' : {text: _main.textConnectionLost, header: _main.textDisconnect, target: '#toolbar', maxwidth: 'none', showButton: false, automove: true, noHighlight: true, multiple: true}, 'updateVersion' : {text: _main.errorUpdateVersionOnDisconnect, header: _main.titleUpdateVersion, target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true}, @@ -431,7 +423,6 @@ define([ toolbar.btnPageColor.on('color:select', _.bind(this.onSelectPageColor, this)); toolbar.mnuPageNoFill.on('click', _.bind(this.onPageNoFillClick, this)); toolbar.btnTextFromFile.menu.on('item:click', _.bind(this.onTextFromFileClick, this)); - toolbar.btnTextFromFile.menu.on('show:after', _.bind(this.onTextFromFileShowAfter, this)); Common.NotificationCenter.on('leftmenu:save', _.bind(this.tryToSave, this)); this.onSetupCopyStyleButton(); this.onBtnChangeState('undo:disabled', toolbar.btnUndo, toolbar.btnUndo.isDisabled()); @@ -1645,13 +1636,6 @@ define([ } }, - onTextFromFileShowAfter: function(menu, e) { - if (!(e && e.target === e.currentTarget)) - return; - - Common.UI.TooltipManager.closeTip('textFromFile'); - }, - onMarkerSettingsClick: function(type) { var me = this; var listId = me.api.asc_GetCurrentNumberingId(), diff --git a/apps/documenteditor/main/app/controller/ViewTab.js b/apps/documenteditor/main/app/controller/ViewTab.js index debfaeebca..145a9e6ee3 100644 --- a/apps/documenteditor/main/app/controller/ViewTab.js +++ b/apps/documenteditor/main/app/controller/ViewTab.js @@ -235,9 +235,6 @@ define([ Common.NotificationCenter.on('uitheme:countchanged', _fill_themes.bind(me)); _fill_themes.call(me); - me.view.btnInterfaceTheme.menu && me.view.btnInterfaceTheme.menu.on('show:after', function() { - Common.UI.TooltipManager.closeTip('grayTheme'); - }); if (me.view.btnInterfaceTheme.menu.getItemsLength(true)) { // me.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); me.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index f3723fcabc..3fc8f086e9 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -56,7 +56,6 @@ define([ events: function() { return { 'click .fm-btn': _.bind(function(event){ - this.mode && this.mode.isEdit && Common.UI.TooltipManager.closeTip('customInfo'); var $item = $(event.currentTarget); if (!$item.hasClass('active')) { $('.fm-btn',this.el).removeClass('active'); @@ -381,12 +380,10 @@ define([ this.selectMenu(panel, opts, defPanel); this.api && this.api.asc_enableKeyEvents(false); - this.mode.isEdit && Common.UI.TooltipManager.showTip('customInfo'); this.fireEvent('menu:show', [this]); }, hide: function() { - this.mode && this.mode.isEdit && Common.UI.TooltipManager.closeTip('customInfo'); this.$el.hide(); // if (this.mode.isEdit) DE.getController('Toolbar').DisableToolbar(false); this.fireEvent('menu:hide', [this]); diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index 2ad138e985..041140505c 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -163,7 +163,6 @@ define([ me.fireEvent('forms:insert', ['picture']); }); this.btnSignField && this.btnSignField.on('click', function (b, e) { - Common.UI.TooltipManager.closeTip('signatureField'); me.fireEvent('forms:insert', ['signature']); }); this.btnComplexField && this.btnComplexField.on('click', function (b, e) { diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index 9c40d501df..a28c8e7eeb 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -419,7 +419,6 @@ define([ this._state.pluginIsRunning = false; this.panelHistory.show(); this.panelHistory.$el.width((parseInt(Common.localStorage.getItem('de-mainmenu-width')) || MENU_SCALE_PART) - SCALE_MIN); - Common.UI.TooltipManager.showTip('textDeleted'); Common.NotificationCenter.trigger('layout:changed', 'history'); }, diff --git a/apps/pdfeditor/main/app/controller/Toolbar.js b/apps/pdfeditor/main/app/controller/Toolbar.js index 54f3b35871..d392ea8897 100644 --- a/apps/pdfeditor/main/app/controller/Toolbar.js +++ b/apps/pdfeditor/main/app/controller/Toolbar.js @@ -179,9 +179,9 @@ define([ this.mode = mode; this.toolbar.applyLayout(mode); Common.UI.TooltipManager.addTips({ - 'addStamp' : {name: 'help-tip-add-stamp', placement: 'bottom-left', text: this.helpAddStamp, header: this.helpAddStampHeader, target: '#slot-btn-stamp', maxwidth: 250, closable: false}, - 'selectPages' : {name: 'help-tip-select-pages', placement: 'right-bottom', offset: {x: -30, y: 60}, text: this.helpSelectPages, header: this.helpSelectPagesHeader, target: '#thumbnails-btn-close', maxwidth: 250, closable: false}, - 'fastUndo' : {name: 'pdfe-help-tip-fast-undo', placement: 'bottom-right', text: this.helpFastUndo, header: this.helpFastUndoHeader, target: mode.compactHeader ? '#slot-btn-undo' : '#slot-btn-dt-undo', maxwidth: 250, extCls: 'inc-index', closable: false}, + 'addStamp' : {name: 'help-tip-add-stamp', placement: 'bottom-left', text: this.helpAddStamp, header: this.helpAddStampHeader, target: '#slot-btn-stamp', closable: false}, + 'selectPages' : {name: 'help-tip-select-pages', placement: 'right-bottom', offset: {x: -30, y: 60}, text: this.helpSelectPages, header: this.helpSelectPagesHeader, target: '#thumbnails-btn-close', closable: false}, + 'fastUndo' : {name: 'pdfe-help-tip-fast-undo', placement: 'bottom-right', text: this.helpFastUndo, header: this.helpFastUndoHeader, target: mode.compactHeader ? '#slot-btn-undo' : '#slot-btn-dt-undo', extCls: 'inc-index', closable: false}, 'refreshFile' : {text: _main.textUpdateVersion, header: _main.textUpdating, target: '#toolbar', maxwidth: 'none', showButton: false, automove: true, noHighlight: true, multiple: true}, 'disconnect' : {text: _main.textConnectionLost, header: _main.textDisconnect, target: '#toolbar', maxwidth: 'none', showButton: false, automove: true, noHighlight: true, multiple: true}, 'updateVersion' : {text: _main.errorUpdateVersionOnDisconnect, header: _main.titleUpdateVersion, target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true}, diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index f8229e28aa..14125dd4e2 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -3149,6 +3149,7 @@ define([ length++; }); this._state.usersCount = length; + this._state.fastCoauth && this._state.usersCount>1 && this.api.asc_getCanUndo() && Common.UI.TooltipManager.showTip('fastUndo'); }, onUserConnection: function(change){ @@ -3177,6 +3178,7 @@ define([ this._state.fastCoauth = (value===null || parseInt(value) == 1); if (this._state.fastCoauth && !oldval) this.synchronizeChanges(); + this._state.fastCoauth && this._state.usersCount>1 && this.api.asc_getCanUndo() && Common.UI.TooltipManager.showTip('fastUndo'); } if (this.appOptions.canForcesave) { this.appOptions.forcesave = Common.localStorage.getBool("sse-settings-forcesave", this.appOptions.canForcesave); diff --git a/apps/spreadsheeteditor/main/app/controller/PivotTable.js b/apps/spreadsheeteditor/main/app/controller/PivotTable.js index 6bced518f3..9fb37f2fbf 100644 --- a/apps/spreadsheeteditor/main/app/controller/PivotTable.js +++ b/apps/spreadsheeteditor/main/app/controller/PivotTable.js @@ -70,6 +70,9 @@ define([ }, 'TableSettings': { 'pivottable:create': _.bind(this.onCreateClick, this) + }, + 'Toolbar': { + 'tab:active': _.bind(this.onActiveTab, this) } }); }, @@ -197,6 +200,8 @@ define([ }, onCalculatedClick: function(btn, opts){ + Common.UI.TooltipManager.closeTip('calcItems'); + var me = this; var pivotInfo = this.api.asc_getCellInfo().asc_getPivotTableInfo(); var pivotFieldIndex = pivotInfo.asc_getFieldIndexByActiveCell(); @@ -534,6 +539,8 @@ define([ Common.Utils.lockControls(Common.enumLock.editPivot, !!pivotInfo, {array: this.view.btnsAddPivot}); Common.Utils.lockControls(Common.enumLock.pivotExpandLock, !(pivotInfo && pivotInfo.asc_canExpandCollapseByActiveCell(this.api)), {array: [this.view.btnExpandField, this.view.btnCollapseField]}); Common.Utils.lockControls(Common.enumLock.pivotCalcItemsLock, !(pivotInfo && pivotInfo.asc_canChangeCalculatedItemByActiveCell()), {array: [this.view.btnCalculatedItems]}); + if (!this.view.btnCalculatedItems.isDisabled() && this.view.toolbar && this.view.toolbar.isTabActive('pivot')) + Common.UI.TooltipManager.showTip('calcItems'); if (pivotInfo) this.ChangeSettings(pivotInfo); @@ -571,6 +578,13 @@ define([ } }, + onActiveTab: function(tab) { + if (tab !== 'pivot') + Common.UI.TooltipManager.closeTip('calcItems'); + else if (this.view && this.view.btnCalculatedItems && !this.view.btnCalculatedItems.isDisabled()) + Common.UI.TooltipManager.showTip('calcItems'); + }, + strSheet : 'Sheet', txtPivotItemNameNotFound: 'An item name cannot be found. Check that you\'ve typed name correctly and the item is present in the PivotTable report.', txtCalculatedItemInPageField: 'The item cannot be added or modified. PivotTable report has this field in Filters.', diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 1cdaed9b0b..6ed4931b08 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -275,9 +275,8 @@ define([ this.mode = mode; this.toolbar.applyLayout(mode); Common.UI.TooltipManager.addTips({ - // 'insPivot' : {name: 'sse-help-tip-ins-pivot', placement: 'bottom-right', text: this.helpInsPivot, header: this.helpInsPivotHeader, target: 'li.ribtab #ins', automove: true}, - // 'grayTheme' : {name: 'help-tip-gray-theme', placement: 'bottom-right', text: this.helpGrayTheme, header: this.helpGrayThemeHeader, target: '#slot-btn-interface-theme', automove: true, maxwidth: 320}, - // 'customInfo' : {name: 'help-tip-custom-info', placement: 'right', text: this.helpCustomInfo, header: this.helpCustomInfoHeader, target: '#fm-btn-info', automove: true, extCls: 'inc-index'}, + 'fastUndo' : {name: 'sse-help-tip-fast-undo', placement: 'bottom-right', text: this.helpFastUndo, header: this.helpFastUndoHeader, target: mode.compactHeader ? '#slot-btn-undo' : '#slot-btn-dt-undo', extCls: 'inc-index', closable: false}, + 'calcItems' : {name: 'help-tip-calc-items', placement: 'bottom-left', text: this.helpCalcItems, header: this.helpCalcItemsHeader, target: '#slot-btn-calculated-items', automove: true, closable: false}, 'refreshFile' : {text: _main.textUpdateVersion, header: _main.textUpdating, target: '#toolbar', maxwidth: 'none', showButton: false, automove: true, noHighlight: true, multiple: true}, 'disconnect' : {text: _main.textConnectionLost, header: _main.textDisconnect, target: '#toolbar', maxwidth: 'none', showButton: false, automove: true, noHighlight: true, multiple: true}, 'updateVersion' : {text: _main.errorUpdateVersionOnDisconnect, header: _main.titleUpdateVersion, target: '#toolbar', maxwidth: 600, showButton: false, automove: true, noHighlight: true, multiple: true}, @@ -615,6 +614,8 @@ define([ }, onUndo: function(btn, e) { + Common.UI.TooltipManager.closeTip('fastUndo'); + if (this.api) this.api.asc_Undo(); @@ -2567,6 +2568,10 @@ define([ if (this._state.can_undo !== can) { this.toolbar.btnUndo.setDisabled(!can); this._state.can_undo = can; + if (can) { + var _main = this.getApplication().getController('Main'); + _main._state.fastCoauth && _main._state.usersCount>1 && Common.UI.TooltipManager.showTip('fastUndo'); + } } } else { if (this._state.can_redo !== can) { @@ -4673,12 +4678,6 @@ define([ Common.UI.LayoutManager.addControls(this.btnsComment); } } - - Common.Utils.asyncCall(function () { - if ( config.isEdit ) { - Common.UI.TooltipManager.showTip('insPivot'); - } - }); }, onFileMenu: function (opts) { @@ -5249,8 +5248,7 @@ define([ }, onActiveTab: function(tab) { - (tab !== 'home') && Common.UI.TooltipManager.closeTip('insPivot'); - (tab === 'view') ? Common.UI.TooltipManager.showTip('grayTheme') : Common.UI.TooltipManager.closeTip('grayTheme'); + (tab === 'file') && Common.UI.TooltipManager.closeTip('fastUndo'); }, onClickTab: function(tab) { @@ -5258,7 +5256,7 @@ define([ }, onTabCollapse: function(tab) { - Common.UI.TooltipManager.closeTip('grayTheme'); + Common.UI.TooltipManager.closeTip('calcItems'); } }, SSE.Controllers.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index a7d5f30439..ea787ab9f3 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -47,7 +47,6 @@ define([ events: function() { return { 'click .fm-btn': _.bind(function(event){ - this.mode && this.mode.isEdit && Common.UI.TooltipManager.closeTip('customInfo'); var $item = $(event.currentTarget); if (!$item.hasClass('active')) { $('.fm-btn',this.el).removeClass('active'); @@ -362,12 +361,10 @@ define([ this.api.asc_enableKeyEvents(false); - this.mode.isEdit && Common.UI.TooltipManager.showTip('customInfo'); this.fireEvent('menu:show', [this]); }, hide: function() { - this.mode && this.mode.isEdit && Common.UI.TooltipManager.closeTip('customInfo'); this.$el.hide(); // this.api && this.api.asc_enableKeyEvents(true); this.fireEvent('menu:hide', [this]); diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index 2fe0f1ea84..2a8d1a316a 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -565,9 +565,6 @@ define([ Common.NotificationCenter.on('uitheme:countchanged', _fill_themes.bind(me)); _fill_themes.call(me); - me.btnInterfaceTheme.menu && me.btnInterfaceTheme.menu.on('show:after', function() { - Common.UI.TooltipManager.closeTip('grayTheme'); - }); if (me.btnInterfaceTheme.menu.getItemsLength(true)) { me.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { var value = item.value; diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index f1e9909546..02ecf2d0ea 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1529,12 +1529,16 @@ "SSE.Controllers.Toolbar.errorMaxPoints": "The maximum number of points in series per chart is 4096.", "SSE.Controllers.Toolbar.errorMaxRows": "ERROR! The maximum number of data series per chart is 255", "SSE.Controllers.Toolbar.errorStockChart": "Incorrect row order. To build a stock chart place the data on the sheet in the following order:
opening price, max price, min price, closing price.", - "SSE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.", - "SSE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields", - "SSE.Controllers.Toolbar.helpGrayTheme": "Try Gray theme and access more customization options via File tab – Advanced Settings – Appearance.", - "SSE.Controllers.Toolbar.helpGrayThemeHeader": "Revamped interface", - "SSE.Controllers.Toolbar.helpInsPivot": "To start working with Pivot Tables, access the Insert tab.", - "SSE.Controllers.Toolbar.helpInsPivotHeader": "Updated Pivot Tables", + "del_SSE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.", + "del_SSE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields", + "del_SSE.Controllers.Toolbar.helpGrayTheme": "Try Gray theme and access more customization options via File tab – Advanced Settings – Appearance.", + "del_SSE.Controllers.Toolbar.helpGrayThemeHeader": "Revamped interface", + "del_SSE.Controllers.Toolbar.helpInsPivot": "To start working with Pivot Tables, access the Insert tab.", + "del_SSE.Controllers.Toolbar.helpInsPivotHeader": "Updated Pivot Tables", + "SSE.Controllers.Toolbar.helpFastUndo": "Easily undo changes while editing documents with co-authors in real time.", + "SSE.Controllers.Toolbar.helpFastUndoHeader": "\"Undo\" Now Available in Fast Co-Editing mode", + "SSE.Controllers.Toolbar.helpCalcItems": "You can now create calculated items directly in the spreadsheet editor.", + "SSE.Controllers.Toolbar.helpCalcItemsHeader": "New Calculated Items feature", "SSE.Controllers.Toolbar.textAccent": "Accents", "SSE.Controllers.Toolbar.textBracket": "Brackets", "SSE.Controllers.Toolbar.textDirectional": "Directional",