Skip to content

Commit

Permalink
Merge pull request #2939 from ONLYOFFICE/feature/pdf-edit
Browse files Browse the repository at this point in the history
Feature/pdf edit
  • Loading branch information
JuliaRadzhabova authored Apr 16, 2024
2 parents 1a0fd18 + 2746691 commit 58a1407
Show file tree
Hide file tree
Showing 100 changed files with 22,687 additions and 279 deletions.
4 changes: 3 additions & 1 deletion apps/common/main/lib/component/ColorButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ define([
(this.options.themecolors!==undefined) && (config['themecolors'] = this.options.themecolors);
(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.colorPicker = new Common.UI.ThemeColorPalette(config);
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
Expand All @@ -95,6 +96,7 @@ define([
if (typeof this.menu !== 'object') {
options = options || this.options;
var height = options.paletteHeight ? options.paletteHeight + 'px' : 'auto',
width = options.paletteWidth ? options.paletteWidth + 'px' : '164px',
id = Common.UI.getId(),
auto = [],
eyedropper = [];
Expand All @@ -120,7 +122,7 @@ define([
cls: 'color-menu ' + (options.eyeDropper ? 'shifted-right' : 'shifted-left'),
additionalAlign: options.additionalAlign,
items: (options.additionalItems ? options.additionalItems : []).concat(auto).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: 164px; height:' + height + '; display: inline-block;"></div>') },
{ template: _.template('<div id="' + id + '-color-menu" style="width: ' + width + '; height:' + height + '; display: inline-block;"></div>') },
{caption: '--'}
]).concat(eyedropper).concat([
{
Expand Down
2 changes: 2 additions & 0 deletions apps/common/main/lib/component/ThemeColorPalette.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ define([

colorRe: /(?:^|\s)color-(.{6})(?:\s|$)/,
selectedCls: 'selected',
cls : '',

initialize : function(options) {
Common.UI.BaseView.prototype.initialize.call(this, options);
Expand All @@ -128,6 +129,7 @@ define([
me.moveKeys = [Common.UI.Keys.UP, Common.UI.Keys.DOWN, Common.UI.Keys.LEFT, Common.UI.Keys.RIGHT];

el.addClass('theme-colorpalette');
me.options.cls && el.addClass(me.options.cls);
this.render();

if (this.options.updateColorsArr)
Expand Down
13 changes: 13 additions & 0 deletions apps/common/main/lib/util/define.js
Original file line number Diff line number Diff line change
Expand Up @@ -1074,4 +1074,17 @@ define(function(){ 'use strict';
},
}
})(), Common.define.smartArt || {});

Common.define.simpleColorsConfig = {
colors: [
'1755A0', 'D43230', 'F5C346', 'EA3368', '12A489', '552F8B', '9D1F87', 'BB2765', '479ED2', '67C9FA',
'3D8A44', '80CA3D', '1C19B4', '7F4B0F', 'FF7E07', 'FFFFFF', 'D3D3D4', '879397', '575757', '000000'
],
dynamiccolors: 5,
themecolors: 0,
effects: 0,
columns: 5,
cls: 'palette-large',
paletteWidth: 174
};
});
18 changes: 10 additions & 8 deletions apps/common/main/lib/view/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ define([
var me = this;
config = config || appConfig;
if (!me.btnPDFMode || !config) return;
me.btnPDFMode.setIconCls('toolbar__icon icon--inverse ' + (config.isPDFEdit ? 'btn-edit' : (config.isPDFAnnotate ? 'btn-menu-comments' : 'btn-sheet-view')));
me.btnPDFMode.setCaption(config.isPDFEdit ? me.textEdit : (config.isPDFAnnotate ? me.textComment : me.textView));
me.btnPDFMode.updateHint(config.isPDFEdit ? me.tipEdit : (config.isPDFAnnotate ? me.tipComment : me.tipView));
me.btnPDFMode.setIconCls('toolbar__icon icon--inverse ' + (config.isPDFEdit ? 'btn-edit' : (config.isPDFAnnotate && config.canCoEditing ? 'btn-menu-comments' : 'btn-sheet-view')));
me.btnPDFMode.setCaption(config.isPDFEdit ? me.textEdit : (config.isPDFAnnotate && config.canCoEditing ? me.textComment : me.textView));
me.btnPDFMode.updateHint(config.isPDFEdit ? me.tipEdit : (config.isPDFAnnotate && config.canCoEditing ? me.tipComment : me.tipView));
}

function changeDocMode(type, lockEditing) {
Expand Down Expand Up @@ -459,18 +459,18 @@ define([
caption: me.textEdit,
iconCls : 'menu__icon btn-edit',
template: menuTemplate,
description: me.textEditDesc,
description: appConfig.canCoEditing ? me.textEditDesc : me.textEditDescNoCoedit,
value: 'edit'
});
arr.push({
caption: me.textComment,
iconCls : 'menu__icon btn-menu-comments',
caption: appConfig.canCoEditing ? me.textComment : me.textView,
iconCls : 'menu__icon ' + (appConfig.canCoEditing ? 'btn-menu-comments' : 'btn-sheet-view'),
template: menuTemplate,
description: me.textCommentDesc,
description: appConfig.canCoEditing ? me.textCommentDesc : me.textViewDescNoCoedit,
value: 'comment',
disabled: !appConfig.canPDFAnnotate
});
arr.push({
appConfig.canCoEditing && arr.push({
caption: me.textView,
iconCls : 'menu__icon btn-sheet-view',
template: menuTemplate,
Expand Down Expand Up @@ -1146,6 +1146,8 @@ define([
textViewDesc: 'All changes will be saved locally',
textCommentDesc: 'All changes will be saved to the file. Real time collaboration',
textEditDesc: 'All changes will be saved to the file. Real time collaboration',
textViewDescNoCoedit: 'View or annotate',
textEditDescNoCoedit: 'Add or edit text, shapes, images etc.',
tipView: 'Viewing',
tipComment: 'Commenting',
tipEdit: 'Editing',
Expand Down
1 change: 1 addition & 0 deletions apps/common/main/lib/view/SymbolTableDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ define([
'common/main/lib/util/utils',
'common/main/lib/util/character',
'common/main/lib/component/InputField',
'common/main/lib/component/ListView',
'common/main/lib/component/Window'
], function () { 'use strict';

Expand Down
8 changes: 8 additions & 0 deletions apps/pdfeditor/main/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,22 @@ require([
'DocumentHolder',
'Toolbar',
'Statusbar',
'RightMenu',
'Navigation',
'PageThumbnails',
'LeftMenu',
'Main',
'ViewTab',
'InsTab',
'Search',
'Print',
'Common.Controllers.Fonts',
'Common.Controllers.Chat',
'Common.Controllers.Comments',
'Common.Controllers.Draw',
'Common.Controllers.Plugins',
// 'Common.Controllers.ExternalDiagramEditor',
// 'Common.Controllers.ExternalOleEditor',
'Common.Controllers.Protection'
]
});
Expand All @@ -172,11 +176,13 @@ require([
'pdfeditor/main/app/controller/DocumentHolder',
'pdfeditor/main/app/controller/Toolbar',
'pdfeditor/main/app/controller/Statusbar',
'pdfeditor/main/app/controller/RightMenu',
'pdfeditor/main/app/controller/Navigation',
'pdfeditor/main/app/controller/PageThumbnails',
'pdfeditor/main/app/controller/LeftMenu',
'pdfeditor/main/app/controller/Main',
'pdfeditor/main/app/controller/ViewTab',
'pdfeditor/main/app/controller/InsTab',
'pdfeditor/main/app/controller/Search',
'pdfeditor/main/app/controller/Print',
'pdfeditor/main/app/view/FileMenuPanels',
Expand All @@ -186,6 +192,8 @@ require([
'common/main/lib/controller/Chat',
/** coauthoring end **/
'common/main/lib/controller/Plugins',
// 'common/main/lib/controller/ExternalDiagramEditor',
// 'common/main/lib/controller/ExternalOleEditor',
'common/main/lib/controller/Draw',
'common/main/lib/controller/Protection'
], function() {
Expand Down
52 changes: 52 additions & 0 deletions apps/pdfeditor/main/app/collection/EquationGroups.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
*
* 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-6 Ernesta Birznieka-Upish
* 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
*
*/
/**
* EquationGroups.js
*
* Created by Alexey Musinov on 29/10/14
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/

define([
'backbone',
'pdfeditor/main/app/model/EquationGroup'
], function(Backbone){ 'use strict';
if (Common === undefined)
var Common = {};

Common.Collections = Common.Collections || {};

PDFE.Collections.EquationGroups = Backbone.Collection.extend({
model: PDFE.Models.EquationGroup
});
});
Loading

0 comments on commit 58a1407

Please sign in to comment.