Skip to content

Commit

Permalink
Merge tag 'v7.1.0.219' into cp7.1.0.219
Browse files Browse the repository at this point in the history
  • Loading branch information
wginolas committed Feb 28, 2023
2 parents 3f029ce + 9bd6fc3 commit 9a31986
Show file tree
Hide file tree
Showing 1,032 changed files with 82,080 additions and 17,842 deletions.
50 changes: 36 additions & 14 deletions apps/api/documents/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
edit: ["Group1", ""] // current user can edit comments made by users from Group1 and users without a group.
remove: ["Group1", ""] // current user can remove comments made by users from Group1 and users without a group.
},
userInfoGroups: ["Group1", ""], // show tooltips/cursors/info in header only for users in userInfoGroups groups. [""] - means users without group, [] - don't show any users, null/undefined/"" - show all users
protect: <can protect document> // default = true. show/hide protect tab or protect buttons
}
},
Expand Down Expand Up @@ -165,7 +166,7 @@
navigation: false/true // navigation button in de
} / false / true, // view tab
save: false/true // save button on toolbar in
},
} / false / true, // use instead of customization.toolbar,
header: {
users: false/true // users list button
save: false/true // save button
Expand All @@ -179,7 +180,7 @@
textLang: false/true // text language button in de/pe
docLang: false/true // document language button in de/pe
actionStatus: false/true // status of operation
}
} / false / true, // use instead of customization.statusBar
},
features: { // disable feature
spellcheck: {
Expand All @@ -194,8 +195,8 @@
leftMenu: true, // must be deprecated. use layout.leftMenu instead
rightMenu: true, // must be deprecated. use layout.rightMenu instead
hideRightMenu: false, // hide or show right panel on first loading
toolbar: true,
statusBar: true,
toolbar: true, // must be deprecated. use layout.toolbar instead
statusBar: true, // must be deprecated. use layout.statusBar instead
autosave: true,
forcesave: false,
commentAuthorOnly: false, // must be deprecated. use permissions.editCommentAuthorOnly and permissions.deleteCommentAuthorOnly instead
Expand Down Expand Up @@ -931,14 +932,17 @@
if (config.editorConfig.customization.loaderName !== 'none') params += "&customer=" + encodeURIComponent(config.editorConfig.customization.loaderName);
} else
params += "&customer={{APP_CUSTOMER_NAME}}";
if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.loaderLogo) {
if (config.editorConfig.customization.loaderLogo !== '') params += "&logo=" + encodeURIComponent(config.editorConfig.customization.loaderLogo);
} else if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.logo) {
if (config.type=='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded))
params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded);
else if (config.type!='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageDark)) {
config.editorConfig.customization.logo.image && (params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image));
config.editorConfig.customization.logo.imageDark && (params += "&headerlogodark=" + encodeURIComponent(config.editorConfig.customization.logo.imageDark));
if (typeof(config.editorConfig.customization) == 'object') {
if ( config.editorConfig.customization.loaderLogo && config.editorConfig.customization.loaderLogo !== '') {
params += "&logo=" + encodeURIComponent(config.editorConfig.customization.loaderLogo);
}
if ( config.editorConfig.customization.logo ) {
if (config.type=='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded))
params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded);
else if (config.type!='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageDark)) {
config.editorConfig.customization.logo.image && (params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image));
config.editorConfig.customization.logo.imageDark && (params += "&headerlogodark=" + encodeURIComponent(config.editorConfig.customization.logo.imageDark));
}
}
}
}
Expand All @@ -961,8 +965,6 @@

if (config.editorConfig && config.editorConfig.customization && (config.editorConfig.customization.toolbar===false))
params += "&toolbar=false";
else if (config.document && config.document.permissions && (config.document.permissions.edit === false && config.document.permissions.fillForms ))
params += "&toolbar=true";

if (config.parentOrigin)
params += "&parentOrigin=" + config.parentOrigin;
Expand All @@ -973,6 +975,25 @@
return params;
}

function getFrameTitle(config) {
var title = 'Powerful online editor for text documents, spreadsheets, and presentations';
var appMap = {
'text': 'text documents',
'spreadsheet': 'spreadsheets',
'presentation': 'presentations',
'word': 'text documents',
'cell': 'spreadsheets',
'slide': 'presentations'
};

if (typeof config.documentType === 'string') {
var app = appMap[config.documentType.toLowerCase()];
if (app)
title = 'Powerful online editor for ' + app;
}
return title;
}

function createIframe(config) {
var iframe = document.createElement("iframe");

Expand All @@ -982,6 +1003,7 @@
iframe.align = "top";
iframe.frameBorder = 0;
iframe.name = "frameEditor";
iframe.title = getFrameTitle(config);
iframe.allowFullscreen = true;
iframe.setAttribute("allowfullscreen",""); // for IE11
iframe.setAttribute("onmousewheel",""); // for Safari on Mac
Expand Down
16 changes: 16 additions & 0 deletions apps/common/forms/resources/less/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
@import "../../../../common/main/resources/less/spinner.less";
@import "../../../../common/main/resources/less/checkbox.less";
@import "../../../../common/main/resources/less/opendialog.less";
@import "../../../../common/main/resources/less/advanced-settings-window.less";

@toolbarBorderColor: @border-toolbar-ie;
@toolbarBorderColor: @border-toolbar;
Expand Down Expand Up @@ -668,4 +669,19 @@

.font-size-large {
.fontsize(@font-size-large);
}

.input-field-btn {
.select-button {
display: none;
}

.input-error {
&:before {
right: 3px;
}
}
input {
padding-right: 0;
}
}
1 change: 1 addition & 0 deletions apps/common/main/lib/component/ComboBoxFonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ define([
this.trigger('show:after', this, e);
this.flushVisibleFontsTiles();
this.updateVisibleFontsTiles(null, 0);
Common.Utils.isGecko && this.scroller && this.scroller.update();
} else {
Common.UI.ComboBox.prototype.onAfterShowMenu.apply(this, arguments);
}
Expand Down
7 changes: 6 additions & 1 deletion apps/common/main/lib/component/ComboDataView.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ define([
this.delayRenderTips = this.options.delayRenderTips || false;
this.itemTemplate = this.options.itemTemplate || _.template([
'<div class="style" id="<%= id %>">',
'<img src="<%= imageUrl %>" width="' + this.itemWidth + '" height="' + this.itemHeight + '"/>',
'<img src="<%= imageUrl %>" width="' + this.itemWidth + '" height="' + this.itemHeight + '" + <% if(typeof imageUrl === "undefined" || imageUrl===null || imageUrl==="") { %> style="visibility: hidden;" <% } %>/>',
'<% if (typeof title !== "undefined") {%>',
'<span class="title"><%= title %></span>',
'<% } %>',
Expand Down Expand Up @@ -255,6 +255,7 @@ define([
var picker = this.menuPicker;
if (picker) {
var record = picker.getSelectedRec();
this.itemMarginLeft = undefined;
this.fillComboView(record || picker.store.at(0), !!record, true);

picker.onResize();
Expand Down Expand Up @@ -415,6 +416,9 @@ define([
if (forceFill || !me.fieldPicker.store.findWhere({'id': record.get('id')})){
if (me.itemMarginLeft===undefined) {
var div = $($(this.menuPicker.el).find('.inner > div:not(.grouped-data):not(.ps-scrollbar-x-rail):not(.ps-scrollbar-y-rail)')[0]);
if (!div || div.length<1) { // try to find items in groups
div = $($(this.menuPicker.el).find('.inner .group-items-container > div:not(.grouped-data):not(.ps-scrollbar-x-rail):not(.ps-scrollbar-y-rail)')[0]);
}
if (div.length > 0) {
me.itemMarginLeft = parseInt(div.css('margin-left'));
me.itemMarginRight = parseInt(div.css('margin-right'));
Expand Down Expand Up @@ -455,6 +459,7 @@ define([
me.resumeEvents();
}
}
return me.fieldPicker.store.models; // return list of visible items
}
}
},
Expand Down
33 changes: 33 additions & 0 deletions apps/common/main/lib/component/ComboDataViewShape.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,39 @@ define([
recents = Common.localStorage.getItem(this.appPrefix + 'recent-shapes');
recents = recents ? JSON.parse(recents) : [];

// check lang
if (recents.length > 0) {
var isTranslated = _.findWhere(groups, {groupName: recents[0].groupName});
if (!isTranslated) {
for (var r = 0; r < recents.length; r++) {
var type = recents[r].data.shapeType,
record;
for (var g = 0; g < groups.length; g++) {
var store = groups[g].groupStore,
groupName = groups[g].groupName;
for (var i = 0; i < store.length; i++) {
if (store.at(i).get('data').shapeType === type) {
record = store.at(i).toJSON();
recents[r] = {
data: record.data,
tip: record.tip,
allowSelected: record.allowSelected,
selected: false,
groupName: groupName
};
break;
}
}
if (record) {
record = undefined;
break;
}
}
}
Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(recents));
}
}

if (recents.length < 12) {
var count = 12 - recents.length;

Expand Down
90 changes: 74 additions & 16 deletions apps/common/main/lib/component/DataView.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ define([
me.delayRenderTips = me.options.delayRenderTips || false;
if (me.parentMenu)
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
me.delaySelect = me.options.delaySelect || false;
me.rendered = false;
me.dataViewItems = [];
if (me.options.keyMoveDirection=='vertical')
Expand Down Expand Up @@ -396,13 +397,7 @@ define([
});

if (record) {
if (Common.Utils.isSafari) {
setTimeout(function () {
record.set({selected: true});
}, 200);
} else {
record.set({selected: true});
}
record.set({selected: true});
}
} else {
if (record)
Expand Down Expand Up @@ -606,14 +601,30 @@ define([

window._event = e; // for FireFox only

if (this.showLast) this.selectRecord(record);
if (this.showLast) {
if (!this.delaySelect) {
this.selectRecord(record);
} else {
_.each(this.store.where({selected: true}), function(rec){
rec.set({selected: false});
});
if (record) {
setTimeout(_.bind(function () {
record.set({selected: true});
this.trigger('item:click', this, view, record, e);
}, this), 300);
}
}
}
this.lastSelectedRec = null;

var tip = view.$el.data('bs.tooltip');
if (tip) (tip.tip()).remove();

if (!this.isSuspendEvents) {
this.trigger('item:click', this, view, record, e);
if (!this.delaySelect) {
this.trigger('item:click', this, view, record, e);
}
}
},

Expand Down Expand Up @@ -792,6 +803,12 @@ define([

setEmptyText: function(emptyText) {
this.emptyText = emptyText;

if (this.store.length < 1) {
var el = $(this.el).find('.inner').addBack().filter('.inner').find('.empty-text td');
if ( el.length>0 )
el.text(this.emptyText);
}
},

alignPosition: function() {
Expand Down Expand Up @@ -1386,6 +1403,39 @@ define([

me.recentShapes = recentArr;

// check lang
if (me.recentShapes.length > 0) {
var isTranslated = _.findWhere(me.groups, {groupName: me.recentShapes[0].groupName});
if (!isTranslated) {
for (var r = 0; r < me.recentShapes.length; r++) {
var type = me.recentShapes[r].data.shapeType,
record;
for (var g = 0; g < me.groups.length; g++) {
var store = me.groups[g].groupStore,
groupName = me.groups[g].groupName;
for (var i = 0; i < store.length; i++) {
if (store.at(i).get('data').shapeType === type) {
record = store.at(i).toJSON();
me.recentShapes[r] = {
data: record.data,
tip: record.tip,
allowSelected: record.allowSelected,
selected: false,
groupName: groupName
};
break;
}
}
if (record) {
record = undefined;
break;
}
}
}
Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(me.recentShapes));
}
}

// Add default recent

if (me.recentShapes.length < 12) {
Expand Down Expand Up @@ -1442,7 +1492,7 @@ define([
var models = group.groupStore.models;
if (index > 0) {
for (var i = 0; i < models.length; i++) {
models.at(i).set({groupName: group.groupName})
models[i].set({groupName: group.groupName});
}
}
store.add(models);
Expand Down Expand Up @@ -1578,11 +1628,8 @@ define([
selected: false,
groupName: groupName
};
me.recentShapes.unshift(model);
if (me.recentShapes.length > 12) {
me.recentShapes.splice(12, 1);
}
Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(me.recentShapes));
var arr = [model].concat(me.recentShapes.slice(0, 11));
Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(arr));
me.recentShapes = undefined;
},
updateRecents: function () {
Expand All @@ -1603,7 +1650,18 @@ define([

if (recents.length > 0 && diff) {
me.recentShapes = recents;
me.groups[0].groupStore.reset(me.recentShapes);
var resentsStore = new Common.UI.DataViewStore();
_.each(me.recentShapes, function (recent) {
var model = {
data: {shapeType: recent.data.shapeType},
tip: recent.tip,
allowSelected: recent.allowSelected,
selected: recent.selected,
groupName: recent.groupName
};
resentsStore.push(model);
});
me.groups[0].groupStore = resentsStore;

var store = new Common.UI.DataViewStore();
_.each(me.groups, function (group) {
Expand Down
16 changes: 16 additions & 0 deletions apps/common/main/lib/component/InputField.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,14 @@ define([
this.passwordHide(e);
this.hidePwd = true;
}
var me = this;
var prevstart = me._input[0].selectionStart,
prevend = me._input[0].selectionEnd;
setTimeout(function () {
me.focus();
me._input[0].selectionStart = prevstart;
me._input[0].selectionEnd = prevend;
}, 1);
},

passwordShow: function (e) {
Expand Down Expand Up @@ -643,6 +651,14 @@ define([
else {
this._btnElm.off('mouseup', this.passwordHide);
this._btnElm.off('mouseout', this.passwordHide);
var me = this;
var prevstart = me._input[0].selectionStart,
prevend = me._input[0].selectionEnd;
setTimeout(function () {
me.focus();
me._input[0].selectionStart = prevstart;
me._input[0].selectionEnd = prevend;
}, 1);
}
},
textHintShowPwd: 'Show password',
Expand Down
Loading

0 comments on commit 9a31986

Please sign in to comment.