From b8c49ec79347fe27aca164479c9a02517424d7d0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 18 May 2021 01:49:08 +0300 Subject: [PATCH] [DE embed] Change fill form mode --- apps/common/embed/resources/less/common.less | 31 +++++++++++++------ apps/documenteditor/embed/index.html | 7 +++-- .../embed/js/ApplicationController.js | 18 +++++++++-- 3 files changed, 40 insertions(+), 16 deletions(-) diff --git a/apps/common/embed/resources/less/common.less b/apps/common/embed/resources/less/common.less index ddc3269e5..b8d8034f2 100644 --- a/apps/common/embed/resources/less/common.less +++ b/apps/common/embed/resources/less/common.less @@ -243,21 +243,25 @@ background-origin: content-box; padding: 0 1px; + &.has-caption { + width: auto; + padding-right: 5px; + } + &:active { - background-position-y: -@icon-height !important; + &, .btn-icon { + background-position-y: -@icon-height !important; + } + + &.has-caption { + color: #ffffff + } } - //margin: 0; - - &.no-caption { - padding: 1px 2px; - } - -// Hover state + // Hover state &:hover { - color: @toolbarHoverColor; text-decoration: none; - text-shadow: 0 1px 0 @toolbarBorderShadowColor; + background-color: @btnColor; } // Focus state for keyboard and accessibility @@ -516,6 +520,12 @@ float: left; margin: 0 15px 0 -35px; } +.btn-icon { + width: 24px; + height: 22px; + display: inline-block; + vertical-align: middle; +} .btn, button { &:focus, &:active:focus { @@ -599,6 +609,7 @@ } #box-tools { + display: inline-block; a { cursor: pointer; } diff --git a/apps/documenteditor/embed/index.html b/apps/documenteditor/embed/index.html index f1d59925f..c842249f9 100644 --- a/apps/documenteditor/embed/index.html +++ b/apps/documenteditor/embed/index.html @@ -185,11 +185,12 @@
- - +
- ffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffff +
of 0
diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 94a433c40..36afc29d5 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -369,20 +369,30 @@ DE.ApplicationController = new(function(){ } var licType = params.asc_getLicenseType(); var canFillForms = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && (permissions.fillForms===true) && (config.mode !== 'view'); + + api.asc_setViewMode(!canFillForms); + if (!canFillForms) { $('#id-btn-prev-field').hide(); $('#id-btn-next-field').hide(); + $('#id-btn-clear-fields').hide(); } else { + $('#id-btn-next-field .caption').text(me.textNext); + $('#id-btn-clear-fields .caption').text(me.textClear); $('#id-btn-prev-field').on('click', function(){ api.asc_MoveToFillingForm(false); }); $('#id-btn-next-field').on('click', function(){ api.asc_MoveToFillingForm(true); }); + $('#id-btn-clear-fields').on('click', function(){ + api.asc_ClearAllSpecialForms(); + }); + api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms); + api.asc_SetFastCollaborative(true); + api.asc_setAutoSaveGap(1); } - api.asc_setViewMode(!canFillForms); - canFillForms && api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms); api.asc_LoadDocument(); api.Resize(); } @@ -623,6 +633,8 @@ DE.ApplicationController = new(function(){ textLoadingDocument: 'Loading document', txtClose: 'Close', errorFileSizeExceed: 'The file size exceeds the limitation set for your server.
Please contact your Document Server administrator for details.', - errorUpdateVersionOnDisconnect: 'Internet connection has been restored, and the file version has been changed.
Before you can continue working, you need to download the file or copy its content to make sure nothing is lost, and then reload this page.' + errorUpdateVersionOnDisconnect: 'Internet connection has been restored, and the file version has been changed.
Before you can continue working, you need to download the file or copy its content to make sure nothing is lost, and then reload this page.', + textNext: 'Next Field', + textClear: 'Clear All Fields' } })(); \ No newline at end of file