Skip to content

Commit

Permalink
Merge branch 'release/v8.3.0' into feature/pdf-stamp
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Jan 14, 2025
2 parents 747a9f1 + f38c8e3 commit c2209b9
Show file tree
Hide file tree
Showing 751 changed files with 35,354 additions and 12,578 deletions.
1 change: 1 addition & 0 deletions apps/api/documents/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@
_config.editorConfig.canSaveDocumentToBinary = _config.events && !!_config.events.onSaveDocument;
_config.editorConfig.canStartFilling = _config.events && !!_config.events.onRequestStartFilling;
_config.editorConfig.canRequestRefreshFile = _config.events && !!_config.events.onRequestRefreshFile;
_config.editorConfig.canUpdateVersion = _config.events && !!_config.events.onOutdatedVersion;
_config.frameEditorId = placeholderId;
_config.parentOrigin = window.location.origin;

Expand Down
394 changes: 176 additions & 218 deletions apps/common/forms/resources/img/icon-menu-sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 4 additions & 7 deletions apps/common/main/lib/component/AceEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@ define([], function () {
case 'aceEditorReady':
this.fireEvent('ready', cmd.data);
break;
case 'mouseUp':
case 'mouseMove':
var offset = Common.Utils.getOffset(this.parentEl);
var x = cmd.data.x * Common.Utils.zoom() + offset.left,
y = cmd.data.y * Common.Utils.zoom() + offset.top;
this.fireEvent(cmd.command.toLowerCase(), x, y);
break;
}
}
},
Expand Down Expand Up @@ -160,6 +153,10 @@ define([], function () {
});
},

enablePointerEvents: function(enable) {
this.iframe && (this.iframe.style.pointerEvents = enable ? "" : "none");
},

destroyEditor: function() {
this._unbindWindowEvents();
}
Expand Down
6 changes: 3 additions & 3 deletions apps/common/main/lib/component/ColorButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ define([
(this.options.effects!==undefined) && (config['effects'] = this.options.effects);
(this.options.colorHints!==undefined) && (config['colorHints'] = this.options.colorHints);
(this.options.paletteCls!==undefined) && (config['cls'] = this.options.paletteCls);
(this.options.storageSuffix!==undefined) && (config['storageSuffix'] = this.options.storageSuffix);

this.colorPicker = new Common.UI.ThemeColorPalette(config);
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
Expand Down Expand Up @@ -124,9 +125,8 @@ define([
cls: 'color-menu ' + (options.eyeDropper ? 'shifted-right' : 'shifted-left'),
additionalAlign: options.additionalAlign,
items: (options.additionalItemsBefore ? options.additionalItemsBefore : []).concat(auto).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: ' + width + '; height:' + height + '; display: inline-block;"></div>') },
{caption: '--'}
]).concat(eyedropper).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: ' + width + '; height:' + height + '; display: inline-block;"></div>') }
]).concat(options.hideColorsSeparator ? [] : {caption: '--'}).concat(eyedropper).concat([
{
id: id + '-color-new',
template: _.template('<a tabindex="-1" type="menuitem" style="">' + this.textNewColor + '</a>')
Expand Down
10 changes: 0 additions & 10 deletions apps/common/main/lib/component/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,6 @@ define([
mouseup : this.resize.eventStop
});

Common.NotificationCenter.on({
'frame:mousemove': this.resize.eventMove,
'frame:mouseup': this.resize.eventStop
});

var panel = e.data.panel;
this.resize.type = e.data.type;
this.resize.$el = panel.el;
Expand Down Expand Up @@ -319,11 +314,6 @@ define([
mouseup : this.resize.eventStop
});

Common.NotificationCenter.off({
'frame:mousemove': this.resize.eventMove,
'frame:mouseup': this.resize.eventStop
});

if (!this.resize.$el) return;

var zoom = (e instanceof jQuery.Event) ? Common.Utils.zoom() : 1;
Expand Down
6 changes: 4 additions & 2 deletions apps/common/main/lib/component/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,13 @@ define([

if (!options.dontshow) body.css('padding-bottom', '10px');

if (options.maxwidth && options.width=='auto') {
if ((options.maxwidth || options.minwidth) && options.width=='auto') {
var width = !Common.UI.isRTL() ? (Common.Utils.getPosition(text).left + text.width() + parseInt(text_cnt.css('padding-right'))) :
(parseInt(text_cnt.css('padding-right')) + icon_width + text.width() + parseInt(text_cnt.css('padding-left')));
if (width > options.maxwidth)
if (options.maxwidth && width > options.maxwidth)
options.width = options.maxwidth;
else if (options.minwidth && width < options.minwidth)
options.width = options.minwidth;
}
if (options.width=='auto') {
text_cnt.height(Math.max(text.height(), icon_height) + ((check.length>0) ? (check.height() + parseInt(check.css('margin-top'))) : 0));
Expand Down
3 changes: 1 addition & 2 deletions apps/common/main/lib/controller/Chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ define([
}
}
}

usersStore[usersStore.size() > 0 ? 'add' : 'reset'](arrUsers);
usersStore.reset(arrUsers);
arrIds.length && Common.UI.ExternalUsers.get('info', arrIds);
}
},
Expand Down
2 changes: 1 addition & 1 deletion apps/common/main/lib/controller/Comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ define([
this.getPopover().saveText();
this.getPopover().hideTips();

if (posY < 0 || this.getPopover().sdkBounds.height < posY || (!_.isUndefined(leftX) && this.getPopover().sdkBounds.width < leftX)) {
if (posY < 0 || this.getPopover().sdkBounds.outerHeight < posY || (!_.isUndefined(leftX) && this.getPopover().sdkBounds.width < leftX)) {
this.getPopover().hide();
} else {
if (this.isModeChanged)
Expand Down
5 changes: 5 additions & 0 deletions apps/common/main/lib/controller/Desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ define([
!!titlebuttons['undo'] && (info.hints['undo'] = titlebuttons['undo'].btn.btnEl.attr('data-hint-title-lang'));
!!titlebuttons['redo'] && (info.hints['redo'] = titlebuttons['redo'].btn.btnEl.attr('data-hint-title-lang'));
!!titlebuttons['save'] && (info.hints['save'] = titlebuttons['save'].btn.btnEl.attr('data-hint-title-lang'));
!!titlebuttons['startover'] && (info.hints['startover'] = titlebuttons['startover'].btn.btnEl.attr('data-hint-title-lang'));
}

native.execCommand('althints:show', JSON.stringify(info));
Expand Down Expand Up @@ -483,6 +484,10 @@ define([
if (!!header.btnRedo)
titlebuttons['redo'] = {btn: header.btnRedo};

if (!!header.btnStartOver) {
titlebuttons['startover'] = {btn: header.btnStartOver};
}

if (!!header.btnQuickAccess)
titlebuttons['quickaccess'] = {btn: header.btnQuickAccess};

Expand Down
84 changes: 33 additions & 51 deletions apps/common/main/lib/controller/Plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ define([
reset: this.onResetPlugins.bind(this)
});


this._moveOffset = {x:0, y:0};
this.autostart = [];
this.pluginsWinToShow = [];
this.startOnPostLoad = false;
this.customPluginsDlg = [];

Expand Down Expand Up @@ -193,8 +192,6 @@ define([
this.api.asc_registerCallback("asc_onPluginShow", _.bind(this.onPluginShow, this));
this.api.asc_registerCallback("asc_onPluginClose", _.bind(this.onPluginClose, this));
this.api.asc_registerCallback("asc_onPluginResize", _.bind(this.onPluginResize, this));
this.api.asc_registerCallback("asc_onPluginMouseUp", _.bind(this.onPluginMouseUp, this));
this.api.asc_registerCallback("asc_onPluginMouseMove", _.bind(this.onPluginMouseMove, this));
this.api.asc_registerCallback('asc_onPluginsReset', _.bind(this.resetPluginsList, this));
this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.onPluginsInit, this));
this.api.asc_registerCallback('asc_onPluginShowButton', _.bind(this.onPluginShowButton, this));
Expand All @@ -203,8 +200,6 @@ define([
this.api.asc_registerCallback("asc_onPluginWindowShow", _.bind(this.onPluginWindowShow, this));
this.api.asc_registerCallback("asc_onPluginWindowClose", _.bind(this.onPluginWindowClose, this));
this.api.asc_registerCallback("asc_onPluginWindowResize", _.bind(this.onPluginWindowResize, this));
this.api.asc_registerCallback("asc_onPluginWindowMouseUp", _.bind(this.onPluginWindowMouseUp, this));
this.api.asc_registerCallback("asc_onPluginWindowMouseMove", _.bind(this.onPluginWindowMouseMove, this));
this.api.asc_registerCallback("asc_onPluginWindowActivate", _.bind(this.openUIPlugin, this));

this.loadPlugins();
Expand All @@ -221,21 +216,20 @@ define([
return this;
},

onAfterRender: function(panel, guid) {
onAfterRender: function(panel, guid, isActivated) {
var me = this;
this.openUIPlugin(guid);
isActivated && this.openUIPlugin(guid);
panel.pluginClose.on('click', _.bind(this.onToolClose, this, panel));
Common.NotificationCenter.on({
'layout:resizestart': function(e) {
if (panel) {
var offset = Common.Utils.getOffset(panel.currentPluginFrame);
me._moveOffset = {x: offset.left + parseInt(panel.currentPluginFrame.css('padding-left')),
y: offset.top + parseInt(panel.currentPluginFrame.css('padding-top'))};
panel.enablePointerEvents && panel.enablePointerEvents(false);
me.api.asc_pluginEnableMouseEvents(true);
}
},
'layout:resizestop': function(e){
if (panel) {
panel.enablePointerEvents && panel.enablePointerEvents(true);
me.api.asc_pluginEnableMouseEvents(false);
}
}
Expand Down Expand Up @@ -651,7 +645,7 @@ define([
el: '#panel-plugins-' + name,
menu: menu
});
this.viewPlugins.pluginPanels[pluginGuid].on('render:after', _.bind(this.onAfterRender, this, this.viewPlugins.pluginPanels[pluginGuid], pluginGuid));
this.viewPlugins.pluginPanels[pluginGuid].on('render:after', _.bind(this.onAfterRender, this, this.viewPlugins.pluginPanels[pluginGuid], pluginGuid, true));
},

openUIPlugin: function (id) {
Expand Down Expand Up @@ -723,9 +717,11 @@ define([
},
'drag': function(args){
me.api.asc_pluginEnableMouseEvents(args[1]=='start');
args[0].enablePointerEvents(args[1]!=='start');
},
'resize': function(args){
me.api.asc_pluginEnableMouseEvents(args[1]=='start');
args[0].enablePointerEvents(args[1]!=='start');
},
'help': function(){
help && window.open(help, '_blank');
Expand Down Expand Up @@ -787,23 +783,6 @@ define([
this.api.asc_pluginButtonClick(-1, panel && panel._state.insidePlugin, panel && panel.frameId);
},

onPluginMouseUp: function(x, y) {
if (this.pluginDlg) {
if (this.pluginDlg.binding.dragStop) this.pluginDlg.binding.dragStop();
if (this.pluginDlg.binding.resizeStop) this.pluginDlg.binding.resizeStop();
} else
Common.NotificationCenter.trigger('frame:mouseup', { pageX: x*Common.Utils.zoom()+this._moveOffset.x, pageY: y*Common.Utils.zoom()+this._moveOffset.y });
},

onPluginMouseMove: function(x, y) {
if (this.pluginDlg) {
var offset = Common.Utils.getOffset(this.pluginContainer);
if (this.pluginDlg.binding.drag) this.pluginDlg.binding.drag({ pageX: x*Common.Utils.zoom()+offset.left, pageY: y*Common.Utils.zoom()+offset.top });
if (this.pluginDlg.binding.resize) this.pluginDlg.binding.resize({ pageX: x*Common.Utils.zoom()+offset.left, pageY: y*Common.Utils.zoom()+offset.top });
} else
Common.NotificationCenter.trigger('frame:mousemove', { pageX: x*Common.Utils.zoom()+this._moveOffset.x, pageY: y*Common.Utils.zoom()+this._moveOffset.y });
},

onPluginsInit: function(pluginsdata, fromManager) {
!(pluginsdata instanceof Array) && (pluginsdata = pluginsdata["pluginsData"]);
this.parsePlugins(pluginsdata, false, true, fromManager);
Expand Down Expand Up @@ -1133,6 +1112,10 @@ define([

// Plugin can create windows
onPluginWindowShow: function(frameId, variation) {
if (!Common.Controllers.LaunchController.isScriptLoaded()) {
this.pluginsWinToShow.push({frameId: frameId, variation: variation});
return;
}
if (variation.isVisual) {
if (this.customPluginsDlg[frameId] || this.viewPlugins.customPluginPanels[frameId]) return;

Expand Down Expand Up @@ -1192,9 +1175,11 @@ define([
},
'drag': function(args){
me.api.asc_pluginEnableMouseEvents(args[1]=='start', frameId);
args[0].enablePointerEvents(args[1]!=='start');
},
'resize': function(args){
me.api.asc_pluginEnableMouseEvents(args[1]=='start', frameId);
args[0].enablePointerEvents(args[1]!=='start');
},
'help': function(){
help && window.open(help, '_blank');
Expand All @@ -1207,9 +1192,18 @@ define([
me.customPluginsDlg[frameId].show();
}
}
if (this.pluginsWinToShow.length>0) {
let plg = this.pluginsWinToShow.shift();
plg && this.onPluginWindowShow(plg.frameId, plg.variation);
}
},

onPluginWindowClose: function(frameId) {
if (this.pluginsWinToShow.length>0) {
this.pluginsWinToShow = _.reject(this.pluginsWinToShow, function (item) {
return item.frameId === frameId;
});
}
if (this.customPluginsDlg[frameId]) {
this.customPluginsDlg[frameId].close();
} else if (this.viewPlugins.customPluginPanels[frameId]) {
Expand All @@ -1233,23 +1227,6 @@ define([
}
},

onPluginWindowMouseUp: function(frameId, x, y) {
if (this.customPluginsDlg[frameId]) {
if (this.customPluginsDlg[frameId].binding.dragStop) this.customPluginsDlg[frameId].binding.dragStop();
if (this.customPluginsDlg[frameId].binding.resizeStop) this.customPluginsDlg[frameId].binding.resizeStop();
} else
Common.NotificationCenter.trigger('frame:mouseup', { pageX: x*Common.Utils.zoom()+this._moveOffset.x, pageY: y*Common.Utils.zoom()+this._moveOffset.y });
},

onPluginWindowMouseMove: function(frameId, x, y) {
if (this.customPluginsDlg[frameId]) {
var offset = Common.Utils.getOffset(this.customPluginsDlg[frameId].options.pluginContainer);
if (this.customPluginsDlg[frameId].binding.drag) this.customPluginsDlg[frameId].binding.drag({ pageX: x*Common.Utils.zoom()+offset.left, pageY: y*Common.Utils.zoom()+offset.top });
if (this.customPluginsDlg[frameId].binding.resize) this.customPluginsDlg[frameId].binding.resize({ pageX: x*Common.Utils.zoom()+offset.left, pageY: y*Common.Utils.zoom()+offset.top });
} else
Common.NotificationCenter.trigger('frame:mousemove', { pageX: x*Common.Utils.zoom()+this._moveOffset.x, pageY: y*Common.Utils.zoom()+this._moveOffset.y });
},

onPluginPanelShow: function (frameId, variation, lang) {
var guid = variation.guid,
menu = this.isPDFEditor ? 'left' : (variation.type == 'panelRight' ? 'right' : 'left');
Expand All @@ -1259,10 +1236,11 @@ define([
if (typeof variation.descriptionLocale == 'object')
description = variation.descriptionLocale[lang] || variation.descriptionLocale['en'] || description || '';

var baseUrl = variation.baseUrl || "";
var model = this.viewPlugins.storePlugins.findWhere({guid: guid});
var icons = variation.icons;
var icon_url, icon_cls;
var baseUrl = variation.baseUrl || "",
model = this.viewPlugins.storePlugins.findWhere({guid: guid}),
icons = variation.icons,
icon_url, icon_cls,
isActivated = variation.isActivated!==false;

if (model) {
if ("" === baseUrl)
Expand Down Expand Up @@ -1302,7 +1280,7 @@ define([
baseUrl: baseUrl,
icons: icons
});
this.viewPlugins.customPluginPanels[frameId].on('render:after', _.bind(this.onAfterRender, this, this.viewPlugins.customPluginPanels[frameId], frameId));
this.viewPlugins.customPluginPanels[frameId].on('render:after', _.bind(this.onAfterRender, this, this.viewPlugins.customPluginPanels[frameId], frameId, isActivated));

if (!this.viewPlugins.customPluginPanels[frameId].openInsideMode(description, variation.url, frameId, guid))
this.api.asc_pluginButtonClick(-1, guid, frameId);
Expand Down Expand Up @@ -1355,6 +1333,10 @@ define([
},

onPostLoadComplete: function() {
if (this.pluginsWinToShow.length>0) {
let plg = this.pluginsWinToShow.shift();
plg && this.onPluginWindowShow(plg.frameId, plg.variation);
}
this.startOnPostLoad && this.runAutoStartPlugins();
},

Expand Down
2 changes: 1 addition & 1 deletion apps/common/main/lib/controller/ReviewChanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ define([
saveTxtReplyId = '';

if (this.getPopover()) {
if (posY < 0 || this.getPopover().sdkBounds.height < posY) {
if (posY < 0 || this.getPopover().sdkBounds.outerHeight < posY) {
this.getPopover().hide();
} else if (this.popoverChanges.length>0) {
if (!this.getPopover().isVisible())
Expand Down
14 changes: 7 additions & 7 deletions apps/common/main/lib/mods/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
clearMenus()

if (!isActive) {
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
// if mobile we use a backdrop because click events don't delegate
$(document.createElement('div'))
.addClass('dropdown-backdrop')
.insertAfter($(this))
.on('click', clearMenus)
}
// if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
// // if mobile we use a backdrop because click events don't delegate
// $(document.createElement('div'))
// .addClass('dropdown-backdrop')
// .insertAfter($(this))
// .on('click', clearMenus)
// }

var relatedTarget = { relatedTarget: this }
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
Expand Down
Loading

0 comments on commit c2209b9

Please sign in to comment.