Skip to content

Commit

Permalink
Merge pull request #2992 from ONLYOFFICE/fix/pdf-forms
Browse files Browse the repository at this point in the history
Fix/pdf forms
  • Loading branch information
JuliaRadzhabova authored May 17, 2024
2 parents 6400cb9 + e0160dc commit e3ebe95
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 5 deletions.
6 changes: 6 additions & 0 deletions apps/documenteditor/main/app/controller/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ define([
toolbar.btnSelectAll.on('click', _.bind(this.onSelectAll, this));
toolbar.btnSelectTool.on('toggle', _.bind(this.onSelectTool, this, 'select'));
toolbar.btnHandTool.on('toggle', _.bind(this.onSelectTool, this, 'hand'));
toolbar.btnEditMode.on('click', function (btn, e) {
Common.Gateway.requestEditRights();
});
Common.NotificationCenter.on('leftmenu:save', _.bind(this.tryToSave, this));
this.onBtnChangeState('undo:disabled', toolbar.btnUndo, toolbar.btnUndo.isDisabled());
this.onBtnChangeState('redo:disabled', toolbar.btnRedo, toolbar.btnRedo.isDisabled());
Expand Down Expand Up @@ -3556,6 +3559,9 @@ define([

me.toolbar.btnSave.on('disabled', _.bind(me.onBtnChangeState, me, 'save:disabled'));

if (!(me.mode.canRequestEditRights && me.mode.isPDFForm && me.mode.canFillForms && me.mode.isRestrictedEdit))
me.toolbar.btnEditMode && me.toolbar.btnEditMode.cmpEl.parents('.group').hide().next('.separator').hide();

if (!config.compactHeader) {
// hide 'print' and 'save' buttons group and next separator
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
Expand Down
6 changes: 5 additions & 1 deletion apps/documenteditor/main/app/template/ToolbarView.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
</div>
</div>
<div class="separator long"></div>
<div class="group" data-layout-name="toolbar-view-navigation">
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-tb-edit-mode"></span>
</div>
<div class="separator long"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-hand-tool"></span>
<span class="btn-slot text x-huge" id="slot-btn-select-tool"></span>
</div>
Expand Down
18 changes: 17 additions & 1 deletion apps/documenteditor/main/app/view/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,18 @@ define([
});
this.toolbarControls.push(this.btnHandTool);

this.btnEditMode = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-edit-text',
style: 'min-width: 45px;',
lock: [_set.lostConnect, _set.disableOnStart],
caption: this.textEditMode,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.toolbarControls.push(this.btnEditMode);

this.lockControls = this.toolbarControls.concat(this.paragraphControls);
this.lockToolbar(Common.enumLock.disableOnStart, true, {array: this.lockControls});
}
Expand Down Expand Up @@ -1961,6 +1973,7 @@ define([
_injectComponent('#slot-btn-select-all', this.btnSelectAll);
_injectComponent('#slot-btn-select-tool', this.btnSelectTool);
_injectComponent('#slot-btn-hand-tool', this.btnHandTool);
_injectComponent('#slot-btn-tb-edit-mode', this.btnEditMode);

return $host;
},
Expand Down Expand Up @@ -2377,6 +2390,7 @@ define([
this.btnSelectAll.updateHint(this.tipSelectAll + Common.Utils.String.platformKey('Ctrl+A'));
this.btnSelectTool.updateHint(this.tipSelectTool);
this.btnHandTool.updateHint(this.tipHandTool);
this.btnEditMode.updateHint(this.tipEditMode, true);
},

createDelayedElements: function () {
Expand Down Expand Up @@ -3699,7 +3713,9 @@ define([
textIndRight: 'Right indent',
textSpaceBefore: 'Space before',
textSpaceAfter: 'Space after',
txtAutoText: 'Auto'
txtAutoText: 'Auto',
textEditMode: 'Edit PDF',
tipEditMode: 'Edit current file.<br>The page will be reloaded.',
}
})(), DE.Views.Toolbar || {}));
});
2 changes: 2 additions & 0 deletions apps/documenteditor/main/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3519,6 +3519,8 @@
"DE.Views.Toolbar.txtScheme7": "Equity",
"DE.Views.Toolbar.txtScheme8": "Flow",
"DE.Views.Toolbar.txtScheme9": "Foundry",
"DE.Views.Toolbar.textEditMode": "Edit PDF",
"DE.Views.Toolbar.tipEditMode": "Edit current file.<br>The page will be reloaded.",
"DE.Views.ViewTab.textAlwaysShowToolbar": "Always Show Toolbar",
"DE.Views.ViewTab.textDarkDocument": "Dark Document",
"DE.Views.ViewTab.textFitToPage": "Fit To Page",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions apps/pdfeditor/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@
<div class="brendpanel" style="display: none;">
<div><div class="loading-logo"><img src="../../common/main/resources/img/header/header-logo_s.svg"></div><div class="spacer"></div><div class="circle"></div></div><div><span class="rect"></span><span class="rect"></span><span class="rect"></span><span class="rect"></span></div></div>
<div class="sktoolbar" style="display: none;">
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space" style="width: 98px;"></li><li style="width: 105px;"></li><li class="space"></li><li style="width: 160px;"></li></ul>
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space"></li><li class="big"/><li class="big"/><li class="space"></li><li style="width: 105px;"></li><li class="space"></li><li style="width: 160px;"></li></ul>
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space" style="width: 144px;"></li><li style="width: 105px;"></li><li class="space"></li><li style="width: 160px;"></li></ul>
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space"></li><li class="big"/><li class="big"/><li class="big"/><li class="space"></li><li style="width: 105px;"></li><li class="space"></li><li style="width: 160px;"></li></ul>
</div>
<div class="placeholder" style="display: none;">
<div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div>
Expand Down
2 changes: 1 addition & 1 deletion apps/pdfeditor/main/index.html.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<body>
<script src="../../../../../apps/common/main/lib/util/htmlutils.js?__inline=true"></script>

<div id="loading-mask" class="loadmask"><div class="brendpanel" style="display: none;"><div><div class="loading-logo"><img src="../../../apps/common/main/resources/img/header/header-logo_s.svg"></div><div class="spacer"></div><div class="circle"></div></div><div><span class="rect"></span><span class="rect"></span><span class="rect"></span><span class="rect"></span><span class="rect"></span><span class="rect"></span></div></div><div class="sktoolbar" style="display: none;"><ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space" style="width: 98px;"></li><li style="width: 105px;"></li><li class="space"></li><li style="width: 160px;"></li></ul><ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space"></li><li class="big"/><li class="big"/><li class="space"></li><li style="width: 105px;"></li><li class="space"></li><li style="width: 160px;"></li></ul></div><div class="placeholder" style="display: none;"><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div></div></div>
<div id="loading-mask" class="loadmask"><div class="brendpanel" style="display: none;"><div><div class="loading-logo"><img src="../../../apps/common/main/resources/img/header/header-logo_s.svg"></div><div class="spacer"></div><div class="circle"></div></div><div><span class="rect"></span><span class="rect"></span><span class="rect"></span><span class="rect"></span><span class="rect"></span><span class="rect"></span></div></div><div class="sktoolbar" style="display: none;"><ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space" style="width: 144px;"></li><li style="width: 105px;"></li><li class="space"></li><li style="width: 160px;"></li></ul><ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space"></li><li class="big"/><li class="big"/><li class="big"/><li class="space"></li><li style="width: 105px;"></li><li class="space"></li><li style="width: 160px;"></li></ul></div><div class="placeholder" style="display: none;"><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div></div></div>
<div id="viewport"></div>

<script>
Expand Down

0 comments on commit e3ebe95

Please sign in to comment.