Skip to content

Commit

Permalink
Merge tag 'v7.2.0.209' into cp7.2.0.209
Browse files Browse the repository at this point in the history
  • Loading branch information
wginolas committed Mar 1, 2023
2 parents 9a31986 + 068c9cd commit bf72fd9
Show file tree
Hide file tree
Showing 16,520 changed files with 184,441 additions and 175,812 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Thumbs.db
.DS_Store
/deploy
build/node_modules
build/plugins/**/node_modules/
build/sprites/node_modules/
vendor/framework7-react/
apps/documenteditor/embed/resources/less/node_modules
Expand Down
35 changes: 9 additions & 26 deletions apps/api/documents/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
address: 'New-York, 125f-25',
mail: '[email protected]',
www: 'www.superpuper.com',
phone: '1234567890',
info: 'Some info',
logo: '',
logoDark: '', // logo for dark theme
Expand Down Expand Up @@ -219,8 +220,9 @@
uiTheme: 'theme-dark' // set interface theme: id or default-dark/default-light
},
coEditing: {
mode: 'fast', // <coauthoring mode>, 'fast' or 'strict'. if 'fast' and 'customization.autosave'=false -> set 'customization.autosave'=true
change: true, // can change co-authoring mode
mode: 'fast', // <coauthoring mode>, 'fast' or 'strict'. if 'fast' and 'customization.autosave'=false -> set 'customization.autosave'=true. 'fast' - default for editor
// for viewer: 'strict' is default, offline viewer; 'fast' - live viewer, show changes from other users
change: true, // can change co-authoring mode. true - default for editor, false - default for viewer
},
plugins: {
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
Expand Down Expand Up @@ -913,7 +915,7 @@
if ( typeof(customization) == 'object' && ( customization.toolbarNoTabs ||
(config.editorConfig.targetApp!=='desktop') && (customization.loaderName || customization.loaderLogo))) {
index = "/index_loader.html";
} else if (config.editorConfig.mode === 'editdiagram' || config.editorConfig.mode === 'editmerge')
} else if (config.editorConfig.mode === 'editdiagram' || config.editorConfig.mode === 'editmerge' || config.editorConfig.mode === 'editole')
index = "/index_internal.html";

}
Expand Down Expand Up @@ -950,7 +952,7 @@
if (window.APP && window.APP.urlArgs) {
params += "&"+ window.APP.urlArgs;
}
if (config.editorConfig && (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge'))
if (config.editorConfig && (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge' || config.editorConfig.mode == 'editole'))
params += "&internal=true";

if (config.frameEditorId)
Expand All @@ -975,25 +977,6 @@
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 @@ -1003,12 +986,12 @@
iframe.align = "top";
iframe.frameBorder = 0;
iframe.name = "frameEditor";
iframe.title = getFrameTitle(config);
config.title && (typeof config.title === 'string') && (iframe.title = config.title);
iframe.allowFullscreen = true;
iframe.setAttribute("allowfullscreen",""); // for IE11
iframe.setAttribute("onmousewheel",""); // for Safari on Mac
iframe.setAttribute("allow", "autoplay; camera; microphone; display-capture");
iframe.setAttribute("allow", "autoplay; camera; microphone; display-capture; clipboard-write;");

if (config.type == "mobile")
{
iframe.style.position = "fixed";
Expand Down
4 changes: 2 additions & 2 deletions apps/api/wopi/editor-wopi.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ div {
var config = {
"width": "100%",
"height": "100%",
"type": "desktop",
"type": queryParams.embed==="1" ? "embedded" : "desktop",
"documentType": documentType,
"token": token,
"document": {
Expand Down Expand Up @@ -302,7 +302,7 @@ div {
"uiTheme": queryParams.thm==="1" ? "default-light" : (queryParams.thm==="2" ? "default-dark" : undefined)
},
"coEditing": {
"mode": "fast",
"mode": userAuth.mode !== "view" ? "fast" : "strict",
"change": false
},
"wopi": {
Expand Down
10 changes: 10 additions & 0 deletions apps/common/embed/lib/controller/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@

$dlgShare.find('#btn-copyshort').on('click', copytext.bind(this, $dlgShare.find('#id-short-url')));
$dlgShare.find('.share-buttons > span').on('click', function(e){
if ( window.config ) {
const key = $(e.target).attr('data-name');
const btn = config.btnsShare[key];
if ( btn && btn.getUrl ) {
window.open(btn.getUrl(appConfig.shareUrl, appConfig.docTitle), btn.target || '',
btn.features || 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');
return;
}
}

var _url;
switch ($(e.target).attr('data-name')) {
case 'facebook':
Expand Down
9 changes: 8 additions & 1 deletion apps/common/embed/lib/util/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
!common.utils && (common.utils = {});

common.utils = new(function(){
var userAgent = navigator.userAgent.toLowerCase(),
check = function(regex){
return regex.test(userAgent);
},
isMac = check(/macintosh|mac os x/);
return {
openLink: function(url) {
if (url) {
Expand Down Expand Up @@ -102,7 +107,9 @@
return prop;
}
}
}
},

isMac : isMac
};
})();
}();
77 changes: 77 additions & 0 deletions apps/common/embed/lib/view/SearchBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/

/**
* SearchBar.js
*
* Created by Julia Svinareva on 27.04.2022
* Copyright (c) 2022 Ascensio System SIA. All rights reserved.
*
*/

!window.common && (window.common = {});
!common.view && (common.view = {});
common.view.SearchBar = new(function() {
var tpl = '<div class="asc-window search-window" style="display: none;">' +
'<div class="body">{body}</div>' +
'</div>';
var tplBody = '<input type="text" id="search-bar-text" placeholder="{textFind}" autocomplete="off">' +
'<div class="tools">' +
'<button id="search-bar-back" class="svg-icon search-arrow-up"></button>' +
'<button id="search-bar-next" class="svg-icon search-arrow-down"></button>' +
'<button id="search-bar-close" class="svg-icon search-close"></button>' +
'</div>';

return {
create: function(parent) {
!parent && (parent = 'body');

var _$dlg = $(tpl
.replace(/\{body}/, tplBody)
.replace(/\{textFind}/, this.textFind))
.appendTo(parent)
.attr('id', 'dlg-search');

return _$dlg;
},

disableNavButtons: function (resultNumber, allResults) {
var disable = $('#search-bar-text').val() === '' || !allResults;
$('#search-bar-back').attr({disabled: disable});
$('#search-bar-next').attr({disabled: disable});
},

textFind: 'Find'

};
})();
14 changes: 14 additions & 0 deletions apps/common/embed/lib/view/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ common.view.modals = new(function() {

var _$dlg;
if (name == 'share') {
if ( window.config && window.config.btnsShare ) {
let _btns = [];
for (const key of Object.keys(config.btnsShare))
_btns.push(`<span class="svg big-${key}" data-name="${key}"></span>`);

if ( _btns ) {
let $sharebox = $(_tplbody_share);
$sharebox.find('.autotest').prevAll().remove();
$sharebox.eq(1).prepend(_btns.join(''));

_tplbody_share = $("<div>").append($sharebox).html();
}
}

_$dlg = $(tplDialog
.replace(/\{title}/, this.txtShare)
.replace(/\{body}/, _tplbody_share)
Expand Down
Loading

0 comments on commit bf72fd9

Please sign in to comment.