Skip to content

Commit

Permalink
Show macros plugin hints
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Oct 10, 2024
1 parent fa93dae commit c85063b
Show file tree
Hide file tree
Showing 170 changed files with 880 additions and 166 deletions.
10 changes: 9 additions & 1 deletion apps/common/main/lib/component/SynchronizeTip.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,19 @@ define([

var _addTips = function(arr) {
for (var step in arr) {
if (arr.hasOwnProperty(step) && !Common.localStorage.getItem(arr[step].name)) {
if (arr.hasOwnProperty(step) && !Common.localStorage.getItem(arr[step].name) && !(_helpTips[step] && _helpTips[step].tip && _helpTips[step].tip.isVisible())) { // don't replace tip when it's visible
_helpTips[step] = arr[step];
}
}
};

var _removeTip = function(step) {
if (_helpTips[step]) {
delete _helpTips[step];
_helpTips[step] = undefined;
}
};

var _getNeedShow = function(step) {
return _helpTips[step] && !(_helpTips[step].name && Common.localStorage.getItem(_helpTips[step].name));
};
Expand Down Expand Up @@ -310,6 +317,7 @@ define([
return {
showTip: _showTip,
closeTip: _closeTip,
removeTip: _removeTip,
addTips: _addTips,
getNeedShow: _getNeedShow
}
Expand Down
36 changes: 35 additions & 1 deletion apps/common/main/lib/controller/Plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ define([
this._moveOffset = {x:0, y:0};
this.autostart = [];
this.customPluginsDlg = [];
this.macrosPlugin = {el: null, show: false};

this.newInstalledBackgroundPlugins = [];
this.customButtonsArr = [];
Expand Down Expand Up @@ -178,6 +179,10 @@ define([
accept();
})).then(function(){
me.onChangeProtectDocument();
Common.UI.TooltipManager.addTips({
'moveMacros' : {name: 'help-tip-move-macros', placement: 'bottom-right', text: me.helpMoveMacros, header: me.helpMoveMacrosHeader, target: $('li.ribtab #view').parent(), automove: true}
});

Common.NotificationCenter.on('protect:doclock', _.bind(me.onChangeProtectDocument, me));
});
},
Expand Down Expand Up @@ -414,6 +419,7 @@ define([
me.toolbar && me.toolbar.addCustomItems({action: item.tab}, undefined, [item.btn])
});
me.customButtonsArr = [];
me.macrosPlugin = {};

me.appOptions.canPlugins = !collection.isEmpty();
if ( me.$toolbarPanelPlugins ) {
Expand All @@ -439,6 +445,16 @@ define([
btn.options.separator = tab.separator;
me.toolbar && me.toolbar.addCustomItems(tab, [btn]);
me.customButtonsArr.push({tab: tab.action, btn: btn});
if (model.get('guid') === "asc.{E6978D28-0441-4BD7-8346-82FAD68BCA3B}" ) {
me.macrosPlugin.el = btn.cmpEl;
if (me.toolbar && me.toolbar.isTabActive('plugins')) {
me.macrosPlugin.show = true;
Common.UI.TooltipManager.addTips({
'useMacros' : {name: 'help-tip-use-macros', placement: 'bottom-left', text: me.helpUseMacros, header: me.helpUseMacrosHeader, target: me.macrosPlugin.el, automove: true},
});
Common.UI.TooltipManager.removeTip('grayTheme');
}
}
}
return;
}
Expand Down Expand Up @@ -657,6 +673,10 @@ define([
},

onPluginShow: function(plugin, variationIndex, frameId, urlAddition) {
if (plugin.get_Guid() === "asc.{E6978D28-0441-4BD7-8346-82FAD68BCA3B}" ) {
Common.UI.TooltipManager.closeTip('useMacros');
}

var variation = plugin.get_Variations()[variationIndex];
if (variation.get_Visual()) {
var lang = this.appOptions && this.appOptions.lang ? this.appOptions.lang.split(/[\-_]/)[0] : 'en';
Expand Down Expand Up @@ -1330,10 +1350,24 @@ define([
}, this);
this.backgroundPluginsTip.show();
}
this.macrosPlugin.show && Common.UI.TooltipManager.showTip('moveMacros');
this.macrosPlugin.show = false;
},

onActiveTab: function (tab) {
(tab !== 'plugins') && this.closeBackPluginsTip();
if (tab === 'plugins') {
if (this.macrosPlugin.el) {
Common.UI.TooltipManager.addTips({
'useMacros' : {name: 'help-tip-use-macros', placement: 'bottom-left', text: this.helpUseMacros, header: this.helpUseMacrosHeader, target: this.macrosPlugin.el, automove: true},
});
Common.UI.TooltipManager.removeTip('grayTheme');
this.macrosPlugin.el && Common.UI.TooltipManager.showTip('moveMacros');
}
} else {
this.closeBackPluginsTip();
Common.UI.TooltipManager.closeTip('moveMacros');
}
(tab === 'view') ? Common.UI.TooltipManager.showTip('useMacros') : Common.UI.TooltipManager.closeTip('useMacros');
},

closeBackPluginsTip: function() {
Expand Down
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
4 changes: 4 additions & 0 deletions apps/documenteditor/main/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"Common.Controllers.Plugins.textPluginSuccessfullyInstalled": "<b>{0}</b> is successfully installed. You can access all background plugins here.",
"Common.Controllers.Plugins.textRunInstalledPlugins": "Run installed plugins",
"Common.Controllers.Plugins.textRunPlugin": "Run plugin",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros",
"Common.Controllers.ReviewChanges.textAcceptBeforeCompare": "In order to compare documents all the tracked changes in them will be considered to have been accepted. Do you want to continue?",
"Common.Controllers.ReviewChanges.textAtLeast": "at least",
"Common.Controllers.ReviewChanges.textAuto": "auto",
Expand Down
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/eu.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/gl.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
6 changes: 5 additions & 1 deletion apps/documenteditor/main/locale/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,5 +3663,9 @@
"DE.Controllers.Toolbar.helpTextDeleted": "Highlight deleted text to easily track changes and see the removed content between revisions.",
"DE.Controllers.Toolbar.helpTextDeletedHeader": "Enhanced Version History",
"DE.Controllers.Toolbar.helpCustomInfo": "Create and edit the document properties yourself in the Info section.",
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields"
"DE.Controllers.Toolbar.helpCustomInfoHeader": "Custom file fields",
"Common.Controllers.Plugins.helpMoveMacros": "To start working with macros, switch to the View tab.",
"Common.Controllers.Plugins.helpMoveMacrosHeader": "The moved Macros button",
"Common.Controllers.Plugins.helpUseMacros": "Find the Macros button here",
"Common.Controllers.Plugins.helpUseMacrosHeader": "Updated access to macros"
}
Loading

0 comments on commit c85063b

Please sign in to comment.