2020-10-07 07:43:34 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* (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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* FormsTab.js
|
|
|
|
*
|
|
|
|
* Created by Julia Radzhabova on 06.10.2020
|
|
|
|
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
define([
|
|
|
|
'common/main/lib/util/utils',
|
|
|
|
'common/main/lib/component/BaseView',
|
|
|
|
'common/main/lib/component/Layout'
|
|
|
|
], function () {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
DE.Views.FormsTab = Common.UI.BaseView.extend(_.extend((function(){
|
2021-02-04 20:19:43 +00:00
|
|
|
var template =
|
|
|
|
'<section class="panel" data-tab="forms">' +
|
2022-09-08 13:25:00 +00:00
|
|
|
'<div class="group forms-buttons" style="display: none;">' +
|
2021-02-04 20:19:43 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-field"></span>' +
|
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-combobox"></span>' +
|
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-dropdown"></span>' +
|
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-checkbox"></span>' +
|
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-radiobox"></span>' +
|
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-image"></span>' +
|
|
|
|
'</div>' +
|
2022-09-08 13:25:00 +00:00
|
|
|
'<div class="separator long forms-buttons" style="display: none;"></div>' +
|
|
|
|
'<div class="group forms-buttons" style="display: none;">' +
|
2022-08-30 11:37:12 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-email"></span>' +
|
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-phone"></span>' +
|
2022-12-01 18:39:15 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-datetime"></span>' +
|
2022-12-01 17:26:08 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-zipcode"></span>' +
|
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-credit"></span>' +
|
2022-08-30 11:37:12 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-complex"></span>' +
|
2021-02-04 20:19:43 +00:00
|
|
|
'</div>' +
|
2022-11-02 20:43:56 +00:00
|
|
|
'<div class="separator long forms-buttons" style="display: none;"></div>' +
|
|
|
|
'<div class="group forms-buttons" style="display: none;">' +
|
2022-04-13 19:35:41 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-manager"></span>' +
|
2021-02-04 20:19:43 +00:00
|
|
|
'</div>' +
|
2022-11-02 20:43:56 +00:00
|
|
|
'<div class="separator long forms-buttons" style="display: none;"></div>' +
|
2022-04-13 19:35:41 +00:00
|
|
|
'<div class="group no-group-mask" style="">' +
|
2022-04-15 21:04:48 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-view-roles"></span>' +
|
2021-02-04 20:19:43 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-prev"></span>' +
|
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-next"></span>' +
|
2022-04-13 19:35:41 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-clear"></span>' +
|
2021-02-04 20:19:43 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-submit"></span>' +
|
2021-09-22 16:17:14 +00:00
|
|
|
'<span class="btn-slot text x-huge" id="slot-btn-form-save"></span>' +
|
2021-02-04 20:19:43 +00:00
|
|
|
'</div>' +
|
|
|
|
'</section>';
|
|
|
|
|
2020-10-07 07:43:34 +00:00
|
|
|
function setEvents() {
|
|
|
|
var me = this;
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnTextField && this.btnTextField.on('click', function (b, e) {
|
2022-12-01 15:05:24 +00:00
|
|
|
me.fireEvent('forms:insert', ['text', {fixed: b.options.fieldType==='fixed'}]);
|
|
|
|
});
|
|
|
|
this.btnTextField && this.btnTextField.menu.on('item:click', function (menu, item) {
|
|
|
|
var oldType = me.btnTextField.options.fieldType;
|
|
|
|
var newType = item.value;
|
|
|
|
|
|
|
|
if(newType !== oldType){
|
|
|
|
me.btnTextField.changeIcon({
|
|
|
|
next: item.options.iconClsForMainBtn,
|
|
|
|
curr: me.btnTextField.menu.items.filter(function(mnu){return mnu.value === oldType})[0].options.iconClsForMainBtn
|
|
|
|
});
|
|
|
|
me.btnTextField.updateHint(item.options.hintForMainBtn);
|
|
|
|
me.btnTextField.options.fieldType = newType;
|
|
|
|
Common.localStorage.setBool("de-text-form-fixed", newType==='fixed')
|
|
|
|
}
|
|
|
|
me.fireEvent('forms:insert', ['text', {fixed: newType==='fixed'}]);
|
2020-10-07 07:43:34 +00:00
|
|
|
});
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnComboBox && this.btnComboBox.on('click', function (b, e) {
|
2020-10-07 07:43:34 +00:00
|
|
|
me.fireEvent('forms:insert', ['combobox']);
|
|
|
|
});
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnDropDown && this.btnDropDown.on('click', function (b, e) {
|
2020-10-07 07:43:34 +00:00
|
|
|
me.fireEvent('forms:insert', ['dropdown']);
|
|
|
|
});
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnCheckBox && this.btnCheckBox.on('click', function (b, e) {
|
2020-10-07 07:43:34 +00:00
|
|
|
me.fireEvent('forms:insert', ['checkbox']);
|
|
|
|
});
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnRadioBox && this.btnRadioBox.on('click', function (b, e) {
|
2020-10-07 07:43:34 +00:00
|
|
|
me.fireEvent('forms:insert', ['radiobox']);
|
|
|
|
});
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnImageField && this.btnImageField.on('click', function (b, e) {
|
2020-10-07 11:20:14 +00:00
|
|
|
me.fireEvent('forms:insert', ['picture']);
|
2020-10-07 07:43:34 +00:00
|
|
|
});
|
2022-08-30 11:37:12 +00:00
|
|
|
this.btnComplexField && this.btnComplexField.on('click', function (b, e) {
|
|
|
|
me.fireEvent('forms:insert', ['complex']);
|
|
|
|
});
|
|
|
|
this.btnEmailField && this.btnEmailField.on('click', function (b, e) {
|
2022-09-01 14:56:51 +00:00
|
|
|
me.fireEvent('forms:insert', ['text', {reg: "\\S+@\\S+\\.\\S+", placeholder: 'user_name@email.com'}]);
|
2022-08-30 11:37:12 +00:00
|
|
|
});
|
|
|
|
this.btnPhoneField && this.btnPhoneField.on('click', function (b, e) {
|
2022-09-01 14:56:51 +00:00
|
|
|
me.fireEvent('forms:insert', ['text', {mask: "(999)999-9999", placeholder: '(999)999-9999'}]);
|
2022-08-30 11:37:12 +00:00
|
|
|
});
|
2022-12-01 17:26:08 +00:00
|
|
|
this.btnCreditCard && this.btnCreditCard.on('click', function (b, e) {
|
|
|
|
me.fireEvent('forms:insert', ['text', {mask: "9999-9999-9999-9999", placeholder: '9999-9999-9999-9999'}]);
|
|
|
|
});
|
|
|
|
this.btnZipCode && this.btnZipCode.on('click', function (b, e) {
|
|
|
|
me.fireEvent('forms:insert', ['text', {mask: "99999-9999", placeholder: '99999-9999'}]);
|
|
|
|
});
|
2022-12-01 18:39:15 +00:00
|
|
|
this.btnDateTime && this.btnDateTime.on('click', function (b, e) {
|
|
|
|
me.fireEvent('forms:insert', ['datetime']);
|
|
|
|
});
|
2022-04-15 21:04:48 +00:00
|
|
|
this.btnViewFormRoles && this.btnViewFormRoles.on('click', function (b, e) {
|
|
|
|
var item = b.menu.getChecked();
|
|
|
|
me.fireEvent('forms:mode', [b.pressed, item ? item.caption : undefined]);
|
|
|
|
});
|
|
|
|
this.btnViewFormRoles.menu.on('item:toggle', _.bind(function (menu, item, state) {
|
|
|
|
if (!!state) {
|
|
|
|
me.btnViewFormRoles.toggle(true, true);
|
|
|
|
me.fireEvent('forms:mode', [true, item.caption]);
|
|
|
|
}
|
|
|
|
}, me));
|
2022-11-28 15:25:02 +00:00
|
|
|
this.btnViewFormRoles.menu.on('show:after', function (menu) {
|
|
|
|
me.fillRolesMenu();
|
|
|
|
});
|
|
|
|
|
2022-04-13 19:35:41 +00:00
|
|
|
this.btnManager && this.btnManager.on('click', function (b, e) {
|
|
|
|
me.fireEvent('forms:manager');
|
2021-02-04 20:19:43 +00:00
|
|
|
});
|
|
|
|
this.btnClear && this.btnClear.on('click', function (b, e) {
|
|
|
|
me.fireEvent('forms:clear');
|
|
|
|
});
|
2022-04-18 12:50:58 +00:00
|
|
|
// if (this.mnuFormsColorPicker) {
|
|
|
|
// this.btnHighlight.on('color:select', function(btn, color) {
|
|
|
|
// me.fireEvent('forms:select-color', [color]);
|
|
|
|
// });
|
|
|
|
// this.mnuNoFormsColor.on('click', function (item) {
|
|
|
|
// me.fireEvent('forms:no-color', [item]);
|
|
|
|
// });
|
|
|
|
// }
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnPrevForm && this.btnPrevForm.on('click', function (b, e) {
|
|
|
|
me.fireEvent('forms:goto', ['prev']);
|
|
|
|
});
|
|
|
|
this.btnNextForm && this.btnNextForm.on('click', function (b, e) {
|
|
|
|
me.fireEvent('forms:goto', ['next']);
|
|
|
|
});
|
|
|
|
this.btnSubmit && this.btnSubmit.on('click', function (b, e) {
|
|
|
|
me.fireEvent('forms:submit');
|
|
|
|
});
|
2021-09-22 16:17:14 +00:00
|
|
|
this.btnSaveForm && this.btnSaveForm.on('click', function (b, e) {
|
|
|
|
me.fireEvent('forms:save');
|
|
|
|
});
|
2020-10-07 07:43:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
options: {},
|
|
|
|
|
|
|
|
initialize: function (options) {
|
|
|
|
Common.UI.BaseView.prototype.initialize.call(this);
|
|
|
|
this.toolbar = options.toolbar;
|
2021-02-04 20:19:43 +00:00
|
|
|
this.appConfig = options.config;
|
2020-10-07 07:43:34 +00:00
|
|
|
|
|
|
|
this.paragraphControls = [];
|
2022-11-28 15:25:02 +00:00
|
|
|
this._state = {};
|
2020-10-07 07:43:34 +00:00
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
var me = this;
|
2021-12-29 16:32:43 +00:00
|
|
|
var _set = Common.enumLock;
|
2020-10-07 07:43:34 +00:00
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
if (this.appConfig.isRestrictedEdit && this.appConfig.canFillForms) {
|
2022-04-13 19:35:41 +00:00
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
} else {
|
2022-12-01 15:05:24 +00:00
|
|
|
var isfixed = Common.localStorage.getBool("de-text-form-fixed", true);
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnTextField = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
2022-12-02 13:07:48 +00:00
|
|
|
iconCls: 'toolbar__icon ' + (isfixed ? 'btn-fixed-field' : 'btn-text-field'),
|
2022-12-06 11:25:18 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2021-02-04 20:19:43 +00:00
|
|
|
caption: this.capBtnText,
|
2022-12-01 15:05:24 +00:00
|
|
|
fieldType: isfixed ? 'fixed' : 'inline',
|
|
|
|
split: true,
|
|
|
|
menu: true,
|
2021-07-08 17:16:39 +00:00
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
2021-02-04 20:19:43 +00:00
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnTextField);
|
2020-10-07 07:43:34 +00:00
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnComboBox = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
iconCls: 'toolbar__icon btn-combo-box',
|
2022-12-06 11:25:18 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2021-02-04 20:19:43 +00:00
|
|
|
caption: this.capBtnComboBox,
|
2021-07-08 17:16:39 +00:00
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
2021-02-04 20:19:43 +00:00
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnComboBox);
|
2020-10-07 07:43:34 +00:00
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnDropDown = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
iconCls: 'toolbar__icon btn-dropdown',
|
2022-12-06 11:25:18 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2021-02-04 20:19:43 +00:00
|
|
|
caption: this.capBtnDropDown,
|
2021-07-08 17:16:39 +00:00
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
2021-02-04 20:19:43 +00:00
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnDropDown);
|
2020-10-07 07:43:34 +00:00
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnCheckBox = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
iconCls: 'toolbar__icon btn-checkbox',
|
2022-12-06 11:25:18 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2021-02-04 20:19:43 +00:00
|
|
|
caption: this.capBtnCheckBox,
|
2021-07-08 17:16:39 +00:00
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
2021-02-04 20:19:43 +00:00
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnCheckBox);
|
2020-10-07 07:43:34 +00:00
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnRadioBox = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
iconCls: 'toolbar__icon btn-radio-button',
|
2022-12-06 11:25:18 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2021-02-04 20:19:43 +00:00
|
|
|
caption: this.capBtnRadioBox,
|
2021-07-08 17:16:39 +00:00
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
2021-02-04 20:19:43 +00:00
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnRadioBox);
|
2020-10-07 07:43:34 +00:00
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnImageField = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
iconCls: 'toolbar__icon btn-insertimage',
|
2022-12-06 11:25:18 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.complexForm, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2021-02-04 20:19:43 +00:00
|
|
|
caption: this.capBtnImage,
|
2021-07-08 17:16:39 +00:00
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
2021-02-04 20:19:43 +00:00
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnImageField);
|
|
|
|
|
2022-04-13 19:35:41 +00:00
|
|
|
this.btnManager = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
iconCls: 'toolbar__icon btn-ic-sharing',
|
2022-11-02 20:43:56 +00:00
|
|
|
lock: [ _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments],
|
2022-04-13 19:35:41 +00:00
|
|
|
caption: this.capBtnManager,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnManager);
|
|
|
|
|
2022-08-30 11:37:12 +00:00
|
|
|
this.btnEmailField = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
2022-08-30 13:57:55 +00:00
|
|
|
iconCls: 'toolbar__icon btn-email',
|
2022-12-06 11:25:18 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2022-08-30 11:37:12 +00:00
|
|
|
caption: this.capBtnEmail,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnEmailField);
|
|
|
|
|
|
|
|
this.btnPhoneField = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
2022-08-30 13:57:55 +00:00
|
|
|
iconCls: 'toolbar__icon btn-phone',
|
2022-12-06 11:25:18 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2022-08-30 11:37:12 +00:00
|
|
|
caption: this.capBtnPhone,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnPhoneField);
|
|
|
|
|
2022-12-01 17:26:08 +00:00
|
|
|
this.btnZipCode = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
iconCls: 'toolbar__icon btn-zip-code',
|
2022-12-22 14:19:11 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2022-12-01 17:26:08 +00:00
|
|
|
caption: this.capZipCode,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnZipCode);
|
|
|
|
|
|
|
|
this.btnCreditCard = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
2022-12-02 13:07:48 +00:00
|
|
|
iconCls: 'toolbar__icon btn-credit-card',
|
2022-12-22 14:19:11 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2022-12-01 17:26:08 +00:00
|
|
|
caption: this.capCreditCard,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnCreditCard);
|
|
|
|
|
2022-12-01 18:39:15 +00:00
|
|
|
this.btnDateTime = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
iconCls: 'toolbar__icon btn-datetime',
|
2022-12-22 14:19:11 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2022-12-01 18:39:15 +00:00
|
|
|
caption: this.capDateTime,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnDateTime);
|
|
|
|
|
2022-08-30 11:37:12 +00:00
|
|
|
this.btnComplexField = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
2022-08-31 18:41:02 +00:00
|
|
|
iconCls: 'toolbar__icon complex-field',
|
2022-12-06 11:25:18 +00:00
|
|
|
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.complexForm, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.inSmartart, _set.inSmartartInternal],
|
2022-08-30 11:37:12 +00:00
|
|
|
caption: this.capBtnComplex,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnComplexField);
|
|
|
|
|
2022-04-15 21:04:48 +00:00
|
|
|
this.btnViewFormRoles = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
iconCls: 'toolbar__icon btn-sheet-view',
|
2022-11-02 20:43:56 +00:00
|
|
|
lock: [ _set.previewReviewMode, _set.formsNoRoles, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments],
|
2022-04-15 21:04:48 +00:00
|
|
|
caption: this.capBtnView,
|
|
|
|
split: true,
|
|
|
|
menu: new Common.UI.Menu({
|
|
|
|
cls: 'menu-roles',
|
|
|
|
maxHeight: 270,
|
|
|
|
items: []
|
|
|
|
}),
|
|
|
|
enableToggle: true,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
2022-04-18 12:50:58 +00:00
|
|
|
dataHintOffset: 'small'
|
2022-04-15 21:04:48 +00:00
|
|
|
});
|
|
|
|
this.paragraphControls.push(this.btnViewFormRoles);
|
|
|
|
|
2022-04-13 19:35:41 +00:00
|
|
|
// this.btnHighlight = new Common.UI.ButtonColored({
|
|
|
|
// cls : 'btn-toolbar',
|
|
|
|
// iconCls : 'toolbar__icon btn-highlight',
|
|
|
|
// lock: [ _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart],
|
|
|
|
// caption : this.textHighlight,
|
|
|
|
// menu : true,
|
|
|
|
// additionalItems: [ this.mnuNoFormsColor = new Common.UI.MenuItem({
|
|
|
|
// id: 'id-toolbar-menu-no-highlight-form',
|
|
|
|
// caption: this.textNoHighlight,
|
|
|
|
// checkable: true,
|
|
|
|
// style: 'padding-left: 20px;'
|
|
|
|
// }),
|
|
|
|
// {caption: '--'}],
|
|
|
|
// colors: ['000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333', '800000', 'FF6600',
|
|
|
|
// '808000', '00FF00', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966',
|
|
|
|
// '33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF',
|
|
|
|
// '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF'
|
|
|
|
// ],
|
|
|
|
// dataHint: '1',
|
|
|
|
// dataHintDirection: 'left',
|
|
|
|
// dataHintOffset: 'small'
|
|
|
|
// });
|
2021-02-04 20:19:43 +00:00
|
|
|
}
|
|
|
|
|
2022-04-13 19:35:41 +00:00
|
|
|
this.btnClear = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
|
|
|
iconCls: 'toolbar__icon clear-style',
|
|
|
|
caption: this.textClear,
|
|
|
|
visible: false,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnPrevForm = new Common.UI.Button({
|
2020-10-07 07:43:34 +00:00
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
2021-02-09 15:18:32 +00:00
|
|
|
iconCls: 'toolbar__icon previous-field',
|
2022-09-23 20:43:09 +00:00
|
|
|
lock: [ _set.previewReviewMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockComments],
|
2021-07-08 17:16:39 +00:00
|
|
|
caption: this.capBtnPrev,
|
2022-04-13 19:35:41 +00:00
|
|
|
visible: false,
|
2021-12-29 10:14:42 +00:00
|
|
|
// disabled: this.appConfig.isEdit && this.appConfig.canFeatureContentControl && this.appConfig.canFeatureForms, // disable only for edit mode
|
2021-07-08 17:16:39 +00:00
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
2020-10-07 07:43:34 +00:00
|
|
|
});
|
2022-09-08 13:25:00 +00:00
|
|
|
!(this.appConfig.isRestrictedEdit && this.appConfig.canFillForms) && this.paragraphControls.push(this.btnPrevForm);
|
2020-10-07 07:43:34 +00:00
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnNextForm = new Common.UI.Button({
|
2020-10-07 07:43:34 +00:00
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
2021-02-09 15:18:32 +00:00
|
|
|
iconCls: 'toolbar__icon next-field',
|
2022-09-23 20:43:09 +00:00
|
|
|
lock: [ _set.previewReviewMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockComments],
|
2021-07-08 17:16:39 +00:00
|
|
|
caption: this.capBtnNext,
|
2022-04-13 19:35:41 +00:00
|
|
|
visible: false,
|
2021-12-29 10:14:42 +00:00
|
|
|
// disabled: this.appConfig.isEdit && this.appConfig.canFeatureContentControl && this.appConfig.canFeatureForms, // disable only for edit mode,
|
2021-07-08 17:16:39 +00:00
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
2020-10-07 07:43:34 +00:00
|
|
|
});
|
2022-09-08 13:25:00 +00:00
|
|
|
!(this.appConfig.isRestrictedEdit && this.appConfig.canFillForms) && this.paragraphControls.push(this.btnNextForm);
|
2021-02-04 20:19:43 +00:00
|
|
|
|
|
|
|
if (this.appConfig.canSubmitForms) {
|
|
|
|
this.btnSubmit = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
2021-02-09 15:18:32 +00:00
|
|
|
iconCls: 'toolbar__icon submit-form',
|
2021-12-29 10:14:42 +00:00
|
|
|
lock: [_set.lostConnect, _set.disableOnStart],
|
2021-07-08 17:16:39 +00:00
|
|
|
caption: this.capBtnSubmit,
|
2021-12-29 10:14:42 +00:00
|
|
|
// disabled: this.appConfig.isEdit && this.appConfig.canFeatureContentControl && this.appConfig.canFeatureForms, // disable only for edit mode,
|
2021-07-08 17:16:39 +00:00
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
2021-02-04 20:19:43 +00:00
|
|
|
});
|
2022-09-08 13:25:00 +00:00
|
|
|
!(this.appConfig.isRestrictedEdit && this.appConfig.canFillForms) && this.paragraphControls.push(this.btnSubmit);
|
2021-02-04 20:19:43 +00:00
|
|
|
}
|
2021-09-22 16:17:14 +00:00
|
|
|
if (this.appConfig.canDownloadForms) {
|
|
|
|
this.btnSaveForm = new Common.UI.Button({
|
|
|
|
cls: 'btn-toolbar x-huge icon-top',
|
2021-12-29 10:14:42 +00:00
|
|
|
lock: [_set.lostConnect, _set.disableOnStart],
|
2021-09-22 16:17:14 +00:00
|
|
|
iconCls: 'toolbar__icon save-form',
|
2022-10-25 18:50:44 +00:00
|
|
|
caption: this.appConfig.canRequestSaveAs || !!this.appConfig.saveAsUrl || this.appConfig.isOffline ? this.capBtnSaveForm : this.capBtnDownloadForm,
|
2021-12-29 10:14:42 +00:00
|
|
|
// disabled: this.appConfig.isEdit && this.appConfig.canFeatureContentControl && this.appConfig.canFeatureForms, // disable only for edit mode,
|
2021-09-22 16:17:14 +00:00
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'bottom',
|
|
|
|
dataHintOffset: 'small'
|
|
|
|
});
|
2022-09-08 13:25:00 +00:00
|
|
|
!(this.appConfig.isRestrictedEdit && this.appConfig.canFillForms) && this.paragraphControls.push(this.btnSaveForm);
|
2021-09-22 16:17:14 +00:00
|
|
|
}
|
2021-12-29 16:32:43 +00:00
|
|
|
Common.Utils.lockControls(Common.enumLock.disableOnStart, true, {array: this.paragraphControls});
|
2020-10-07 07:43:34 +00:00
|
|
|
this._state = {disabled: false};
|
|
|
|
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
|
|
|
},
|
|
|
|
|
|
|
|
render: function (el) {
|
2021-02-04 20:19:43 +00:00
|
|
|
if ( el ) el.html( this.getPanel() );
|
|
|
|
|
2020-10-07 07:43:34 +00:00
|
|
|
return this;
|
|
|
|
},
|
2021-02-04 20:19:43 +00:00
|
|
|
|
2020-10-07 07:43:34 +00:00
|
|
|
onAppReady: function (config) {
|
|
|
|
var me = this;
|
|
|
|
(new Promise(function (accept, reject) {
|
|
|
|
accept();
|
|
|
|
})).then(function(){
|
2021-12-05 09:12:27 +00:00
|
|
|
if (config.isEdit && config.canFeatureContentControl && config.canFeatureForms) {
|
2022-04-13 19:35:41 +00:00
|
|
|
// if (config.canEditContentControl) {
|
|
|
|
// me.btnHighlight.setMenu();
|
|
|
|
// me.mnuFormsColorPicker = me.btnHighlight.getPicker();
|
|
|
|
// me.btnHighlight.currentColor && me.mnuFormsColorPicker.selectByRGB(me.btnHighlight.currentColor, true);
|
|
|
|
// me.mnuNoFormsColor.setChecked(me.btnHighlight.currentColor === null);
|
|
|
|
// me.btnHighlight.setColor(me.btnHighlight.currentColor || 'transparent');
|
|
|
|
// } else {
|
|
|
|
// me.btnHighlight.cmpEl.parents('.group').hide().prev('.separator').hide();
|
|
|
|
// }
|
2022-12-01 15:05:24 +00:00
|
|
|
var menuTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem">'+
|
|
|
|
'<% if (!_.isEmpty(iconCls)) { %>'+
|
|
|
|
'<span class="menu-item-icon <%= iconCls %>"></span>'+
|
|
|
|
'<% } %>'+
|
|
|
|
'<div><%= caption %></div>' +
|
|
|
|
'<% if (options.description !== null) { %><label style="display: block;cursor: pointer;white-space: normal;"><%= options.description %></label>' +
|
|
|
|
'<% } %></a>');
|
|
|
|
|
|
|
|
me.btnTextField.setMenu(new Common.UI.Menu({
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
caption: me.txtInlineText,
|
|
|
|
template: menuTemplate,
|
|
|
|
description: me.txtInlineDesc,
|
2022-12-01 18:15:23 +00:00
|
|
|
iconCls : 'menu__icon btn-field',
|
2022-12-01 15:05:24 +00:00
|
|
|
value: 'inline',
|
|
|
|
iconClsForMainBtn: 'btn-text-field',
|
|
|
|
hintForMainBtn: [me.tipInlineText, me.tipTextField]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
caption: me.txtFixedText,
|
|
|
|
template: menuTemplate,
|
|
|
|
description: me.txtFixedDesc,
|
2022-12-02 13:07:48 +00:00
|
|
|
iconCls : 'menu__icon btn-fixed-field',
|
2022-12-01 15:05:24 +00:00
|
|
|
value: 'fixed',
|
2022-12-02 13:07:48 +00:00
|
|
|
iconClsForMainBtn: 'btn-fixed-field',
|
2022-12-01 15:05:24 +00:00
|
|
|
hintForMainBtn: [me.tipFixedText, me.tipTextField]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}));
|
|
|
|
me.btnTextField.updateHint([Common.localStorage.getBool("de-text-form-fixed", true) ? me.tipFixedText : me.tipInlineText, me.tipTextField]);
|
2021-02-04 20:19:43 +00:00
|
|
|
|
|
|
|
me.btnComboBox.updateHint(me.tipComboBox);
|
|
|
|
me.btnDropDown.updateHint(me.tipDropDown);
|
|
|
|
me.btnCheckBox.updateHint(me.tipCheckBox);
|
|
|
|
me.btnRadioBox.updateHint(me.tipRadioBox);
|
|
|
|
me.btnImageField.updateHint(me.tipImageField);
|
2022-04-15 21:04:48 +00:00
|
|
|
me.btnViewFormRoles.updateHint(me.tipViewForm);
|
2022-04-13 19:35:41 +00:00
|
|
|
me.btnManager.updateHint(me.tipManager);
|
2022-08-30 11:37:12 +00:00
|
|
|
me.btnEmailField.updateHint(me.tipEmailField);
|
|
|
|
me.btnPhoneField.updateHint(me.tipPhoneField);
|
|
|
|
me.btnComplexField.updateHint(me.tipComplexField);
|
2022-12-01 17:26:08 +00:00
|
|
|
me.btnZipCode.updateHint(me.tipZipCode);
|
|
|
|
me.btnCreditCard.updateHint(me.tipCreditCard);
|
2022-12-01 18:39:15 +00:00
|
|
|
me.btnDateTime.updateHint(me.tipDateTime);
|
2021-02-04 20:19:43 +00:00
|
|
|
}
|
2022-04-13 19:35:41 +00:00
|
|
|
me.btnClear.updateHint(me.textClearFields);
|
2021-02-04 20:19:43 +00:00
|
|
|
me.btnPrevForm.updateHint(me.tipPrevForm);
|
|
|
|
me.btnNextForm.updateHint(me.tipNextForm);
|
|
|
|
me.btnSubmit && me.btnSubmit.updateHint(me.tipSubmit);
|
2022-04-26 12:20:30 +00:00
|
|
|
me.btnSaveForm && me.btnSaveForm.updateHint(config.canRequestSaveAs || !!config.saveAsUrl ? me.tipSaveForm : me.tipDownloadForm);
|
2020-10-07 07:43:34 +00:00
|
|
|
|
|
|
|
setEvents.call(me);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
getPanel: function () {
|
|
|
|
this.$el = $(_.template(template)( {} ));
|
|
|
|
var $host = this.$el;
|
|
|
|
|
2021-09-22 16:17:14 +00:00
|
|
|
this.appConfig.canSubmitForms && this.btnSubmit.render($host.find('#slot-btn-form-submit'));
|
|
|
|
this.appConfig.canDownloadForms && this.btnSaveForm.render($host.find('#slot-btn-form-save'));
|
2021-02-09 13:39:27 +00:00
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
if (this.appConfig.isRestrictedEdit && this.appConfig.canFillForms) {
|
|
|
|
} else {
|
|
|
|
this.btnTextField.render($host.find('#slot-btn-form-field'));
|
|
|
|
this.btnComboBox.render($host.find('#slot-btn-form-combobox'));
|
|
|
|
this.btnDropDown.render($host.find('#slot-btn-form-dropdown'));
|
|
|
|
this.btnCheckBox.render($host.find('#slot-btn-form-checkbox'));
|
|
|
|
this.btnRadioBox.render($host.find('#slot-btn-form-radiobox'));
|
|
|
|
this.btnImageField.render($host.find('#slot-btn-form-image'));
|
2022-04-15 21:04:48 +00:00
|
|
|
this.btnViewFormRoles.render($host.find('#slot-btn-form-view-roles'));
|
2022-04-13 19:35:41 +00:00
|
|
|
this.btnManager.render($host.find('#slot-btn-manager'));
|
|
|
|
// this.btnHighlight.render($host.find('#slot-form-highlight'));
|
2022-08-30 11:37:12 +00:00
|
|
|
this.btnEmailField.render($host.find('#slot-btn-form-email'));
|
|
|
|
this.btnPhoneField.render($host.find('#slot-btn-form-phone'));
|
|
|
|
this.btnComplexField.render($host.find('#slot-btn-form-complex'));
|
2022-12-01 17:26:08 +00:00
|
|
|
this.btnZipCode.render($host.find('#slot-btn-form-zipcode'));
|
|
|
|
this.btnCreditCard.render($host.find('#slot-btn-form-credit'));
|
2022-12-01 18:39:15 +00:00
|
|
|
this.btnDateTime.render($host.find('#slot-btn-form-datetime'));
|
2021-02-09 13:39:27 +00:00
|
|
|
|
2022-09-08 13:25:00 +00:00
|
|
|
$host.find('.forms-buttons').show();
|
2021-02-04 20:19:43 +00:00
|
|
|
}
|
2022-04-13 19:35:41 +00:00
|
|
|
this.btnClear.render($host.find('#slot-btn-form-clear'));
|
2021-02-04 20:19:43 +00:00
|
|
|
this.btnPrevForm.render($host.find('#slot-btn-form-prev'));
|
|
|
|
this.btnNextForm.render($host.find('#slot-btn-form-next'));
|
|
|
|
|
|
|
|
return this.$el;
|
|
|
|
},
|
|
|
|
|
2022-12-01 15:38:42 +00:00
|
|
|
fillRolesMenu: function(roles, lastViewRole) {
|
2022-11-28 15:25:02 +00:00
|
|
|
if (!(this.btnViewFormRoles && this.btnViewFormRoles.menu && this.btnViewFormRoles.menu.isVisible())) {
|
|
|
|
this._state.roles = roles;
|
2022-12-01 15:38:42 +00:00
|
|
|
this._state.lastViewRole = lastViewRole;
|
2022-11-28 15:25:02 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
roles = roles || this._state.roles;
|
2022-12-01 15:38:42 +00:00
|
|
|
lastViewRole = lastViewRole || this._state.lastViewRole;
|
|
|
|
this._state.roles = this._state.lastViewRole = undefined;
|
2022-11-28 15:25:02 +00:00
|
|
|
|
|
|
|
if (!roles) return;
|
|
|
|
|
2022-04-15 21:04:48 +00:00
|
|
|
var checkedIndex = 0,
|
|
|
|
me = this;
|
|
|
|
|
|
|
|
this.btnViewFormRoles.menu.removeAll();
|
|
|
|
|
|
|
|
roles && roles.forEach(function(item, index) {
|
2022-11-28 15:25:02 +00:00
|
|
|
var role = item.asc_getSettings(),
|
|
|
|
color = role.asc_getColor();
|
2022-12-01 15:38:42 +00:00
|
|
|
if (role.asc_getName()===lastViewRole)
|
2022-04-15 21:04:48 +00:00
|
|
|
checkedIndex = index;
|
|
|
|
me.btnViewFormRoles.menu.addItem(new Common.UI.MenuItem({
|
2022-11-28 15:25:02 +00:00
|
|
|
caption: role.asc_getName() || me.textAnyone,
|
|
|
|
color: color ? '#' + Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()) : 'transparent',
|
2022-04-15 21:04:48 +00:00
|
|
|
checkable: true,
|
|
|
|
toggleGroup: 'formtab-view-role',
|
|
|
|
template: _.template([
|
|
|
|
'<a id="<%= id %>" tabindex="-1" type="menuitem" class="<%= options.cls %>">',
|
|
|
|
'<span class="color" style="background: <%= options.color %>;"></span>',
|
|
|
|
'<%= caption %>',
|
|
|
|
'</a>'
|
|
|
|
].join(''))
|
|
|
|
}));
|
|
|
|
});
|
|
|
|
|
|
|
|
var len = this.btnViewFormRoles.menu.items.length>0;
|
|
|
|
len && this.btnViewFormRoles.menu.items[checkedIndex].setChecked(true, true);
|
2022-04-18 12:50:58 +00:00
|
|
|
Common.Utils.lockControls(Common.enumLock.formsNoRoles, !len,{array: [this.btnViewFormRoles]});
|
2022-04-15 21:04:48 +00:00
|
|
|
},
|
|
|
|
|
2020-10-07 07:43:34 +00:00
|
|
|
show: function () {
|
|
|
|
Common.UI.BaseView.prototype.show.call(this);
|
|
|
|
this.fireEvent('show', this);
|
|
|
|
},
|
|
|
|
|
|
|
|
getButtons: function() {
|
|
|
|
return this.paragraphControls;
|
|
|
|
},
|
|
|
|
|
2022-04-13 19:35:41 +00:00
|
|
|
setPreviewMode: function(state) {
|
|
|
|
this.btnClear.setVisible(state);
|
|
|
|
this.btnPrevForm.setVisible(state);
|
|
|
|
this.btnNextForm.setVisible(state);
|
|
|
|
this.btnSubmit && this.btnSubmit.setVisible(!state);
|
|
|
|
this.btnSaveForm && this.btnSaveForm.setVisible(!state);
|
|
|
|
},
|
|
|
|
|
2020-10-07 07:43:34 +00:00
|
|
|
SetDisabled: function (state) {
|
|
|
|
this._state.disabled = state;
|
|
|
|
this.paragraphControls.forEach(function(button) {
|
|
|
|
if ( button ) {
|
|
|
|
button.setDisabled(state);
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
},
|
|
|
|
|
|
|
|
capBtnText: 'Text Field',
|
|
|
|
capBtnComboBox: 'Combo Box',
|
|
|
|
capBtnDropDown: 'Dropdown',
|
|
|
|
capBtnCheckBox: 'Checkbox',
|
|
|
|
capBtnRadioBox: 'Radio Button',
|
|
|
|
capBtnImage: 'Image',
|
2020-11-12 09:03:14 +00:00
|
|
|
capBtnView: 'Fill Form',
|
2020-10-07 07:43:34 +00:00
|
|
|
textClearFields: 'Clear All Fields',
|
|
|
|
textHighlight: 'Highlight Settings',
|
|
|
|
tipTextField: 'Insert text field',
|
|
|
|
tipComboBox: 'Insert combo box',
|
|
|
|
tipDropDown: 'Insert dropdown list',
|
|
|
|
tipCheckBox: 'Insert checkbox',
|
|
|
|
tipRadioBox: 'Insert radio button',
|
|
|
|
tipImageField: 'Insert image',
|
2021-02-09 15:47:55 +00:00
|
|
|
tipViewForm: 'View form',
|
2020-10-07 07:43:34 +00:00
|
|
|
textNoHighlight: 'No highlighting',
|
2021-02-04 20:19:43 +00:00
|
|
|
textClear: 'Clear Fields',
|
|
|
|
capBtnPrev: 'Previous Field',
|
|
|
|
capBtnNext: 'Next Field',
|
|
|
|
capBtnSubmit: 'Submit',
|
|
|
|
tipPrevForm: 'Go to the previous field',
|
|
|
|
tipNextForm: 'Go to the next field',
|
2021-02-06 11:58:40 +00:00
|
|
|
tipSubmit: 'Submit form',
|
2021-06-18 08:14:43 +00:00
|
|
|
textSubmited: 'Form submitted successfully',
|
2021-09-22 16:17:14 +00:00
|
|
|
textRequired: 'Fill all required fields to send form.',
|
2022-04-26 12:20:30 +00:00
|
|
|
capBtnSaveForm: 'Save as oform',
|
2021-10-20 13:26:55 +00:00
|
|
|
tipSaveForm: 'Save a file as a fillable OFORM document',
|
2021-10-28 13:41:06 +00:00
|
|
|
txtUntitled: 'Untitled',
|
2021-10-29 15:50:41 +00:00
|
|
|
textCreateForm: 'Add fields and create a fillable OFORM document',
|
2022-04-13 19:35:41 +00:00
|
|
|
textGotIt: 'Got it',
|
|
|
|
capBtnManager: 'Manage Roles',
|
2022-06-17 14:56:21 +00:00
|
|
|
tipManager: 'Manage Roles',
|
2022-04-26 12:20:30 +00:00
|
|
|
capBtnDownloadForm: 'Download as oform',
|
2022-08-30 11:37:12 +00:00
|
|
|
tipDownloadForm: 'Download a file as a fillable OFORM document',
|
|
|
|
capBtnEmail: 'Email Address',
|
|
|
|
capBtnPhone: 'Phone Number',
|
|
|
|
capBtnComplex: 'Complex Field',
|
|
|
|
tipEmailField: 'Insert email address',
|
|
|
|
tipPhoneField: 'Insert phone number',
|
2022-11-28 15:25:02 +00:00
|
|
|
tipComplexField: 'Insert complex field',
|
2022-12-01 15:05:24 +00:00
|
|
|
textAnyone: 'Anyone',
|
|
|
|
txtInlineText: 'Inline',
|
|
|
|
txtInlineDesc: 'Insert inline text field',
|
|
|
|
txtFixedText: 'Fixed',
|
|
|
|
txtFixedDesc: 'Insert fixed text field',
|
|
|
|
tipInlineText: 'Insert inline text field',
|
2022-12-01 17:26:08 +00:00
|
|
|
tipFixedText: 'Insert fixed text field',
|
|
|
|
capZipCode: 'Zip Code',
|
|
|
|
capCreditCard: 'Credit Card',
|
|
|
|
tipZipCode: 'Insert zip code',
|
2022-12-01 18:39:15 +00:00
|
|
|
tipCreditCard: 'Insert credit card number',
|
|
|
|
capDateTime: 'Date & Time',
|
|
|
|
tipDateTime: 'Insert date and time'
|
2020-10-07 07:43:34 +00:00
|
|
|
}
|
|
|
|
}()), DE.Views.FormsTab || {}));
|
|
|
|
});
|