[DE] Insert datetime form

This commit is contained in:
Julia Radzhabova 2022-12-01 21:39:15 +03:00
parent 59ca763710
commit 525b0f6223
5 changed files with 29 additions and 5 deletions

View file

@ -153,7 +153,7 @@ define([
var content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked;
var arr = [ this.view.btnTextField, this.view.btnComboBox, this.view.btnDropDown, this.view.btnCheckBox,
this.view.btnRadioBox, this.view.btnImageField, this.view.btnEmailField, this.view.btnPhoneField, this.view.btnComplexField,
this.view.btnCreditCard, this.view.btnZipCode];
this.view.btnCreditCard, this.view.btnZipCode, this.view.btnDateTime];
Common.Utils.lockControls(Common.enumLock.paragraphLock, paragraph_locked, {array: arr});
Common.Utils.lockControls(Common.enumLock.headerLock, header_locked, {array: arr});
Common.Utils.lockControls(Common.enumLock.controlPlain, control_plain, {array: arr});
@ -191,6 +191,8 @@ define([
this.api.asc_AddContentControlCheckBox(oPr, oFormPr);
} else if (type == 'combobox' || type == 'dropdown')
this.api.asc_AddContentControlList(type == 'combobox', oPr, oFormPr);
else if (type == 'datetime')
this.api.asc_AddContentControlDatePicker(); // !!!! change for datetime form
else if (type == 'text') {
var props = new AscCommon.CContentControlPr();
oPr = new AscCommon.CSdtTextFormPr();

View file

@ -220,7 +220,8 @@ define([
if (control_props && control_props.get_FormPr() && this.rightmenu.formSettings) {
var spectype = control_props.get_SpecificType();
if (spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture || spectype==Asc.c_oAscContentControlSpecificType.Complex ||
spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.None) {
spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.None ||
spectype==Asc.c_oAscContentControlSpecificType.DateTime) {
settingsType = Common.Utils.documentSettingsType.Form;
this._settings[settingsType].props = control_props;
this._settings[settingsType].locked = control_lock || isProtected;

View file

@ -61,6 +61,7 @@ define([
'<div class="group forms-buttons" style="display: none;">' +
'<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>' +
'<span class="btn-slot text x-huge" id="slot-btn-form-datetime"></span>' +
'<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>' +
'<span class="btn-slot text x-huge" id="slot-btn-form-complex"></span>' +
@ -130,6 +131,9 @@ define([
this.btnZipCode && this.btnZipCode.on('click', function (b, e) {
me.fireEvent('forms:insert', ['text', {mask: "99999-9999", placeholder: '99999-9999'}]);
});
this.btnDateTime && this.btnDateTime.on('click', function (b, e) {
me.fireEvent('forms:insert', ['datetime']);
});
this.btnViewFormRoles && this.btnViewFormRoles.on('click', function (b, e) {
var item = b.menu.getChecked();
me.fireEvent('forms:mode', [b.pressed, item ? item.caption : undefined]);
@ -315,6 +319,17 @@ define([
});
this.paragraphControls.push(this.btnCreditCard);
this.btnDateTime = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-datetime',
lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments],
caption: this.capDateTime,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.paragraphControls.push(this.btnDateTime);
this.btnComplexField = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon complex-field',
@ -500,6 +515,7 @@ define([
me.btnComplexField.updateHint(me.tipComplexField);
me.btnZipCode.updateHint(me.tipZipCode);
me.btnCreditCard.updateHint(me.tipCreditCard);
me.btnDateTime.updateHint(me.tipDateTime);
}
me.btnClear.updateHint(me.textClearFields);
me.btnPrevForm.updateHint(me.tipPrevForm);
@ -534,6 +550,7 @@ define([
this.btnComplexField.render($host.find('#slot-btn-form-complex'));
this.btnZipCode.render($host.find('#slot-btn-form-zipcode'));
this.btnCreditCard.render($host.find('#slot-btn-form-credit'));
this.btnDateTime.render($host.find('#slot-btn-form-datetime'));
$host.find('.forms-buttons').show();
}
@ -662,7 +679,9 @@ define([
capZipCode: 'Zip Code',
capCreditCard: 'Credit Card',
tipZipCode: 'Insert zip code',
tipCreditCard: 'Insert credit card number'
tipCreditCard: 'Insert credit card number',
capDateTime: 'Date & Time',
tipDateTime: 'Insert date and time'
}
}()), DE.Views.FormsTab || {}));
});

View file

@ -1400,7 +1400,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
var spectype = control_props.get_SpecificType();
fixed_size = (spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.ComboBox ||
spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.None ||
spectype==Asc.c_oAscContentControlSpecificType.Picture || spectype==Asc.c_oAscContentControlSpecificType.Complex) &&
spectype==Asc.c_oAscContentControlSpecificType.Picture || spectype==Asc.c_oAscContentControlSpecificType.Complex ||
spectype==Asc.c_oAscContentControlSpecificType.DateTime) &&
control_props.get_FormPr() && control_props.get_FormPr().get_Fixed();
}

View file

@ -810,7 +810,8 @@ define([
var spectype = control_props.get_SpecificType();
control_props = (spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.ComboBox ||
spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.None ||
spectype==Asc.c_oAscContentControlSpecificType.Picture || spectype==Asc.c_oAscContentControlSpecificType.Complex) &&
spectype==Asc.c_oAscContentControlSpecificType.Picture || spectype==Asc.c_oAscContentControlSpecificType.Complex ||
spectype==Asc.c_oAscContentControlSpecificType.DateTime) &&
control_props.get_FormPr() && control_props.get_FormPr().get_Fixed();
} else
control_props = false;