From 17a1ec78e415f8bce44a59624e3aeb72e5c2e316 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 17 Feb 2021 20:25:30 +0300 Subject: [PATCH 1/5] Change synchronize tip component: add new placements --- .../main/lib/component/SynchronizeTip.js | 64 +++-- .../main/resources/less/synchronize-tip.less | 261 +++++++++++++++++- .../main/app/controller/Statusbar.js | 2 +- .../main/app/view/SignatureSettings.js | 2 +- apps/documenteditor/main/app/view/Toolbar.js | 1 + .../main/app/view/SignatureSettings.js | 2 +- .../main/app/view/Toolbar.js | 1 + .../main/app/view/SignatureSettings.js | 2 +- .../main/app/view/Toolbar.js | 1 + 9 files changed, 296 insertions(+), 40 deletions(-) diff --git a/apps/common/main/lib/component/SynchronizeTip.js b/apps/common/main/lib/component/SynchronizeTip.js index e317f4044..ca8fbd9e7 100644 --- a/apps/common/main/lib/component/SynchronizeTip.js +++ b/apps/common/main/lib/component/SynchronizeTip.js @@ -43,7 +43,7 @@ define([ options : { target : $(document.body), text : '', - placement: 'right', + placement: 'right-bottom', showLink: true }, @@ -53,7 +53,7 @@ define([ '
', '
', '
<%= scope.text %>
', - '
', + '
', '
', '<% if ( scope.showLink ) { %>', '', @@ -103,27 +103,45 @@ define([ }, applyPlacement: function () { - var showxy = this.target.offset(), - innerHeight = Common.Utils.innerHeight(); - - if (this.placement == 'document') { - // this.cmpEl.css('top', $('#editor_sdk').offset().top); - } else - if (this.placement == 'top') - this.cmpEl.css({bottom : innerHeight - showxy.top + 'px', right: Common.Utils.innerWidth() - showxy.left - this.target.width()/2 + 'px'}); - else if (this.placement == 'bottom') - this.cmpEl.css({top : (showxy.top+5) + this.target.height() + 'px', left: showxy.left + (this.target.width() - this.cmpEl.width())/2 + 'px'}); - else if (this.placement == 'target') { - this.cmpEl.css({top : (showxy.top+5) + 'px', left: (showxy.left+5) + 'px'}); - } else {// left or right - var top = showxy.top + this.target.height()/2, - height = this.cmpEl.height(); - if (top+height>innerHeight) - top = innerHeight - height; - if (this.placement == 'left') - this.cmpEl.css({top : top + 'px', right: Common.Utils.innerWidth() - showxy.left - 5 + 'px'}); - else - this.cmpEl.css({top : top + 'px', left: showxy.left + this.target.width() + 'px'}); + var showxy = this.target.offset(); + if (this.placement=='target') { + this.cmpEl.css({top : showxy.top + 5 + 'px', left: showxy.left + 5 + 'px'}); + return; + } + + var placement = this.placement.split('-'); + if (placement.length>0) { + var top, left, bottom, right; + var pos = placement[0]; + if (pos=='top') { + bottom = Common.Utils.innerHeight() - showxy.top; + } else if (pos == 'bottom') { + top = showxy.top + this.target.height(); + } else if (pos == 'left') { + right = Common.Utils.innerWidth() - showxy.left; + } else if (pos == 'right') { + left = showxy.left + this.target.width(); + } + pos = placement[1]; + if (pos=='top') { + bottom = Common.Utils.innerHeight() - showxy.top - this.target.height()/2; + } else if (pos == 'bottom') { + top = showxy.top + this.target.height()/2; + } else if (pos == 'left') { + right = Common.Utils.innerWidth() - showxy.left - this.target.width()/2; + } else if (pos == 'right') { + left = showxy.left + this.target.width()/2; + } else { + if (bottom!==undefined || top!==undefined) + left = showxy.left + (this.target.width() - this.cmpEl.width())/2; + else + top = showxy.top + (this.target.height() - this.cmpEl.height())/2; + } + top = (top!==undefined) ? (top + 'px') : 'auto'; + bottom = (bottom!==undefined) ? (bottom + 'px') : 'auto'; + left = (left!==undefined) ? (left + 'px') : 'auto'; + right = (right!==undefined) ? (right + 'px') : 'auto'; + this.cmpEl.css({top : top, left: left, right: right, bottom: bottom}); } }, diff --git a/apps/common/main/resources/less/synchronize-tip.less b/apps/common/main/resources/less/synchronize-tip.less index 5c2cdc38a..64ebe4bc6 100644 --- a/apps/common/main/resources/less/synchronize-tip.less +++ b/apps/common/main/resources/less/synchronize-tip.less @@ -33,6 +33,40 @@ } } + &.theme-color { + .asc-synchronizetip { + background-color: @header-background-color-ie; + background-color: @header-background-color; + color: @text-toolbar-header-ie; + color: @text-toolbar-header; + + .close { + &:before, &:after { + background-color: @text-toolbar-header-ie; + background-color: @text-toolbar-header; + } + } + } + + .tip-arrow:after { + background-color: @header-background-color-ie; + background-color: @header-background-color; + } + } + + &.toolbar-color { + .asc-synchronizetip { + background-color: @background-toolbar-ie; + background-color: @background-toolbar; + } + + .tip-arrow:after { + background-color: @background-toolbar-ie; + background-color: @background-toolbar; + } + } + + &.inc-index { z-index: @zindex-navbar + 4; } @@ -42,9 +76,103 @@ overflow: hidden; } + &.right-top, + &.right-bottom, &.right { margin: 0 0 0 15px; + } + &.left-top, + &.left-bottom, + &.left { + margin: 0 15px 0 0; + } + + &.top-left, + &.top-right, + &.top { + margin: 0 0 15px 0; + } + + &.bottom-left, + &.bottom-right, + &.bottom { + margin: 15px 0 0 0; + } + + &.right-top, + &.right-bottom { + margin: 0 0 0 15px; + } + + &.right { + .tip-arrow { + left: -13px; + top: 50%; + margin-top: -7px; + width: 16px; + height: 15px; + .box-shadow(0 0 8px -5px rgba(0, 0, 0, 0.2)); + + &:after { + top: 0; + left: 8px; + width: 16px; + .box-shadow(0 0 8px -1px rgba(0, 0, 0, 0.2)); + } + } + } + &.left { + .tip-arrow { + right: -13px; + top: 50%; + margin-top: -7px; + width: 16px; + height: 15px; + .box-shadow(0 0 8px -5px rgba(0, 0, 0, 0.2)); + + &:after { + top: 0; + left: -8px; + width: 16px; + .box-shadow(0 4px 8px -1px rgba(0, 0, 0, 0.2)); + } + } + } + &.top { + .tip-arrow { + left: 50%; + bottom: -12px; + margin-left: -6px; + width: 16px; + height: 16px; + .box-shadow(0 0 8px -5px rgba(0, 0, 0, 0.2)); + + &:after { + top: -6px; + left: 0; + width: 16px; + } + } + } + &.bottom { + .tip-arrow { + left: 50%; + top: -12px; + margin-left: -7px; + width: 16px; + height: 15px; + .box-shadow(0 0 8px -5px rgba(0, 0, 0, 0.2)); + + &:after { + top: 7px; + left: 0; + width: 16px; + } + } + } + + &.right-bottom { .tip-arrow { left: -15px; top: 0; @@ -60,9 +188,7 @@ } } - &.left { - margin: 0 15px 0 0; - + &.left-bottom { .tip-arrow { right: -15px; top: 0; @@ -73,14 +199,11 @@ &:after { top: -7px; left: -7px; - width: 15px; } } } - &.top { - margin: 0 0 15px 0; - + &.top-left { .tip-arrow { right: 0; bottom: -15px; @@ -94,6 +217,87 @@ } } } + + &.top-right { + .tip-arrow { + left: 0; + bottom: -15px; + width: 15px; + height: 15px; + .box-shadow(-5px 0 8px -5px rgba(0, 0, 0, 0.2)); + + &:after { + top: -8px; + left: -8px; + .box-shadow(2px 2px 8px -1px rgba(0, 0, 0, 0.2)); + } + } + } + + &.bottom-left { + .tip-arrow { + right: 0; + top: -15px; + width: 15px; + height: 15px; + .box-shadow(8px 5px 8px -5px rgba(0, 0, 0, 0.2)); + + &:after { + top: 8px; + left: 8px; + .box-shadow(0 0 8px -1px rgba(0, 0, 0, 0.2)); + } + } + } + + &.bottom-right { + .tip-arrow { + left: 0; + top: -15px; + width: 15px; + height: 15px; + .box-shadow(-8px 0 8px -5px rgba(0, 0, 0, 0.2)); + + &:after { + top: 8px; + left: -8px; + .box-shadow(0 0 8px -1px rgba(0, 0, 0, 0.2)); + } + } + } + + &.right-top { + .tip-arrow { + left: -15px; + bottom: 0; + width: 15px; + height: 15px; + .box-shadow(0 5px 8px -5px rgba(0, 0, 0, 0.2)); + + &:after { + top: 7px; + left: 7px; + width: 16px; + } + } + } + + &.left-top { + .tip-arrow { + right: -15px; + bottom: 0; + width: 15px; + height: 13px; + .box-shadow(-5px 8px 8px -5px rgba(0, 0, 0, 0.2)); + + &:after { + bottom: -7px; + left: -7px; + //width: 15px; + .box-shadow(0 0 8px -1px rgba(0, 0, 0, 0.2)); + } + } + } } .asc-synchronizetip { @@ -103,15 +307,23 @@ background-color: @background-notification-popover; overflow: visible; - .right & { + .bottom-right &, + .right-bottom & { border-top-left-radius: 0; } - .left & { + .bottom-left &, + .left-bottom & { border-top-right-radius: 0; } - .top & { + .top-right &, + .right-top & { + border-bottom-left-radius: 0; + } + + .top-left &, + .left-top & { border-bottom-right-radius: 0; } @@ -159,10 +371,33 @@ margin: 8px; cursor: pointer; - background-position: @but-close-offset-x @but-close-offset-y; + opacity: 0.7; + transition: transform .3s; - &.over, &:hover { - background-position: @but-close-offset-x @but-close-offset-y - 16px; + transform: scale(1.1); + opacity: 1; + } + + &:before, &:after { + content: ' '; + position: absolute; + left: 7px; + left: calc(7px/@pixel-ratio-factor); + top: @scaled-one-px-value-ie; + top: @scaled-one-px-value; + height: 14px; + width: @scaled-one-px-value-ie; + width: @scaled-one-px-value; + background-color: @icon-normal-ie; + background-color: @icon-normal; + } + + &:before { + transform: rotate(45deg); + } + + &:after { + transform: rotate(-45deg); } } diff --git a/apps/documenteditor/main/app/controller/Statusbar.js b/apps/documenteditor/main/app/controller/Statusbar.js index 1abf49a5d..1960e6a27 100644 --- a/apps/documenteditor/main/app/controller/Statusbar.js +++ b/apps/documenteditor/main/app/controller/Statusbar.js @@ -257,7 +257,7 @@ define([ var tip = new Common.UI.SynchronizeTip({ target : me.btnTurnReview.$el, text : text, - placement: 'top' + placement: 'top-left' }); tip.on({ 'dontshowclick': function() { diff --git a/apps/documenteditor/main/app/view/SignatureSettings.js b/apps/documenteditor/main/app/view/SignatureSettings.js index ac95843c9..1a62fd30e 100644 --- a/apps/documenteditor/main/app/view/SignatureSettings.js +++ b/apps/documenteditor/main/app/view/SignatureSettings.js @@ -348,7 +348,7 @@ define([ text : tipText, showLink: showLink, textLink: this.txtContinueEditing, - placement: 'left' + placement: 'left-bottom' }); tip.on({ 'dontshowclick': function() { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index e45eefed8..c9a908189 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -2123,6 +2123,7 @@ define([ createSynchTip: function () { this.synchTooltip = new Common.UI.SynchronizeTip({ extCls: (this.mode.customization && !!this.mode.customization.compactHeader) ? undefined : 'inc-index', + placement: 'right-bottom', target: this.btnCollabChanges.$el }); this.synchTooltip.on('dontshowclick', function () { diff --git a/apps/presentationeditor/main/app/view/SignatureSettings.js b/apps/presentationeditor/main/app/view/SignatureSettings.js index bd40ef48f..8f59da3af 100644 --- a/apps/presentationeditor/main/app/view/SignatureSettings.js +++ b/apps/presentationeditor/main/app/view/SignatureSettings.js @@ -302,7 +302,7 @@ define([ text : tipText, showLink: showLink, textLink: this.txtContinueEditing, - placement: 'left' + placement: 'left-bottom' }); tip.on({ 'dontshowclick': function() { diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 1ede74398..a4aec78b0 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1495,6 +1495,7 @@ define([ createSynchTip: function () { this.synchTooltip = new Common.UI.SynchronizeTip({ extCls: (this.mode.customization && !!this.mode.customization.compactHeader) ? undefined : 'inc-index', + placement: 'right-bottom', target: this.btnCollabChanges.$el }); this.synchTooltip.on('dontshowclick', function () { diff --git a/apps/spreadsheeteditor/main/app/view/SignatureSettings.js b/apps/spreadsheeteditor/main/app/view/SignatureSettings.js index b05e67694..2502aafde 100644 --- a/apps/spreadsheeteditor/main/app/view/SignatureSettings.js +++ b/apps/spreadsheeteditor/main/app/view/SignatureSettings.js @@ -348,7 +348,7 @@ define([ text : tipText, showLink: showLink, textLink: this.txtContinueEditing, - placement: 'left' + placement: 'left-bottom' }); tip.on({ 'dontshowclick': function() { diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index ad53816ec..193bf123d 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2093,6 +2093,7 @@ define([ createSynchTip: function () { this.synchTooltip = new Common.UI.SynchronizeTip({ extCls: (this.mode.customization && !!this.mode.customization.compactHeader) ? undefined : 'inc-index', + placement: 'right-bottom', target: this.btnCollabChanges.$el }); this.synchTooltip.on('dontshowclick', function() { From 1dff1aaae3e7b5d17858c2086ade6f400a558633 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 17 Feb 2021 21:11:04 +0300 Subject: [PATCH 2/5] Show tooltips with dark theme description --- .../main/lib/component/SynchronizeTip.js | 3 ++- .../main/app/controller/Viewport.js | 25 +++++++++++++++++-- apps/documenteditor/main/locale/en.json | 1 + .../main/app/controller/Viewport.js | 24 +++++++++++++++++- apps/presentationeditor/main/locale/en.json | 1 + .../main/app/controller/Viewport.js | 24 +++++++++++++++++- apps/spreadsheeteditor/main/locale/en.json | 1 + 7 files changed, 74 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/component/SynchronizeTip.js b/apps/common/main/lib/component/SynchronizeTip.js index ca8fbd9e7..b048d94e3 100644 --- a/apps/common/main/lib/component/SynchronizeTip.js +++ b/apps/common/main/lib/component/SynchronizeTip.js @@ -96,6 +96,7 @@ define([ hide: function() { if (this.cmpEl) this.cmpEl.hide(); + this.trigger('hide'); }, close: function() { @@ -108,7 +109,7 @@ define([ this.cmpEl.css({top : showxy.top + 5 + 'px', left: showxy.left + 5 + 'px'}); return; } - + var placement = this.placement.split('-'); if (placement.length>0) { var top, left, bottom, right; diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index 4262f468d..b9aea5f3d 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -327,8 +327,28 @@ define([ Common.NotificationCenter.on('uitheme:change', function (name) { mnuitemDarkTheme.setChecked(Common.UI.Themes.isDarkTheme()); }); - } + if (!Common.localStorage.getBool("hide-dark-theme-tip")) { + me.themeTip = new Common.UI.SynchronizeTip({ + target: me.header.btnOptions.$el, + placement : 'bottom-left', + showLink: false, + extCls: (config.customization && config.customization.toolbarNoTabs) ? 'toolbar-color' : 'theme-color', + text: me.textTipTheme + }); + me.themeTip.on({ + 'closeclick': function() { + me.themeTip.hide(); + }, + 'hide': function() { + me.themeTip = undefined; + Common.localStorage.setBool("hide-dark-theme-tip", true); + } + }); + me.themeTip.show(); + me.header.btnOptions.on('click', function() { me.themeTip && me.themeTip.hide(); }); + } + } me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this)); } }, @@ -435,6 +455,7 @@ define([ }, textFitPage: 'Fit to Page', - textFitWidth: 'Fit to Width' + textFitWidth: 'Fit to Width', + textTipTheme: 'You can switch to Dark Theme in the View Settings' }, DE.Controllers.Viewport)); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index ccbb98aed..acdd55d7f 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1172,6 +1172,7 @@ "DE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", "DE.Controllers.Viewport.textFitPage": "Fit to Page", "DE.Controllers.Viewport.textFitWidth": "Fit to Width", + "DE.Controllers.Viewport.textTipTheme": "You can switch to Dark Theme in the View Settings", "DE.Views.AddNewCaptionLabelDialog.textLabel": "Label:", "DE.Views.AddNewCaptionLabelDialog.textLabelError": "Label must not be empty.", "DE.Views.BookmarksDialog.textAdd": "Add", diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index 57d6e7337..aaa09e874 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -330,6 +330,27 @@ define([ Common.NotificationCenter.on('uitheme:change', function (name) { mnuitemDarkTheme.setChecked(Common.UI.Themes.isDarkTheme()); }); + + if (!Common.localStorage.getBool("hide-dark-theme-tip")) { + me.themeTip = new Common.UI.SynchronizeTip({ + target: me.header.btnOptions.$el, + placement : 'bottom-left', + showLink: false, + extCls: (config.customization && config.customization.toolbarNoTabs) ? 'toolbar-color' : 'theme-color', + text: me.textTipTheme + }); + me.themeTip.on({ + 'closeclick': function() { + me.themeTip.hide(); + }, + 'hide': function() { + me.themeTip = undefined; + Common.localStorage.setBool("hide-dark-theme-tip", true); + } + }); + me.themeTip.show(); + me.header.btnOptions.on('click', function() { me.themeTip && me.themeTip.hide(); }); + } } me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this)); @@ -478,6 +499,7 @@ define([ }, textFitPage: 'Fit to Page', - textFitWidth: 'Fit to Width' + textFitWidth: 'Fit to Width', + textTipTheme: 'You can switch to Dark Theme in the View Settings' }, PE.Controllers.Viewport)); }); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 3db4f0764..ae2856bbd 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1042,6 +1042,7 @@ "PE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", "PE.Controllers.Viewport.textFitPage": "Fit to Slide", "PE.Controllers.Viewport.textFitWidth": "Fit to Width", + "PE.Controllers.Viewport.textTipTheme": "You can switch to Dark Theme in the View Settings", "PE.Views.ChartSettings.textAdvanced": "Show advanced settings", "PE.Views.ChartSettings.textChartType": "Change Chart Type", "PE.Views.ChartSettings.textEditData": "Edit Data", diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index e4fda19c3..132ff930c 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -341,6 +341,27 @@ define([ Common.NotificationCenter.on('uitheme:change', function (name) { mnuitemDarkTheme.setChecked(Common.UI.Themes.isDarkTheme()); }); + + if (!Common.localStorage.getBool("hide-dark-theme-tip")) { + me.themeTip = new Common.UI.SynchronizeTip({ + target: me.header.btnOptions.$el, + placement : 'bottom-left', + showLink: false, + extCls: (config.customization && config.customization.toolbarNoTabs) ? 'toolbar-color' : 'theme-color', + text: me.textTipTheme + }); + me.themeTip.on({ + 'closeclick': function() { + me.themeTip.hide(); + }, + 'hide': function() { + me.themeTip = undefined; + Common.localStorage.setBool("hide-dark-theme-tip", true); + } + }); + me.themeTip.show(); + me.header.btnOptions.on('click', function() { me.themeTip && me.themeTip.hide(); }); + } } me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this)); @@ -532,6 +553,7 @@ define([ textHideHeadings: 'Hide Headings', textHideGridlines: 'Hide Gridlines', textFreezePanes: 'Freeze Panes', - textFreezePanesShadow: 'Show Freezed Panes Shadow' + textFreezePanesShadow: 'Show Freezed Panes Shadow', + textTipTheme: 'You can switch to Dark Theme in the View Settings' }, SSE.Controllers.Viewport)); }); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index f25b73cca..f8b2ba265 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1282,6 +1282,7 @@ "SSE.Controllers.Viewport.textHideFBar": "Hide Formula Bar", "SSE.Controllers.Viewport.textHideGridlines": "Hide Gridlines", "SSE.Controllers.Viewport.textHideHeadings": "Hide Headings", + "SSE.Controllers.Viewport.textTipTheme": "You can switch to Dark Theme in the View Settings", "SSE.Views.AdvancedSeparatorDialog.strDecimalSeparator": "Decimal separator", "SSE.Views.AdvancedSeparatorDialog.strThousandsSeparator": "Thousands separator", "SSE.Views.AdvancedSeparatorDialog.textLabel": "Settings used to recognize numeric data", From 1bed0d1bf44323b0db5dc11171924822cd951303 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 17 Feb 2021 22:09:50 +0300 Subject: [PATCH 3/5] Add api parameter customization.hideStartTips: hide theme tooltip --- apps/api/documents/api.js | 3 ++- apps/documenteditor/main/app/controller/Viewport.js | 2 +- apps/presentationeditor/main/app/controller/Viewport.js | 2 +- apps/spreadsheeteditor/main/app/controller/Viewport.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 20ec5730d..ed61aebeb 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -156,7 +156,8 @@ plugins: true // can run plugins in document macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn', trackChanges: undefined // true/false - open editor with track changes mode on/off, - hideRulers: false, // hide or show rulers on first loading (presentation or document editor) + hideRulers: false, // hide or show rulers on first loading (presentation or document editor), + hideStartTips: false // hide help toolips on starting editors }, plugins: { autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'], diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index b9aea5f3d..ece465680 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -328,7 +328,7 @@ define([ mnuitemDarkTheme.setChecked(Common.UI.Themes.isDarkTheme()); }); - if (!Common.localStorage.getBool("hide-dark-theme-tip")) { + if (!Common.localStorage.getBool("hide-dark-theme-tip") && !(config.customization && config.customization.hideStartTips===true)) { me.themeTip = new Common.UI.SynchronizeTip({ target: me.header.btnOptions.$el, placement : 'bottom-left', diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index aaa09e874..c98f54fd5 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -331,7 +331,7 @@ define([ mnuitemDarkTheme.setChecked(Common.UI.Themes.isDarkTheme()); }); - if (!Common.localStorage.getBool("hide-dark-theme-tip")) { + if (!Common.localStorage.getBool("hide-dark-theme-tip") && !(config.customization && config.customization.hideStartTips===true)) { me.themeTip = new Common.UI.SynchronizeTip({ target: me.header.btnOptions.$el, placement : 'bottom-left', diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index 132ff930c..7a3ef1390 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -342,7 +342,7 @@ define([ mnuitemDarkTheme.setChecked(Common.UI.Themes.isDarkTheme()); }); - if (!Common.localStorage.getBool("hide-dark-theme-tip")) { + if (!Common.localStorage.getBool("hide-dark-theme-tip") && !(config.customization && config.customization.hideStartTips===true)) { me.themeTip = new Common.UI.SynchronizeTip({ target: me.header.btnOptions.$el, placement : 'bottom-left', From 5c1b1185dd32524599b95260401409796fcb0c19 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 19 Feb 2021 20:00:35 +0300 Subject: [PATCH 4/5] Delete dark theme tooltip --- .../main/app/controller/Viewport.js | 21 ------------------- .../main/app/controller/Viewport.js | 21 ------------------- .../main/app/controller/Viewport.js | 21 ------------------- 3 files changed, 63 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index ece465680..a7fbf3ef0 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -327,27 +327,6 @@ define([ Common.NotificationCenter.on('uitheme:change', function (name) { mnuitemDarkTheme.setChecked(Common.UI.Themes.isDarkTheme()); }); - - if (!Common.localStorage.getBool("hide-dark-theme-tip") && !(config.customization && config.customization.hideStartTips===true)) { - me.themeTip = new Common.UI.SynchronizeTip({ - target: me.header.btnOptions.$el, - placement : 'bottom-left', - showLink: false, - extCls: (config.customization && config.customization.toolbarNoTabs) ? 'toolbar-color' : 'theme-color', - text: me.textTipTheme - }); - me.themeTip.on({ - 'closeclick': function() { - me.themeTip.hide(); - }, - 'hide': function() { - me.themeTip = undefined; - Common.localStorage.setBool("hide-dark-theme-tip", true); - } - }); - me.themeTip.show(); - me.header.btnOptions.on('click', function() { me.themeTip && me.themeTip.hide(); }); - } } me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this)); } diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index c98f54fd5..4bb50f813 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -330,27 +330,6 @@ define([ Common.NotificationCenter.on('uitheme:change', function (name) { mnuitemDarkTheme.setChecked(Common.UI.Themes.isDarkTheme()); }); - - if (!Common.localStorage.getBool("hide-dark-theme-tip") && !(config.customization && config.customization.hideStartTips===true)) { - me.themeTip = new Common.UI.SynchronizeTip({ - target: me.header.btnOptions.$el, - placement : 'bottom-left', - showLink: false, - extCls: (config.customization && config.customization.toolbarNoTabs) ? 'toolbar-color' : 'theme-color', - text: me.textTipTheme - }); - me.themeTip.on({ - 'closeclick': function() { - me.themeTip.hide(); - }, - 'hide': function() { - me.themeTip = undefined; - Common.localStorage.setBool("hide-dark-theme-tip", true); - } - }); - me.themeTip.show(); - me.header.btnOptions.on('click', function() { me.themeTip && me.themeTip.hide(); }); - } } me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this)); diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index 7a3ef1390..c573a5c39 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -341,27 +341,6 @@ define([ Common.NotificationCenter.on('uitheme:change', function (name) { mnuitemDarkTheme.setChecked(Common.UI.Themes.isDarkTheme()); }); - - if (!Common.localStorage.getBool("hide-dark-theme-tip") && !(config.customization && config.customization.hideStartTips===true)) { - me.themeTip = new Common.UI.SynchronizeTip({ - target: me.header.btnOptions.$el, - placement : 'bottom-left', - showLink: false, - extCls: (config.customization && config.customization.toolbarNoTabs) ? 'toolbar-color' : 'theme-color', - text: me.textTipTheme - }); - me.themeTip.on({ - 'closeclick': function() { - me.themeTip.hide(); - }, - 'hide': function() { - me.themeTip = undefined; - Common.localStorage.setBool("hide-dark-theme-tip", true); - } - }); - me.themeTip.show(); - me.header.btnOptions.on('click', function() { me.themeTip && me.themeTip.hide(); }); - } } me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this)); From 3d088ba86bc5d75b44d1a96a3dc5e9cdc15fb484 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 19 Feb 2021 20:06:36 +0300 Subject: [PATCH 5/5] Fix translation --- apps/api/documents/api.js | 3 +-- apps/documenteditor/main/app/controller/Viewport.js | 3 +-- apps/documenteditor/main/locale/en.json | 1 - apps/presentationeditor/main/app/controller/Viewport.js | 3 +-- apps/presentationeditor/main/locale/en.json | 1 - apps/spreadsheeteditor/main/app/controller/Viewport.js | 3 +-- apps/spreadsheeteditor/main/locale/en.json | 1 - 7 files changed, 4 insertions(+), 11 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index ed61aebeb..20ec5730d 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -156,8 +156,7 @@ plugins: true // can run plugins in document macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn', trackChanges: undefined // true/false - open editor with track changes mode on/off, - hideRulers: false, // hide or show rulers on first loading (presentation or document editor), - hideStartTips: false // hide help toolips on starting editors + hideRulers: false, // hide or show rulers on first loading (presentation or document editor) }, plugins: { autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'], diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index a7fbf3ef0..156f3f8a9 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -434,7 +434,6 @@ define([ }, textFitPage: 'Fit to Page', - textFitWidth: 'Fit to Width', - textTipTheme: 'You can switch to Dark Theme in the View Settings' + textFitWidth: 'Fit to Width' }, DE.Controllers.Viewport)); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index acdd55d7f..ccbb98aed 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1172,7 +1172,6 @@ "DE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", "DE.Controllers.Viewport.textFitPage": "Fit to Page", "DE.Controllers.Viewport.textFitWidth": "Fit to Width", - "DE.Controllers.Viewport.textTipTheme": "You can switch to Dark Theme in the View Settings", "DE.Views.AddNewCaptionLabelDialog.textLabel": "Label:", "DE.Views.AddNewCaptionLabelDialog.textLabelError": "Label must not be empty.", "DE.Views.BookmarksDialog.textAdd": "Add", diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index 4bb50f813..57d6e7337 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -478,7 +478,6 @@ define([ }, textFitPage: 'Fit to Page', - textFitWidth: 'Fit to Width', - textTipTheme: 'You can switch to Dark Theme in the View Settings' + textFitWidth: 'Fit to Width' }, PE.Controllers.Viewport)); }); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index ae2856bbd..3db4f0764 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1042,7 +1042,6 @@ "PE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", "PE.Controllers.Viewport.textFitPage": "Fit to Slide", "PE.Controllers.Viewport.textFitWidth": "Fit to Width", - "PE.Controllers.Viewport.textTipTheme": "You can switch to Dark Theme in the View Settings", "PE.Views.ChartSettings.textAdvanced": "Show advanced settings", "PE.Views.ChartSettings.textChartType": "Change Chart Type", "PE.Views.ChartSettings.textEditData": "Edit Data", diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index c573a5c39..e4fda19c3 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -532,7 +532,6 @@ define([ textHideHeadings: 'Hide Headings', textHideGridlines: 'Hide Gridlines', textFreezePanes: 'Freeze Panes', - textFreezePanesShadow: 'Show Freezed Panes Shadow', - textTipTheme: 'You can switch to Dark Theme in the View Settings' + textFreezePanesShadow: 'Show Freezed Panes Shadow' }, SSE.Controllers.Viewport)); }); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index f8b2ba265..f25b73cca 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1282,7 +1282,6 @@ "SSE.Controllers.Viewport.textHideFBar": "Hide Formula Bar", "SSE.Controllers.Viewport.textHideGridlines": "Hide Gridlines", "SSE.Controllers.Viewport.textHideHeadings": "Hide Headings", - "SSE.Controllers.Viewport.textTipTheme": "You can switch to Dark Theme in the View Settings", "SSE.Views.AdvancedSeparatorDialog.strDecimalSeparator": "Decimal separator", "SSE.Views.AdvancedSeparatorDialog.strThousandsSeparator": "Thousands separator", "SSE.Views.AdvancedSeparatorDialog.textLabel": "Settings used to recognize numeric data",