Merge pull request #3030 from ONLYOFFICE/fix/bug_67305

Fix/bug 67305
This commit is contained in:
Julia Radzhabova
2024-06-05 10:42:56 +03:00
committed by GitHub
5 changed files with 74 additions and 8 deletions

View File

@ -70,7 +70,8 @@ define([
me.toolbar = toolbar;
toolbar.addTab(tab, me.$toolbarPanelPlugins, Common.UI.LayoutManager.lastTabIdx); // TODO: clear plugins list in left panel
}
}
},
'tab:active': this.onActiveTab
},
'Common.Views.Plugins': {
'plugin:select': function(guid, type, isRun, closePanel) {
@ -116,12 +117,15 @@ define([
this.autostart = [];
this.customPluginsDlg = [];
this.newInstalledBackgroundPlugins = [];
Common.Gateway.on('init', this.loadConfig.bind(this));
Common.NotificationCenter.on('app:face', this.onAppShowed.bind(this));
Common.NotificationCenter.on('uitheme:changed', this.updatePluginsButtons.bind(this));
Common.NotificationCenter.on('window:resize', this.updatePluginsButtons.bind(this));
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('doc:mode-changed', this.onChangeDocMode.bind(this));
Common.NotificationCenter.on('modal:close', this.onModalClose.bind(this));
},
loadConfig: function(data) {
@ -776,9 +780,9 @@ define([
Common.NotificationCenter.trigger('frame:mousemove', { pageX: x*Common.Utils.zoom()+this._moveOffset.x, pageY: y*Common.Utils.zoom()+this._moveOffset.y });
},
onPluginsInit: function(pluginsdata) {
onPluginsInit: function(pluginsdata, fromManager) {
!(pluginsdata instanceof Array) && (pluginsdata = pluginsdata["pluginsData"]);
this.parsePlugins(pluginsdata, false, true)
this.parsePlugins(pluginsdata, false, true, fromManager);
},
onPluginShowButton: function(id, toRight) {
@ -816,7 +820,8 @@ define([
});
},
parsePlugins: function(pluginsdata, uiCustomize, forceUpdate) {
parsePlugins: function(pluginsdata, uiCustomize, forceUpdate, fromManager) {
this.newInstalledBackgroundPlugins.length = 0;
var me = this;
var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins'),
isEdit = me.appOptions.isEdit && !me.isPDFEditor,
@ -916,6 +921,12 @@ define([
tab: item.tab ? {action: item.tab.id, caption: ((typeof item.tab.text == 'object') ? item.tab.text[lang] || item.tab.text['en'] : item.tab.text) || ''} : undefined
};
updatedItem ? updatedItem.set(props) : arr.push(new Common.Models.Plugin(props));
if (fromManager && !updatedItem && props.isBackgroundPlugin) {
me.newInstalledBackgroundPlugins.push({
name: name,
guid: item.guid
});
}
}
});
@ -1259,7 +1270,50 @@ define([
if (!this.viewPlugins.customPluginPanels[frameId].openInsideMode(description, variation.url, frameId, guid))
this.api.asc_pluginButtonClick(-1, guid, frameId);
}
},
onModalClose: function () {
var plugins = this.newInstalledBackgroundPlugins;
if (plugins && plugins.length > 0) {
var text = plugins.length > 1 ? this.textPluginsSuccessfullyInstalled :
Common.Utils.String.format(this.textPluginSuccessfullyInstalled, plugins[0].name);
this.backgroundPluginsTip = new Common.UI.SynchronizeTip({
extCls: 'colored',
placement: 'bottom',
target: this.viewPlugins.backgroundBtn.$el,
text: text,
showLink: true,
textLink: plugins.length > 1 ? this.textRunInstalledPlugins : this.textRunPlugin
});
this.backgroundPluginsTip.on('dontshowclick', function() {
this.backgroundPluginsTip.close();
this.backgroundPluginsTip = undefined;
this.newInstalledBackgroundPlugins.forEach(_.bind(function (item) {
this.api.asc_pluginRun(item.guid, 0, '');
}, this));
this.newInstalledBackgroundPlugins.length = 0;
}, this);
this.backgroundPluginsTip.on('closeclick', function () {
this.backgroundPluginsTip.close();
this.backgroundPluginsTip = undefined;
this.newInstalledBackgroundPlugins.length = 0;
}, this);
this.backgroundPluginsTip.show();
}
},
onActiveTab: function (tab) {
if (tab !== 'plugins' && this.backgroundPluginsTip) {
this.backgroundPluginsTip.close();
this.backgroundPluginsTip = undefined;
this.newInstalledBackgroundPlugins.length = 0;
}
},
textRunPlugin: 'Run plugin',
textRunInstalledPlugins: 'Run installed plugins',
textPluginSuccessfullyInstalled: '<b>{0}</b> is successfully installed. You can access all background plugins here.',
textPluginsSuccessfullyInstalled: 'Plugins are successfully installed. You can access all background plugins here.'
}, Common.Controllers.Plugins || {}));
});

View File

@ -1085,13 +1085,13 @@ section .field-styles {
align-items: center;
}
.plugin-settings {
width: 20px;
height: 20px;
.margin-left-8();
.btn-toolbar.dropdown-toggle {
min-width: 20px;
}
.btn-group {
width: 20px;
height: 20px;
.margin-left-8();
&:active, &.active {
&:not(.disabled) .icon {
background-position-x: @button-small-active-icon-offset-x !important;

View File

@ -85,6 +85,10 @@
"Common.Controllers.ReviewChanges.textUrl": "Paste a document URL",
"Common.Controllers.ReviewChanges.textWidow": "Widow control",
"Common.Controllers.ReviewChanges.textWord": "Word level",
"Common.Controllers.Plugins.textRunPlugin": "Run plugin",
"Common.Controllers.Plugins.textRunInstalledPlugins": "Run installed plugins",
"Common.Controllers.Plugins.textPluginSuccessfullyInstalled": "<b>{0}</b> is successfully installed. You can access all background plugins here.",
"Common.Controllers.Plugins.textPluginsSuccessfullyInstalled": "Plugins are successfully installed. You can access all background plugins here.",
"Common.define.chartData.textArea": "Area",
"Common.define.chartData.textAreaStacked": "Stacked area",
"Common.define.chartData.textAreaStackedPer": "100% Stacked area",

View File

@ -11,6 +11,10 @@
"Common.Controllers.ExternalOleEditor.textClose": "Close",
"Common.Controllers.ExternalOleEditor.warningText": "The object is disabled because it is being edited by another user.",
"Common.Controllers.ExternalOleEditor.warningTitle": "Warning",
"Common.Controllers.Plugins.textRunPlugin": "Run plugin",
"Common.Controllers.Plugins.textRunInstalledPlugins": "Run installed plugins",
"Common.Controllers.Plugins.textPluginSuccessfullyInstalled": "<b>{0}</b> is successfully installed. You can access all background plugins here.",
"Common.Controllers.Plugins.textPluginsSuccessfullyInstalled": "Plugins are successfully installed. You can access all background plugins here.",
"Common.define.chartData.textArea": "Area",
"Common.define.chartData.textAreaStacked": "Stacked area",
"Common.define.chartData.textAreaStackedPer": "100% Stacked area",

View File

@ -5,6 +5,10 @@
"Common.Controllers.Desktop.hintBtnHome": "Show Main window",
"Common.Controllers.Desktop.itemCreateFromTemplate": "Create from template",
"Common.Controllers.History.notcriticalErrorTitle": "Warning",
"Common.Controllers.Plugins.textRunPlugin": "Run plugin",
"Common.Controllers.Plugins.textRunInstalledPlugins": "Run installed plugins",
"Common.Controllers.Plugins.textPluginSuccessfullyInstalled": "<b>{0}</b> is successfully installed. You can access all background plugins here.",
"Common.Controllers.Plugins.textPluginsSuccessfullyInstalled": "Plugins are successfully installed. You can access all background plugins here.",
"Common.define.chartData.textArea": "Area",
"Common.define.chartData.textAreaStacked": "Stacked area",
"Common.define.chartData.textAreaStackedPer": "100% Stacked area",