From 73f0b3bb1e7cbc5191cacd7365ac7b06af3972c6 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 12 Sep 2024 02:51:49 +0500 Subject: [PATCH 01/18] feat/de: custom properties --- .../main/lib/view/DocumentPropertyDialog.js | 277 ++++++++++++++ .../main/app/view/FileMenuPanels.js | 354 +++++++++++------- apps/documenteditor/main/app_dev.js | 1 + apps/documenteditor/main/app_pack.js | 1 + apps/documenteditor/main/locale/en.json | 17 + .../main/resources/less/filemenu.less | 131 ++++++- 6 files changed, 637 insertions(+), 144 deletions(-) create mode 100644 apps/common/main/lib/view/DocumentPropertyDialog.js diff --git a/apps/common/main/lib/view/DocumentPropertyDialog.js b/apps/common/main/lib/view/DocumentPropertyDialog.js new file mode 100644 index 0000000000..ca5c831c03 --- /dev/null +++ b/apps/common/main/lib/view/DocumentPropertyDialog.js @@ -0,0 +1,277 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2024 + * + * 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-6 Ernesta Birznieka-Upish + * 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 + * + */ + +define([], function () { 'use strict'; + + Common.Views.DocumentPropertyDialog = Common.UI.Window.extend(_.extend({ + options: { + width: 320, + cls: 'modal-dlg', + buttons: ['ok', 'cancel'] + }, + + initialize : function(options) { + _.extend(this.options, { + title: this.txtTitle, + defaultValue: {} + }, options); + + this.template = [ + '
', + '
', + '', + '
', + '
', + '
', + '', + '
', + '
', + '
', + '', + '
', + '
', + '
', + '
', + '
' + ].join(''); + + this.options.tpl = _.template(this.template)(this.options); + + this.asc2type = function(ascType) { + if (ascType === AscCommon.c_oVariantTypes.vtLpwstr) { + return 'text'; + } else if (ascType === AscCommon.c_oVariantTypes.vtI4 || ascType === AscCommon.c_oVariantTypes.vtR8) { + return 'number'; + } else if (ascType === AscCommon.c_oVariantTypes.vtBool) { + return 'boolean'; + } else if (ascType === AscCommon.c_oVariantTypes.vtFiletime) { + return 'date'; + } + } + + Common.UI.Window.prototype.initialize.call(this, this.options); + }, + + render: function() { + Common.UI.Window.prototype.render.call(this); + + this.inputTitle = new Common.UI.InputField({ + el: $('#id-dlg-title'), + allowBlank: false, + validateOnBlur: false, + validation: function(value) { + return value.length === 0 ? this.txtPropertyTitleBlankError : true; + } + }); + if (this.options.defaultValue.name) { + this.inputTitle.setValue(this.options.defaultValue.name); + } + + this.comboboxType = new Common.UI.ComboBox({ + el: $('#id-dlg-type'), + cls: 'input-group-nr', + menuStyle: 'min-width: 85px;', + editable: false, + data: [ + { displayValue: this.txtPropertyTypeText, value: 'text' }, + { displayValue: this.txtPropertyTypeNumber, value: 'number' }, + { displayValue: this.txtPropertyTypeDate, value: 'date' }, + { displayValue: this.txtPropertyTypeBoolean, value: 'boolean' } + ], + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'big', + ariaLabel: this.strLineHeight + }); + var currentType = this.options.defaultValue.type ? this.asc2type(this.options.defaultValue.type) : 'text' + this.comboboxType.setValue(currentType); + this.comboboxType.on('selected', _.bind(function (cmb, record) { + this.inputTextOrNumber.setVisible(record.value === 'text' || record.value === 'number'); + this.comboboxBoolean.setVisible(record.value === 'boolean'); + this.datepicker.setVisible(record.value === 'date'); + }, this)) + + this.inputTextOrNumber = new Common.UI.InputField({ + el: $('#id-dlg-value-input'), + style: 'width: 100%;', + validateOnBlur: false, + validation: function(value) { + if (value.length === 0) { + return this.txtPropertyValueBlankError; + } + + if (this.comboboxType.getValue() === 'number' && isNaN(value.replace(',', '.'))) { + return this.txtPropertyTypeNumberInvalid; + } + + return true; + }.bind(this) + }); + if (this.options.defaultValue.value && (currentType === 'text' || currentType === 'number')) { + this.inputTextOrNumber.setValue(this.options.defaultValue.value); + } + this.inputTextOrNumber.setVisible( + this.options.defaultValue.type + ? (this.options.defaultValue.type !== AscCommon.c_oVariantTypes.vtFiletime && this.options.defaultValue.type !== AscCommon.c_oVariantTypes.vtBool) + : (currentType === 'text' || currentType === 'number') + ); + + this.comboboxBoolean = new Common.UI.ComboBox({ + el: $('#id-dlg-value-boolean'), + cls: 'input-group-nr', + menuStyle: 'min-width: 85px;', + editable: false, + data: [ + { displayValue: this.txtPropertyBooleanTrue, value: 1 }, + { displayValue: this.txtPropertyBooleanFalse, value: 0 } + ], + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'big', + ariaLabel: this.strLineHeight + }); + this.comboboxBoolean.setValue(this.options.defaultValue.value !== undefined && currentType === 'boolean' ? (this.options.defaultValue.value ? 1 : 0) : 1); + this.comboboxBoolean.setVisible(this.options.defaultValue.type ? this.options.defaultValue.type === AscCommon.c_oVariantTypes.vtBool : currentType === 'boolean'); + + this.datepicker = new Common.UI.InputFieldBtnCalendar({ + el: $('#id-dlg-value-date'), + allowBlank : true, + validateOnChange: false, + validateOnBlur: false, + value : '', + dataHint : '1', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + if (this.options.defaultValue.value && currentType === 'date') { + this.datepicker.setValue(this.options.defaultValue.value); + } + this.datepicker.setVisible(this.options.defaultValue.type ? this.options.defaultValue.type === AscCommon.c_oVariantTypes.vtFiletime : currentType === 'date'); + this.datepicker.on('date:click', function (_, date) { + this.datepicker.setValue(date); + }.bind(this)); + + var $window = this.getChild(); + $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); + }, + + getFocusedComponents: function() { + return [this.inputUrl].concat(this.getFooterButtons()); + }, + + getDefaultFocusableComponent: function () { + return this.inputUrl; + }, + + show: function() { + Common.UI.Window.prototype.show.apply(this, arguments); + + var me = this; + _.delay(function(){ + me.getChild('input').focus(); + },100); + }, + + onPrimary: function(event) { + this._handleInput('ok'); + return false; + }, + + onBtnClick: function(event) { + this._handleInput(event.currentTarget.attributes['result'].value); + }, + + _handleInput: function(state) { + if (this.options.handler) { + if (state === 'ok') { + if (this.inputTitle.checkValidate() !== true) { + this.inputTitle.cmpEl.find('input').focus(); + return; + } + + var title = this.inputTitle.getValue(), type = this.comboboxType.getValue(), ascValue, ascType; + if (type === 'boolean') { + ascValue = this.comboboxBoolean.getValue() === 1; + ascType = AscCommon.c_oVariantTypes.vtBool; + } else if (type === 'date') { + if (this.datepicker.checkValidate() !== true) { + this.datepicker.cmpEl.find('input').focus(); + return; + } + + ascValue = this.datepicker.getValue(); + ascType = AscCommon.c_oVariantTypes.vtFiletime; + } else { + if (this.inputTextOrNumber.checkValidate() !== true) { + this.inputTextOrNumber.cmpEl.find('input').focus(); + return; + } + + var value = this.inputTextOrNumber.getValue(); + if (type === 'text') { + ascType = AscCommon.c_oVariantTypes.vtLpwstr; + ascValue = value; + } else { + // note: precisely a numeric value because we validated it + value = value.replace(',', '.'); + if (value % 1 === 0) { + ascType = AscCommon.c_oVariantTypes.vtI4; + ascValue = parseInt(value); + } else { + ascType = AscCommon.c_oVariantTypes.vtR8; + ascValue = parseFloat(value); + } + } + } + + this.options.handler.call(this, state, title, ascType, ascValue); + } + } + + this.close(); + }, + + txtTitle: "New Document Property", + txtPropertyTitleLabel: "Title", + txtPropertyTitleBlankError: 'Property should have a title', + txtPropertyTypeLabel: "Type", + txtPropertyValueLabel: "Value", + txtPropertyValueBlankError: 'Property should have a value', + txtPropertyTypeText: "Text", + txtPropertyTypeNumber: "Number", + txtPropertyTypeNumberInvalid: 'Provide a valid number', + txtPropertyTypeDate: "Date", + txtPropertyTypeBoolean: '"Yes" or "no"', + txtPropertyBooleanTrue: 'Yes', + txtPropertyBooleanFalse: 'No' + }, Common.Views.DocumentPropertyDialog || {})); +}); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 16f97f5a3d..bf5024436d 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1329,141 +1329,158 @@ define([], function () { this.rendered = false; this.template = _.template([ - '
', - '
' + this.txtDocumentInfo + '
', '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', // '', // '', // '', // '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', + '', + '', + '', + '', + '', + '', - '', - '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', '
' + this.txtDocumentInfo + '
', + '
', '', '', - '', + '', '', '
', - '
', - '
', - '
', - '', - '', - '', - '', - '', - '
', - '
' + '
', + '', + '', + '', + '', + '', + '
', + '', + '
', + '
', + '
', + '', + '', + '', + '', + '', + '
', + '', + '
', + '
' ].join('')); this.infoObj = {PageCount: 0, WordsCount: 0, ParagraphCount: 0, SymbolsCount: 0, SymbolsWSCount:0}; @@ -1620,7 +1637,11 @@ define([], function () { }); this.btnApply.on('click', _.bind(this.applySettings, this)); - this.pnlInfo = $markup.find('.flex-settings').addBack().filter('.flex-settings'); + this.btnAddProperty = new Common.UI.Button({ + el: $markup.findById('#fminfo-btn-add-property') + }); + this.btnAddProperty.on('click', _.bind(this.onAddPropertyClick, this)); + this.pnlApply = $markup.findById('#fms-flex-apply'); this.rendered = true; @@ -1630,8 +1651,7 @@ define([], function () { this.$el = $(node).html($markup); if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ - el: this.pnlInfo, - suppressScrollX: true, + el: this.$el, alwaysVisibleY: true }); } @@ -1663,7 +1683,7 @@ define([], function () { updateScroller: function(destroy) { if (this.scroller) { this.scroller.update(destroy ? {} : undefined); - this.pnlInfo.toggleClass('bordered', this.scroller.isVisible()); + // this.pnlInfo.toggleClass('bordered', this.scroller.isVisible()); } }, @@ -1720,6 +1740,12 @@ define([], function () { this._ShowHideInfoItem(this.lblDate, !!value); } else if (pdfProps) this.updatePdfInfo(pdfProps); + + if (this.api) { + _.each(this.api.asc_getAllCustomProperties(), _.bind(function(prop, idx) { + this.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), idx); + }, this)); + } }, updateFileInfo: function() { @@ -1967,6 +1993,55 @@ define([], function () { this.fillDocInfo(); }, + tplCustomProperty: function(name, type, value) { + if (type === AscCommon.c_oVariantTypes.vtBool) { + value = value ? 'Yes' : 'No'; + } + + return '' + + '' + + '
' + + '' + + '
' + + '
'; + }, + + renderCustomProperty: function(name, type, value, idx) { + var me = this; + + var currentCustomProperty = $('tr[data-name="' + name + '"]'); + if (currentCustomProperty.length) { + currentCustomProperty.off('click'); + currentCustomProperty.html($(this.tplCustomProperty(name, type, value))); + } else { + currentCustomProperty = $(this.tplCustomProperty(name, type, value)); + $('tbody.properties-tab').append(currentCustomProperty); + } + + currentCustomProperty.on('click', function (e) { + var btn = currentCustomProperty.find(e.target); + if (btn.hasClass('close')) { + me.api.asc_removeCustomProperty(idx); + $('tr[data-name="' + name + '"]').remove(); + } else if (btn.hasClass('form-control')) { + (new Common.Views.DocumentPropertyDialog({ + title: me.txtDocumentPropertyUpdateTitle, + defaultValue: { + name: name, + type: type, + value: value + }, + handler: function(result, name, type, value) { + if (result === 'ok') { + me.api.asc_modifyCustomProperty(idx, name, type, value); + me.renderCustomProperty(name, type, value, idx); + } + } + })).show(); + } + }) + }, + fillDocInfo: function() { this.lblStatPages.text(this.infoObj.PageCount); this.lblStatWords.text(this.infoObj.WordsCount); @@ -2007,6 +2082,20 @@ define([], function () { this.btnApply.setDisabled(this._state._locked); }, + onAddPropertyClick: function() { + var me = this; + (new Common.Views.DocumentPropertyDialog({ + handler: function(result, title, type, value) { + if (result === 'ok') { + me.api.asc_addCustomProperty(title, type, value); + var properties = me.api.asc_getAllCustomProperties(); + var prop = properties[properties.length - 1]; + me.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), properties.length - 1); + } + } + })).show(); + }, + applySettings: function() { if (this.coreProps && this.api) { this.coreProps.asc_putTitle(this.inputTitle.getValue()); @@ -2049,7 +2138,12 @@ define([], function () { txtYes: 'Yes', txtNo: 'No', txtPdfProducer: 'PDF Producer', - txtDocumentInfo: 'Document Info' + txtCommon: 'Common', + txtStatistics: 'Statistics', + txtProperties: 'Properties', + txtDocumentInfo: 'Document Info', + txtDocumentPropertyUpdateTitle: "Document Property", + txtAddProperty: 'Add property' }, DE.Views.FileMenuPanels.DocumentInfo || {})); diff --git a/apps/documenteditor/main/app_dev.js b/apps/documenteditor/main/app_dev.js index ca3c8005a2..0985ae77c2 100644 --- a/apps/documenteditor/main/app_dev.js +++ b/apps/documenteditor/main/app_dev.js @@ -222,6 +222,7 @@ require([ 'common/main/lib/view/TextInputDialog', 'common/main/lib/view/DocumentHolderExt', 'common/main/lib/util/define', + 'common/main/lib/view/DocumentPropertyDialog', 'documenteditor/main/app/view/FileMenuPanels', 'documenteditor/main/app/view/DocumentHolderExt', diff --git a/apps/documenteditor/main/app_pack.js b/apps/documenteditor/main/app_pack.js index 9938cf47e4..7dfe624408 100644 --- a/apps/documenteditor/main/app_pack.js +++ b/apps/documenteditor/main/app_pack.js @@ -27,6 +27,7 @@ require([ 'common/main/lib/view/LanguageDialog', 'common/main/lib/view/TextInputDialog', 'common/main/lib/view/DocumentHolderExt', + 'common/main/lib/view/DocumentPropertyDialog', 'documenteditor/main/app/view/FileMenuPanels', 'documenteditor/main/app/view/DocumentHolderExt', diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 5b9f23ee68..603c42f104 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -827,6 +827,19 @@ "Common.Views.UserNameDialog.textDontShow": "Don't ask me again", "Common.Views.UserNameDialog.textLabel": "Label:", "Common.Views.UserNameDialog.textLabelError": "Label must not be empty.", + "Common.Views.DocumentPropertyDialog.txtTitle": "New Document Property", + "Common.Views.DocumentPropertyDialog.txtPropertyTitleLabel": "Title", + "Common.Views.DocumentPropertyDialog.txtPropertyTitleBlankError": "Property should have a title", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeLabel": "Type", + "Common.Views.DocumentPropertyDialog.txtPropertyValueLabel": "Value", + "Common.Views.DocumentPropertyDialog.txtPropertyValueBlankError": "Property should have a value", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeText": "Text", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumber": "Number", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumberInvalid": "Provide a valid number", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeDate": "Date", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"no\"", + "Common.Views.DocumentPropertyDialog.txtPropertyBooleanTrue": "Yes", + "Common.Views.DocumentPropertyDialog.txtPropertyBooleanFalse": "No", "DE.Controllers.DocProtection.txtIsProtectedComment": "Document is protected. You may only insert comments to this document.", "DE.Controllers.DocProtection.txtIsProtectedForms": "Document is protected. You may only fill in forms in this document.", "DE.Controllers.DocProtection.txtIsProtectedTrack": "Document is protected. You may edit this document, but all changes will be tracked.", @@ -2176,6 +2189,10 @@ "DE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded", "DE.Views.FileMenuPanels.DocumentInfo.txtWords": "Words", "DE.Views.FileMenuPanels.DocumentInfo.txtYes": "Yes", + "DE.Views.FileMenuPanels.DocumentInfo.txtCommon": "Common", + "DE.Views.FileMenuPanels.DocumentInfo.txtProperties": "Properties", + "DE.Views.FileMenuPanels.DocumentInfo.txtDocumentPropertyUpdateTitle": "Document Property", + "DE.Views.FileMenuPanels.DocumentInfo.txtAddProperty": "Add property", "DE.Views.FileMenuPanels.DocumentRights.txtAccessRights": "Access rights", "DE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights", "DE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights", diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index b50dfe6213..d983086cc3 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -184,8 +184,7 @@ } -#panel-settings, -#panel-info { +#panel-settings { #file-menu-panel & { padding: 0; display: flex; @@ -193,6 +192,93 @@ } } +#panel-info { + #file-menu-panel & { + padding: 30px; + + .flex-settings { + gap: 30px; + display: flex; + flex-direction: column; + } + } + + .header { + .font-size-very-huge(); + line-height: 26px; + } + + table { + display: flex; + gap: 30px; + flex-direction: column; + + tbody { + display: flex; + gap: 12px; + flex-direction: column; + + &.properties-tab { + gap: 10px; + } + } + + tr { + display: flex; + gap: 24px; + align-items: center; + td { + font-size: 11px; + line-height: 16px; + + &.title { + label { + font-size: 14px; + font-weight: 700; + line-height: 20px; + } + } + + &.left { + width: 120px; + height: 16px; + flex-shrink: 0; + } + + &.right { + flex-grow: 1; + } + } + + &.divider { + height: 10px; + } + } + + tr.author-info { + align-items: flex-start; + + td { + display: flex; + gap: 5px; + align-items: center; + } + } + + .author-info tbody tr:last-child { + margin-bottom: 20px; + } + + &.main { + width: 100%; + } + } + + #fms-flex-add-property { + margin: 10px 0; + } +} + #panel-settings { .header { margin: 30px 0 16px 30px; @@ -562,18 +648,6 @@ } } -#panel-info { - .header { - margin: 30px 0 20px 30px; - .font-size-very-huge(); - - .rtl & { - margin: 30px 30px 20px 0; - } - } -} - -#panel-info, #panel-rights { table { tr { @@ -838,4 +912,33 @@ } } } +} + +.document-info-content { + display: flex; + flex-direction: column; + margin: 0 20px; + gap: 10px; +} + +#fminfo-btn-add-property > span { + text-decoration: underline dotted; + text-underline-offset: 4px; +} + +#fms-flex-add-property, #fms-flex-apply { + #panel-info table tr td { + height: 0; + } +} + +#fminfo-btn-add-property { + background-color: transparent; + height: 24px; +} + +.custom-property-wrapper { + display: flex; + gap: 5px; + align-items: center; } \ No newline at end of file From 214793bcde57da56db3b40349c64a99fda658991 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 12 Sep 2024 13:18:59 +0500 Subject: [PATCH 02/18] fix/de: support disable custom property fields --- .../main/lib/view/DocumentPropertyDialog.js | 4 ++-- .../main/app/view/FileMenuPanels.js | 21 ++++++++++++++++--- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/view/DocumentPropertyDialog.js b/apps/common/main/lib/view/DocumentPropertyDialog.js index ca5c831c03..1069c5b43b 100644 --- a/apps/common/main/lib/view/DocumentPropertyDialog.js +++ b/apps/common/main/lib/view/DocumentPropertyDialog.js @@ -185,11 +185,11 @@ define([], function () { 'use strict'; }, getFocusedComponents: function() { - return [this.inputUrl].concat(this.getFooterButtons()); + return [this.inputTitle].concat(this.getFooterButtons()); }, getDefaultFocusableComponent: function () { - return this.inputUrl; + return this.inputTitle; }, show: function() { diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index bf5024436d..4d68e8b893 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1465,7 +1465,7 @@ define([], function () { '', '', '', '', '', @@ -2019,6 +2019,10 @@ define([], function () { } currentCustomProperty.on('click', function (e) { + if (currentCustomProperty.find('div.disabled').length) { + return; + } + var btn = currentCustomProperty.find(e.target); if (btn.hasClass('close')) { me.api.asc_removeCustomProperty(idx); @@ -2042,6 +2046,13 @@ define([], function () { }) }, + setDisabledCustomProperties: function(disable) { + _.each($('tr[data-name]'), function(prop) { + $(prop).find('div.custom-property-wrapper')[disable ? 'addClass' : 'removeClass']('disabled'); + $(prop).find('div.close')[disable ? 'hide' : 'show'](); + }) + }, + fillDocInfo: function() { this.lblStatPages.text(this.infoObj.PageCount); this.lblStatWords.text(this.infoObj.WordsCount); @@ -2080,6 +2091,8 @@ define([], function () { this.tblAuthor.find('.close').toggleClass('disabled', this._state._locked); this.tblAuthor.toggleClass('disabled', disable); this.btnApply.setDisabled(this._state._locked); + this.btnAddProperty.setDisabled(disable); + this.setDisabledCustomProperties(disable); }, onAddPropertyClick: function() { @@ -2089,8 +2102,10 @@ define([], function () { if (result === 'ok') { me.api.asc_addCustomProperty(title, type, value); var properties = me.api.asc_getAllCustomProperties(); - var prop = properties[properties.length - 1]; - me.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), properties.length - 1); + if (properties.length) { + var prop = properties[properties.length - 1]; + me.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), properties.length - 1); + } } } })).show(); From f0659de87e512c02f532525c81a950f9ef04a6f0 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 12 Sep 2024 22:45:05 +0500 Subject: [PATCH 03/18] feat/[pe, se]: rework document info --- .../main/lib/view/DocumentPropertyDialog.js | 2 +- .../main/app/view/FileMenuPanels.js | 75 +++--- .../main/resources/less/filemenu.less | 50 ++-- .../main/app/view/FileMenu.js | 3 +- .../main/app/view/FileMenuPanels.js | 234 +++++++++++++----- apps/presentationeditor/main/app_dev.js | 1 + apps/presentationeditor/main/app_pack.js | 1 + apps/presentationeditor/main/locale/en.json | 19 ++ .../main/resources/less/app.less | 1 + .../main/resources/less/leftmenu.less | 88 ++++++- .../main/app/view/FileMenuPanels.js | 161 +++++++++--- apps/spreadsheeteditor/main/app_dev.js | 1 + apps/spreadsheeteditor/main/app_pack.js | 1 + apps/spreadsheeteditor/main/locale/en.json | 19 ++ .../main/resources/less/leftmenu.less | 90 ++++++- 15 files changed, 564 insertions(+), 182 deletions(-) diff --git a/apps/common/main/lib/view/DocumentPropertyDialog.js b/apps/common/main/lib/view/DocumentPropertyDialog.js index 1069c5b43b..8afccfa430 100644 --- a/apps/common/main/lib/view/DocumentPropertyDialog.js +++ b/apps/common/main/lib/view/DocumentPropertyDialog.js @@ -46,7 +46,7 @@ define([], function () { 'use strict'; }, options); this.template = [ - '
', + '
', '
', '', '
', diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 4d68e8b893..2bb447d7b2 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1356,6 +1356,42 @@ define([], function () { '', '', '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', '', '', '', @@ -1420,43 +1456,6 @@ define([], function () { '', '
', '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', '', '', '
', @@ -1995,7 +1994,7 @@ define([], function () { tplCustomProperty: function(name, type, value) { if (type === AscCommon.c_oVariantTypes.vtBool) { - value = value ? 'Yes' : 'No'; + value = value ? this.txtYes : this.txtNo; } return '' + diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index d983086cc3..fc41a6afb9 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -274,8 +274,27 @@ } } - #fms-flex-add-property { + #fminfo-btn-add-property { margin: 10px 0; + background-color: transparent; + height: 24px; + + span { + text-decoration: underline dotted; + text-underline-offset: 4px; + } + } + + #fms-flex-add-property, #fms-flex-apply { + #panel-info table tr td { + height: 0; + } + } + + .custom-property-wrapper { + display: flex; + gap: 5px; + align-items: center; } } @@ -912,33 +931,4 @@ } } } -} - -.document-info-content { - display: flex; - flex-direction: column; - margin: 0 20px; - gap: 10px; -} - -#fminfo-btn-add-property > span { - text-decoration: underline dotted; - text-underline-offset: 4px; -} - -#fms-flex-add-property, #fms-flex-apply { - #panel-info table tr td { - height: 0; - } -} - -#fminfo-btn-add-property { - background-color: transparent; - height: 24px; -} - -.custom-property-wrapper { - display: flex; - gap: 5px; - align-items: center; } \ No newline at end of file diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index 3dcb5e3e2b..afaf5ec089 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -42,7 +42,8 @@ define([ 'text!presentationeditor/main/app/template/FileMenu.template', 'underscore', 'common/main/lib/component/BaseView', - 'common/main/lib/view/RecentFiles' + 'common/main/lib/view/RecentFiles', + 'common/main/lib/component/Calendar' ], function (tpl, _) { 'use strict'; diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index b8514d18af..020e8af52a 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1090,78 +1090,86 @@ define([], function () { this.rendered = false; this.template = _.template([ - '
', - '
' + this.txtPresentationInfo + '
', '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', // '', // '', // '', // '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '
' + this.txtPresentationInfo + '
', + '', + '', + '', + '', + '
', + '
', + '
', + '', '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', + '', + '', '', - '', '
', - '', - '', - '', - '', - '
', - '
', + '', + '
', '
', '
', - '', + '
', '', '', '', @@ -1290,9 +1298,13 @@ define([], function () { }); this.btnApply.on('click', _.bind(this.applySettings, this)); - this.pnlInfo = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlApply = $markup.findById('#fms-flex-apply'); + this.btnAddProperty = new Common.UI.Button({ + el: $markup.findById('#fminfo-btn-add-property') + }); + this.btnAddProperty.on('click', _.bind(this.onAddPropertyClick, this)); + this.rendered = true; this.updateInfo(this.doc); @@ -1300,8 +1312,7 @@ define([], function () { this.$el = $(node).html($markup); if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ - el: this.pnlInfo, - suppressScrollX: true, + el: this.$el, alwaysVisibleY: true }); } @@ -1330,7 +1341,6 @@ define([], function () { updateScroller: function(destroy) { if (this.scroller) { this.scroller.update(destroy ? {} : undefined); - this.pnlInfo.toggleClass('bordered', this.scroller.isVisible()); } }, @@ -1380,6 +1390,12 @@ define([], function () { } this._ShowHideInfoItem(this.lblDate, !!value); } + + if (this.api) { + _.each(this.api.asc_getAllCustomProperties(), _.bind(function(prop, idx) { + this.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), idx); + }, this)); + } }, updateFileInfo: function() { @@ -1443,6 +1459,82 @@ define([], function () { this.SetDisabled(); }, + tplCustomProperty: function(name, type, value) { + if (type === AscCommon.c_oVariantTypes.vtBool) { + value = value ? this.txtYes : this.txtNo; + } + + return '' + + '' + + ''; + }, + + renderCustomProperty: function(name, type, value, idx) { + var me = this; + + var currentCustomProperty = $('tr[data-name="' + name + '"]'); + if (currentCustomProperty.length) { + currentCustomProperty.off('click'); + currentCustomProperty.html($(this.tplCustomProperty(name, type, value))); + } else { + currentCustomProperty = $(this.tplCustomProperty(name, type, value)); + $('tbody.properties-tab').append(currentCustomProperty); + } + + currentCustomProperty.on('click', function (e) { + if (currentCustomProperty.find('div.disabled').length) { + return; + } + + var btn = currentCustomProperty.find(e.target); + if (btn.hasClass('close')) { + me.api.asc_removeCustomProperty(idx); + $('tr[data-name="' + name + '"]').remove(); + } else if (btn.hasClass('form-control')) { + (new Common.Views.DocumentPropertyDialog({ + title: me.txtDocumentPropertyUpdateTitle, + defaultValue: { + name: name, + type: type, + value: value + }, + handler: function(result, name, type, value) { + if (result === 'ok') { + me.api.asc_modifyCustomProperty(idx, name, type, value); + me.renderCustomProperty(name, type, value, idx); + } + } + })).show(); + } + }) + }, + + setDisabledCustomProperties: function(disable) { + _.each($('tr[data-name]'), function(prop) { + $(prop).find('div.custom-property-wrapper')[disable ? 'addClass' : 'removeClass']('disabled'); + $(prop).find('div.close')[disable ? 'hide' : 'show'](); + }) + }, + + onAddPropertyClick: function() { + var me = this; + (new Common.Views.DocumentPropertyDialog({ + handler: function(result, name, type, value) { + if (result === 'ok') { + me.api.asc_addCustomProperty(name, type, value); + var properties = me.api.asc_getAllCustomProperties(); + if (properties.length) { + var prop = properties[properties.length - 1]; + me.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), properties.length - 1); + } + } + } + })).show(); + }, + _ShowHideInfoItem: function(el, visible) { el.closest('tr')[visible?'show':'hide'](); return visible; @@ -1492,6 +1584,8 @@ define([], function () { this.tblAuthor.find('.close').toggleClass('disabled', this._locked); this.tblAuthor.toggleClass('disabled', disable); this.btnApply.setDisabled(this._locked); + this.btnAddProperty.setDisabled(disable); + this.setDisabledCustomProperties(disable); }, applySettings: function() { @@ -1523,7 +1617,13 @@ define([], function () { txtAddText: 'Add Text', txtMinutes: 'min', okButtonText: 'Apply', - txtPresentationInfo: 'Info' + txtPresentationInfo: 'Presentation Info', + txtCommon: 'Common', + txtProperties: 'Properties', + txtDocumentPropertyUpdateTitle: "Document Property", + txtAddProperty: 'Add property', + txtYes: 'Yes', + txtNo: 'No' }, PE.Views.FileMenuPanels.DocumentInfo || {})); PE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({ diff --git a/apps/presentationeditor/main/app_dev.js b/apps/presentationeditor/main/app_dev.js index ff23c32eed..818135e29f 100644 --- a/apps/presentationeditor/main/app_dev.js +++ b/apps/presentationeditor/main/app_dev.js @@ -219,6 +219,7 @@ require([ 'common/main/lib/util/define', 'common/main/lib/view/SignDialog', 'common/main/lib/view/ListSettingsDialog', + 'common/main/lib/view/DocumentPropertyDialog', 'presentationeditor/main/app/view/FileMenuPanels', 'presentationeditor/main/app/view/DocumentHolderExt', diff --git a/apps/presentationeditor/main/app_pack.js b/apps/presentationeditor/main/app_pack.js index 1894aef73d..22fcbeece5 100644 --- a/apps/presentationeditor/main/app_pack.js +++ b/apps/presentationeditor/main/app_pack.js @@ -25,6 +25,7 @@ require([ 'common/main/lib/view/DocumentHolderExt', 'common/main/lib/view/SignDialog', 'common/main/lib/view/ListSettingsDialog', + 'common/main/lib/view/DocumentPropertyDialog', 'presentationeditor/main/app/view/FileMenuPanels', 'presentationeditor/main/app/view/DocumentHolderExt', diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index cb5c0316a8..115ab4cc77 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -890,6 +890,19 @@ "Common.Views.UserNameDialog.textDontShow": "Don't ask me again", "Common.Views.UserNameDialog.textLabel": "Label:", "Common.Views.UserNameDialog.textLabelError": "Label must not be empty.", + "Common.Views.DocumentPropertyDialog.txtTitle": "New Document Property", + "Common.Views.DocumentPropertyDialog.txtPropertyTitleLabel": "Title", + "Common.Views.DocumentPropertyDialog.txtPropertyTitleBlankError": "Property should have a title", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeLabel": "Type", + "Common.Views.DocumentPropertyDialog.txtPropertyValueLabel": "Value", + "Common.Views.DocumentPropertyDialog.txtPropertyValueBlankError": "Property should have a value", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeText": "Text", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumber": "Number", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumberInvalid": "Provide a valid number", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeDate": "Date", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"no\"", + "Common.Views.DocumentPropertyDialog.txtPropertyBooleanTrue": "Yes", + "Common.Views.DocumentPropertyDialog.txtPropertyBooleanFalse": "No", "PE.Controllers.LeftMenu.leavePageText": "All unsaved changes in this document will be lost.
Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.", "PE.Controllers.LeftMenu.newDocumentTitle": "Unnamed presentation", "PE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", @@ -2033,6 +2046,12 @@ "PE.Views.FileMenuPanels.DocumentInfo.txtTags": "Tags", "PE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Title", "PE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded", + "PE.Views.FileMenuPanels.DocumentInfo.txtYes": "Yes", + "PE.Views.FileMenuPanels.DocumentInfo.txtNo": "Yes", + "PE.Views.FileMenuPanels.DocumentInfo.txtCommon": "Common", + "PE.Views.FileMenuPanels.DocumentInfo.txtProperties": "Properties", + "PE.Views.FileMenuPanels.DocumentInfo.txtDocumentPropertyUpdateTitle": "Document Property", + "PE.Views.FileMenuPanels.DocumentInfo.txtAddProperty": "Add property", "PE.Views.FileMenuPanels.DocumentRights.txtAccessRights": "Access rights", "PE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights", "PE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights", diff --git a/apps/presentationeditor/main/resources/less/app.less b/apps/presentationeditor/main/resources/less/app.less index 95b29c6312..88b31f122c 100644 --- a/apps/presentationeditor/main/resources/less/app.less +++ b/apps/presentationeditor/main/resources/less/app.less @@ -126,6 +126,7 @@ @import "../../../../common/main/resources/less/label.less"; @import "../../../../common/main/resources/less/bigscaling.less"; @import "../../../../common/main/resources/less/updown-picker.less"; +@import "../../../../common/main/resources/less/calendar.less"; // App // -------------------------------------------------- diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index dcdb8a37b5..3d9ad8b641 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -513,17 +513,97 @@ } #panel-info { + padding: 30px; + .header { - margin: 30px 0 20px 30px; .font-size-very-huge(); + line-height: 26px; + } - .rtl & { - margin: 30px 30px 20px 0; + table { + display: flex; + gap: 30px; + flex-direction: column; + + tbody { + display: flex; + gap: 12px; + flex-direction: column; + + &.properties-tab { + gap: 10px; + } } + + tr { + display: flex; + gap: 24px; + align-items: center; + td { + font-size: 11px; + line-height: 16px; + + &.title { + label { + font-size: 14px; + font-weight: 700; + line-height: 20px; + } + } + + &.left { + width: 120px; + height: 16px; + flex-shrink: 0; + } + + &.right { + flex-grow: 1; + } + } + + &.divider { + height: 10px; + } + } + + tr.author-info { + align-items: flex-start; + + td { + display: flex; + gap: 5px; + align-items: center; + } + } + + .author-info tbody tr:last-child { + margin-bottom: 20px; + } + + &.main { + width: 100%; + } + } + + #fminfo-btn-add-property { + margin: 10px 0; + background-color: transparent; + height: 24px; + + span { + text-decoration: underline dotted; + text-underline-offset: 4px; + } + } + + .custom-property-wrapper { + display: flex; + gap: 5px; + align-items: center; } } - #panel-info, #panel-rights { table { tr { diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 8b4de836bd..253f2cfb23 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1566,9 +1566,10 @@ define([], function () { this.rendered = false; this.template = _.template([ - '
', - '
' + this.txtSpreadsheetInfo + '
', - '
' + + '' + + '
' + + '
', + '
', + '', + '', + '', '', '', '', @@ -1581,26 +1582,6 @@ define([], function () { '', '', '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', '', '', '', @@ -1609,8 +1590,6 @@ define([], function () { '', '', '', - '', - '', '', '', '', @@ -1619,9 +1598,12 @@ define([], function () { '', '', '', - '', + '', + '', + '', + '', '', - '', '', - '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '
' + this.txtSpreadsheetInfo + '
', + '
', '', '', '', @@ -1629,11 +1611,36 @@ define([], function () { '
', '
', + '
', + '', + '', + '', + '', + '', '
', + '', + '
', '
', '
', - '', + '
', '', '', '', @@ -1762,9 +1769,13 @@ define([], function () { }); this.btnApply.on('click', _.bind(this.applySettings, this)); - this.pnlInfo = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlApply = $markup.findById('#fms-flex-apply'); + this.btnAddProperty = new Common.UI.Button({ + el: $markup.findById('#fminfo-btn-add-property') + }); + this.btnAddProperty.on('click', _.bind(this.onAddPropertyClick, this)); + this.rendered = true; this.updateInfo(this.doc); @@ -1772,8 +1783,7 @@ define([], function () { this.$el = $(node).html($markup); if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ - el: this.pnlInfo, - suppressScrollX: true, + el: this.$el, alwaysVisibleY: true }); } @@ -1802,7 +1812,6 @@ define([], function () { updateScroller: function(destroy) { if (this.scroller) { this.scroller.update(destroy ? {} : undefined); - this.pnlInfo.toggleClass('bordered', this.scroller.isVisible()); } }, @@ -1954,6 +1963,82 @@ define([], function () { this.updateFileInfo(); }, + tplCustomProperty: function(name, type, value) { + if (type === AscCommon.c_oVariantTypes.vtBool) { + value = value ? this.txtYes : this.txtNo; + } + + return '' + + '' + + ''; + }, + + renderCustomProperty: function(name, type, value, idx) { + var me = this; + + var currentCustomProperty = $('tr[data-name="' + name + '"]'); + if (currentCustomProperty.length) { + currentCustomProperty.off('click'); + currentCustomProperty.html($(this.tplCustomProperty(name, type, value))); + } else { + currentCustomProperty = $(this.tplCustomProperty(name, type, value)); + $('tbody.properties-tab').append(currentCustomProperty); + } + + currentCustomProperty.on('click', function (e) { + if (currentCustomProperty.find('div.disabled').length) { + return; + } + + var btn = currentCustomProperty.find(e.target); + if (btn.hasClass('close')) { + me.api.asc_removeCustomProperty(idx); + $('tr[data-name="' + name + '"]').remove(); + } else if (btn.hasClass('form-control')) { + (new Common.Views.DocumentPropertyDialog({ + title: me.txtDocumentPropertyUpdateTitle, + defaultValue: { + name: name, + type: type, + value: value + }, + handler: function(result, name, type, value) { + if (result === 'ok') { + me.api.asc_modifyCustomProperty(idx, name, type, value); + me.renderCustomProperty(name, type, value, idx); + } + } + })).show(); + } + }) + }, + + setDisabledCustomProperties: function(disable) { + _.each($('tr[data-name]'), function(prop) { + $(prop).find('div.custom-property-wrapper')[disable ? 'addClass' : 'removeClass']('disabled'); + $(prop).find('div.close')[disable ? 'hide' : 'show'](); + }) + }, + + onAddPropertyClick: function() { + var me = this; + (new Common.Views.DocumentPropertyDialog({ + handler: function(result, name, type, value) { + if (result === 'ok') { + me.api.asc_addCustomProperty(name, type, value); + var properties = me.api.asc_getAllCustomProperties(); + if (properties.length) { + var prop = properties[properties.length - 1]; + me.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), properties.length - 1); + } + } + } + })).show(); + }, + SetDisabled: function() { var disable = !this.mode.isEdit || this._locked; this.inputTitle.setDisabled(disable); @@ -1964,6 +2049,8 @@ define([], function () { this.tblAuthor.find('.close').toggleClass('disabled', this._locked); this.tblAuthor.toggleClass('disabled', disable); this.btnApply.setDisabled(this._locked); + this.btnAddProperty.setDisabled(disable); + this.setDisabledCustomProperties(disable); }, applySettings: function() { @@ -1994,7 +2081,13 @@ define([], function () { txtAddText: 'Add Text', txtMinutes: 'min', okButtonText: 'Apply', - txtSpreadsheetInfo: 'Spreadsheet Info' + txtSpreadsheetInfo: 'Spreadsheet Info', + txtCommon: 'Common', + txtProperties: 'Properties', + txtDocumentPropertyUpdateTitle: "Document Property", + txtAddProperty: 'Add property', + txtYes: 'Yes', + txtNo: 'No' }, SSE.Views.FileMenuPanels.DocumentInfo || {})); SSE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({ diff --git a/apps/spreadsheeteditor/main/app_dev.js b/apps/spreadsheeteditor/main/app_dev.js index d2e8c6f946..083f59cacc 100644 --- a/apps/spreadsheeteditor/main/app_dev.js +++ b/apps/spreadsheeteditor/main/app_dev.js @@ -218,6 +218,7 @@ require([ 'common/main/lib/util/define', 'common/main/lib/view/SignDialog', 'common/main/lib/view/SignSettingsDialog', + 'common/main/lib/view/DocumentPropertyDialog', 'spreadsheeteditor/main/app/view/FileMenuPanels', 'spreadsheeteditor/main/app/view/DocumentHolderExt', diff --git a/apps/spreadsheeteditor/main/app_pack.js b/apps/spreadsheeteditor/main/app_pack.js index 7a4013bc3e..fab57163a2 100644 --- a/apps/spreadsheeteditor/main/app_pack.js +++ b/apps/spreadsheeteditor/main/app_pack.js @@ -24,6 +24,7 @@ require([ 'common/main/lib/view/DocumentHolderExt', 'common/main/lib/view/SignDialog', 'common/main/lib/view/SignSettingsDialog', + 'common/main/lib/view/DocumentPropertyDialog', 'spreadsheeteditor/main/app/view/FileMenuPanels', 'spreadsheeteditor/main/app/view/DocumentHolderExt', diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 81445574d9..77710982a2 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -749,6 +749,19 @@ "Common.Views.UserNameDialog.textDontShow": "Don't ask me again", "Common.Views.UserNameDialog.textLabel": "Label:", "Common.Views.UserNameDialog.textLabelError": "Label must not be empty.", + "Common.Views.DocumentPropertyDialog.txtTitle": "New Document Property", + "Common.Views.DocumentPropertyDialog.txtPropertyTitleLabel": "Title", + "Common.Views.DocumentPropertyDialog.txtPropertyTitleBlankError": "Property should have a title", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeLabel": "Type", + "Common.Views.DocumentPropertyDialog.txtPropertyValueLabel": "Value", + "Common.Views.DocumentPropertyDialog.txtPropertyValueBlankError": "Property should have a value", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeText": "Text", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumber": "Number", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumberInvalid": "Provide a valid number", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeDate": "Date", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"no\"", + "Common.Views.DocumentPropertyDialog.txtPropertyBooleanTrue": "Yes", + "Common.Views.DocumentPropertyDialog.txtPropertyBooleanFalse": "No", "SSE.Controllers.DataTab.strSheet": "Sheet", "SSE.Controllers.DataTab.textAddExternalData": "The link to an external source has been added. You can update such links in the Data tab.", "SSE.Controllers.DataTab.textColumns": "Columns", @@ -2640,6 +2653,12 @@ "SSE.Views.FileMenuPanels.DocumentInfo.txtTags": "Tags", "SSE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Title", "SSE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded", + "SSE.Views.FileMenuPanels.DocumentInfo.txtYes": "Yes", + "SSE.Views.FileMenuPanels.DocumentInfo.txtNo": "Yes", + "SSE.Views.FileMenuPanels.DocumentInfo.txtCommon": "Common", + "SSE.Views.FileMenuPanels.DocumentInfo.txtProperties": "Properties", + "SSE.Views.FileMenuPanels.DocumentInfo.txtDocumentPropertyUpdateTitle": "Document Property", + "SSE.Views.FileMenuPanels.DocumentInfo.txtAddProperty": "Add property", "SSE.Views.FileMenuPanels.DocumentRights.txtAccessRights": "Access Rights", "SSE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights", "SSE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights", diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 6f60c576e6..1fb9795339 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -181,17 +181,94 @@ } #panel-info { - padding: 0; - display: flex; - flex-direction: column; + padding: 30px; .header { - margin: 30px 0 20px 30px; .font-size-very-huge(); + line-height: 26px; + } - .rtl & { - margin: 30px 30px 20px 0; + table { + display: flex; + gap: 30px; + flex-direction: column; + + tbody { + display: flex; + gap: 12px; + flex-direction: column; + + &.properties-tab { + gap: 10px; + } } + + tr { + display: flex; + gap: 24px; + align-items: center; + td { + font-size: 11px; + line-height: 16px; + + &.title { + label { + font-size: 14px; + font-weight: 700; + line-height: 20px; + } + } + + &.left { + width: 120px; + height: 16px; + flex-shrink: 0; + } + + &.right { + flex-grow: 1; + } + } + + &.divider { + height: 10px; + } + } + + tr.author-info { + align-items: flex-start; + + td { + display: flex; + gap: 5px; + align-items: center; + } + } + + .author-info tbody tr:last-child { + margin-bottom: 20px; + } + + &.main { + width: 100%; + } + } + + #fminfo-btn-add-property { + margin: 10px 0; + background-color: transparent; + height: 24px; + + span { + text-decoration: underline dotted; + text-underline-offset: 4px; + } + } + + .custom-property-wrapper { + display: flex; + gap: 5px; + align-items: center; } } @@ -613,7 +690,6 @@ } } - #panel-info, #panel-rights { table { tr { From 207e66fc7b32c5c12e9458d417a8c2de5fa54f3c Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Fri, 13 Sep 2024 13:57:02 +0500 Subject: [PATCH 04/18] fix/[common,de,pe,se]: additional edits --- .../main/lib/view/DocumentPropertyDialog.js | 21 +++++++++++-------- .../main/app/view/FileMenuPanels.js | 4 ++-- .../main/resources/less/filemenu.less | 4 ++++ .../main/app/view/FileMenuPanels.js | 4 ++-- .../main/resources/less/leftmenu.less | 4 ++++ .../main/app/view/FileMenuPanels.js | 4 ++-- .../main/resources/less/leftmenu.less | 4 ++++ 7 files changed, 30 insertions(+), 15 deletions(-) diff --git a/apps/common/main/lib/view/DocumentPropertyDialog.js b/apps/common/main/lib/view/DocumentPropertyDialog.js index 8afccfa430..d8957788a4 100644 --- a/apps/common/main/lib/view/DocumentPropertyDialog.js +++ b/apps/common/main/lib/view/DocumentPropertyDialog.js @@ -99,7 +99,7 @@ define([], function () { 'use strict'; this.comboboxType = new Common.UI.ComboBox({ el: $('#id-dlg-type'), cls: 'input-group-nr', - menuStyle: 'min-width: 85px;', + menuStyle: 'min-width: 85px; width: 100%;', editable: false, data: [ { displayValue: this.txtPropertyTypeText, value: 'text' }, @@ -148,7 +148,7 @@ define([], function () { 'use strict'; this.comboboxBoolean = new Common.UI.ComboBox({ el: $('#id-dlg-value-boolean'), cls: 'input-group-nr', - menuStyle: 'min-width: 85px;', + menuStyle: 'min-width: 85px; width: 100%;', editable: false, data: [ { displayValue: this.txtPropertyBooleanTrue, value: 1 }, @@ -170,7 +170,10 @@ define([], function () { 'use strict'; value : '', dataHint : '1', dataHintDirection: 'left', - dataHintOffset: 'small' + dataHintOffset: 'small', + validation: function(value) { + return value.length === 0 || isNaN(new Date(value).getTime()) ? this.txtPropertyValueBlankError : true; + } }); if (this.options.defaultValue.value && currentType === 'date') { this.datepicker.setValue(this.options.defaultValue.value); @@ -185,7 +188,7 @@ define([], function () { 'use strict'; }, getFocusedComponents: function() { - return [this.inputTitle].concat(this.getFooterButtons()); + return [this.inputTitle, this.comboboxType, this.inputTextOrNumber, this.comboboxBoolean, this.datepicker].concat(this.getFooterButtons()); }, getDefaultFocusableComponent: function () { @@ -197,7 +200,7 @@ define([], function () { 'use strict'; var me = this; _.delay(function(){ - me.getChild('input').focus(); + me.inputTitle.focus(); },100); }, @@ -214,7 +217,7 @@ define([], function () { 'use strict'; if (this.options.handler) { if (state === 'ok') { if (this.inputTitle.checkValidate() !== true) { - this.inputTitle.cmpEl.find('input').focus(); + this.inputTitle.focus(); return; } @@ -224,15 +227,15 @@ define([], function () { 'use strict'; ascType = AscCommon.c_oVariantTypes.vtBool; } else if (type === 'date') { if (this.datepicker.checkValidate() !== true) { - this.datepicker.cmpEl.find('input').focus(); + this.datepicker.focus(); return; } - ascValue = this.datepicker.getValue(); + ascValue = new Date(this.datepicker.getValue()); ascType = AscCommon.c_oVariantTypes.vtFiletime; } else { if (this.inputTextOrNumber.checkValidate() !== true) { - this.inputTextOrNumber.cmpEl.find('input').focus(); + this.inputTextOrNumber.focus(); return; } diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 2bb447d7b2..c4b69e496d 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1578,7 +1578,7 @@ define([], function () { this.lblApplication = $markup.findById('#id-info-appname'); this.tblAuthor = $markup.findById('#id-info-author table'); this.trAuthor = $markup.findById('#id-info-add-author').closest('tr'); - this.authorTpl = ''; + this.authorTpl = ''; this.tblAuthor.on('click', function(e) { var btn = $markup.find(e.target); @@ -2001,7 +2001,7 @@ define([], function () { '' + ''; }, diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index fc41a6afb9..fda3074b3c 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -296,6 +296,10 @@ gap: 5px; align-items: center; } + + .tool.close:before, .tool.close:after { + margin-top: 2px; + } } #panel-settings { diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 020e8af52a..7b04573e8e 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1251,7 +1251,7 @@ define([], function () { this.lblApplication = $markup.findById('#id-info-appname'); this.tblAuthor = $markup.findById('#id-info-author table'); this.trAuthor = $markup.findById('#id-info-add-author').closest('tr'); - this.authorTpl = ''; + this.authorTpl = ''; this.tblAuthor.on('click', function(e) { var btn = $markup.find(e.target); @@ -1468,7 +1468,7 @@ define([], function () { '' + ''; }, diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 3d9ad8b641..39b51e4a32 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -602,6 +602,10 @@ gap: 5px; align-items: center; } + + .tool.close:before, .tool.close:after { + margin-top: 2px; + } } #panel-rights { diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 253f2cfb23..658e497b3a 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1722,7 +1722,7 @@ define([], function () { this.lblApplication = $markup.findById('#id-info-appname'); this.tblAuthor = $markup.findById('#id-info-author table'); this.trAuthor = $markup.findById('#id-info-add-author').closest('tr'); - this.authorTpl = ''; + this.authorTpl = ''; this.tblAuthor.on('click', function(e) { var btn = $markup.find(e.target); @@ -1972,7 +1972,7 @@ define([], function () { '' + ''; }, diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 1fb9795339..3b4ce1de98 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -270,6 +270,10 @@ gap: 5px; align-items: center; } + + .tool.close:before, .tool.close:after { + margin-top: 2px; + } } #panel-settings { From 175c6e6fdc3b93031f176810026ee62cf78b0273 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Fri, 13 Sep 2024 15:21:17 +0500 Subject: [PATCH 05/18] fix/common: second time number submit --- apps/common/main/lib/view/DocumentPropertyDialog.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/view/DocumentPropertyDialog.js b/apps/common/main/lib/view/DocumentPropertyDialog.js index d8957788a4..47cd7bc179 100644 --- a/apps/common/main/lib/view/DocumentPropertyDialog.js +++ b/apps/common/main/lib/view/DocumentPropertyDialog.js @@ -129,7 +129,7 @@ define([], function () { 'use strict'; return this.txtPropertyValueBlankError; } - if (this.comboboxType.getValue() === 'number' && isNaN(value.replace(',', '.'))) { + if (this.comboboxType.getValue() === 'number' && (typeof value !== 'number' && isNaN(value.replace(',', '.')))) { return this.txtPropertyTypeNumberInvalid; } @@ -245,7 +245,10 @@ define([], function () { 'use strict'; ascValue = value; } else { // note: precisely a numeric value because we validated it - value = value.replace(',', '.'); + if (typeof value !== 'number') { + value = value.replace(',', '.'); + } + if (value % 1 === 0) { ascType = AscCommon.c_oVariantTypes.vtI4; ascValue = parseInt(value); From b27f0937be8bdca4eb82db5f094bb55826d269d7 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 17 Sep 2024 17:05:35 +0300 Subject: [PATCH 06/18] Fix date property in document info --- apps/common/main/lib/component/InputField.js | 17 ++++- .../main/lib/view/DocumentPropertyDialog.js | 58 ++++++++++++---- .../main/app/view/FileMenuPanels.js | 68 +++++++------------ apps/documenteditor/main/locale/en.json | 1 + .../main/app/view/FileMenuPanels.js | 41 +++++------ apps/presentationeditor/main/locale/en.json | 1 + .../main/app/view/FileMenuPanels.js | 41 +++++------ apps/spreadsheeteditor/main/locale/en.json | 1 + 8 files changed, 131 insertions(+), 97 deletions(-) diff --git a/apps/common/main/lib/component/InputField.js b/apps/common/main/lib/component/InputField.js index a46b2345f4..887f910335 100644 --- a/apps/common/main/lib/component/InputField.js +++ b/apps/common/main/lib/component/InputField.js @@ -701,6 +701,8 @@ define([ options.btnHint = options.btnHint || this.textDate; Common.UI.InputFieldBtn.prototype.initialize.call(this, options); + + this.dateValue = undefined; }, render: function (parentEl) { @@ -725,18 +727,29 @@ define([ firstday: 1 }); me.cmpCalendar.on('date:click', function (cmp, date) { + me.dateValue = date; me.trigger('date:click', me, date); menu.hide(); }); + me.dateValue && me.cmpCalendar.setDate(me.dateValue); menu.alignPosition(); } me.cmpCalendar.focus(); - }) + }); + this._input.on('input', function() { + me.dateValue = undefined; + }); }, setDate: function(date) { - if (this.cmpCalendar && date && date instanceof Date && !isNaN(date)) + if (date && date instanceof Date && !isNaN(date)) { this.cmpCalendar && this.cmpCalendar.setDate(date); + this.dateValue = date; + } + }, + + getDate: function() { + return this.dateValue; }, textDate: 'Select date' diff --git a/apps/common/main/lib/view/DocumentPropertyDialog.js b/apps/common/main/lib/view/DocumentPropertyDialog.js index 47cd7bc179..5925a19076 100644 --- a/apps/common/main/lib/view/DocumentPropertyDialog.js +++ b/apps/common/main/lib/view/DocumentPropertyDialog.js @@ -164,23 +164,21 @@ define([], function () { 'use strict'; this.datepicker = new Common.UI.InputFieldBtnCalendar({ el: $('#id-dlg-value-date'), - allowBlank : true, - validateOnChange: false, + allowBlank : false, + blankError : this.txtPropertyValueBlankError, validateOnBlur: false, value : '', dataHint : '1', dataHintDirection: 'left', - dataHintOffset: 'small', - validation: function(value) { - return value.length === 0 || isNaN(new Date(value).getTime()) ? this.txtPropertyValueBlankError : true; - } + dataHintOffset: 'small' }); if (this.options.defaultValue.value && currentType === 'date') { - this.datepicker.setValue(this.options.defaultValue.value); + this.datepicker.setDate(this.options.defaultValue.value); + this.datepicker.setValue(this.dateToString(this.options.defaultValue.value)); } this.datepicker.setVisible(this.options.defaultValue.type ? this.options.defaultValue.type === AscCommon.c_oVariantTypes.vtFiletime : currentType === 'date'); - this.datepicker.on('date:click', function (_, date) { - this.datepicker.setValue(date); + this.datepicker.on('date:click', function (cmp, date) { + cmp.setValue(this.dateToString(date)); }.bind(this)); var $window = this.getChild(); @@ -230,8 +228,27 @@ define([], function () { 'use strict'; this.datepicker.focus(); return; } - - ascValue = new Date(this.datepicker.getValue()); + ascValue = this.datepicker.getDate(); + if (!ascValue) { + ascValue = new Date(this.datepicker.getValue()); + if (!ascValue || !(ascValue instanceof Date) || isNaN(ascValue)) + ascValue = undefined; + } + if (!ascValue) { + var me = this; + Common.UI.warning({ + msg: me.errorDate, + buttons: ['ok', 'cancel'], + callback: function(btn) { + if (btn==='ok') { + me.options.handler.call(this, state, title, AscCommon.c_oVariantTypes.vtLpwstr, me.datepicker.getValue()); + me.close(); + } else + me.datepicker.focus(); + } + }); + return; + } ascType = AscCommon.c_oVariantTypes.vtFiletime; } else { if (this.inputTextOrNumber.checkValidate() !== true) { @@ -266,6 +283,22 @@ define([], function () { 'use strict'; this.close(); }, + dateToString: function (value) { + var text = ''; + if (value) { + value = new Date(value) + var lang = (this.options.lang || 'en').replace('_', '-').toLowerCase(); + try { + if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; + text = value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}); + } catch (e) { + lang = 'en'; + text = value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}); + } + } + return text; + }, + txtTitle: "New Document Property", txtPropertyTitleLabel: "Title", txtPropertyTitleBlankError: 'Property should have a title', @@ -278,6 +311,7 @@ define([], function () { 'use strict'; txtPropertyTypeDate: "Date", txtPropertyTypeBoolean: '"Yes" or "no"', txtPropertyBooleanTrue: 'Yes', - txtPropertyBooleanFalse: 'No' + txtPropertyBooleanFalse: 'No', + errorDate: 'You can choose a value from the calendar to store the value as Date.
If you enter a value manually, it will be stored as Text.' }, Common.Views.DocumentPropertyDialog || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index c4b69e496d..d31b79372c 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1726,16 +1726,7 @@ define([], function () { this.coreProps = (this.api) ? this.api.asc_getCoreProps() : null; if (this.coreProps) { var value = this.coreProps.asc_getCreated(); - if (value) { - var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); - try { - if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; - this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } catch (e) { - lang = 'en'; - this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } - } + this.lblDate.text(this.dateToString(value)); this._ShowHideInfoItem(this.lblDate, !!value); } else if (pdfProps) this.updatePdfInfo(pdfProps); @@ -1759,17 +1750,7 @@ define([], function () { if (props) { var visible = false; value = props.asc_getModified(); - - if (value) { - var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); - try { - if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; - this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } catch (e) { - lang = 'en'; - this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } - } + this.lblModifyDate.text(this.dateToString(value)); visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; value = props.asc_getLastModifiedBy(); if (value) @@ -1810,32 +1791,14 @@ define([], function () { if (props) { value = props.CreationDate; - if (value) { - value = new Date(value); - var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); - try { - if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; - this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } catch (e) { - lang = 'en'; - this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } - } + value && (value = new Date(value)); + this.lblDate.text(this.dateToString(value)); this._ShowHideInfoItem(this.lblDate, !!value); var visible = false; value = props.ModDate; - if (value) { - value = new Date(value); - var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); - try { - if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; - this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } catch (e) { - lang = 'en'; - this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } - } + value && (value = new Date(value)); + this.lblModifyDate.text(this.dateToString(value)); visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; visible = this._ShowHideInfoItem(this.lblModifyBy, false) || visible; $('tr.divider.modify', this.el)[visible?'show':'hide'](); @@ -1995,6 +1958,8 @@ define([], function () { tplCustomProperty: function(name, type, value) { if (type === AscCommon.c_oVariantTypes.vtBool) { value = value ? this.txtYes : this.txtNo; + } else if (type === AscCommon.c_oVariantTypes.vtFiletime) { + value = this.dateToString(new Date(value), true); } return '
' + @@ -2005,6 +1970,21 @@ define([], function () { ''; }, + dateToString: function (value, hideTime) { + var text = ''; + if (value) { + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; + text = value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + (!hideTime ? ' ' + value.toLocaleString(lang, {timeStyle: 'short'}) : ''); + } catch (e) { + lang = 'en'; + text = value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + (!hideTime ? ' ' + value.toLocaleString(lang, {timeStyle: 'short'}) : ''); + } + } + return text; + }, + renderCustomProperty: function(name, type, value, idx) { var me = this; @@ -2029,6 +2009,7 @@ define([], function () { } else if (btn.hasClass('form-control')) { (new Common.Views.DocumentPropertyDialog({ title: me.txtDocumentPropertyUpdateTitle, + lang: me.mode.lang, defaultValue: { name: name, type: type, @@ -2097,6 +2078,7 @@ define([], function () { onAddPropertyClick: function() { var me = this; (new Common.Views.DocumentPropertyDialog({ + lang: me.mode.lang, handler: function(result, title, type, value) { if (result === 'ok') { me.api.asc_addCustomProperty(title, type, value); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 603c42f104..e1acf2ec58 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -840,6 +840,7 @@ "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"no\"", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanTrue": "Yes", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanFalse": "No", + "Common.Views.DocumentPropertyDialog.errorDate": "You can choose a value from the calendar to store the value as Date.
If you enter a value manually, it will be stored as Text.", "DE.Controllers.DocProtection.txtIsProtectedComment": "Document is protected. You may only insert comments to this document.", "DE.Controllers.DocProtection.txtIsProtectedForms": "Document is protected. You may only fill in forms in this document.", "DE.Controllers.DocProtection.txtIsProtectedTrack": "Document is protected. You may edit this document, but all changes will be tracked.", diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 7b04573e8e..680e592c69 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1378,16 +1378,7 @@ define([], function () { this.coreProps = (this.api) ? this.api.asc_getCoreProps() : null; if (this.coreProps) { var value = this.coreProps.asc_getCreated(); - if (value) { - var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); - try { - if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; - this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } catch (e) { - lang = 'en'; - this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } - } + this.lblDate.text(this.dateToString(value)); this._ShowHideInfoItem(this.lblDate, !!value); } @@ -1418,16 +1409,7 @@ define([], function () { if (props) { var visible = false; value = props.asc_getModified(); - if (value) { - var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); - try { - if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; - this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } catch (e) { - lang = 'en'; - this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } - } + this.lblModifyDate.text(this.dateToString(value)); visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; value = props.asc_getLastModifiedBy(); if (value) @@ -1462,6 +1444,8 @@ define([], function () { tplCustomProperty: function(name, type, value) { if (type === AscCommon.c_oVariantTypes.vtBool) { value = value ? this.txtYes : this.txtNo; + } else if (type === AscCommon.c_oVariantTypes.vtFiletime) { + value = this.dateToString(new Date(value), true); } return '' + @@ -1472,6 +1456,21 @@ define([], function () { ''; }, + dateToString: function (value, hideTime) { + var text = ''; + if (value) { + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; + text = value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + (!hideTime ? ' ' + value.toLocaleString(lang, {timeStyle: 'short'}) : ''); + } catch (e) { + lang = 'en'; + text = value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + (!hideTime ? ' ' + value.toLocaleString(lang, {timeStyle: 'short'}) : ''); + } + } + return text; + }, + renderCustomProperty: function(name, type, value, idx) { var me = this; @@ -1496,6 +1495,7 @@ define([], function () { } else if (btn.hasClass('form-control')) { (new Common.Views.DocumentPropertyDialog({ title: me.txtDocumentPropertyUpdateTitle, + lang: me.mode.lang, defaultValue: { name: name, type: type, @@ -1522,6 +1522,7 @@ define([], function () { onAddPropertyClick: function() { var me = this; (new Common.Views.DocumentPropertyDialog({ + lang: me.mode.lang, handler: function(result, name, type, value) { if (result === 'ok') { me.api.asc_addCustomProperty(name, type, value); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 115ab4cc77..a796d6cf82 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -903,6 +903,7 @@ "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"no\"", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanTrue": "Yes", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanFalse": "No", + "Common.Views.DocumentPropertyDialog.errorDate": "You can choose a value from the calendar to store the value as Date.
If you enter a value manually, it will be stored as Text.", "PE.Controllers.LeftMenu.leavePageText": "All unsaved changes in this document will be lost.
Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.", "PE.Controllers.LeftMenu.newDocumentTitle": "Unnamed presentation", "PE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 658e497b3a..c5901fb17b 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1849,16 +1849,7 @@ define([], function () { this.coreProps = (this.api) ? this.api.asc_getCoreProps() : null; if (this.coreProps) { var value = this.coreProps.asc_getCreated(); - if (value) { - var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); - try { - if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; - this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } catch (e) { - lang = 'en'; - this.lblDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } - } + this.lblDate.text(this.dateToString(value)); this._ShowHideInfoItem(this.lblDate, !!value); } }, @@ -1883,16 +1874,7 @@ define([], function () { if (props) { var visible = false; value = props.asc_getModified(); - if (value) { - var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); - try { - if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; - this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } catch (e) { - lang = 'en'; - this.lblModifyDate.text(value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(lang, {timeStyle: 'short'})); - } - } + this.lblModifyDate.text(this.dateToString(value)); visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible; value = props.asc_getLastModifiedBy(); if (value) @@ -1966,6 +1948,8 @@ define([], function () { tplCustomProperty: function(name, type, value) { if (type === AscCommon.c_oVariantTypes.vtBool) { value = value ? this.txtYes : this.txtNo; + } else if (type === AscCommon.c_oVariantTypes.vtFiletime) { + value = this.dateToString(new Date(value), true); } return '' + @@ -1976,6 +1960,21 @@ define([], function () { ''; }, + dateToString: function (value, hideTime) { + var text = ''; + if (value) { + var lang = (this.mode.lang || 'en').replace('_', '-').toLowerCase(); + try { + if ( lang == 'ar-SA'.toLowerCase() ) lang = lang + '-u-nu-latn-ca-gregory'; + text = value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + (!hideTime ? ' ' + value.toLocaleString(lang, {timeStyle: 'short'}) : ''); + } catch (e) { + lang = 'en'; + text = value.toLocaleString(lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + (!hideTime ? ' ' + value.toLocaleString(lang, {timeStyle: 'short'}) : ''); + } + } + return text; + }, + renderCustomProperty: function(name, type, value, idx) { var me = this; @@ -2000,6 +1999,7 @@ define([], function () { } else if (btn.hasClass('form-control')) { (new Common.Views.DocumentPropertyDialog({ title: me.txtDocumentPropertyUpdateTitle, + lang: me.mode.lang, defaultValue: { name: name, type: type, @@ -2026,6 +2026,7 @@ define([], function () { onAddPropertyClick: function() { var me = this; (new Common.Views.DocumentPropertyDialog({ + lang: me.mode.lang, handler: function(result, name, type, value) { if (result === 'ok') { me.api.asc_addCustomProperty(name, type, value); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 77710982a2..e5e23ee212 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -762,6 +762,7 @@ "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"no\"", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanTrue": "Yes", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanFalse": "No", + "Common.Views.DocumentPropertyDialog.errorDate": "You can choose a value from the calendar to store the value as Date.
If you enter a value manually, it will be stored as Text.", "SSE.Controllers.DataTab.strSheet": "Sheet", "SSE.Controllers.DataTab.textAddExternalData": "The link to an external source has been added. You can update such links in the Data tab.", "SSE.Controllers.DataTab.textColumns": "Columns", From e91e4ae551dd10d98282e11c14d642fa853f4b8a Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 17 Sep 2024 19:10:19 +0300 Subject: [PATCH 07/18] InputField: hide errors on input --- apps/common/main/lib/component/InputField.js | 17 +++++++++++++++-- .../main/lib/view/DocumentPropertyDialog.js | 3 +++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/component/InputField.js b/apps/common/main/lib/component/InputField.js index 887f910335..882e181e97 100644 --- a/apps/common/main/lib/component/InputField.js +++ b/apps/common/main/lib/component/InputField.js @@ -73,7 +73,8 @@ define([ validateOnChange: false, validateOnBlur: true, disabled: false, - editable: true + editable: true, + hideErrorOnInput: false }, template: _.template([ @@ -114,6 +115,7 @@ define([ this.validateOnChange = me.options.validateOnChange; this.validateOnBlur = me.options.validateOnBlur; this.maxLength = me.options.maxLength; + this.hideErrorOnInput = me.options.hideErrorOnInput; me.rendered = me.options.rendered || false; @@ -361,7 +363,12 @@ define([ if (modalParents.length > 0) { errorBadge.data('bs.tooltip').tip().css('z-index', parseInt(modalParents.css('z-index')) + 10); } - + if (me.hideErrorOnInput) { + var onInputChanging = function() { + me.showError(); + }; + me._input.one('input', onInputChanging); + } return errors; } } else { @@ -391,6 +398,12 @@ define([ if (modalParents.length > 0) { errorBadge.data('bs.tooltip').tip().css('z-index', parseInt(modalParents.css('z-index')) + 10); } + if (me.hideErrorOnInput) { + var onInputChanging = function() { + me.showError(); + }; + me._input.one('input', onInputChanging); + } } else { me.cmpEl.removeClass('error'); me.cmpEl.removeClass('warning'); diff --git a/apps/common/main/lib/view/DocumentPropertyDialog.js b/apps/common/main/lib/view/DocumentPropertyDialog.js index 5925a19076..18339f97be 100644 --- a/apps/common/main/lib/view/DocumentPropertyDialog.js +++ b/apps/common/main/lib/view/DocumentPropertyDialog.js @@ -88,6 +88,7 @@ define([], function () { 'use strict'; el: $('#id-dlg-title'), allowBlank: false, validateOnBlur: false, + hideErrorOnInput: true, validation: function(value) { return value.length === 0 ? this.txtPropertyTitleBlankError : true; } @@ -124,6 +125,7 @@ define([], function () { 'use strict'; el: $('#id-dlg-value-input'), style: 'width: 100%;', validateOnBlur: false, + hideErrorOnInput: true, validation: function(value) { if (value.length === 0) { return this.txtPropertyValueBlankError; @@ -168,6 +170,7 @@ define([], function () { 'use strict'; blankError : this.txtPropertyValueBlankError, validateOnBlur: false, value : '', + hideErrorOnInput: true, dataHint : '1', dataHintDirection: 'left', dataHintOffset: 'small' From 39197ed975bc1ca925fb986f043cb7ab7dc2bee5 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Wed, 18 Sep 2024 16:03:45 +0500 Subject: [PATCH 08/18] fix/[de,pe,de]: remove apply button --- .../main/lib/view/DocumentPropertyDialog.js | 18 +- .../main/app/view/FileMenuPanels.js | 169 +++++++++--------- apps/documenteditor/main/locale/en.json | 1 + .../main/resources/less/filemenu.less | 16 +- .../main/app/view/FileMenuPanels.js | 167 ++++++++--------- apps/presentationeditor/main/locale/en.json | 1 + .../main/resources/less/leftmenu.less | 18 +- .../main/app/view/FileMenuPanels.js | 163 +++++++++-------- apps/spreadsheeteditor/main/locale/en.json | 1 + .../main/resources/less/leftmenu.less | 18 +- 10 files changed, 302 insertions(+), 270 deletions(-) diff --git a/apps/common/main/lib/view/DocumentPropertyDialog.js b/apps/common/main/lib/view/DocumentPropertyDialog.js index 18339f97be..9768508def 100644 --- a/apps/common/main/lib/view/DocumentPropertyDialog.js +++ b/apps/common/main/lib/view/DocumentPropertyDialog.js @@ -84,13 +84,17 @@ define([], function () { 'use strict'; render: function() { Common.UI.Window.prototype.render.call(this); + var me = this; this.inputTitle = new Common.UI.InputField({ el: $('#id-dlg-title'), allowBlank: false, + blankError: this.txtPropertyTitleBlankError, validateOnBlur: false, hideErrorOnInput: true, validation: function(value) { - return value.length === 0 ? this.txtPropertyTitleBlankError : true; + if (me.options.nameValidator !== undefined) { + return me.options.nameValidator(value); + } } }); if (this.options.defaultValue.name) { @@ -111,7 +115,8 @@ define([], function () { 'use strict'; dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'big', - ariaLabel: this.strLineHeight + ariaLabel: this.strLineHeight, + takeFocusOnClose: true }); var currentType = this.options.defaultValue.type ? this.asc2type(this.options.defaultValue.type) : 'text' this.comboboxType.setValue(currentType); @@ -126,11 +131,9 @@ define([], function () { 'use strict'; style: 'width: 100%;', validateOnBlur: false, hideErrorOnInput: true, + allowBlank: false, + blankError: this.txtPropertyValueBlankError, validation: function(value) { - if (value.length === 0) { - return this.txtPropertyValueBlankError; - } - if (this.comboboxType.getValue() === 'number' && (typeof value !== 'number' && isNaN(value.replace(',', '.')))) { return this.txtPropertyTypeNumberInvalid; } @@ -159,7 +162,8 @@ define([], function () { 'use strict'; dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'big', - ariaLabel: this.strLineHeight + ariaLabel: this.strLineHeight, + takeFocusOnClose: true }); this.comboboxBoolean.setValue(this.options.defaultValue.value !== undefined && currentType === 'boolean' ? (this.options.defaultValue.value ? 1 : 0) : 1); this.comboboxBoolean.setVisible(this.options.defaultValue.type ? this.options.defaultValue.type === AscCommon.c_oVariantTypes.vtBool : currentType === 'boolean'); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index d31b79372c..c2c4c69626 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1470,16 +1470,6 @@ define([], function () { '', '
' + + '' + + '
' + + '
' + '' + - '
' + + '
' + '
' + '' + - '
' + + '
' + '
' + '' + - '
' + + '
' + '
', '
', - '
', - '', - '', - '', - '', - '', - '
', - '', - '
', - '
' ].join('')); this.infoObj = {PageCount: 0, WordsCount: 0, ParagraphCount: 0, SymbolsCount: 0, SymbolsWSCount:0}; @@ -1537,7 +1527,11 @@ define([], function () { dataHintDirection: 'left', dataHintOffset: 'small', ariaLabel: this.txtTitle - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putTitle(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); + this.inputTags = new Common.UI.InputField({ el : $markup.findById('#id-info-tags'), style : 'width: 200px;', @@ -1547,7 +1541,11 @@ define([], function () { dataHintDirection: 'left', dataHintOffset: 'small', ariaLabel: this.txtTags - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putKeywords(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); + this.inputSubject = new Common.UI.InputField({ el : $markup.findById('#id-info-subject'), style : 'width: 200px;', @@ -1557,7 +1555,11 @@ define([], function () { dataHintDirection: 'left', dataHintOffset: 'small', ariaLabel: this.txtSubject - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putSubject(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); + this.inputComment = new Common.UI.InputField({ el : $markup.findById('#id-info-comment'), style : 'width: 200px;', @@ -1567,7 +1569,10 @@ define([], function () { dataHintDirection: 'left', dataHintOffset: 'small', ariaLabel: this.txtComment - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putDescription(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); // modify info this.lblModifyDate = $markup.findById('#id-info-modify-date'); @@ -1587,6 +1592,8 @@ define([], function () { idx = me.tblAuthor.find('tr').index(el); el.remove(); me.authors.splice(idx, 1); + me.coreProps.asc_putCreator(me.authors.join(';')); + me.api.asc_setCoreProps(me.coreProps); me.updateScroller(true); } }); @@ -1619,6 +1626,9 @@ define([], function () { }); !isFromApply && me.inputAuthor.setValue(''); } + + me.coreProps.asc_putCreator(me.authors.join(';')); + me.api.asc_setCoreProps(me.coreProps); }).on('keydown:before', keyDownBefore); // pdf info @@ -1631,18 +1641,11 @@ define([], function () { this.lblPdfProducer = $markup.findById('#id-info-pdf-produce'); this.lblFastWV = $markup.findById('#id-info-fast-wv'); - this.btnApply = new Common.UI.Button({ - el: $markup.findById('#fminfo-btn-apply') - }); - this.btnApply.on('click', _.bind(this.applySettings, this)); - this.btnAddProperty = new Common.UI.Button({ el: $markup.findById('#fminfo-btn-add-property') }); this.btnAddProperty.on('click', _.bind(this.onAddPropertyClick, this)); - this.pnlApply = $markup.findById('#fms-flex-apply'); - this.rendered = true; this.updateInfo(this.doc); @@ -1730,12 +1733,8 @@ define([], function () { this._ShowHideInfoItem(this.lblDate, !!value); } else if (pdfProps) this.updatePdfInfo(pdfProps); - - if (this.api) { - _.each(this.api.asc_getAllCustomProperties(), _.bind(function(prop, idx) { - this.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), idx); - }, this)); - } + + this.renderCustomProperties(); }, updateFileInfo: function() { @@ -1898,7 +1897,7 @@ define([], function () { setMode: function(mode) { this.mode = mode; this.inputAuthor.setVisible(mode.isEdit); - this.pnlApply.toggleClass('hidden', !mode.isEdit); + this.btnAddProperty.setVisible(mode.isEdit); this.tblAuthor.find('.close').toggleClass('hidden', !mode.isEdit); this.inputTitle._input.attr('placeholder', mode.isEdit ? this.txtAddText : ''); this.inputTags._input.attr('placeholder', mode.isEdit ? this.txtAddText : ''); @@ -1962,10 +1961,10 @@ define([], function () { value = this.dateToString(new Date(value), true); } - return '' + + return '' + '' + '
' + - '' + + '' + '
' + '
'; }, @@ -1985,49 +1984,59 @@ define([], function () { return text; }, - renderCustomProperty: function(name, type, value, idx) { - var me = this; - - var currentCustomProperty = $('tr[data-name="' + name + '"]'); - if (currentCustomProperty.length) { - currentCustomProperty.off('click'); - currentCustomProperty.html($(this.tplCustomProperty(name, type, value))); - } else { - currentCustomProperty = $(this.tplCustomProperty(name, type, value)); - $('tbody.properties-tab').append(currentCustomProperty); + renderCustomProperties: function() { + if (!this.api) { + return; } - currentCustomProperty.on('click', function (e) { - if (currentCustomProperty.find('div.disabled').length) { - return; - } + $('tr[data-custom-property]').remove(); + + var properties = this.api.asc_getAllCustomProperties(); + _.each(properties, _.bind(function(prop, idx) { + var me = this, name = prop.asc_getName(), type = prop.asc_getType(), value = prop.asc_getValue(); + var $propertyEl = $(this.tplCustomProperty(name, type, value)); - var btn = currentCustomProperty.find(e.target); - if (btn.hasClass('close')) { - me.api.asc_removeCustomProperty(idx); - $('tr[data-name="' + name + '"]').remove(); - } else if (btn.hasClass('form-control')) { - (new Common.Views.DocumentPropertyDialog({ - title: me.txtDocumentPropertyUpdateTitle, - lang: me.mode.lang, - defaultValue: { - name: name, - type: type, - value: value - }, - handler: function(result, name, type, value) { - if (result === 'ok') { - me.api.asc_modifyCustomProperty(idx, name, type, value); - me.renderCustomProperty(name, type, value, idx); + $('tbody.properties-tab').append($propertyEl); + + $propertyEl.on('click', function (e) { + if ($propertyEl.find('div.disabled').length) { + return; + } + + var btn = $propertyEl.find(e.target); + if (btn.hasClass('close')) { + me.api.asc_removeCustomProperty(idx); + me.renderCustomProperties(); + } else if (btn.hasClass('form-control')) { + (new Common.Views.DocumentPropertyDialog({ + title: me.txtDocumentPropertyUpdateTitle, + lang: me.mode.lang, + defaultValue: { + name: name, + type: type, + value: value + }, + nameValidator: function(newName) { + if (newName !== name && _.some(properties, function (prop) { return prop.name === newName; })) { + return me.txtPropertyTitleConflictError; + } + + return true; + }, + handler: function(result, name, type, value) { + if (result === 'ok') { + me.api.asc_modifyCustomProperty(idx, name, type, value); + me.renderCustomProperties(); + } } - } - })).show(); - } - }) + })).show(); + } + }); + }, this)); }, setDisabledCustomProperties: function(disable) { - _.each($('tr[data-name]'), function(prop) { + _.each($('tr[data-custom-property]'), function(prop) { $(prop).find('div.custom-property-wrapper')[disable ? 'addClass' : 'removeClass']('disabled'); $(prop).find('div.close')[disable ? 'hide' : 'show'](); }) @@ -2070,7 +2079,6 @@ define([], function () { this.inputAuthor.setDisabled(disable); this.tblAuthor.find('.close').toggleClass('disabled', this._state._locked); this.tblAuthor.toggleClass('disabled', disable); - this.btnApply.setDisabled(this._state._locked); this.btnAddProperty.setDisabled(disable); this.setDisabledCustomProperties(disable); }, @@ -2079,31 +2087,23 @@ define([], function () { var me = this; (new Common.Views.DocumentPropertyDialog({ lang: me.mode.lang, + nameValidator: function(newName) { + var properties = me.api.asc_getAllCustomProperties(); + if (_.some(properties, function (prop) { return prop.name === newName; })) { + return me.txtPropertyTitleConflictError; + } + + return true; + }, handler: function(result, title, type, value) { if (result === 'ok') { me.api.asc_addCustomProperty(title, type, value); - var properties = me.api.asc_getAllCustomProperties(); - if (properties.length) { - var prop = properties[properties.length - 1]; - me.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), properties.length - 1); - } + me.renderCustomProperties(); } } })).show(); }, - applySettings: function() { - if (this.coreProps && this.api) { - this.coreProps.asc_putTitle(this.inputTitle.getValue()); - this.coreProps.asc_putKeywords(this.inputTags.getValue()); - this.coreProps.asc_putSubject(this.inputSubject.getValue()); - this.coreProps.asc_putDescription(this.inputComment.getValue()); - this.coreProps.asc_putCreator(this.authors.join(';')); - this.api.asc_setCoreProps(this.coreProps); - } - this.menu.hide(); - }, - txtPlacement: 'Location', txtOwner: 'Owner', txtUploaded: 'Uploaded', @@ -2139,6 +2139,7 @@ define([], function () { txtProperties: 'Properties', txtDocumentInfo: 'Document Info', txtDocumentPropertyUpdateTitle: "Document Property", + txtPropertyTitleConflictError: 'Property with this title already exists', txtAddProperty: 'Add property' }, DE.Views.FileMenuPanels.DocumentInfo || {})); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index e1acf2ec58..bbe52492ee 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -2194,6 +2194,7 @@ "DE.Views.FileMenuPanels.DocumentInfo.txtProperties": "Properties", "DE.Views.FileMenuPanels.DocumentInfo.txtDocumentPropertyUpdateTitle": "Document Property", "DE.Views.FileMenuPanels.DocumentInfo.txtAddProperty": "Add property", + "DE.Views.FileMenuPanels.DocumentInfo.txtPropertyTitleConflictError": "Property with this title already exists", "DE.Views.FileMenuPanels.DocumentRights.txtAccessRights": "Access rights", "DE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights", "DE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights", diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index fda3074b3c..d495d675fc 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -54,7 +54,7 @@ .header { .font-size-very-huge(); - margin-bottom: 20px; + margin-bottom: 30px; } .format-items { @@ -205,7 +205,7 @@ .header { .font-size-very-huge(); - line-height: 26px; + line-height: 22px; } table { @@ -226,7 +226,7 @@ tr { display: flex; gap: 24px; - align-items: center; + td { font-size: 11px; line-height: 16px; @@ -241,8 +241,12 @@ &.left { width: 120px; - height: 16px; flex-shrink: 0; + line-height: 22px; + + label { + overflow-wrap: break-word; + } } &.right { @@ -380,7 +384,7 @@ padding: 0 0 0 10px; white-space: nowrap; margin-top: 30px; - margin-bottom: 20px; + margin-bottom: 30px; .rtl & { padding: 0 10px 10px 0; @@ -794,7 +798,7 @@ } #fms-btn-invisible-sign { - margin-bottom: 20px; + margin-bottom: 30px; } #id-fms-lbl-protect-header { diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 680e592c69..ad560f200c 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1167,14 +1167,6 @@ define([], function () { '', '', '', - '
', - '
', - '', - '', - '', - '', - '', - '
', '
' ].join('')); @@ -1213,7 +1205,11 @@ define([], function () { dataHint: '2', dataHintDirection: 'left', dataHintOffset: 'small' - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putTitle(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); + this.inputTags = new Common.UI.InputField({ el : $markup.findById('#id-info-tags'), style : 'width: 200px;', @@ -1222,7 +1218,11 @@ define([], function () { dataHint: '2', dataHintDirection: 'left', dataHintOffset: 'small' - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putKeywords(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); + this.inputSubject = new Common.UI.InputField({ el : $markup.findById('#id-info-subject'), style : 'width: 200px;', @@ -1231,7 +1231,11 @@ define([], function () { dataHint: '2', dataHintDirection: 'left', dataHintOffset: 'small' - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putSubject(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); + this.inputComment = new Common.UI.InputField({ el : $markup.findById('#id-info-comment'), style : 'width: 200px;', @@ -1240,7 +1244,10 @@ define([], function () { dataHint: '2', dataHintDirection: 'left', dataHintOffset: 'small' - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putDescription(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); // modify info this.lblModifyDate = $markup.findById('#id-info-modify-date'); @@ -1260,6 +1267,8 @@ define([], function () { idx = me.tblAuthor.find('tr').index(el); el.remove(); me.authors.splice(idx, 1); + me.coreProps.asc_putCreator(me.authors.join(';')); + me.api.asc_setCoreProps(me.coreProps); me.updateScroller(true); } }); @@ -1291,14 +1300,10 @@ define([], function () { }); !isFromApply && me.inputAuthor.setValue(''); } - }).on('keydown:before', keyDownBefore); - - this.btnApply = new Common.UI.Button({ - el: $markup.findById('#fminfo-btn-apply') - }); - this.btnApply.on('click', _.bind(this.applySettings, this)); - this.pnlApply = $markup.findById('#fms-flex-apply'); + me.coreProps.asc_putCreator(me.authors.join(';')); + me.api.asc_setCoreProps(me.coreProps); + }).on('keydown:before', keyDownBefore); this.btnAddProperty = new Common.UI.Button({ el: $markup.findById('#fminfo-btn-add-property') @@ -1382,11 +1387,7 @@ define([], function () { this._ShowHideInfoItem(this.lblDate, !!value); } - if (this.api) { - _.each(this.api.asc_getAllCustomProperties(), _.bind(function(prop, idx) { - this.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), idx); - }, this)); - } + this.renderCustomProperties(); }, updateFileInfo: function() { @@ -1448,10 +1449,10 @@ define([], function () { value = this.dateToString(new Date(value), true); } - return '' + + return '' + '' + '
' + - '' + + '' + '
' + '
'; }, @@ -1471,49 +1472,59 @@ define([], function () { return text; }, - renderCustomProperty: function(name, type, value, idx) { - var me = this; - - var currentCustomProperty = $('tr[data-name="' + name + '"]'); - if (currentCustomProperty.length) { - currentCustomProperty.off('click'); - currentCustomProperty.html($(this.tplCustomProperty(name, type, value))); - } else { - currentCustomProperty = $(this.tplCustomProperty(name, type, value)); - $('tbody.properties-tab').append(currentCustomProperty); + renderCustomProperties: function() { + if (!this.api) { + return; } - currentCustomProperty.on('click', function (e) { - if (currentCustomProperty.find('div.disabled').length) { - return; - } + $('tr[data-custom-property]').remove(); + + var properties = this.api.asc_getAllCustomProperties(); + _.each(properties, _.bind(function(prop, idx) { + var me = this, name = prop.asc_getName(), type = prop.asc_getType(), value = prop.asc_getValue(); + var $propertyEl = $(this.tplCustomProperty(name, type, value)); + + $('tbody.properties-tab').append($propertyEl); - var btn = currentCustomProperty.find(e.target); - if (btn.hasClass('close')) { - me.api.asc_removeCustomProperty(idx); - $('tr[data-name="' + name + '"]').remove(); - } else if (btn.hasClass('form-control')) { - (new Common.Views.DocumentPropertyDialog({ - title: me.txtDocumentPropertyUpdateTitle, - lang: me.mode.lang, - defaultValue: { - name: name, - type: type, - value: value - }, - handler: function(result, name, type, value) { - if (result === 'ok') { - me.api.asc_modifyCustomProperty(idx, name, type, value); - me.renderCustomProperty(name, type, value, idx); + $propertyEl.on('click', function (e) { + if ($propertyEl.find('div.disabled').length) { + return; + } + + var btn = $propertyEl.find(e.target); + if (btn.hasClass('close')) { + me.api.asc_removeCustomProperty(idx); + me.renderCustomProperties(); + } else if (btn.hasClass('form-control')) { + (new Common.Views.DocumentPropertyDialog({ + title: me.txtDocumentPropertyUpdateTitle, + lang: me.mode.lang, + defaultValue: { + name: name, + type: type, + value: value + }, + nameValidator: function(newName) { + if (newName !== name && _.some(properties, function (prop) { return prop.name === newName; })) { + return me.txtPropertyTitleConflictError; + } + + return true; + }, + handler: function(result, name, type, value) { + if (result === 'ok') { + me.api.asc_modifyCustomProperty(idx, name, type, value); + me.renderCustomProperties(); + } } - } - })).show(); - } - }) + })).show(); + } + }); + }, this)); }, setDisabledCustomProperties: function(disable) { - _.each($('tr[data-name]'), function(prop) { + _.each($('tr[data-custom-property]'), function(prop) { $(prop).find('div.custom-property-wrapper')[disable ? 'addClass' : 'removeClass']('disabled'); $(prop).find('div.close')[disable ? 'hide' : 'show'](); }) @@ -1523,14 +1534,18 @@ define([], function () { var me = this; (new Common.Views.DocumentPropertyDialog({ lang: me.mode.lang, + nameValidator: function(newName) { + var properties = me.api.asc_getAllCustomProperties(); + if (_.some(properties, function (prop) { return prop.name === newName; })) { + return me.txtPropertyTitleConflictError; + } + + return true; + }, handler: function(result, name, type, value) { if (result === 'ok') { me.api.asc_addCustomProperty(name, type, value); - var properties = me.api.asc_getAllCustomProperties(); - if (properties.length) { - var prop = properties[properties.length - 1]; - me.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), properties.length - 1); - } + me.renderCustomProperties(); } } })).show(); @@ -1550,7 +1565,7 @@ define([], function () { setMode: function(mode) { this.mode = mode; this.inputAuthor.setVisible(mode.isEdit); - this.pnlApply.toggleClass('hidden', !mode.isEdit); + this.btnAddProperty.setVisible(mode.isEdit); this.tblAuthor.find('.close').toggleClass('hidden', !mode.isEdit); if (!mode.isEdit) { this.inputTitle._input.attr('placeholder', ''); @@ -1584,23 +1599,10 @@ define([], function () { this.inputAuthor.setDisabled(disable); this.tblAuthor.find('.close').toggleClass('disabled', this._locked); this.tblAuthor.toggleClass('disabled', disable); - this.btnApply.setDisabled(this._locked); this.btnAddProperty.setDisabled(disable); this.setDisabledCustomProperties(disable); }, - applySettings: function() { - if (this.coreProps && this.api) { - this.coreProps.asc_putTitle(this.inputTitle.getValue()); - this.coreProps.asc_putKeywords(this.inputTags.getValue()); - this.coreProps.asc_putSubject(this.inputSubject.getValue()); - this.coreProps.asc_putDescription(this.inputComment.getValue()); - this.coreProps.asc_putCreator(this.authors.join(';')); - this.api.asc_setCoreProps(this.coreProps); - } - this.menu.hide(); - }, - txtPlacement: 'Location', txtOwner: 'Owner', txtUploaded: 'Uploaded', @@ -1624,7 +1626,8 @@ define([], function () { txtDocumentPropertyUpdateTitle: "Document Property", txtAddProperty: 'Add property', txtYes: 'Yes', - txtNo: 'No' + txtNo: 'No', + txtPropertyTitleConflictError: 'Property with this title already exists', }, PE.Views.FileMenuPanels.DocumentInfo || {})); PE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({ diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index a796d6cf82..53709cfaf8 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -2053,6 +2053,7 @@ "PE.Views.FileMenuPanels.DocumentInfo.txtProperties": "Properties", "PE.Views.FileMenuPanels.DocumentInfo.txtDocumentPropertyUpdateTitle": "Document Property", "PE.Views.FileMenuPanels.DocumentInfo.txtAddProperty": "Add property", + "PE.Views.FileMenuPanels.DocumentInfo.txtPropertyTitleConflictError": "Property with this title already exists", "PE.Views.FileMenuPanels.DocumentRights.txtAccessRights": "Access rights", "PE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights", "PE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights", diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 39b51e4a32..1c10a4034f 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -145,7 +145,7 @@ .header { .font-size-very-huge(); - margin-bottom: 20px; + margin-bottom: 30px; } .format-items { @@ -243,7 +243,7 @@ padding: 0 0 0 10px; white-space: nowrap; margin-top: 30px; - margin-bottom: 20px; + margin-bottom: 30px; .rtl & { padding: 0 10px 10px 0; @@ -517,7 +517,7 @@ .header { .font-size-very-huge(); - line-height: 26px; + line-height: 22px; } table { @@ -538,7 +538,7 @@ tr { display: flex; gap: 24px; - align-items: center; + td { font-size: 11px; line-height: 16px; @@ -553,8 +553,12 @@ &.left { width: 120px; - height: 16px; flex-shrink: 0; + line-height: 22px; + + label { + overflow-wrap: break-word; + } } &.right { @@ -578,7 +582,7 @@ } .author-info tbody tr:last-child { - margin-bottom: 20px; + margin-bottom: 30px; } &.main { @@ -707,7 +711,7 @@ } #fms-btn-invisible-sign { - margin-bottom: 20px; + margin-bottom: 30px; } #id-fms-lbl-protect-header { diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index c5901fb17b..ed49564719 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1639,14 +1639,6 @@ define([], function () { '', '', '
', - '
', - '', - '', - '', - '', - '', - '
', - '
' ].join('')); this.menu = options.menu; @@ -1684,7 +1676,11 @@ define([], function () { dataHint: '2', dataHintDirection: 'left', dataHintOffset: 'small' - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putTitle(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); + this.inputTags = new Common.UI.InputField({ el : $markup.findById('#id-info-tags'), style : 'width: 200px;', @@ -1693,7 +1689,11 @@ define([], function () { dataHint: '2', dataHintDirection: 'left', dataHintOffset: 'small' - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putKeywords(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); + this.inputSubject = new Common.UI.InputField({ el : $markup.findById('#id-info-subject'), style : 'width: 200px;', @@ -1702,7 +1702,11 @@ define([], function () { dataHint: '2', dataHintDirection: 'left', dataHintOffset: 'small' - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putSubject(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); + this.inputComment = new Common.UI.InputField({ el : $markup.findById('#id-info-comment'), style : 'width: 200px;', @@ -1711,7 +1715,10 @@ define([], function () { dataHint: '2', dataHintDirection: 'left', dataHintOffset: 'small' - }).on('keydown:before', keyDownBefore); + }).on('keydown:before', keyDownBefore).on('changed:after', function(_, newValue) { + me.coreProps.asc_putDescription(newValue); + me.api.asc_setCoreProps(me.coreProps); + }); // modify info this.lblModifyDate = $markup.findById('#id-info-modify-date'); @@ -1731,6 +1738,8 @@ define([], function () { idx = me.tblAuthor.find('tr').index(el); el.remove(); me.authors.splice(idx, 1); + me.coreProps.asc_putCreator(me.authors.join(';')); + me.api.asc_setCoreProps(me.coreProps); me.updateScroller(true); } }); @@ -1762,14 +1771,10 @@ define([], function () { }); !isFromApply && me.inputAuthor.setValue(''); } - }).on('keydown:before', keyDownBefore); - this.btnApply = new Common.UI.Button({ - el: $markup.findById('#fminfo-btn-apply') - }); - this.btnApply.on('click', _.bind(this.applySettings, this)); - - this.pnlApply = $markup.findById('#fms-flex-apply'); + me.coreProps.asc_putCreator(me.authors.join(';')); + me.api.asc_setCoreProps(me.coreProps); + }).on('keydown:before', keyDownBefore); this.btnAddProperty = new Common.UI.Button({ el: $markup.findById('#fminfo-btn-add-property') @@ -1852,6 +1857,8 @@ define([], function () { this.lblDate.text(this.dateToString(value)); this._ShowHideInfoItem(this.lblDate, !!value); } + + this.renderCustomProperties(); }, updateFileInfo: function() { @@ -1920,7 +1927,7 @@ define([], function () { setMode: function(mode) { this.mode = mode; this.inputAuthor.setVisible(mode.isEdit); - this.pnlApply.toggleClass('hidden', !mode.isEdit); + this.btnAddProperty.setVisible(mode.isEdit); this.tblAuthor.find('.close').toggleClass('hidden', !mode.isEdit); if (!mode.isEdit) { this.inputTitle._input.attr('placeholder', ''); @@ -1952,10 +1959,10 @@ define([], function () { value = this.dateToString(new Date(value), true); } - return '' + + return '' + '' + '
' + - '' + + '' + '
' + '
'; }, @@ -1975,49 +1982,59 @@ define([], function () { return text; }, - renderCustomProperty: function(name, type, value, idx) { - var me = this; - - var currentCustomProperty = $('tr[data-name="' + name + '"]'); - if (currentCustomProperty.length) { - currentCustomProperty.off('click'); - currentCustomProperty.html($(this.tplCustomProperty(name, type, value))); - } else { - currentCustomProperty = $(this.tplCustomProperty(name, type, value)); - $('tbody.properties-tab').append(currentCustomProperty); + renderCustomProperties: function() { + if (!this.api) { + return; } - currentCustomProperty.on('click', function (e) { - if (currentCustomProperty.find('div.disabled').length) { - return; - } + $('tr[data-custom-property]').remove(); + + var properties = this.api.asc_getAllCustomProperties(); + _.each(properties, _.bind(function(prop, idx) { + var me = this, name = prop.asc_getName(), type = prop.asc_getType(), value = prop.asc_getValue(); + var $propertyEl = $(this.tplCustomProperty(name, type, value)); - var btn = currentCustomProperty.find(e.target); - if (btn.hasClass('close')) { - me.api.asc_removeCustomProperty(idx); - $('tr[data-name="' + name + '"]').remove(); - } else if (btn.hasClass('form-control')) { - (new Common.Views.DocumentPropertyDialog({ - title: me.txtDocumentPropertyUpdateTitle, - lang: me.mode.lang, - defaultValue: { - name: name, - type: type, - value: value - }, - handler: function(result, name, type, value) { - if (result === 'ok') { - me.api.asc_modifyCustomProperty(idx, name, type, value); - me.renderCustomProperty(name, type, value, idx); + $('tbody.properties-tab').append($propertyEl); + + $propertyEl.on('click', function (e) { + if ($propertyEl.find('div.disabled').length) { + return; + } + + var btn = $propertyEl.find(e.target); + if (btn.hasClass('close')) { + me.api.asc_removeCustomProperty(idx); + me.renderCustomProperties(); + } else if (btn.hasClass('form-control')) { + (new Common.Views.DocumentPropertyDialog({ + title: me.txtDocumentPropertyUpdateTitle, + lang: me.mode.lang, + defaultValue: { + name: name, + type: type, + value: value + }, + nameValidator: function(newName) { + if (newName !== name && _.some(properties, function (prop) { return prop.name === newName; })) { + return me.txtPropertyTitleConflictError; + } + + return true; + }, + handler: function(result, name, type, value) { + if (result === 'ok') { + me.api.asc_modifyCustomProperty(idx, name, type, value); + me.renderCustomProperties(); + } } - } - })).show(); - } - }) + })).show(); + } + }); + }, this)); }, setDisabledCustomProperties: function(disable) { - _.each($('tr[data-name]'), function(prop) { + _.each($('tr[data-custom-property]'), function(prop) { $(prop).find('div.custom-property-wrapper')[disable ? 'addClass' : 'removeClass']('disabled'); $(prop).find('div.close')[disable ? 'hide' : 'show'](); }) @@ -2027,14 +2044,18 @@ define([], function () { var me = this; (new Common.Views.DocumentPropertyDialog({ lang: me.mode.lang, + nameValidator: function(newName) { + var properties = me.api.asc_getAllCustomProperties(); + if (_.some(properties, function (prop) { return prop.name === newName; })) { + return me.txtPropertyTitleConflictError; + } + + return true; + }, handler: function(result, name, type, value) { if (result === 'ok') { me.api.asc_addCustomProperty(name, type, value); - var properties = me.api.asc_getAllCustomProperties(); - if (properties.length) { - var prop = properties[properties.length - 1]; - me.renderCustomProperty(prop.asc_getName(), prop.asc_getType(), prop.asc_getValue(), properties.length - 1); - } + me.renderCustomProperties(); } } })).show(); @@ -2049,23 +2070,10 @@ define([], function () { this.inputAuthor.setDisabled(disable); this.tblAuthor.find('.close').toggleClass('disabled', this._locked); this.tblAuthor.toggleClass('disabled', disable); - this.btnApply.setDisabled(this._locked); this.btnAddProperty.setDisabled(disable); this.setDisabledCustomProperties(disable); }, - applySettings: function() { - if (this.coreProps && this.api) { - this.coreProps.asc_putTitle(this.inputTitle.getValue()); - this.coreProps.asc_putKeywords(this.inputTags.getValue()); - this.coreProps.asc_putSubject(this.inputSubject.getValue()); - this.coreProps.asc_putDescription(this.inputComment.getValue()); - this.coreProps.asc_putCreator(this.authors.join(';')); - this.api.asc_setCoreProps(this.coreProps); - } - this.menu.hide(); - }, - txtPlacement: 'Location', txtOwner: 'Owner', txtUploaded: 'Uploaded', @@ -2088,7 +2096,8 @@ define([], function () { txtDocumentPropertyUpdateTitle: "Document Property", txtAddProperty: 'Add property', txtYes: 'Yes', - txtNo: 'No' + txtNo: 'No', + txtPropertyTitleConflictError: 'Property with this title already exists', }, SSE.Views.FileMenuPanels.DocumentInfo || {})); SSE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({ diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index e5e23ee212..ee0826f364 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -2660,6 +2660,7 @@ "SSE.Views.FileMenuPanels.DocumentInfo.txtProperties": "Properties", "SSE.Views.FileMenuPanels.DocumentInfo.txtDocumentPropertyUpdateTitle": "Document Property", "SSE.Views.FileMenuPanels.DocumentInfo.txtAddProperty": "Add property", + "SSE.Views.FileMenuPanels.DocumentInfo.txtPropertyTitleConflictError": "Property with this title already exists", "SSE.Views.FileMenuPanels.DocumentRights.txtAccessRights": "Access Rights", "SSE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights", "SSE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights", diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 3b4ce1de98..f40f12152e 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -148,7 +148,7 @@ .header { .font-size-very-huge(); - margin-bottom: 20px; + margin-bottom: 30px; } .format-items { @@ -185,7 +185,7 @@ .header { .font-size-very-huge(); - line-height: 26px; + line-height: 22px; } table { @@ -206,7 +206,7 @@ tr { display: flex; gap: 24px; - align-items: center; + td { font-size: 11px; line-height: 16px; @@ -221,8 +221,12 @@ &.left { width: 120px; - height: 16px; flex-shrink: 0; + line-height: 22px; + + label { + overflow-wrap: break-word; + } } &.right { @@ -246,7 +250,7 @@ } .author-info tbody tr:last-child { - margin-bottom: 20px; + margin-bottom: 30px; } &.main { @@ -428,7 +432,7 @@ padding: 0 0 0 10px; white-space: nowrap; margin-top: 30px; - margin-bottom: 20px; + margin-bottom: 30px; .rtl & { padding: 0 10px 0 0; @@ -793,7 +797,7 @@ } #fms-btn-invisible-sign { - margin-bottom: 20px; + margin-bottom: 30px; } #id-fms-lbl-protect-header { From 5e43885e1b40a3e65a25613b5dad77beaa702079 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Wed, 18 Sep 2024 16:09:47 +0500 Subject: [PATCH 09/18] fix/[de,pe,de]: xss --- apps/documenteditor/main/app/view/FileMenuPanels.js | 4 ++-- apps/presentationeditor/main/app/view/FileMenuPanels.js | 4 ++-- apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index c2c4c69626..6864b5b6d9 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1962,9 +1962,9 @@ define([], function () { } return '' + - '' + + '' + '
' + - '' + + '' + '
' + '
'; }, diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index ad560f200c..340a4c8cc8 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1450,9 +1450,9 @@ define([], function () { } return '' + - '' + + '' + '
' + - '' + + '' + '
' + '
'; }, diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index ed49564719..8b1777143a 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1960,9 +1960,9 @@ define([], function () { } return '' + - '' + + '' + '
' + - '' + + '' + '
' + '
'; }, From 76f49562c0d3fa1aa76721a03ccf3258525efb67 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Wed, 18 Sep 2024 19:55:38 +0500 Subject: [PATCH 10/18] fix/[de,pe,se]: space between elements --- .../main/resources/less/filemenu.less | 15 ++++++--------- .../main/resources/less/leftmenu.less | 17 +++++++---------- .../main/resources/less/leftmenu.less | 17 +++++++---------- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index d495d675fc..f0f1136310 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -54,7 +54,7 @@ .header { .font-size-very-huge(); - margin-bottom: 30px; + margin-bottom: 24px; } .format-items { @@ -205,12 +205,11 @@ .header { .font-size-very-huge(); - line-height: 22px; } table { display: flex; - gap: 30px; + gap: 24px; flex-direction: column; tbody { @@ -229,20 +228,18 @@ td { font-size: 11px; - line-height: 16px; + line-height: 22px; &.title { label { font-size: 14px; font-weight: 700; - line-height: 20px; } } &.left { width: 120px; flex-shrink: 0; - line-height: 22px; label { overflow-wrap: break-word; @@ -308,7 +305,7 @@ #panel-settings { .header { - margin: 30px 0 16px 30px; + margin: 30px 0 18px 30px; .font-size-very-huge(); .rtl & { margin: 30px 30px 16px 0; @@ -384,7 +381,7 @@ padding: 0 0 0 10px; white-space: nowrap; margin-top: 30px; - margin-bottom: 30px; + margin-bottom: 24px; .rtl & { padding: 0 10px 10px 0; @@ -798,7 +795,7 @@ } #fms-btn-invisible-sign { - margin-bottom: 30px; + margin-bottom: 24px; } #id-fms-lbl-protect-header { diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 1c10a4034f..081517b3bc 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -145,7 +145,7 @@ .header { .font-size-very-huge(); - margin-bottom: 30px; + margin-bottom: 24px; } .format-items { @@ -186,7 +186,7 @@ #panel-settings { .header { - margin: 30px 0 16px 30px; + margin: 30px 0 18px 30px; .font-size-very-huge(); .rtl & { margin: 30px 30px 16px 0; @@ -243,7 +243,7 @@ padding: 0 0 0 10px; white-space: nowrap; margin-top: 30px; - margin-bottom: 30px; + margin-bottom: 24px; .rtl & { padding: 0 10px 10px 0; @@ -517,12 +517,11 @@ .header { .font-size-very-huge(); - line-height: 22px; } table { display: flex; - gap: 30px; + gap: 24px; flex-direction: column; tbody { @@ -541,20 +540,18 @@ td { font-size: 11px; - line-height: 16px; + line-height: 22px; &.title { label { font-size: 14px; font-weight: 700; - line-height: 20px; } } &.left { width: 120px; flex-shrink: 0; - line-height: 22px; label { overflow-wrap: break-word; @@ -582,7 +579,7 @@ } .author-info tbody tr:last-child { - margin-bottom: 30px; + margin-bottom: 20px; } &.main { @@ -711,7 +708,7 @@ } #fms-btn-invisible-sign { - margin-bottom: 30px; + margin-bottom: 24px; } #id-fms-lbl-protect-header { diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index f40f12152e..2fed580ee2 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -148,7 +148,7 @@ .header { .font-size-very-huge(); - margin-bottom: 30px; + margin-bottom: 24px; } .format-items { @@ -185,12 +185,11 @@ .header { .font-size-very-huge(); - line-height: 22px; } table { display: flex; - gap: 30px; + gap: 24px; flex-direction: column; tbody { @@ -209,20 +208,18 @@ td { font-size: 11px; - line-height: 16px; + line-height: 22px; &.title { label { font-size: 14px; font-weight: 700; - line-height: 20px; } } &.left { width: 120px; flex-shrink: 0; - line-height: 22px; label { overflow-wrap: break-word; @@ -250,7 +247,7 @@ } .author-info tbody tr:last-child { - margin-bottom: 30px; + margin-bottom: 20px; } &.main { @@ -286,7 +283,7 @@ flex-direction: column; .header { - margin: 30px 0 16px 30px; + margin: 30px 0 18px 30px; .font-size-very-huge(); .rtl & { margin: 30px 30px 16px 0; @@ -432,7 +429,7 @@ padding: 0 0 0 10px; white-space: nowrap; margin-top: 30px; - margin-bottom: 30px; + margin-bottom: 24px; .rtl & { padding: 0 10px 0 0; @@ -797,7 +794,7 @@ } #fms-btn-invisible-sign { - margin-bottom: 30px; + margin-bottom: 24px; } #id-fms-lbl-protect-header { From 2bfd8440c81ce3cbaa8bc3343540566f8adad9ca Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Wed, 18 Sep 2024 20:00:31 +0500 Subject: [PATCH 11/18] fix/[de,pe,se]: remove author inline styles --- apps/documenteditor/main/app/view/FileMenuPanels.js | 4 ++-- apps/presentationeditor/main/app/view/FileMenuPanels.js | 4 ++-- apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 6864b5b6d9..5cfb19106a 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1431,8 +1431,8 @@ define([], function () { '', '', '', - '', - '
', + '', + '
', '', '', '', diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 340a4c8cc8..ee0ab7f28d 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1131,8 +1131,8 @@ define([], function () { '', '', '', - '', - '', + '
', + '
', '', '', '', diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 8b1777143a..3b0c590190 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1602,8 +1602,8 @@ define([], function () { '', '', '', - '', - '', + '
', + '
', '', '', '', From 5591b92cc3bd8881774e202e89fd6db0f8a43b25 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 19 Sep 2024 14:30:13 +0500 Subject: [PATCH 12/18] fix/[de,pe,se]: height of properties --- .../main/app/view/FileMenuPanels.js | 2 +- .../main/resources/less/filemenu.less | 64 +++++++++++++------ .../main/app/view/FileMenuPanels.js | 2 +- .../main/resources/less/leftmenu.less | 58 +++++++++++++---- .../main/app/view/FileMenuPanels.js | 2 +- .../main/resources/less/leftmenu.less | 58 +++++++++++++---- 6 files changed, 135 insertions(+), 51 deletions(-) diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 5cfb19106a..5ecb67831a 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1460,7 +1460,7 @@ define([], function () { '
', '
', '', - '', + '', '', '
', '
', '
', '', - '', + '', '', '
', '', diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 081517b3bc..ba1485ac84 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -524,25 +524,18 @@ gap: 24px; flex-direction: column; - tbody { - display: flex; - gap: 12px; - flex-direction: column; - - &.properties-tab { - gap: 10px; - } - } - tr { display: flex; gap: 24px; td { font-size: 11px; - line-height: 22px; + line-height: 16px; + height: 16px; &.title { + line-height: 20px; + height: 20px; label { font-size: 14px; font-weight: 700; @@ -550,11 +543,13 @@ } &.left { - width: 120px; + width: 140px; flex-shrink: 0; label { - overflow-wrap: break-word; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; } } @@ -568,10 +563,37 @@ } } + tbody { + display: flex; + gap: 12px; + flex-direction: column; + + &.properties-tab { + gap: 10px; + + tr { + gap: 20px; + } + + td { + height: unset; + } + + td.left { + display: flex; + align-items: center; + } + } + } + tr.author-info { align-items: flex-start; td { + &.left { + height: 22px; + } + display: flex; gap: 5px; align-items: center; @@ -587,8 +609,16 @@ } } + #fms-flex-add-property { + margin-top: 10px; + td { + height: unset; + } + } + #fminfo-btn-add-property { - margin: 10px 0; + padding: 0; + border: 0; background-color: transparent; height: 24px; diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 3b0c590190..8273bd373c 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1631,7 +1631,7 @@ define([], function () { '
', '
', '', - '', + '', '', '
', '', diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 2fed580ee2..7d34cbaa26 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -192,25 +192,18 @@ gap: 24px; flex-direction: column; - tbody { - display: flex; - gap: 12px; - flex-direction: column; - - &.properties-tab { - gap: 10px; - } - } - tr { display: flex; gap: 24px; td { font-size: 11px; - line-height: 22px; + line-height: 16px; + height: 16px; &.title { + line-height: 20px; + height: 20px; label { font-size: 14px; font-weight: 700; @@ -218,11 +211,13 @@ } &.left { - width: 120px; + width: 140px; flex-shrink: 0; label { - overflow-wrap: break-word; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; } } @@ -236,10 +231,37 @@ } } + tbody { + display: flex; + gap: 12px; + flex-direction: column; + + &.properties-tab { + gap: 10px; + + tr { + gap: 20px; + } + + td { + height: unset; + } + + td.left { + display: flex; + align-items: center; + } + } + } + tr.author-info { align-items: flex-start; td { + &.left { + height: 22px; + } + display: flex; gap: 5px; align-items: center; @@ -255,8 +277,16 @@ } } + #fms-flex-add-property { + margin-top: 10px; + td { + height: unset; + } + } + #fminfo-btn-add-property { - margin: 10px 0; + padding: 0; + border: 0; background-color: transparent; height: 24px; From 83a7b22041b1f40c1cc6ee7ffa5cd01b17858e49 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 19 Sep 2024 14:31:31 +0500 Subject: [PATCH 13/18] feat/pdfe: stylized document info --- .../pdfeditor/main/app/view/FileMenuPanels.js | 241 +++++++++--------- apps/pdfeditor/main/locale/en.json | 1 + .../main/resources/less/filemenu.less | 70 ++++- 3 files changed, 185 insertions(+), 127 deletions(-) diff --git a/apps/pdfeditor/main/app/view/FileMenuPanels.js b/apps/pdfeditor/main/app/view/FileMenuPanels.js index 092f75b534..69cb53a21e 100644 --- a/apps/pdfeditor/main/app/view/FileMenuPanels.js +++ b/apps/pdfeditor/main/app/view/FileMenuPanels.js @@ -1098,130 +1098,129 @@ define([], function () { this.template = _.template([ '
', - '
' + this.txtDocumentInfo + '
', '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '',, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', // '', // '', // '', // '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', '
' + this.txtDocumentInfo + '
', + '', + '', + '', + '', + '
', + '
', - '', - '', - '', - '', - '
', - '
', '
', '
', @@ -1798,8 +1797,8 @@ define([], function () { txtYes: 'Yes', txtNo: 'No', txtPdfProducer: 'PDF Producer', - txtDocumentInfo: 'Document Info' - + txtDocumentInfo: 'Document Info', + txtCommon: 'Common', }, PDFE.Views.FileMenuPanels.DocumentInfo || {})); PDFE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({ diff --git a/apps/pdfeditor/main/locale/en.json b/apps/pdfeditor/main/locale/en.json index 2b397c5d08..2fd64a9bc9 100644 --- a/apps/pdfeditor/main/locale/en.json +++ b/apps/pdfeditor/main/locale/en.json @@ -1279,6 +1279,7 @@ "PDFE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded", "PDFE.Views.FileMenuPanels.DocumentInfo.txtWords": "Words", "PDFE.Views.FileMenuPanels.DocumentInfo.txtYes": "Yes", + "PDFE.Views.FileMenuPanels.DocumentInfo.txtCommon": "Common", "PDFE.Views.FileMenuPanels.DocumentRights.txtAccessRights": "Access Rights", "PDFE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights", "PDFE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights", diff --git a/apps/pdfeditor/main/resources/less/filemenu.less b/apps/pdfeditor/main/resources/less/filemenu.less index b320f57796..3ca87d9833 100644 --- a/apps/pdfeditor/main/resources/less/filemenu.less +++ b/apps/pdfeditor/main/resources/less/filemenu.less @@ -188,8 +188,7 @@ } -#panel-settings, -#panel-info { +#panel-settings { #file-menu-panel & { padding: 0; display: flex; @@ -520,17 +519,76 @@ } #panel-info { + #file-menu-panel & { + padding: 30px; + + .flex-settings { + gap: 30px; + display: flex; + flex-direction: column; + } + } + .header { - margin: 30px 0 20px 30px; .font-size-very-huge(); + } - .rtl & { - margin: 30px 30px 20px 0; + table { + display: flex; + gap: 24px; + flex-direction: column; + + tr { + display: flex; + gap: 24px; + + td { + font-size: 11px; + line-height: 16px; + height: 16px; + + &.title { + line-height: 20px; + height: 20px; + label { + font-size: 14px; + font-weight: 700; + } + } + + &.left { + width: 140px; + flex-shrink: 0; + + label { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + } + + &.right { + flex-grow: 1; + } + } + + &.divider { + height: 10px; + } + } + + tbody { + display: flex; + gap: 12px; + flex-direction: column; + } + + &.main { + width: 100%; } } } -#panel-info, #panel-rights { table { tr { From d1f0690f207101e0d098233792638ea82de007e8 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 19 Sep 2024 14:39:18 +0500 Subject: [PATCH 14/18] feat/[de,pe,se,pdfe]: header jumping on change tabs --- apps/documenteditor/main/resources/less/filemenu.less | 2 ++ apps/pdfeditor/main/resources/less/filemenu.less | 2 ++ apps/presentationeditor/main/resources/less/leftmenu.less | 5 +++-- apps/spreadsheeteditor/main/resources/less/leftmenu.less | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index b8f9153a15..71124bd726 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -205,6 +205,8 @@ .header { .font-size-very-huge(); + height: unset; + line-height: unset; } table { diff --git a/apps/pdfeditor/main/resources/less/filemenu.less b/apps/pdfeditor/main/resources/less/filemenu.less index 3ca87d9833..3ce60a5de8 100644 --- a/apps/pdfeditor/main/resources/less/filemenu.less +++ b/apps/pdfeditor/main/resources/less/filemenu.less @@ -531,6 +531,8 @@ .header { .font-size-very-huge(); + height: unset; + line-height: unset; } table { diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index ba1485ac84..c3488b936b 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -177,8 +177,7 @@ } } - #panel-settings, - #panel-info { + #panel-settings { padding: 0; display: flex; flex-direction: column; @@ -517,6 +516,8 @@ .header { .font-size-very-huge(); + height: unset; + line-height: unset; } table { diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 7d34cbaa26..ae55a69960 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -185,6 +185,8 @@ .header { .font-size-very-huge(); + height: unset; + line-height: unset; } table { From 7610f5aba6142186c62b8bbaeeece2e1b089b157 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 19 Sep 2024 17:39:52 +0500 Subject: [PATCH 15/18] fix/pdfe: scroller --- apps/pdfeditor/main/app/view/FileMenuPanels.js | 4 +--- apps/pdfeditor/main/resources/less/filemenu.less | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/pdfeditor/main/app/view/FileMenuPanels.js b/apps/pdfeditor/main/app/view/FileMenuPanels.js index 69cb53a21e..41c0e823cf 100644 --- a/apps/pdfeditor/main/app/view/FileMenuPanels.js +++ b/apps/pdfeditor/main/app/view/FileMenuPanels.js @@ -1376,7 +1376,6 @@ define([], function () { }); this.btnApply.on('click', _.bind(this.applySettings, this)); - this.pnlInfo = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlApply = $markup.findById('#fms-flex-apply'); this.rendered = true; @@ -1386,7 +1385,7 @@ define([], function () { this.$el = $(node).html($markup); if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ - el: this.pnlInfo, + el: this.$el, suppressScrollX: true, alwaysVisibleY: true }); @@ -1419,7 +1418,6 @@ define([], function () { updateScroller: function(destroy) { if (this.scroller) { this.scroller.update(destroy ? {} : undefined); - this.pnlInfo.toggleClass('bordered', this.scroller.isVisible()); } }, diff --git a/apps/pdfeditor/main/resources/less/filemenu.less b/apps/pdfeditor/main/resources/less/filemenu.less index 3ce60a5de8..a73947587b 100644 --- a/apps/pdfeditor/main/resources/less/filemenu.less +++ b/apps/pdfeditor/main/resources/less/filemenu.less @@ -59,7 +59,7 @@ .header { .font-size-very-huge(); - margin-bottom: 20px; + margin-bottom: 30px; } .format-items { @@ -198,7 +198,7 @@ #panel-settings { .header { - margin: 30px 0 16px 30px; + margin: 30px 0 18px 30px; .font-size-very-huge(); .rtl & { margin: 30px 30px 16px 0; @@ -287,7 +287,7 @@ padding: 0 0 0 10px; white-space: nowrap; margin-top: 30px; - margin-bottom: 20px; + margin-bottom: 30px; .rtl & { padding: 0 10px 10px 0; From e3cd8fed1584b90463fe9c3b2c7a7a8083482bdf Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 19 Sep 2024 19:29:37 +0500 Subject: [PATCH 16/18] fix/[de,pe,se,pdfe]: fix nameValidator and set common label max-lines to 2 --- .../main/app/view/FileMenuPanels.js | 4 ++-- .../main/resources/less/filemenu.less | 19 +++++++++---------- .../main/resources/less/filemenu.less | 13 +++---------- .../main/app/view/FileMenuPanels.js | 4 ++-- .../main/resources/less/leftmenu.less | 19 +++++++++---------- .../main/app/view/FileMenuPanels.js | 4 ++-- .../main/resources/less/leftmenu.less | 19 +++++++++---------- 7 files changed, 36 insertions(+), 46 deletions(-) diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 5ecb67831a..310f8591ef 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -2017,7 +2017,7 @@ define([], function () { value: value }, nameValidator: function(newName) { - if (newName !== name && _.some(properties, function (prop) { return prop.name === newName; })) { + if (newName !== name && _.some(properties, function (prop) { return prop.asc_getName() === newName; })) { return me.txtPropertyTitleConflictError; } @@ -2089,7 +2089,7 @@ define([], function () { lang: me.mode.lang, nameValidator: function(newName) { var properties = me.api.asc_getAllCustomProperties(); - if (_.some(properties, function (prop) { return prop.name === newName; })) { + if (_.some(properties, function (prop) { return prop.asc_getName() === newName; })) { return me.txtPropertyTitleConflictError; } diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index 71124bd726..74905b5dff 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -219,15 +219,14 @@ gap: 24px; td { - font-size: 11px; + .font-size-normal(); line-height: 16px; - height: 16px; &.title { line-height: 20px; - height: 20px; + label { - font-size: 14px; + .font-size-huge(); font-weight: 700; } } @@ -235,12 +234,6 @@ &.left { width: 140px; flex-shrink: 0; - - label { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - } } &.right { @@ -272,6 +265,12 @@ td.left { display: flex; align-items: center; + + label { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } } } } diff --git a/apps/pdfeditor/main/resources/less/filemenu.less b/apps/pdfeditor/main/resources/less/filemenu.less index a73947587b..d4d772a643 100644 --- a/apps/pdfeditor/main/resources/less/filemenu.less +++ b/apps/pdfeditor/main/resources/less/filemenu.less @@ -545,15 +545,14 @@ gap: 24px; td { - font-size: 11px; + .font-size-normal(); line-height: 16px; - height: 16px; &.title { line-height: 20px; - height: 20px; + label { - font-size: 14px; + .font-size-huge(); font-weight: 700; } } @@ -561,12 +560,6 @@ &.left { width: 140px; flex-shrink: 0; - - label { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - } } &.right { diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index a8f512006e..5271bcaa7d 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1505,7 +1505,7 @@ define([], function () { value: value }, nameValidator: function(newName) { - if (newName !== name && _.some(properties, function (prop) { return prop.name === newName; })) { + if (newName !== name && _.some(properties, function (prop) { return prop.asc_getName() === newName; })) { return me.txtPropertyTitleConflictError; } @@ -1536,7 +1536,7 @@ define([], function () { lang: me.mode.lang, nameValidator: function(newName) { var properties = me.api.asc_getAllCustomProperties(); - if (_.some(properties, function (prop) { return prop.name === newName; })) { + if (_.some(properties, function (prop) { return prop.asc_getName() === newName; })) { return me.txtPropertyTitleConflictError; } diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index c3488b936b..9a0e9a3b3a 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -530,15 +530,14 @@ gap: 24px; td { - font-size: 11px; + .font-size-normal(); line-height: 16px; - height: 16px; &.title { line-height: 20px; - height: 20px; + label { - font-size: 14px; + .font-size-huge(); font-weight: 700; } } @@ -546,12 +545,6 @@ &.left { width: 140px; flex-shrink: 0; - - label { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - } } &.right { @@ -583,6 +576,12 @@ td.left { display: flex; align-items: center; + + label { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } } } } diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 8273bd373c..4811153acf 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -2015,7 +2015,7 @@ define([], function () { value: value }, nameValidator: function(newName) { - if (newName !== name && _.some(properties, function (prop) { return prop.name === newName; })) { + if (newName !== name && _.some(properties, function (prop) { return prop.asc_getName() === newName; })) { return me.txtPropertyTitleConflictError; } @@ -2046,7 +2046,7 @@ define([], function () { lang: me.mode.lang, nameValidator: function(newName) { var properties = me.api.asc_getAllCustomProperties(); - if (_.some(properties, function (prop) { return prop.name === newName; })) { + if (_.some(properties, function (prop) { return prop.asc_getName() === newName; })) { return me.txtPropertyTitleConflictError; } diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index ae55a69960..efca6933fc 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -199,15 +199,14 @@ gap: 24px; td { - font-size: 11px; + .font-size-normal(); line-height: 16px; - height: 16px; &.title { line-height: 20px; - height: 20px; + label { - font-size: 14px; + .font-size-huge(); font-weight: 700; } } @@ -215,12 +214,6 @@ &.left { width: 140px; flex-shrink: 0; - - label { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - } } &.right { @@ -252,6 +245,12 @@ td.left { display: flex; align-items: center; + + label { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } } } } From 032ec876687fe0ae41366c97e2788fcf97d39aec Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 19 Sep 2024 20:11:28 +0500 Subject: [PATCH 17/18] fix/[de,pe,se,pdfe]: rtl --- apps/documenteditor/main/resources/less/filemenu.less | 2 +- apps/pdfeditor/main/resources/less/filemenu.less | 2 +- apps/presentationeditor/main/resources/less/leftmenu.less | 2 +- apps/spreadsheeteditor/main/resources/less/leftmenu.less | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index 74905b5dff..88dd527a88 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -333,7 +333,7 @@ margin: 30px 0 18px 30px; .font-size-very-huge(); .rtl & { - margin: 30px 30px 16px 0; + margin: 30px 30px 18px 0; } } diff --git a/apps/pdfeditor/main/resources/less/filemenu.less b/apps/pdfeditor/main/resources/less/filemenu.less index d4d772a643..f95520085a 100644 --- a/apps/pdfeditor/main/resources/less/filemenu.less +++ b/apps/pdfeditor/main/resources/less/filemenu.less @@ -201,7 +201,7 @@ margin: 30px 0 18px 30px; .font-size-very-huge(); .rtl & { - margin: 30px 30px 16px 0; + margin: 30px 30px 18px 0; } } diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 9a0e9a3b3a..e40513318f 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -188,7 +188,7 @@ margin: 30px 0 18px 30px; .font-size-very-huge(); .rtl & { - margin: 30px 30px 16px 0; + margin: 30px 30px 18px 0; } } diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index efca6933fc..5d6a613446 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -317,7 +317,7 @@ margin: 30px 0 18px 30px; .font-size-very-huge(); .rtl & { - margin: 30px 30px 16px 0; + margin: 30px 30px 18px 0; } } From d412b1aaa018a0b1fafc5106554d5f22cf4f2c04 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 19 Sep 2024 20:26:37 +0500 Subject: [PATCH 18/18] fix/[de,pe,se]: translations --- apps/documenteditor/main/locale/en.json | 2 +- apps/presentationeditor/main/locale/en.json | 4 ++-- apps/spreadsheeteditor/main/locale/en.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index bbe52492ee..47a31994c9 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -837,7 +837,7 @@ "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumber": "Number", "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumberInvalid": "Provide a valid number", "Common.Views.DocumentPropertyDialog.txtPropertyTypeDate": "Date", - "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"no\"", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"No\"", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanTrue": "Yes", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanFalse": "No", "Common.Views.DocumentPropertyDialog.errorDate": "You can choose a value from the calendar to store the value as Date.
If you enter a value manually, it will be stored as Text.", diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 53709cfaf8..bc66ebc14f 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -900,7 +900,7 @@ "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumber": "Number", "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumberInvalid": "Provide a valid number", "Common.Views.DocumentPropertyDialog.txtPropertyTypeDate": "Date", - "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"no\"", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"No\"", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanTrue": "Yes", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanFalse": "No", "Common.Views.DocumentPropertyDialog.errorDate": "You can choose a value from the calendar to store the value as Date.
If you enter a value manually, it will be stored as Text.", @@ -2048,7 +2048,7 @@ "PE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Title", "PE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded", "PE.Views.FileMenuPanels.DocumentInfo.txtYes": "Yes", - "PE.Views.FileMenuPanels.DocumentInfo.txtNo": "Yes", + "PE.Views.FileMenuPanels.DocumentInfo.txtNo": "No", "PE.Views.FileMenuPanels.DocumentInfo.txtCommon": "Common", "PE.Views.FileMenuPanels.DocumentInfo.txtProperties": "Properties", "PE.Views.FileMenuPanels.DocumentInfo.txtDocumentPropertyUpdateTitle": "Document Property", diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index ee0826f364..ccf236c2c9 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -759,7 +759,7 @@ "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumber": "Number", "Common.Views.DocumentPropertyDialog.txtPropertyTypeNumberInvalid": "Provide a valid number", "Common.Views.DocumentPropertyDialog.txtPropertyTypeDate": "Date", - "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"no\"", + "Common.Views.DocumentPropertyDialog.txtPropertyTypeBoolean": "\"Yes\" or \"No\"", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanTrue": "Yes", "Common.Views.DocumentPropertyDialog.txtPropertyBooleanFalse": "No", "Common.Views.DocumentPropertyDialog.errorDate": "You can choose a value from the calendar to store the value as Date.
If you enter a value manually, it will be stored as Text.", @@ -2655,7 +2655,7 @@ "SSE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Title", "SSE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded", "SSE.Views.FileMenuPanels.DocumentInfo.txtYes": "Yes", - "SSE.Views.FileMenuPanels.DocumentInfo.txtNo": "Yes", + "SSE.Views.FileMenuPanels.DocumentInfo.txtNo": "No", "SSE.Views.FileMenuPanels.DocumentInfo.txtCommon": "Common", "SSE.Views.FileMenuPanels.DocumentInfo.txtProperties": "Properties", "SSE.Views.FileMenuPanels.DocumentInfo.txtDocumentPropertyUpdateTitle": "Document Property",