From 0941465355588871b8012911992a42a0fca946c4 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 26 Apr 2021 18:36:40 +0300 Subject: [PATCH] [DE embed] Use embedded mode for filling forms --- .../common/embed/resources/img/next-field.png | Bin 0 -> 323 bytes .../embed/resources/img/previous-field.png | Bin 0 -> 323 bytes apps/common/embed/resources/less/common.less | 21 ++++++++++++++++++ apps/documenteditor/embed/index.html | 2 ++ .../embed/js/ApplicationController.js | 18 ++++++++++++++- 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 apps/common/embed/resources/img/next-field.png create mode 100644 apps/common/embed/resources/img/previous-field.png diff --git a/apps/common/embed/resources/img/next-field.png b/apps/common/embed/resources/img/next-field.png new file mode 100644 index 0000000000000000000000000000000000000000..ee043c87821f62d56be8c8fee0602c00486bb31b GIT binary patch literal 323 zcmeAS@N?(olHy`uVBq!ia0vp^7C z9OUlAu=X{Nfl8?MbtTeT}odeyI7+ly_hYCqXKGuyo_ zKJcLB!G7T;dPCAAC=nVgB=#KJOJMR|t5 zpFHD1os;txG)yR&vtYxddDa>RURLiFRCi8yeP12EZvCWPlU?W61V-6 SKfN31M+Q$ z9OUlAu6F7R)Lt=yzi2M$G+dd>JZ1*)DB#_Hb`Pt7)d=)C3Jmz07J*>k1+ z^tj|=MfNnYzqztI`5wpF%4v6JY&f$?&}`L#KQ$p~k2sif9S@~H@Gn0-Ta-QQ>5e;B zD`z#eyf0#re!1ZOG-U}7ZlRh}XJ?+3x0tG(ZTgvGSMiJLT#0jwW*7OE3cif|!Y9vc zC1v!+;lpp2**5lpyoXr5-%0-Pl}kR-p9X>T#)66)&zx Sxoigdk-^i|&t;ucLK6Uyr+q8{ literal 0 HcmV?d00001 diff --git a/apps/common/embed/resources/less/common.less b/apps/common/embed/resources/less/common.less index 4e3566494..cdbdd954a 100644 --- a/apps/common/embed/resources/less/common.less +++ b/apps/common/embed/resources/less/common.less @@ -475,6 +475,26 @@ } } +.png-icon { + display: inline-block; + vertical-align: middle; + cursor: pointer; + background-color: transparent; + border: 1px solid transparent; + border-radius: 2px; + width: 24px; + height: 22px; + + &.prev { + background: data-uri('../../../../common/embed/resources/img/previous-field.png') no-repeat; + background-size: cover; + } + &.next { + background: data-uri('../../../../common/embed/resources/img/next-field.png') no-repeat; + background-size: cover; + } +} + .mi-icon { width: @icon-width; height: @icon-height; @@ -565,6 +585,7 @@ } #box-tools { + display: inline-block; button { width: 24px; height: 22px; diff --git a/apps/documenteditor/embed/index.html b/apps/documenteditor/embed/index.html index d0dec3118..c6f8acbea 100644 --- a/apps/documenteditor/embed/index.html +++ b/apps/documenteditor/embed/index.html @@ -187,6 +187,8 @@ + +
diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index f976ab047..eefc764a5 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -364,7 +364,23 @@ DE.ApplicationController = new(function(){ logo.attr('href', config.customization.logo.url); } } - api.asc_setViewMode(true); + var licType = params.asc_getLicenseType(); + // var canFillForms = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && (permissions.fillForms===true) && (config.mode !== 'view'); + var canFillForms = true; + if (!canFillForms) { + $('#id-btn-prev-field').hide(); + $('#id-btn-next-field').hide(); + } else { + $('#id-btn-prev-field').on('click', function(){ + api.asc_MoveToFillingForm(false); + }); + $('#id-btn-next-field').on('click', function(){ + api.asc_MoveToFillingForm(true); + }); + } + + api.asc_setViewMode(!canFillForms); + canFillForms && api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms); api.asc_LoadDocument(); api.Resize(); }