From 0a63cde13f491fa0c3068342cc6ff59ed4e64a87 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 12 Apr 2022 13:23:45 +0300 Subject: [PATCH 001/179] [DE] Add roles manager --- .../main/app/view/RolesManagerDlg.js | 347 ++++++++++++++++++ 1 file changed, 347 insertions(+) create mode 100644 apps/documenteditor/main/app/view/RolesManagerDlg.js diff --git a/apps/documenteditor/main/app/view/RolesManagerDlg.js b/apps/documenteditor/main/app/view/RolesManagerDlg.js new file mode 100644 index 000000000..a7e6fb344 --- /dev/null +++ b/apps/documenteditor/main/app/view/RolesManagerDlg.js @@ -0,0 +1,347 @@ +/* + * + * (c) Copyright Ascensio System SIA 2010-2022 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * +*/ +/** + * + * RolesManagerDlg.js + * + * Created by Julia.Radzhabova on 12.04.22 + * Copyright (c) 2022 Ascensio System SIA. All rights reserved. + * + */ + +define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', + 'common/main/lib/view/AdvancedSettingsWindow', + 'common/main/lib/component/ListView' +], function (contentTemplate) { + 'use strict'; + + DE.Views = DE.Views || {}; + + DE.Views.RolesManagerDlg = Common.Views.AdvancedSettingsWindow.extend(_.extend({ + options: { + alias: 'RolesManagerDlg', + contentWidth: 525, + height: 353, + buttons: null + }, + + initialize: function (options) { + var me = this; + _.extend(this.options, { + title: this.txtTitle, + template: [ + '
', + '
' + _.template(contentTemplate)({scope: this}) + '
', + '
', + '
', + '' + ].join('') + }, options); + + this.api = options.api; + this.handler = options.handler; + this.props = options.props; + + this.rolesStore = new Common.UI.DataViewStore(); + + this.wrapEvents = { + onRefreshRolesList: _.bind(this.onRefreshRolesList, this) + }; + + Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); + }, + render: function () { + Common.Views.AdvancedSettingsWindow.prototype.render.call(this); + var me = this; + + this.rolesList = new Common.UI.ListView({ + el: $('#name-manager-range-list', this.$window), + store: new Common.UI.DataViewStore(), + simpleAddMode: true, + emptyText: this.textEmpty, + itemTemplate: _.template([ + '
', + '
">
', + '
<%= Common.Utils.String.htmlEncode(name) %>
', + '
<%= scopeName %>
', + '
<%= range %>
', + '<% if (lock) { %>', + '
<%=lockuser%>
', + '<% } %>', + '
' + ].join('')), + tabindex: 1 + }); + this.rolesList.store.comparator = function(item1, item2) { + var n1 = item1.get(me.sort.type).toLowerCase(), + n2 = item2.get(me.sort.type).toLowerCase(); + if (n1==n2) return 0; + return (n10) ? this.textnoNames : this.textEmpty); + } + + var me = this, + store = this.rolesList.store, + models = this.rolesStore.models, + val = this.cmbFilter.getValue(), + isTableFilter = (val<3) ? (val==2) : -1, + isWorkbook = (val>2) ? (val==4) : -1; + if (val>0) + models = this.rolesStore.filter(function(item) { + if (isTableFilter!==-1) + return (isTableFilter===item.get('isTable')); + if (isWorkbook!==-1) + return (isWorkbook===(item.get('scope')===null)); + return false; + }); + + store.reset(models, {silent: false}); + + val = store.length; + this.btnEditRole.setDisabled(!val); + this.btnDeleteRole.setDisabled(!val); + if (val>0) { + if (selectedItem===undefined || selectedItem===null) selectedItem = 0; + if (_.isNumber(selectedItem)) { + if (selectedItem>val-1) selectedItem = val-1; + this.rangeList.selectByIndex(selectedItem); + setTimeout(function() { + me.rangeList.scrollToRecord(store.at(selectedItem)); + }, 50); + + } else if (selectedItem){ // object + var rec = store.findWhere({name: selectedItem.asc_getName(true), scope: selectedItem.asc_getScope()}); + if (rec) { + this.rangeList.selectRecord(rec); + setTimeout(function() { + me.rangeList.scrollToRecord(rec); + }, 50); + } + } + + if (this.userTooltip===true && this.rangeList.cmpEl.find('.lock-user').length>0) + this.rangeList.cmpEl.on('mouseover', _.bind(me.onMouseOverLock, me)).on('mouseout', _.bind(me.onMouseOutLock, me)); + } + _.delay(function () { + me.rangeList.scroller.update({alwaysVisibleY: true}); + }, 100, this); + }, + + onEditRange: function (isEdit) { + if (this._isWarningVisible) return; + + if (this.locked) { + Common.NotificationCenter.trigger('namedrange:locked'); + return; + } + var me = this, + xy = me.$window.offset(), + rec = this.rangeList.getSelectedRec(), + idx = _.indexOf(this.rangeList.store.models, rec), + oldname = (isEdit && rec) ? new Asc.asc_CDefName(rec.get('name'), rec.get('range'), rec.get('scope'), rec.get('type'), undefined, undefined, undefined, true) : null; + + var win = new SSE.Views.NamedRangeEditDlg({ + api: me.api, + sheets : this.sheets, + props : (isEdit) ? oldname : this.props, + isEdit : isEdit, + handler : function(result, settings) { + if (result == 'ok' && settings) { + if (isEdit) { + me.currentNamedRange = settings; + me.api.asc_editDefinedNames(oldname, settings); + } else { + me.cmbFilter.setValue(0); + me.currentNamedRange = settings; + me.api.asc_setDefinedNames(settings); + } + } + } + }).on('close', function() { + me.show(); + setTimeout(function(){ me.getDefaultFocusableComponent().focus(); }, 100); + }); + + me.hide(); + win.show(xy.left + 65, xy.top + 77); + }, + + onDeleteRange: function () { + var rec = this.rangeList.getSelectedRec(); + if (rec) { + var me = this; + me._isWarningVisible = true; + Common.UI.warning({ + msg: Common.Utils.String.format(me.warnDelete, rec.get('name')), + buttons: ['ok', 'cancel'], + callback: function(btn) { + if (btn == 'ok') { + me.currentNamedRange = _.indexOf(me.rangeList.store.models, rec); + me.api.asc_delDefinedNames(new Asc.asc_CDefName(rec.get('name'), rec.get('range'), rec.get('scope'), rec.get('type'), undefined, undefined, undefined, true)); + } + setTimeout(function(){ me.getDefaultFocusableComponent().focus(); }, 100); + me._isWarningVisible = false; + } + }); + } + }, + + getSettings: function() { + return this.sort; + }, + + onPrimary: function() { + return true; + }, + + onDlgBtnClick: function(event) { + this.handler && this.handler.call(this, event.currentTarget.attributes['result'].value); + this.close(); + }, + + onSelectRoleItem: function(lisvView, itemView, record) { + if (!record) return; + + this.userTipHide(); + var rawData = {}, + isViewSelect = _.isFunction(record.toJSON); + + if (isViewSelect){ + if (record.get('selected')) { + rawData = record.toJSON(); + } else {// record deselected + return; + } + this.currentNamedRange = _.indexOf(this.rangeList.store.models, record); + this.btnEditRange.setDisabled(rawData.lock); + this.btnDeleteRange.setDisabled(rawData.lock || rawData.isTable || rawData.isSlicer); + } + }, + + hide: function () { + this.userTipHide(); + Common.UI.Window.prototype.hide.call(this); + }, + + close: function () { + this.userTipHide(); + this.api.asc_unregisterCallback('asc_onRefreshRolesList', this.wrapEvents.onRefreshRolesList); + + Common.UI.Window.prototype.close.call(this); + }, + + onKeyDown: function (lisvView, record, e) { + if (e.keyCode==Common.UI.Keys.DELETE && !this.btnDeleteRange.isDisabled()) + this.onDeleteRange(); + }, + + onDblClickItem: function (lisvView, record, e) { + if (!this.btnEditRole.isDisabled()) + this.onEditRole(true); + }, + + txtTitle: 'Manage Roles', + closeButtonText : 'Close', + textNew: 'New', + textEdit: 'Edit', + textDelete: 'Delete', + textEmpty: 'No named ranges have been created yet.
Create at least one named range and it will appear in this field.', + warnDelete: 'Are you sure you want to delete the role {0}?' + + }, DE.Views.RolesManagerDlg || {})); +}); \ No newline at end of file From 726c0fe6ef6b93e0bfb45e32304db43f66a28c65 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 13 Apr 2022 22:35:41 +0300 Subject: [PATCH 002/179] [DE] Change Forms tab and Roles manager according to layout --- .../less/advanced-settings-window.less | 37 ++++ .../main/app/controller/FormsTab.js | 27 ++- .../app/template/RolesManagerDlg.template | 27 +++ apps/documenteditor/main/app/view/FormsTab.js | 160 +++++++++--------- .../main/app/view/RolesManagerDlg.js | 151 +++++++++-------- .../resources/less/advanced-settings.less | 36 ---- 6 files changed, 255 insertions(+), 183 deletions(-) create mode 100644 apps/documenteditor/main/app/template/RolesManagerDlg.template diff --git a/apps/common/main/resources/less/advanced-settings-window.less b/apps/common/main/resources/less/advanced-settings-window.less index 49085e69c..bd448746e 100644 --- a/apps/common/main/resources/less/advanced-settings-window.less +++ b/apps/common/main/resources/less/advanced-settings-window.less @@ -52,4 +52,41 @@ padding-right: 30px; } } + + .range-tableview { + .list-item > div{ + vertical-align: middle; + display: inline-block; + text-overflow: ellipsis; + overflow: hidden; + white-space: pre; + } + + .listitem-icon { + width: 20px; + height: 20px; + vertical-align: middle; + margin-right: 5px; + } + + .selected { + .listitem-icon { + background-position-x: -20px; + background-position-x: @button-small-active-icon-offset-x; + } + } + + .lock-user { + position: absolute; + right: 2px; + min-width: 100px; + max-width: 150px; + height: 20px; + padding: 2px 10px; + background-color: #EE3525; + color: #fff; + text-align: center; + } + } + } \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 49e71d3ae..adfed2b58 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -41,7 +41,8 @@ define([ 'core', - 'documenteditor/main/app/view/FormsTab' + 'documenteditor/main/app/view/FormsTab', + 'documenteditor/main/app/view/RolesManagerDlg' ], function () { 'use strict'; @@ -66,7 +67,7 @@ define([ this.api.asc_registerCallback('asc_onFocusObject', this.onApiFocusObject.bind(this)); this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); - this.api.asc_registerCallback('asc_onChangeSpecialFormsGlobalSettings', _.bind(this.onChangeSpecialFormsGlobalSettings, this)); + // this.api.asc_registerCallback('asc_onChangeSpecialFormsGlobalSettings', _.bind(this.onChangeSpecialFormsGlobalSettings, this)); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); this.api.asc_registerCallback('asc_onStartAction', _.bind(this.onLongActionBegin, this)); this.api.asc_registerCallback('asc_onEndAction', _.bind(this.onLongActionEnd, this)); @@ -90,12 +91,13 @@ define([ 'FormsTab': { 'forms:insert': this.onControlsSelect, 'forms:clear': this.onClearClick, - 'forms:no-color': this.onNoControlsColor, - 'forms:select-color': this.onSelectControlsColor, + // 'forms:no-color': this.onNoControlsColor, + // 'forms:select-color': this.onSelectControlsColor, 'forms:mode': this.onModeClick, 'forms:goto': this.onGoTo, 'forms:submit': this.onSubmitClick, - 'forms:save': this.onSaveFormClick + 'forms:save': this.onSaveFormClick, + 'forms:manager': this.onManagerClick }, 'Toolbar': { 'tab:active': this.onActiveTab @@ -195,6 +197,7 @@ define([ onModeClick: function(state) { if (this.api) { this.disableEditing(state); + this.view && this.view.setPreviewMode(state); this.api.asc_setRestriction(state ? Asc.c_oAscRestrictionType.OnlyForms : Asc.c_oAscRestrictionType.None); this.api.asc_SetPerformContentControlActionByClick(state); this.api.asc_SetHighlightRequiredFields(state); @@ -412,6 +415,20 @@ define([ } }, + onManagerClick: function() { + var me = this; + (new DE.Views.RolesManagerDlg({ + api: me.api, + handler: function(result) { + Common.component.Analytics.trackEvent('ToolBar', 'Roles Manager'); + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + }, + roles: [], + props : undefined + })).on('close', function(win){ + }).show(); + }, + onActiveTab: function(tab) { if (tab !== 'forms') { this.tipSaveForm && this.tipSaveForm.close(); diff --git a/apps/documenteditor/main/app/template/RolesManagerDlg.template b/apps/documenteditor/main/app/template/RolesManagerDlg.template new file mode 100644 index 000000000..345fc1bb1 --- /dev/null +++ b/apps/documenteditor/main/app/template/RolesManagerDlg.template @@ -0,0 +1,27 @@ +
+
+ + + + + + + + + + + +
+ + +
+
+
+
+
+ + + +
+
+
\ No newline at end of file diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index 9498a7b43..c611cd109 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -49,7 +49,7 @@ define([ DE.Views.FormsTab = Common.UI.BaseView.extend(_.extend((function(){ var template = '
' + - '' + '
' + '
' + - '' + + '' + '
' + '
' + - '' + + '' + '
' + '
' + '
' + diff --git a/apps/presentationeditor/main/resources/less/advanced-settings.less b/apps/presentationeditor/main/resources/less/advanced-settings.less index 7d3cf7c5f..1e1239e46 100644 --- a/apps/presentationeditor/main/resources/less/advanced-settings.less +++ b/apps/presentationeditor/main/resources/less/advanced-settings.less @@ -3,7 +3,7 @@ padding: 0 15px; text-align: right; .font-weight-bold(); - font-size: 11px; + .font-size-normal(); } } diff --git a/apps/presentationeditor/main/resources/less/app.less b/apps/presentationeditor/main/resources/less/app.less index f3ed4c565..eed12b56f 100644 --- a/apps/presentationeditor/main/resources/less/app.less +++ b/apps/presentationeditor/main/resources/less/app.less @@ -147,16 +147,33 @@ @import "sprites/iconssmall@1.75x"; @import "sprites/iconsbig@1.75x"; +.font-size-tiny { + .fontsize(9px); // 9px + .fontsize(calc(@font-size-base-app - 2px)); // 9px +} + .font-size-small { - .fontsize(@font-size-small); + .fontsize(10px); // 10px + .fontsize(calc(@font-size-base-app - 1px)); // 10px } .font-size-normal { - .fontsize(@font-size-base); + .fontsize(@font-size-base-app); // 11px +} + +.font-size-medium { + .fontsize(12px); // 12px + .fontsize(calc(@font-size-base-app + 1px)); // 12px } .font-size-large { - .fontsize(@font-size-large); + .fontsize(13px); // 13px + .fontsize(calc(@font-size-base-app + 2px)); // 13px +} + +.font-size-huge { + .fontsize(14px); // 14px + .fontsize(calc(@font-size-base-app + 3px)); // 14px } .slidenum-div { diff --git a/apps/presentationeditor/main/resources/less/document-preview.less b/apps/presentationeditor/main/resources/less/document-preview.less index 97729c3db..81733da17 100644 --- a/apps/presentationeditor/main/resources/less/document-preview.less +++ b/apps/presentationeditor/main/resources/less/document-preview.less @@ -19,7 +19,8 @@ } #preview-label-slides { - font: bold 11px Helvetica, Arial, Verdana, sans-serif; + //font: bold 11px Helvetica, Arial, Verdana, sans-serif; + .font-size-normal(); color: @text-normal-ie; color: @text-normal; text-shadow: none; diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 15f97642c..5ca7eee69 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -158,7 +158,8 @@ &:extend(.dropdown-menu > li > a); padding-top: 4px; cursor: pointer; - font-size: 13px; + //font-size: 13px; + .font-size-large(); &:hover { text-decoration: none; @@ -216,15 +217,19 @@ tr { td { + label{ + .font-size-normal(); + } + padding: 6px 10px; width: auto !important; &.group-name label { - font-size: 14px; + //font-size: 14px; + .font-size-huge(); .font-weight-bold(); } &.subgroup-name label{ - font-size: 11px; .font-weight-bold(); } @@ -237,7 +242,7 @@ label { .font-weight-bold(); - font-size: 12px; + .font-size-medium(); } } @@ -307,7 +312,7 @@ .title { width: 104px; - font-size: 12px; + .font-size-medium(); line-height: 14px; height: 28px; margin: 8px 8px 12px 8px; @@ -345,7 +350,7 @@ .recent-wrap { padding: 5px 10px; cursor: pointer; - font-size: 12px; + .font-size-medium(); &:hover, &.over { @@ -403,7 +408,8 @@ width: 100%; .box-shadow(none); margin: 0; - font-size: 12px; + //font-size: 12px; + .font-size-medium(); float: none; &:not(.header-name) { @@ -482,7 +488,8 @@ } label, span { - font-size: 12px; + //font-size: 12px; + .font-size-medium(); } .tool { @@ -504,7 +511,8 @@ #panel-protect { label { - font-size: 12px; + //font-size: 12px; + .font-size-medium(); } padding: 30px 30px; diff --git a/apps/presentationeditor/main/resources/less/statusbar.less b/apps/presentationeditor/main/resources/less/statusbar.less index 06767765a..41ad296ec 100644 --- a/apps/presentationeditor/main/resources/less/statusbar.less +++ b/apps/presentationeditor/main/resources/less/statusbar.less @@ -114,7 +114,8 @@ margin-left: 142px; margin-bottom: 2px; width: 285px; - font-size: 12px; + //font-size: 12px; + .font-size-medium(); > label { white-space: normal; diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index 80129babc..70f5531da 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -83,7 +83,8 @@ border-radius: 0; padding: 3px 10px; color: #fff; - font: 11px arial; + //font: 11px arial; + .font-size-normal(); white-space: nowrap; letter-spacing: 1px; overflow: hidden; diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 04c77976e..42cb1f833 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -382,6 +382,10 @@ define([ Common.localStorage.getItem("guest-id") || ('uid-' + Date.now())); this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); + if (this.appOptions.customization.font) { + this.appOptions.customization.font.size && document.documentElement.style.setProperty("--font-size-base-app-custom", this.appOptions.customization.font.size); + } + this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp; @@ -1125,7 +1129,8 @@ define([ }); } } else if (!this.appOptions.isDesktopApp && !this.appOptions.canBrandingExt && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && - this.editorConfig && this.editorConfig.customization && (this.editorConfig.customization.loaderName || this.editorConfig.customization.loaderLogo)) { + this.editorConfig && this.editorConfig.customization && (this.editorConfig.customization.loaderName || this.editorConfig.customization.loaderLogo || + this.editorConfig.customization.font && this.editorConfig.customization.font.size)) { Common.UI.warning({ title: this.textPaidFeature, msg : this.textCustomLoader, diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index 999a30728..0f5683162 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -64,7 +64,7 @@ define([ '' + '' + '
' + - '' + + '' + '
' + '' + '
' + diff --git a/apps/spreadsheeteditor/main/resources/less/advanced-settings.less b/apps/spreadsheeteditor/main/resources/less/advanced-settings.less index eaa2ab0f4..485d9c8fc 100644 --- a/apps/spreadsheeteditor/main/resources/less/advanced-settings.less +++ b/apps/spreadsheeteditor/main/resources/less/advanced-settings.less @@ -3,7 +3,7 @@ padding: 0 0 0 10px; text-align: right; .font-weight-bold(); - font-size: 11px; + .font-size-normal(); white-space: nowrap; } diff --git a/apps/spreadsheeteditor/main/resources/less/app.less b/apps/spreadsheeteditor/main/resources/less/app.less index 635889f84..04228b590 100644 --- a/apps/spreadsheeteditor/main/resources/less/app.less +++ b/apps/spreadsheeteditor/main/resources/less/app.less @@ -149,16 +149,33 @@ @import "sprites/iconssmall@1.75x"; @import "sprites/iconsbig@1.75x"; +.font-size-tiny { + .fontsize(9px); // 9px + .fontsize(calc(@font-size-base-app - 2px)); // 9px +} + .font-size-small { - .fontsize(@font-size-small); + .fontsize(10px); // 10px + .fontsize(calc(@font-size-base-app - 1px)); // 10px } .font-size-normal { - .fontsize(@font-size-base); + .fontsize(@font-size-base-app); // 11px +} + +.font-size-medium { + .fontsize(12px); // 12px + .fontsize(calc(@font-size-base-app + 1px)); // 12px } .font-size-large { - .fontsize(@font-size-large); + .fontsize(13px); // 13px + .fontsize(calc(@font-size-base-app + 2px)); // 13px +} + +.font-size-huge { + .fontsize(14px); // 14px + .fontsize(calc(@font-size-base-app + 3px)); // 14px } // Skeleton of workbook diff --git a/apps/spreadsheeteditor/main/resources/less/celleditor.less b/apps/spreadsheeteditor/main/resources/less/celleditor.less index 26980a101..18131ebbf 100644 --- a/apps/spreadsheeteditor/main/resources/less/celleditor.less +++ b/apps/spreadsheeteditor/main/resources/less/celleditor.less @@ -105,7 +105,8 @@ resize: none; min-height: 19px; border: 0 none; - font-size: 12px; + //font-size: 12px; + .font-size-medium(); line-height: 18px; padding-bottom: 0; diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 33193e4a0..17cf9f4db 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -143,7 +143,8 @@ &:extend(.dropdown-menu > li > a); padding-top: 4px; cursor: pointer; - font-size: 13px; + //font-size: 13px; + .font-size-large(); &:hover { text-decoration: none; @@ -210,7 +211,8 @@ width: 100%; .box-shadow(none); margin: 0; - font-size: 12px; + //font-size: 12px; + .font-size-medium(); .settings-item-wrap { padding: 4px 2px 4px 20px; @@ -246,15 +248,19 @@ width: auto !important; tr { td { + label{ + .font-size-normal(); + } + //padding: 5px 10px; padding: 6px 10px; &.group-name label { - font-size: 14px; + //font-size: 14px; + .font-size-huge(); .font-weight-bold(); } &.subgroup-name label{ - font-size: 11px; .font-weight-bold(); } @@ -268,7 +274,8 @@ label { .font-weight-bold(); - font-size: 12px; + .font-size-medium(); + //font-size: 12px; } } @@ -362,7 +369,8 @@ .title { width: 104px; - font-size: 12px; + //font-size: 12px; + .font-size-medium(); line-height: 14px; height: 28px; margin: 8px 8px 12px 8px; @@ -400,7 +408,8 @@ .recent-wrap { padding: 5px 10px; cursor: pointer; - font-size: 12px; + //font-size: 12px; + .font-size-medium(); &:hover, &.over { @@ -458,7 +467,8 @@ width: 100%; .box-shadow(none); margin: 0; - font-size: 12px; + //font-size: 12px; + .font-size-medium(); float: none; &:not(.header-name) { @@ -537,7 +547,8 @@ } label, span { - font-size: 12px; + //font-size: 12px; + .font-size-medium(); } .tool { @@ -559,7 +570,8 @@ #panel-protect { label { - font-size: 12px; + //font-size: 12px; + .font-size-medium(); } padding: 30px 30px; @@ -610,8 +622,11 @@ flex-direction: column; border-right: @scaled-one-px-value-ie solid @border-toolbar-ie; border-right: @scaled-one-px-value solid @border-toolbar; - label.header { - font-weight: 700; + label { + .font-size-normal(); + &.header { + font-weight: 700; + } } .footer { .btn.primary { diff --git a/apps/spreadsheeteditor/main/resources/less/spellcheck.less b/apps/spreadsheeteditor/main/resources/less/spellcheck.less index 2f7f4cebf..0420be3fe 100644 --- a/apps/spreadsheeteditor/main/resources/less/spellcheck.less +++ b/apps/spreadsheeteditor/main/resources/less/spellcheck.less @@ -15,7 +15,8 @@ border-bottom: @scaled-one-px-value solid @border-toolbar; label { - font-size: 12px; + //font-size: 12px; + .font-size-medium(); .font-weight-bold(); margin-top: 2px; } @@ -29,6 +30,10 @@ padding-top: 45px; overflow: hidden; + label { + .font-size-normal(); + } + .spellcheck-settings-inner { position: relative; width: 100%; @@ -86,6 +91,7 @@ #spellcheck-complete { display: flex; + .font-size-normal(); } .btn-resolve { diff --git a/apps/spreadsheeteditor/main/resources/less/statusbar.less b/apps/spreadsheeteditor/main/resources/less/statusbar.less index ec2de36cb..4558beb39 100644 --- a/apps/spreadsheeteditor/main/resources/less/statusbar.less +++ b/apps/spreadsheeteditor/main/resources/less/statusbar.less @@ -63,7 +63,8 @@ margin-right: 160px; margin-bottom: 2px; width: 285px; - font-size: 12px; + //font-size: 12px; + .font-size-medium(); left: auto; right: 0; diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index 62385c1fd..3c5f71b15 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -68,7 +68,8 @@ border-radius: 0; padding: 3px 10px; color: #ffffff; - font: 11px arial; + //font: 11px arial; + .font-size-normal(); pointer-events: none; white-space: nowrap; letter-spacing: 1px; @@ -210,5 +211,4 @@ .box-shadow(inset 0 0 0 @scaled-two-px-value @border-preview-select) !important; } } -} - +} \ No newline at end of file From dc5241a8fd2c733ac374363c2def0150f8073785 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 11 Nov 2022 00:46:34 +0300 Subject: [PATCH 016/179] FIx components with custom font size --- apps/common/main/resources/less/combo-dataview.less | 2 +- apps/common/main/resources/less/dataview.less | 5 +++++ apps/common/main/resources/less/dropdown-menu.less | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/common/main/resources/less/combo-dataview.less b/apps/common/main/resources/less/combo-dataview.less index 846298ce1..4f0d3420a 100644 --- a/apps/common/main/resources/less/combo-dataview.less +++ b/apps/common/main/resources/less/combo-dataview.less @@ -484,7 +484,7 @@ .caption{ line-height: 12px; //font-size: 11px; - .font-size-normal(); + //.font-size-normal(); text-overflow: ellipsis; overflow: hidden; width: 100%; diff --git a/apps/common/main/resources/less/dataview.less b/apps/common/main/resources/less/dataview.less index 2c5e026cd..c0e45566a 100644 --- a/apps/common/main/resources/less/dataview.less +++ b/apps/common/main/resources/less/dataview.less @@ -1,4 +1,5 @@ .dataview { + font-size: 11px; // must be const value &.inner { width: 100%; height: 100%; @@ -48,6 +49,10 @@ } } + .group-description { + .font-size-normal(); + } + .group-items-container { overflow: hidden; margin-bottom: 5px; diff --git a/apps/common/main/resources/less/dropdown-menu.less b/apps/common/main/resources/less/dropdown-menu.less index 6a922c31c..f6bf2ae7d 100644 --- a/apps/common/main/resources/less/dropdown-menu.less +++ b/apps/common/main/resources/less/dropdown-menu.less @@ -1,6 +1,5 @@ .dropdown-menu { - .font-size-normal(); background-color: @background-normal-ie; background-color: @background-normal; border-color: @border-regular-control-ie; @@ -38,6 +37,7 @@ cursor: pointer; color: @text-normal-ie; color: @text-normal; + .font-size-normal(); &:focus, &.focus { outline: 0; From c9cf25a3a009da4c5521e5302d338bf88caf3de7 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 11 Nov 2022 01:14:29 +0300 Subject: [PATCH 017/179] Refactoring --- apps/common/main/resources/less/calendar.less | 2 -- apps/common/main/resources/less/chat.less | 5 ----- apps/common/main/resources/less/combo-border-size.less | 1 - apps/common/main/resources/less/combo-dataview.less | 2 -- apps/common/main/resources/less/comments.less | 5 ----- apps/common/main/resources/less/dimension-picker.less | 1 - .../main/resources/less/extended-color-picker.less | 2 -- apps/common/main/resources/less/header.less | 4 ---- apps/common/main/resources/less/hint-manager.less | 1 - apps/common/main/resources/less/history.less | 5 ----- apps/common/main/resources/less/loadmask.less | 1 - apps/common/main/resources/less/plugins.less | 1 - apps/common/main/resources/less/review-changes.less | 1 - apps/common/main/resources/less/searchdialog.less | 1 - apps/common/main/resources/less/synchronize-tip.less | 1 - apps/common/main/resources/less/toolbar.less | 2 -- apps/common/main/resources/less/tooltip.less | 1 - apps/common/main/resources/less/window.less | 2 -- apps/documenteditor/main/resources/less/filemenu.less | 9 --------- apps/documenteditor/main/resources/less/navigation.less | 5 ----- apps/documenteditor/main/resources/less/statusbar.less | 1 - apps/documenteditor/main/resources/less/thumbnails.less | 2 -- .../presentationeditor/main/resources/less/leftmenu.less | 5 ----- .../main/resources/less/statusbar.less | 1 - .../main/resources/less/celleditor.less | 1 - apps/spreadsheeteditor/main/resources/less/leftmenu.less | 9 --------- .../main/resources/less/spellcheck.less | 1 - .../spreadsheeteditor/main/resources/less/statusbar.less | 1 - 28 files changed, 73 deletions(-) diff --git a/apps/common/main/resources/less/calendar.less b/apps/common/main/resources/less/calendar.less index 54ea69255..7240c6053 100644 --- a/apps/common/main/resources/less/calendar.less +++ b/apps/common/main/resources/less/calendar.less @@ -83,7 +83,6 @@ width: 100%; margin: 4px 6px 3px 6px; text-align: center; - //font-size: 11px; .font-size-normal(); label { @@ -126,7 +125,6 @@ display: flex; justify-content: center; align-items: center; - //font-size: 13px; .font-size-large(); } diff --git a/apps/common/main/resources/less/chat.less b/apps/common/main/resources/less/chat.less index e313f85e1..caac2aa52 100644 --- a/apps/common/main/resources/less/chat.less +++ b/apps/common/main/resources/less/chat.less @@ -25,7 +25,6 @@ #chat-title { label { padding: 18px 20px; - //font-size: @font-size-large; .font-size-large(); } } @@ -64,7 +63,6 @@ } .name { - //font-size: 12px; .font-size-medium(); .font-weight-bold(); display: block; @@ -82,7 +80,6 @@ top: 70px; right: 0; bottom: 110px; - //font-size: 12px; .font-size-medium(); ul { @@ -108,7 +105,6 @@ .user-name { color: @text-normal-ie; color: @text-normal; - //font-size: 12px; .font-size-medium(); .font-weight-bold(); overflow: hidden; @@ -155,7 +151,6 @@ margin-bottom: 5px; border: 1px solid @border-regular-control-ie; border: 1px solid @border-regular-control; - //font-size: 12px; .font-size-medium(); &:focus { diff --git a/apps/common/main/resources/less/combo-border-size.less b/apps/common/main/resources/less/combo-border-size.less index f3aed67e2..7bb139b2f 100644 --- a/apps/common/main/resources/less/combo-border-size.less +++ b/apps/common/main/resources/less/combo-border-size.less @@ -19,7 +19,6 @@ span { display: inline-block; margin-top: 3px; - //font-size: 11px; .font-size-normal(); height: 17px; } diff --git a/apps/common/main/resources/less/combo-dataview.less b/apps/common/main/resources/less/combo-dataview.less index 4f0d3420a..dbd9da995 100644 --- a/apps/common/main/resources/less/combo-dataview.less +++ b/apps/common/main/resources/less/combo-dataview.less @@ -483,8 +483,6 @@ .caption{ line-height: 12px; - //font-size: 11px; - //.font-size-normal(); text-overflow: ellipsis; overflow: hidden; width: 100%; diff --git a/apps/common/main/resources/less/comments.less b/apps/common/main/resources/less/comments.less index d1035257e..9a9345461 100644 --- a/apps/common/main/resources/less/comments.less +++ b/apps/common/main/resources/less/comments.less @@ -19,7 +19,6 @@ border-bottom: @scaled-one-px-value solid @border-toolbar; label { - //font-size: 12px; .font-size-medium(); .font-weight-bold(); margin-top: 2px; @@ -95,7 +94,6 @@ } textarea { - //font-size: 12px; .font-size-medium(); width: 100%; resize: none; @@ -171,7 +169,6 @@ .user-name { color: @text-normal-ie; color: @text-normal; - //font-size: 12px; .font-size-medium(); .font-weight-bold(); overflow: hidden; @@ -211,7 +208,6 @@ } .user-date { - //font-size: 11px; .font-size-normal(); white-space: nowrap; padding: 0; @@ -470,7 +466,6 @@ min-width: 100px; text-align: center; cursor: pointer; - //font-size: 11px; .font-size-normal(); font-family: @font-family-base; } diff --git a/apps/common/main/resources/less/dimension-picker.less b/apps/common/main/resources/less/dimension-picker.less index 0913efe41..ca1afe73f 100644 --- a/apps/common/main/resources/less/dimension-picker.less +++ b/apps/common/main/resources/less/dimension-picker.less @@ -38,7 +38,6 @@ } .dimension-picker-status { - //font-size: 12px; .font-size-medium(); text-align: center; } \ No newline at end of file diff --git a/apps/common/main/resources/less/extended-color-picker.less b/apps/common/main/resources/less/extended-color-picker.less index ae7a286fd..bff022489 100644 --- a/apps/common/main/resources/less/extended-color-picker.less +++ b/apps/common/main/resources/less/extended-color-picker.less @@ -14,7 +14,6 @@ label { font-weight: normal; - //font-size: 12px; .font-size-medium(); margin-bottom: 0; vertical-align: middle; @@ -31,7 +30,6 @@ input { font-weight: normal; - //font-size: 12px; .font-size-medium(); background-color: @background-normal; } diff --git a/apps/common/main/resources/less/header.less b/apps/common/main/resources/less/header.less index fdd32d667..add1377a0 100644 --- a/apps/common/main/resources/less/header.less +++ b/apps/common/main/resources/less/header.less @@ -285,7 +285,6 @@ .caption { cursor: pointer; - //font-size: 9px; .font-size-tiny(); margin-left: -18px; width: 16px; @@ -396,7 +395,6 @@ padding: 14px; width: 285px; - //font-size: 12px; .font-size-medium(); z-index: 1042; @@ -447,7 +445,6 @@ .user-name { color: @text-normal-ie; color: @text-normal; - //font-size: 12px; .font-size-medium(); .font-weight-bold(); white-space: nowrap; @@ -514,7 +511,6 @@ text-overflow: ellipsis; overflow: hidden; text-align: center; - //font-size: 12px; .font-size-medium(); line-height: 24px; padding: 1px 5px; diff --git a/apps/common/main/resources/less/hint-manager.less b/apps/common/main/resources/less/hint-manager.less index 23fdf4549..6ada91183 100644 --- a/apps/common/main/resources/less/hint-manager.less +++ b/apps/common/main/resources/less/hint-manager.less @@ -9,7 +9,6 @@ background-color: @background-alt-key-hint-ie; background-color: @background-alt-key-hint; color: @text-alt-key-hint; - //font-size: 12px; .font-size-medium(); line-height: 18px; padding: 0 4px; diff --git a/apps/common/main/resources/less/history.less b/apps/common/main/resources/less/history.less index ed72ef3ac..3b3bcd74f 100644 --- a/apps/common/main/resources/less/history.less +++ b/apps/common/main/resources/less/history.less @@ -19,7 +19,6 @@ margin-top: 15px; padding-top: 4px; padding-left: 20px; - //font-size: 13px; .font-size-large(); cursor: pointer; @@ -45,7 +44,6 @@ margin-top: 8px; padding-top: 4px; padding-left: 20px; - //font-size: 13px; .font-size-large(); cursor: pointer; @@ -67,7 +65,6 @@ width: 100%; .box-shadow(none); margin: 0; - //font-size: 12px; .font-size-medium(); &:hover:not(.selected), @@ -101,7 +98,6 @@ .user-date { display: inline-block; - //font-size: 12px; .font-size-medium(); .font-weight-bold(); margin-right: 12px; @@ -131,7 +127,6 @@ width: 100%; white-space: nowrap; overflow: hidden; - //font-size: 12px; .font-size-medium(); .font-weight-bold(); cursor: pointer; diff --git a/apps/common/main/resources/less/loadmask.less b/apps/common/main/resources/less/loadmask.less index f3121563a..e94d07397 100644 --- a/apps/common/main/resources/less/loadmask.less +++ b/apps/common/main/resources/less/loadmask.less @@ -100,7 +100,6 @@ } .text { - //font-size: 14px; .font-size-huge(); } } diff --git a/apps/common/main/resources/less/plugins.less b/apps/common/main/resources/less/plugins.less index c091ef68d..19d5d8d78 100644 --- a/apps/common/main/resources/less/plugins.less +++ b/apps/common/main/resources/less/plugins.less @@ -93,7 +93,6 @@ width: 100%; margin-top: 2px; padding-right: 20px; - //font-size: 12px; .font-size-medium(); .font-weight-bold(); overflow: hidden; diff --git a/apps/common/main/resources/less/review-changes.less b/apps/common/main/resources/less/review-changes.less index ff6a94554..f5d1b8404 100644 --- a/apps/common/main/resources/less/review-changes.less +++ b/apps/common/main/resources/less/review-changes.less @@ -12,7 +12,6 @@ #id-review-button-reject { span.caption { vertical-align: middle; - //font-size: 12px; .font-size-medium(); margin: 0 6px; } diff --git a/apps/common/main/resources/less/searchdialog.less b/apps/common/main/resources/less/searchdialog.less index 5c1a93868..a5203e496 100644 --- a/apps/common/main/resources/less/searchdialog.less +++ b/apps/common/main/resources/less/searchdialog.less @@ -125,7 +125,6 @@ border-bottom: @scaled-one-px-value solid @border-toolbar; label { - //font-size: 12px; .font-size-medium(); .font-weight-bold(); margin-top: 2px; diff --git a/apps/common/main/resources/less/synchronize-tip.less b/apps/common/main/resources/less/synchronize-tip.less index 5e36eefe3..1787fa02e 100644 --- a/apps/common/main/resources/less/synchronize-tip.less +++ b/apps/common/main/resources/less/synchronize-tip.less @@ -449,7 +449,6 @@ } .box-shadow(0 4px 15px -2px rgba(0, 0, 0, 0.5)); - //font-size: 11px; .font-size-normal(); } diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less index 4d5f30d44..359cea31b 100644 --- a/apps/common/main/resources/less/toolbar.less +++ b/apps/common/main/resources/less/toolbar.less @@ -32,7 +32,6 @@ .box-tabs { height: @height-tabs; - //font-size: 12px; .font-size-medium(); display: flex; @@ -101,7 +100,6 @@ padding: 0 12px; text-decoration: none; cursor: default; - //font-size: 12px; .font-size-medium(); text-align: center; color: @text-toolbar-header-ie; diff --git a/apps/common/main/resources/less/tooltip.less b/apps/common/main/resources/less/tooltip.less index 0ffb893ce..73c0418ec 100644 --- a/apps/common/main/resources/less/tooltip.less +++ b/apps/common/main/resources/less/tooltip.less @@ -39,7 +39,6 @@ } .tooltip-inner { - //font-size: 11px; .font-size-normal(); background-color: @background-normal-ie; background-color: @background-normal; diff --git a/apps/common/main/resources/less/window.less b/apps/common/main/resources/less/window.less index ee9789881..77a2b5099 100644 --- a/apps/common/main/resources/less/window.less +++ b/apps/common/main/resources/less/window.less @@ -99,7 +99,6 @@ color: @text-normal-ie; color: @text-normal; text-align: center; - //font-size: 12px; .font-size-medium(); font-weight: 700; letter-spacing: 0.01em; @@ -220,7 +219,6 @@ padding-left: 60px; span { - //font-size: 12px; .font-size-medium(); white-space: nowrap; diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index 6f11f1413..cfbb30986 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -47,7 +47,6 @@ &:extend(.dropdown-menu > li > a); padding-top: 4px; cursor: pointer; - //font-size: 13px; .font-size-large(); &:hover { @@ -207,7 +206,6 @@ padding: 6px 10px; &.group-name label { - //font-size: 14px; .font-size-huge(); .font-weight-bold(); } @@ -226,7 +224,6 @@ width: 30%; label { .font-weight-bold(); - //font-size: 12px; .font-size-medium(); } } @@ -302,7 +299,6 @@ .title { width: 104px; - //font-size: 12px; .font-size-medium(); line-height: 14px; height: 28px; @@ -340,7 +336,6 @@ .recent-wrap { padding: 5px 10px; cursor: pointer; - //font-size: 12px; .font-size-medium(); &:hover, @@ -399,7 +394,6 @@ width: 100%; .box-shadow(none); margin: 0; - //font-size: 12px; .font-size-medium(); float: none; @@ -425,7 +419,6 @@ .header-name { padding: 16px 2px 4px 10px; - //font-size: 12px; .font-size-medium(); } } @@ -482,7 +475,6 @@ } label, span { - //font-size: 12px; .font-size-medium(); } @@ -527,7 +519,6 @@ #panel-protect { label { - //font-size: 12px; .font-size-medium(); } diff --git a/apps/documenteditor/main/resources/less/navigation.less b/apps/documenteditor/main/resources/less/navigation.less index 2f8f9a99c..06f246f4d 100644 --- a/apps/documenteditor/main/resources/less/navigation.less +++ b/apps/documenteditor/main/resources/less/navigation.less @@ -14,7 +14,6 @@ border-bottom: @scaled-one-px-value-ie solid @border-toolbar-ie; border-bottom: @scaled-one-px-value solid @border-toolbar; label { - //font-size: 12px; .font-size-medium(); .font-weight-bold(); margin-top: 2px; @@ -25,7 +24,6 @@ padding-top: 45px; height: 100%; overflow: hidden; - //font-size: 12px; .font-size-medium(); .treeview { @@ -46,18 +44,15 @@ } } &.small{ - //font-size: 10px; .font-size-small(); } &.medium{ - //font-size: 12px; .font-size-medium(); .name { padding: 4px 0; } } &.large{ - //font-size: 14px; .font-size-huge(); } .name.not-header { diff --git a/apps/documenteditor/main/resources/less/statusbar.less b/apps/documenteditor/main/resources/less/statusbar.less index 8d06da7ba..08ee47e55 100644 --- a/apps/documenteditor/main/resources/less/statusbar.less +++ b/apps/documenteditor/main/resources/less/statusbar.less @@ -122,7 +122,6 @@ margin-left: 137px; margin-bottom: 2px; width: 285px; - //font-size: 12px; .font-size-medium(); > label { diff --git a/apps/documenteditor/main/resources/less/thumbnails.less b/apps/documenteditor/main/resources/less/thumbnails.less index e0b1adf70..4dc4b202d 100644 --- a/apps/documenteditor/main/resources/less/thumbnails.less +++ b/apps/documenteditor/main/resources/less/thumbnails.less @@ -18,7 +18,6 @@ border-bottom: @scaled-one-px-value solid @border-toolbar; label { - //font-size: 12px; .font-size-medium(); .font-weight-bold(); margin-top: 2px; @@ -35,7 +34,6 @@ #thumbnails-size { label { - //font-size: 11px; .font-size-normal(); font-weight: normal; margin: 0; diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 5ca7eee69..4f9724585 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -158,7 +158,6 @@ &:extend(.dropdown-menu > li > a); padding-top: 4px; cursor: pointer; - //font-size: 13px; .font-size-large(); &:hover { @@ -224,7 +223,6 @@ padding: 6px 10px; width: auto !important; &.group-name label { - //font-size: 14px; .font-size-huge(); .font-weight-bold(); } @@ -408,7 +406,6 @@ width: 100%; .box-shadow(none); margin: 0; - //font-size: 12px; .font-size-medium(); float: none; @@ -488,7 +485,6 @@ } label, span { - //font-size: 12px; .font-size-medium(); } @@ -511,7 +507,6 @@ #panel-protect { label { - //font-size: 12px; .font-size-medium(); } diff --git a/apps/presentationeditor/main/resources/less/statusbar.less b/apps/presentationeditor/main/resources/less/statusbar.less index 41ad296ec..156ecae0e 100644 --- a/apps/presentationeditor/main/resources/less/statusbar.less +++ b/apps/presentationeditor/main/resources/less/statusbar.less @@ -114,7 +114,6 @@ margin-left: 142px; margin-bottom: 2px; width: 285px; - //font-size: 12px; .font-size-medium(); > label { diff --git a/apps/spreadsheeteditor/main/resources/less/celleditor.less b/apps/spreadsheeteditor/main/resources/less/celleditor.less index 18131ebbf..77298486c 100644 --- a/apps/spreadsheeteditor/main/resources/less/celleditor.less +++ b/apps/spreadsheeteditor/main/resources/less/celleditor.less @@ -105,7 +105,6 @@ resize: none; min-height: 19px; border: 0 none; - //font-size: 12px; .font-size-medium(); line-height: 18px; padding-bottom: 0; diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 17cf9f4db..a315f8934 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -143,7 +143,6 @@ &:extend(.dropdown-menu > li > a); padding-top: 4px; cursor: pointer; - //font-size: 13px; .font-size-large(); &:hover { @@ -211,7 +210,6 @@ width: 100%; .box-shadow(none); margin: 0; - //font-size: 12px; .font-size-medium(); .settings-item-wrap { @@ -255,7 +253,6 @@ //padding: 5px 10px; padding: 6px 10px; &.group-name label { - //font-size: 14px; .font-size-huge(); .font-weight-bold(); } @@ -275,7 +272,6 @@ label { .font-weight-bold(); .font-size-medium(); - //font-size: 12px; } } @@ -369,7 +365,6 @@ .title { width: 104px; - //font-size: 12px; .font-size-medium(); line-height: 14px; height: 28px; @@ -408,7 +403,6 @@ .recent-wrap { padding: 5px 10px; cursor: pointer; - //font-size: 12px; .font-size-medium(); &:hover, @@ -467,7 +461,6 @@ width: 100%; .box-shadow(none); margin: 0; - //font-size: 12px; .font-size-medium(); float: none; @@ -547,7 +540,6 @@ } label, span { - //font-size: 12px; .font-size-medium(); } @@ -570,7 +562,6 @@ #panel-protect { label { - //font-size: 12px; .font-size-medium(); } diff --git a/apps/spreadsheeteditor/main/resources/less/spellcheck.less b/apps/spreadsheeteditor/main/resources/less/spellcheck.less index 0420be3fe..bacb14b02 100644 --- a/apps/spreadsheeteditor/main/resources/less/spellcheck.less +++ b/apps/spreadsheeteditor/main/resources/less/spellcheck.less @@ -15,7 +15,6 @@ border-bottom: @scaled-one-px-value solid @border-toolbar; label { - //font-size: 12px; .font-size-medium(); .font-weight-bold(); margin-top: 2px; diff --git a/apps/spreadsheeteditor/main/resources/less/statusbar.less b/apps/spreadsheeteditor/main/resources/less/statusbar.less index 4558beb39..176c46356 100644 --- a/apps/spreadsheeteditor/main/resources/less/statusbar.less +++ b/apps/spreadsheeteditor/main/resources/less/statusbar.less @@ -63,7 +63,6 @@ margin-right: 160px; margin-bottom: 2px; width: 285px; - //font-size: 12px; .font-size-medium(); left: auto; right: 0; From 73df55f383bb67457afc48e65f104c0fdfa3fd14 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Fri, 11 Nov 2022 19:25:47 +0400 Subject: [PATCH 018/179] [DE mobile] Fix Bug 58655 --- .../mobile/src/controller/Toolbar.jsx | 68 +++++++++---------- apps/documenteditor/mobile/src/page/main.jsx | 2 + 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/Toolbar.jsx b/apps/documenteditor/mobile/src/controller/Toolbar.jsx index e896757d8..98565f426 100644 --- a/apps/documenteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/controller/Toolbar.jsx @@ -16,39 +16,24 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto const stateDisplayMode = displayMode == "final" || displayMode == "original" ? true : false; const displayCollaboration = props.users.hasEditUsers || appOptions.canViewComments || appOptions.canReview || appOptions.canViewReview; const readerMode = appOptions.readerMode; - const objectLocked = props.storeFocusObjects.objectLocked; - const storeToolbarSettings = props.storeToolbarSettings; const isCanUndo = storeToolbarSettings.isCanUndo; const isCanRedo = storeToolbarSettings.isCanRedo; const disabledControls = storeToolbarSettings.disabledControls; const disabledEditControls = storeToolbarSettings.disabledEditControls; const disabledSettings = storeToolbarSettings.disabledSettings; - const showEditDocument = !appOptions.isEdit && appOptions.canEdit && appOptions.canRequestEditRights; - const docInfo = props.storeDocumentInfo; const docExt = docInfo.dataDoc ? docInfo.dataDoc.fileType : ''; const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : ''; - const sensitivity = 20; - let touchStartY = 0; - let touchEndY = 0; - useEffect(() => { - const sdk = document.querySelector('#editor_sdk'); - Common.Gateway.on('init', loadConfig); Common.Notifications.on('toolbar:activatecontrols', activateControls); Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.on('goback', goBack); - if(isViewer) { - sdk.addEventListener('touchstart', handleTouchStart); - sdk.addEventListener('touchend', handleTouchEnd); - } - if (isDisconnected) { f7.popover.close(); f7.sheet.close(); @@ -59,36 +44,47 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto Common.Notifications.off('toolbar:activatecontrols', activateControls); Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.off('goback', goBack); + } + }, []); + useEffect(() => { + const api = Common.EditorApi.get(); + const onEngineCreated = api => { if(isViewer) { - sdk.removeEventListener('touchstart', handleTouchStart); - sdk.removeEventListener('touchend', handleTouchEnd); + api.asc_registerCallback('onMobileScrollDelta', scrollHandler); } + }; + + if (!api) { + Common.Notifications.on('engineCreated', onEngineCreated); + } else { + onEngineCreated(api); } - }); - // Touch handlers + return () => { + const api = Common.EditorApi.get(); - const checkDirection = () => { - const diff = touchStartY - touchEndY; - - if(Math.abs(diff) > sensitivity) { - if(diff > 0) { - // f7.navbar.show('.main-navbar'); - } else { - // f7.navbar.hide('.main-navbar'); - } + if (api) api.asc_unregisterCallback('onMobileScrollDelta', scrollHandler); + Common.Notifications.off('engineCreated', onEngineCreated); } - }; + }, [isViewer]); - const handleTouchStart = e => { - touchStartY = e.changedTouches[0].screenY; - }; + // Scroll handler - const handleTouchEnd = e => { - touchEndY = e.changedTouches[0].screenY; - checkDirection(); - }; + const scrollHandler = offset => { + const api = Common.EditorApi.get(); + const navbarBgHeight = document.querySelector('.navbar-bg').clientHeight; + const subnavbarHeight = document.querySelector('.subnavbar').clientHeight; + const navbarHeight = navbarBgHeight + subnavbarHeight; + + if(offset > navbarHeight) { + f7.navbar.hide('.main-navbar'); + api.SetMobileTopOffset(undefined, 0); + } else { + f7.navbar.show('.main-navbar'); + api.SetMobileTopOffset(undefined, navbarHeight); + } + } // Back button const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder); diff --git a/apps/documenteditor/mobile/src/page/main.jsx b/apps/documenteditor/mobile/src/page/main.jsx index 3a48f88e1..b9f28198d 100644 --- a/apps/documenteditor/mobile/src/page/main.jsx +++ b/apps/documenteditor/mobile/src/page/main.jsx @@ -118,6 +118,8 @@ class MainPage extends Component { appOptions.changeViewerMode(); api.asc_removeRestriction(Asc.c_oAscRestrictionType.View) api.asc_addRestriction(Asc.c_oAscRestrictionType.None); + + f7.navbar.show('.main-navbar'); }; render() { From db812fa94eb1e92915eade4fd8d1d8a57e224155 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 18 Nov 2022 22:22:02 +0300 Subject: [PATCH 019/179] Refactoring test app, remove unused --- test/common/main/lib/util/LocalStorage.js | 137 --- test/common/main/resources/less/common.less | 757 +---------------- test/documenteditor/main/index.html | 48 +- .../main/js/ApplicationController.js | 22 +- test/presentationeditor/main/index.html | 119 +-- .../main/js/ApplicationController.js | 23 +- .../main/resources/less/application.less | 34 +- test/spreadsheeteditor/main/index.html | 77 +- .../main/js/ApplicationController.js | 23 +- .../main/js/CellEditorController.js | 63 -- .../main/js/CellEditorView.js | 27 +- .../main/resources/less/application.less | 6 +- .../main/resources/less/asc-mixins.less | 373 -------- .../main/resources/less/celleditor.less | 167 ---- .../resources/less/colors-table-ie-fix.less | 70 -- .../main/resources/less/colors-table.less | 239 ------ .../main/resources/less/variables.less | 799 ------------------ 17 files changed, 16 insertions(+), 2968 deletions(-) delete mode 100644 test/common/main/lib/util/LocalStorage.js delete mode 100644 test/spreadsheeteditor/main/resources/less/asc-mixins.less delete mode 100644 test/spreadsheeteditor/main/resources/less/celleditor.less delete mode 100644 test/spreadsheeteditor/main/resources/less/colors-table-ie-fix.less delete mode 100644 test/spreadsheeteditor/main/resources/less/colors-table.less delete mode 100644 test/spreadsheeteditor/main/resources/less/variables.less diff --git a/test/common/main/lib/util/LocalStorage.js b/test/common/main/lib/util/LocalStorage.js deleted file mode 100644 index be30d339c..000000000 --- a/test/common/main/lib/util/LocalStorage.js +++ /dev/null @@ -1,137 +0,0 @@ -/* - * - * (c) Copyright Ascensio System SIA 2010-2021 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * -*/ - -!window.common && (window.common = {}); - -common.localStorage = new (function() { - var _storeName, _filter; - var _store = {}; - - var ongetstore = function(data) { - if (data.type == 'localstorage') { - _store = data.keys; - } - }; - - Common.Gateway.on('internalcommand', ongetstore); - - var _refresh = function() { - if (!_lsAllowed) - Common.Gateway.internalMessage('localstorage', {cmd:'get', keys:_filter}); - }; - - var _save = function() { - if (!_lsAllowed) - Common.Gateway.internalMessage('localstorage', {cmd:'set', keys:_store}); - }; - - var _setItem = function(name, value, just) { - if (_lsAllowed) { - try - { - localStorage.setItem(name, value); - } - catch (error){} - - } else { - _store[name] = value; - - if (just===true) { - Common.Gateway.internalMessage('localstorage', { - cmd:'set', - keys: { - name: value - } - }); - } - } - }; - - var _setItemAsBool = function(name, value, just) { - _setItem(name, value ? 1 : 0, just); - }; - - var _getItem = function(name) { - if (_lsAllowed) - return localStorage.getItem(name); - else - return _store[name]===undefined ? null : _store[name]; - }; - - var _getItemAsBool = function (name, defValue) { - var value = _getItem(name); - defValue = defValue || false; - return (value!==null) ? (parseInt(value) != 0) : defValue; - }; - - var _getItemExists = function (name) { - var value = _getItem(name); - return value !== null; - }; - - var _removeItem = function(name) { - if (_lsAllowed) - localStorage.removeItem(name); - else - delete _store[name]; - }; - - try { - var _lsAllowed = !!window.localStorage; - } catch (e) { - _lsAllowed = false; - } - - return { - getId: function() { - return _storeName; - }, - setId: function(name) { - _storeName = name; - }, - getItem: _getItem, - getBool: _getItemAsBool, - setBool: _setItemAsBool, - setItem: _setItem, - removeItem: _removeItem, - setKeysFilter: function(value) { - _filter = value; - }, - getKeysFilter: function() { - return _filter; - }, - itemExists: _getItemExists, - sync: _refresh, - save: _save - }; -})(); diff --git a/test/common/main/resources/less/common.less b/test/common/main/resources/less/common.less index 860c2a90f..89673ad86 100644 --- a/test/common/main/resources/less/common.less +++ b/test/common/main/resources/less/common.less @@ -1,80 +1,3 @@ -// Core variables and mixins -@import "../../../../../vendor/bootstrap/less/variables.less"; - -@icon-font-path: "../../../../../../vendor/bootstrap/dist/fonts/"; - -@import "../../../../../vendor/bootstrap/less/mixins.less"; - -// Reset -@import "../../../../../vendor/bootstrap/less/normalize.less"; -@import "../../../../../vendor/bootstrap/less/print.less"; - -// Core CSS -@import "../../../../../vendor/bootstrap/less/scaffolding.less"; -@import "../../../../../vendor/bootstrap/less/type.less"; -//@import "code.less"; -//@import "grid.less"; -//@import "tables.less"; -@import "../../../../../vendor/bootstrap/less/forms.less"; -@import "../../../../../vendor/bootstrap/less/buttons.less"; - -// Components -@import "../../../../../vendor/bootstrap/less/component-animations.less"; -//@import "../../../../../../vendor/bootstrap/less/glyphicons.less"; -//@import "dropdowns.less"; -//@import "button-groups.less"; -//@import "input-groups.less"; -//@import "navs.less"; -//@import "navbar.less"; -//@import "breadcrumbs.less"; -//@import "pagination.less"; -//@import "pager.less"; -@import "../../../../../vendor/bootstrap/less/labels.less"; -//@import "badges.less"; -//@import "jumbotron.less"; -//@import "thumbnails.less"; -@import "../../../../../vendor/bootstrap/less/alerts.less"; -//@import "progress-bars.less"; -//@import "media.less"; -//@import "list-group.less"; -//@import "panels.less"; -//@import "wells.less"; -@import "../../../../../vendor/bootstrap/less/close.less"; - -// Components w/ JavaScript -@import "../../../../../vendor/bootstrap/less/modals.less"; -@import "../../../../../vendor/bootstrap/less/tooltip.less"; -//@import "../../../../../../vendor/bootstrap/less/popovers.less"; -@import "../../../../../vendor/bootstrap/less/dropdowns.less"; -//@import "carousel.less"; - -// Utility classes -@import "../../../../../vendor/bootstrap/less/utilities.less"; -@import "../../../../../vendor/bootstrap/less/responsive-utilities.less"; - -@toolbarBorderColor: #dbdbdb; -@toolbarBorderShadowColor: #FAFAFA; -@toolbarTopColor: #F7F7F7; -@toolbarBottomColor: #CCCCCC; -@toolbarHoverColor: #7698DE; -@toolbarFontSize: 12px; -@buttonFontSize: 11px; -@controlBtnHoverTopColor: #6180C4; -@controlBtnHoverBottomColor: #8AACF1; -@btnColor: #d8dadc; -@btnActiveColor: #7d858c; -@btnColored: #446995; -@btnActiveColored: #293F59; -@btnHoverColored: #375478; -@notificationColor: #fcfed7; - -@iconSpriteCommonPath: "../../../../unit-tests/common/main/resources/img/glyphicons.png"; -@icon-socnet-size: 40px; - -.input-xs { - .input-size(@input-height-small - 8px; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small); -} - .embed-body { -moz-user-select: -moz-none; -khtml-user-select: none; @@ -82,7 +5,7 @@ -ms-user-select: none; user-select: none; - font-size: @toolbarFontSize; + font-size: 12px; overflow: hidden; } @@ -105,682 +28,4 @@ top: 0; bottom: 46px; } -} - -// Toolbar -// ------------------------- -.toolbar { - position: fixed; - font-size: @toolbarFontSize; - min-width: 340px; - z-index: 100; - background-color: @toolbarTopColor; - - display: flex; - align-items: center; - white-space: nowrap; - - &.top { - top: 0; - left: 0; - width: 100%; - height: 48px; - - -webkit-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor; - //-moz-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor; - box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor; - } - - &.bottom { - bottom: 0; - left: 0; - width: 100%; - height: 46px; - - -webkit-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor; - //-moz-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor; - box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor; - } - - .group { - margin: 0; - padding: 0; - - .item { - input { - display: inline-block; - width: 35px; - padding: 0; - text-align: right; - } - - .text { - cursor: default; - } - } - - &.left { - left: 0; - padding-left: 10px; - - .item { - float: left; - } - - & > div { - display: inline-block; - vertical-align: middle; - } - } - - &.right { - right: 0; - padding-right: 10px; - - .item { - display: inline-block; - } - } - - &.center { - display: flex; - justify-content: center; - flex-grow: 1; - overflow: hidden; - padding: 0 20px; - - #title-doc-name { - overflow: hidden; - text-overflow: ellipsis; - } - } - - .separator { - height: 22px; - margin: 0 9px; - border-right: 1px solid @toolbarBorderShadowColor; - border-left: 1px solid @toolbarBorderColor; - } - } - - .close { - font-size: 28px; - font-family: Arial, sans-serif; - color: #666666; - opacity: 0.8; - display: block; - line-height: 22px; - - &:hover { - opacity: 1; - color: #666666; - } - } - - .margin-right-small { - margin-right: 8px; - } - .margin-right-large { - margin-right: 12px; - } - .margin-left-small { - margin-left: 8px; - } - .margin-left-large { - margin-left: 12px; - } -} - -// Logo -// ------------------------- -/*.brand-logo { - display: block; - width: 100px; - height: 24px; - background: data-uri('../../../../unit-tests/common/main/resources/img/logo.svg') no-repeat; -}*/ - -// Control buttons -// ------------------------- -.control-btn { - display: inline-block; - vertical-align: middle; - cursor: pointer; - background-color: transparent; - border: 1px solid transparent; - border-radius: 2px; - - width: 22px; - height: 22px; - background-origin: content-box; - padding: 0 1px; - font-size: @buttonFontSize; - - &.has-caption { - width: auto; - padding-right: 5px; - } - - &.colored { - padding: 0 16px; - height: 28px; - background-color: @btnColored; - border-radius: 3px; - color: #ffffff; - font-weight: 700; - } - - // Hover state - &:hover:not(:disabled) { - text-decoration: none; - background-color: @btnColor; - - &.colored { - background-color: @btnHoverColored; - } - } - - &:active:not(:disabled) { - &, .btn-icon { - background-position-y: -@icon-height !important; - } - - &.has-caption { - color: #ffffff - } - - &.colored { - background-color: @btnActiveColored; - } - } - -// Focus state for keyboard and accessibility - &:focus { - .tab-focus(); - outline: none; - } - -// Active state - &.active:not(:disabled), - &:active:not(:disabled) { - outline: none; - border: 1px solid @btnActiveColor; - background-color: @btnActiveColor; - } - - &[disabled] { - opacity: 0.4; - } -} - -// Overlay control -// ------------------------- -.overlay-controls { - position: absolute; - bottom: 55px; - z-index: 10; - left: 50%; - - ul { - padding: 0; - list-style-type: none; - margin: 0 auto; - - li { - display: inline-block; - - &:first-child { - margin-right: 5px; - } - - &:last-child { - margin-left: 5px; - } - } - } - - .overlay { - width: 32px; - height: 32px; - - display: inline-block; - cursor: pointer; - background-color: black; - border: 5px solid black; - border-radius: 50%; - outline: none; - opacity: 0.3; - - background-origin: content-box; - padding: 1px 0 0 1px; - - -webkit-box-shadow: 0 0 0 2px rgba(255,255,255,0.3); - -moz-box-shadow: 0 0 0 2px rgba(255,255,255,0.3); - box-shadow: 0 0 0 2px rgba(255,255,255,0.3); - - &:hover { - opacity: .6; - } - - &.active, &:active { - opacity: .8; - } - } -} - -// Error mask -// ------------------------- -.errormask { - position: absolute; - left: 0; - top: 0; - height: 100%; - width: 100%; - overflow: hidden; - border: none; - background-color: #f4f4f4; - z-index: 30002; - - .error-body { - position: relative; - top: 40%; - width: 400px; - margin: 0 auto; - padding: 20px; - background-color: #FFFFFF; - border: 1px solid #C0C0C0; - - .title { - font-weight: bold; - font-size: 1.6em; - padding-bottom: 10px; - } - } -} - -// Modals -// ------------------------- -.modal { - .modal-header { - //padding: 5px 15px; - } - - .modal-footer { - //border-top: none; - } - - //&.in .modal-dialog { .translate(0, 100%)} -} - -.share-buttons { - ul { - width: 244px; - //height: 25px; - list-style-type: none; - margin: 5px 0 0; - overflow: hidden; - - li { - display: inline-block; - float: left; - margin: 1px 5px 0 0; - vertical-align: middle; - - &.share-mail { - float: right; - padding-right: 1px; - margin: 0; - - a { - min-width: 64px; - } - - .glyphicon { - margin-right: 4px; - } - } - - &.share-twitter { - max-width: 93px; - } - } - } -} - -.size-manual { - margin-bottom: 10px; - - .right { - float: right; - } - - .caption { - margin-top: 2px; - margin-right: 8px; - } - - input { - display: inline-block; - font-size: 1em; - padding: 0 4px; - //border-radius: 0; - margin: 0; - margin-top: -1px; - - &.input-xs { - width: 50px; - } - } -} - -.socnet-btn(@index) { - background-position: -@icon-socnet-size*@index 0; - - &:hover { - background-position: -@icon-socnet-size*@index -@icon-socnet-size; - } -} - -/*.svg { - background: data-uri('../../../../unit-tests/common/main/resources/img/icon-social-sprite.svg'); - - width: 40px; - height: 40px; - background-size: @icon-socnet-size*4 @icon-socnet-size*2; - - &.big-facebook:hover { - background-position: 0 -@icon-socnet-size; - } - - &.big-twitter { .socnet-btn(1); } - &.big-gplus { .socnet-btn(2); } - &.big-email { .socnet-btn(3); } -}*/ - -@icon-width: 20px; -@icon-height: 20px; -/*.svg-icon { - background: data-uri('../../../../unit-tests/common/main/resources/img/icon-menu-sprite.svg') no-repeat; - background-size: @icon-width*19 @icon-height*2; - - &.download { - background-position: -@icon-width 0; - } - &.share { - background-position: -@icon-width*2 0; - } - &.embed { - background-position: -@icon-width*3 0; - } - &.fullscr { - background-position: -@icon-width*4 0; - } - &.zoom-up { - background-position: -@icon-width*5 -@icon-height; - } - &.zoom-down { - background-position: -@icon-width*6 -@icon-height; - } - &.slide-prev { - background-position: -@icon-width*7 -@icon-height; - } - &.slide-next { - background-position: -@icon-width*8 -@icon-height; - } - - &.play { - background-position: -@icon-width*9 -@icon-height; - } - - &.pause { - background-position: -@icon-width*10 -@icon-height; - } - - &.print { - background-position: -@icon-width*11 0; - } - - &.arrow-up { - background-position: -@icon-width*17 0; - } - &.arrow-down { - background-position: -@icon-width*16 0; - } - &.clear-style { - background-position: -@icon-width*12 0; - } - &.go-to-location { - background-position: -@icon-width*15 0; - } - &.more-vertical { - background-position: -@icon-width*14 0; - } -} - -.mi-icon { - width: @icon-width; - height: @icon-height; - float: left; - margin: -3px 4px 0 -24px; -}*/ -.btn-icon { - width: 22px; - height: 22px; - display: inline-block; - vertical-align: middle; -} - -.btn, button { - &:focus, &:active:focus { - outline: 0 none; - } - - background-color: @btnColor; -} - -.modal-dialog { - margin-top: 100px; - .share-buttons { - height: 40px; - text-align: center; - - span { - display: inline-block; - margin: 0 7px; - cursor: pointer; - } - } - - .share-link { - margin: 0 0 15px 0; - } -} - -.modal-header { - padding-bottom: 10px; - text-align: center; - - .close { - margin-top: 0; - opacity: 0.5; - - &:hover { - opacity: 0.7; - } - } -} - -.modal-body { - padding: 20px; -} - -.modal-footer { - text-align: center; -} - -#dlg-share, #dlg-embed { - .modal-dialog { - width: 330px; - } - - textarea { - width: 288px; - resize: none; - cursor: auto; - font-size: 1em; - border-radius: 0; - } -} - -.dropdown-menu { - > li > a { - padding: 8px 20px 8px 28px; - &:hover, &:focus { - background-color: @btnColor; - outline: 0 none; - } - font-size: @buttonFontSize; - } - - .divider { - margin: 4px 0; - } -} - -.dropdown { - &.open { - > button { - background-color: @btnActiveColor !important; - background-position: -@icon-width*14 -@icon-height; - } - } -} - -#box-tools { - display: inline-block; - a { - cursor: pointer; - } -} - -.masked { - background-color: transparent; - border-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; -} - -#pages { - cursor: pointer; - display: inline-block; - line-height: 22px; - padding: 0 0 0 3px; -} - -#page-number { - &.masked { - cursor: pointer; - } -} - -.tooltip { - .tooltip-inner { - background-color: #fff; - border: 1px solid rgba(0,0,0,0.15); - color: #333; - font-weight: bold; - font-size: 11px; - box-shadow: 0 6px 12px rgba(0,0,0,0.175); - max-width: 350px; - - padding: 5px 12px; - white-space: pre-wrap; - text-align: left; - word-wrap: break-word; - } - - .tooltip-arrow { - display: none; - } -} - -.form-control { - &:focus { - -webkit-box-shadow: none; - box-shadow: none; - } -} - -.submit-tooltip { - position: absolute; - z-index: 1000; - top: 58px; - right: 15px; - - padding: 7px 15px; - border-radius: 5px; - background-color: @notificationColor; - -webkit-box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.5); - box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.5); - font-size: 11px; -} - -.required-tooltip { - position: absolute; - z-index: 1000; - - padding: 15px; - border-radius: 5px; - background-color: @btnColored; - color: #fff; - -webkit-box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.5); - box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.5); - font-size: 11px; - - &.bottom-left { - border-top-right-radius: 0; - margin: 15px 0 0 0; - - .tip-arrow { - position: absolute; - overflow: hidden; - right: 0; - top: -15px; - width: 15px; - height: 15px; - .box-shadow(8px 5px 8px -5px rgba(0, 0, 0, 0.2)); - - &:after { - content: ''; - position: absolute; - top: 8px; - left: 8px; - background-color: @btnColored; - width: 15px; - height: 15px; - - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -webkit-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); - .box-shadow(0 0 8px -1px rgba(0, 0, 0, 0.2)); - } - } - } - .close-div { - display: inline-block; - border: 1px solid #fff; - border-radius: 2px; - padding: 3px 12px; - margin-top: 10px; - } -} - -.tooltip { - .tooltip-inner { - .toolbar & { - font-weight: normal; - } - } } \ No newline at end of file diff --git a/test/documenteditor/main/index.html b/test/documenteditor/main/index.html index e31e3fcf6..168cbc59d 100644 --- a/test/documenteditor/main/index.html +++ b/test/documenteditor/main/index.html @@ -11,9 +11,6 @@ - @@ -24,21 +21,7 @@ - - - @@ -92,32 +70,10 @@ - - - diff --git a/test/documenteditor/main/js/ApplicationController.js b/test/documenteditor/main/js/ApplicationController.js index d704f28d8..df27eae8d 100644 --- a/test/documenteditor/main/js/ApplicationController.js +++ b/test/documenteditor/main/js/ApplicationController.js @@ -42,18 +42,6 @@ DE.ApplicationController = new(function(){ var LoadingDocument = -256; - // Check browser - // ------------------------- - - if (typeof isBrowserSupported !== 'undefined' && !isBrowserSupported()){ - console.error(this.unsupportedBrowserErrorText); - return; - } - - common.localStorage.setId('text'); - common.localStorage.setKeysFilter('de-,asc.text'); - common.localStorage.sync(); - // Handlers // ------------------------- @@ -71,14 +59,7 @@ DE.ApplicationController = new(function(){ docInfo = new Asc.asc_CDocInfo(), _user = new Asc.asc_CUserInfo(); - var canRenameAnonymous = !((typeof (config.customization) == 'object') && (typeof (config.customization.anonymous) == 'object') && (config.customization.anonymous.request===false)), - guestName = (typeof (config.customization) == 'object') && (typeof (config.customization.anonymous) == 'object') && - (typeof (config.customization.anonymous.label) == 'string') && config.customization.anonymous.label.trim()!=='' ? - common.utils.htmlEncode(config.customization.anonymous.label) : me.textGuest, - value = canRenameAnonymous ? common.localStorage.getItem("guest-username") : null;//, - user = common.utils.fillUserInfo(config.user, config.lang, value ? (value + ' (' + guestName + ')' ) : me.textAnonymous, - common.localStorage.getItem("guest-id") || ('uid-' + Date.now())); - user.anonymous && common.localStorage.setItem("guest-id", user.id); + var user = common.utils.fillUserInfo(config.user, config.lang, me.textAnonymous, ('uid-' + Date.now())); _user.put_Id(user.id); _user.put_FullName(user.fullname); @@ -271,7 +252,6 @@ DE.ApplicationController = new(function(){ } function onBeforeUnload () { - common.localStorage.save(); } function onDocumentResize() { diff --git a/test/presentationeditor/main/index.html b/test/presentationeditor/main/index.html index 39f61c785..cf25a4c1d 100644 --- a/test/presentationeditor/main/index.html +++ b/test/presentationeditor/main/index.html @@ -10,33 +10,10 @@ -
-
@@ -44,21 +21,7 @@ -
- - - - - - - - @@ -166,30 +72,9 @@ - - diff --git a/test/presentationeditor/main/js/ApplicationController.js b/test/presentationeditor/main/js/ApplicationController.js index bcd50030c..4cd6509fc 100644 --- a/test/presentationeditor/main/js/ApplicationController.js +++ b/test/presentationeditor/main/js/ApplicationController.js @@ -39,19 +39,6 @@ PE.ApplicationController = new(function(){ created = false; var LoadingDocument = -256; - - // Check browser - // ------------------------- - - if (typeof isBrowserSupported !== 'undefined' && !isBrowserSupported()){ - console.error(this.unsupportedBrowserErrorText); - return; - } - - common.localStorage.setId('text'); - common.localStorage.setKeysFilter('pe-,asc.presentation'); - common.localStorage.sync(); - // Handlers // ------------------------- @@ -69,14 +56,7 @@ PE.ApplicationController = new(function(){ docInfo = new Asc.asc_CDocInfo(), _user = new Asc.asc_CUserInfo(); - var canRenameAnonymous = !((typeof (config.customization) == 'object') && (typeof (config.customization.anonymous) == 'object') && (config.customization.anonymous.request===false)), - guestName = (typeof (config.customization) == 'object') && (typeof (config.customization.anonymous) == 'object') && - (typeof (config.customization.anonymous.label) == 'string') && config.customization.anonymous.label.trim()!=='' ? - common.utils.htmlEncode(config.customization.anonymous.label) : me.textGuest, - value = canRenameAnonymous ? common.localStorage.getItem("guest-username") : null, - user = common.utils.fillUserInfo(config.user, config.lang, value ? (value + ' (' + guestName + ')' ) : me.textAnonymous, - common.localStorage.getItem("guest-id") || ('uid-' + Date.now())); - user.anonymous && common.localStorage.setItem("guest-id", user.id); + var user = common.utils.fillUserInfo(config.user, config.lang, me.textAnonymous, ('uid-' + Date.now())); _user.put_Id(user.id); _user.put_FullName(user.fullname); @@ -250,7 +230,6 @@ PE.ApplicationController = new(function(){ } function onBeforeUnload () { - common.localStorage.save(); } // Helpers diff --git a/test/presentationeditor/main/resources/less/application.less b/test/presentationeditor/main/resources/less/application.less index ddb4760a3..033e2b7a7 100644 --- a/test/presentationeditor/main/resources/less/application.less +++ b/test/presentationeditor/main/resources/less/application.less @@ -1,34 +1,2 @@ // Bootstrap core variables and mixins -@import "../../../../common/main/resources/less/common.less"; - -.overlay-controls { - /*bottom: 15px;*/ -} - -.overlay-icon-move-left { background-position: -64px -120px; } -.overlay-icon-move-right { background-position: -96px -120px; } - -#box-preview { - position:absolute; - left: 0; - top: 0; - display:none; - width:100%; - height:100%; - z-index: 10; - padding: 48px 0 0 0; -} - -#id-preview { - width:100%; - height:100%; - position: relative; -} - -.svg-icon { - &.play { - &.pause { - background-position: -20px*10 -20px; - } - } -} +@import "../../../../common/main/resources/less/common.less"; \ No newline at end of file diff --git a/test/spreadsheeteditor/main/index.html b/test/spreadsheeteditor/main/index.html index f5da45b3b..4bee12046 100644 --- a/test/spreadsheeteditor/main/index.html +++ b/test/spreadsheeteditor/main/index.html @@ -11,38 +11,18 @@ - - - - - +
-
-
+ -
    - - - - - - - - - - - @@ -140,25 +91,5 @@ - diff --git a/test/spreadsheeteditor/main/js/ApplicationController.js b/test/spreadsheeteditor/main/js/ApplicationController.js index dca9bf116..6a00d654f 100644 --- a/test/spreadsheeteditor/main/js/ApplicationController.js +++ b/test/spreadsheeteditor/main/js/ApplicationController.js @@ -40,19 +40,6 @@ SSE.ApplicationController = new(function(){ created = false; var LoadingDocument = -256; - - // Check browser - // ------------------------- - - if (typeof isBrowserSupported !== 'undefined' && !isBrowserSupported()){ - console.error( this.unsupportedBrowserErrorText); - return; - } - - common.localStorage.setId('text'); - common.localStorage.setKeysFilter('sse-,asc.table'); - common.localStorage.sync(); - // Handlers // ------------------------- @@ -70,14 +57,7 @@ SSE.ApplicationController = new(function(){ docInfo = new Asc.asc_CDocInfo(), _user = new Asc.asc_CUserInfo(); - var canRenameAnonymous = !((typeof (config.customization) == 'object') && (typeof (config.customization.anonymous) == 'object') && (config.customization.anonymous.request===false)), - guestName = (typeof (config.customization) == 'object') && (typeof (config.customization.anonymous) == 'object') && - (typeof (config.customization.anonymous.label) == 'string') && config.customization.anonymous.label.trim()!=='' ? - common.utils.htmlEncode(config.customization.anonymous.label) : me.textGuest, - value = canRenameAnonymous ? common.localStorage.getItem("guest-username") : null, - user = common.utils.fillUserInfo(config.user, config.lang, value ? (value + ' (' + guestName + ')' ) : me.textAnonymous, - common.localStorage.getItem("guest-id") || ('uid-' + Date.now())); - user.anonymous && common.localStorage.setItem("guest-id", user.id); + var user = common.utils.fillUserInfo(config.user, config.lang, me.textAnonymous, ('uid-' + Date.now())); _user.put_Id(user.id); _user.put_FullName(user.fullname); @@ -303,7 +283,6 @@ SSE.ApplicationController = new(function(){ } function onBeforeUnload () { - common.localStorage.save(); } function onDocumentResize() { diff --git a/test/spreadsheeteditor/main/js/CellEditorController.js b/test/spreadsheeteditor/main/js/CellEditorController.js index ee7f806a9..d7c8160af 100644 --- a/test/spreadsheeteditor/main/js/CellEditorController.js +++ b/test/spreadsheeteditor/main/js/CellEditorController.js @@ -11,49 +11,9 @@ SSE.CellEditorController = new(function(){ editor, created=false; - function onCellName(e){ - if (e.keyCode == SSE.Keys.RETURN){ - var name = editor.$cellname.val(); - if (name && name.length) { - api.asc_findCell(name); - } - } - } - - function onKeyupCellEditor(e) { - if(e.keyCode == SSE.Keys.RETURN && !e.altKey){ - api.isCEditorFocused = 'clear'; - } - } - - function onBlurCellEditor() { - if (api.isCEditorFocused == 'clear') - api.isCEditorFocused = undefined; - else if (api.isCellEdited) - api.isCEditorFocused = true; - } - - - - function events() { - editor.$el.find('#ce-cell-name').on( 'keyup', onCellName); - editor.$el.find('textarea#ce-cell-content').on( 'keyup', onKeyupCellEditor); - editor.$el.find('textarea#ce-cell-content').on('blur', onBlurCellEditor); - } - function onLaunch(){ SSE.CellEditorView.create(); editor = SSE.CellEditorView; - events(); - - editor.$el.parent().find('.after').css({zIndex: '4'}); // for spreadsheets - bug 23127 - - var val = common.localStorage.getItem('sse-celleditor-height'); - editor.keep_height = 19;//(val!==null && parseInt(val)>0) ? parseInt(val) : 19; - if (common.localStorage.getBool('sse-celleditor-expand')) { - editor.$el.height(editor.keep_height); - } - this.namedrange_locked = false; } function createController() { @@ -65,33 +25,10 @@ SSE.CellEditorController = new(function(){ return me; } - function onApiCellSelection(info){ - editor.cell.updateInfo(info); - } - - function onApiEditCell(state) { - if (state == Asc.c_oAscCellEditorState.editStart){ - api.isCellEdited = true; - editor.cell.nameDisabled(true); - } else if (state == Asc.c_oAscCellEditorState.editInCell) { - api.isCEditorFocused = 'clear'; - } else if (state == Asc.c_oAscCellEditorState.editEnd) { - api.isCellEdited = false; - api.isCEditorFocused = false; - editor.cell.nameDisabled(false); - } - } - function setApi(apiF){ api=apiF; - - api.isCEditorFocused = false; - api.asc_registerCallback('asc_onSelectionNameChanged', onApiCellSelection); - api.asc_registerCallback('asc_onEditCell', onApiEditCell); } - - return { create: createController, setApi: setApi diff --git a/test/spreadsheeteditor/main/js/CellEditorView.js b/test/spreadsheeteditor/main/js/CellEditorView.js index 9ee6e016e..9cd063598 100644 --- a/test/spreadsheeteditor/main/js/CellEditorView.js +++ b/test/spreadsheeteditor/main/js/CellEditorView.js @@ -39,34 +39,9 @@ SSE.CellEditorView = new(function (){ function createView() { - me=this; - me.$el = $('#cell-editing-box'); - me.$cellcontent=$('#ce-cell-content'); - me.$cellname = $('#ce-cell-name'); - - me.$cellname.on('focus', function(e){ - var txt = me.$cellname[0]; - txt.selectionStart = 0; - txt.selectionEnd = txt.value.length; - txt.scrollLeft = txt.scrollWidth; - }); - } - - function updateCellInfo(info) { - if (info) { - me.$cellname.val(typeof(info)=='string' ? info : info.asc_getName()); - } - } - - function cellNameDisabled(disabled){ - (disabled) ? me.$cellname.attr('disabled', 'disabled') : me.$cellname.removeAttr('disabled'); } return { - create: createView, - cell: { - updateInfo: updateCellInfo, - nameDisabled: cellNameDisabled - } + create: createView } })(); \ No newline at end of file diff --git a/test/spreadsheeteditor/main/resources/less/application.less b/test/spreadsheeteditor/main/resources/less/application.less index 35840c55e..5e602bf16 100644 --- a/test/spreadsheeteditor/main/resources/less/application.less +++ b/test/spreadsheeteditor/main/resources/less/application.less @@ -19,7 +19,7 @@ padding: 0 9px; border-top: 1px solid #5A5A5A; border-bottom: 1px solid #BABABA; - #gradient > .vertical(#B6B6B6, #CACACA); + background: #B6B6B6; box-shadow: 0 4px 4px -4px #333 inset; @@ -30,13 +30,11 @@ margin: 0 2px 2px 3px; padding: 0 13px; color: #FFFFFF; - #gradient > .vertical(#9A9A9A, #828282); + background: #828282; box-shadow: 0 4px 4px -4px #333 inset; -webkit-border-bottom-right-radius: 4px; -// -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; -webkit-border-bottom-left-radius: 4px; -// -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; border-bottom: 1px solid #929292; diff --git a/test/spreadsheeteditor/main/resources/less/asc-mixins.less b/test/spreadsheeteditor/main/resources/less/asc-mixins.less deleted file mode 100644 index c0bf2d9a3..000000000 --- a/test/spreadsheeteditor/main/resources/less/asc-mixins.less +++ /dev/null @@ -1,373 +0,0 @@ -*, *:before, *:after { - -moz-user-select: none; -} - -:focus { - outline: none; -} - -.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) { - background: @color; - background: -webkit-gradient(linear, left bottom,left top, color-stop(0, @start), color-stop(1, @stop)); - background: -moz-linear-gradient(center bottom, @start 0%, @stop 100%); - background: -o-linear-gradient(@stop, @start); - background: linear-gradient(bottom, @start, @stop); -} - -.box-shadow(@arguments) { - -webkit-box-shadow: @arguments; - box-shadow: @arguments; -} - -.box-inner-shadow(@arguments) { - -webkit-box-shadow: inset @arguments; - box-shadow: inset @arguments; -} - -.border-radius(@radius: 2px) { - border-radius: @radius; -} - -.position(@type: absolute, @left: 0, @top: 0, @right: 0, @bottom: 0) { - position: @type; - left: @left; - top: @top; - right: @right; - bottom: @bottom; -} - -.fontsize(@value) { - font-size: @value; -} - -// User select -.user-select(@select: none) { - -webkit-user-select: @select; - -moz-user-select: @select; - -ms-user-select: @select; -// -o-user-select: @select; - user-select: @select; -} - -.toolbar-btn-icon(@icon-class, @index, @icon-size, @offset-x: 0, @offset-y: 0) { - .@{icon-class} {background-position: 0 -(@index * @icon-size - @offset-y);} - .btn.active > .@{icon-class}, - .btn:active > .@{icon-class} {background-position: (-1 * @icon-size - @offset-x) -(@index * @icon-size - @offset-y);} - .btn.disabled > .@{icon-class} {background-position: (-2 * @icon-size - @offset-x) -(@index * @icon-size - @offset-y);} -} - -.toolbar-group-btn-icon(@icon-class, @index, @icon-size, @offset-x: 0, @offset-y: 0) { - .@{icon-class} {background-position: 0 -(@index * @icon-size - @offset-y);} - .btn-group.open > .@{icon-class}, - .btn.active > .@{icon-class}, - .btn:active > .@{icon-class} {background-position: (-1 * @icon-size - @offset-x) -(@index * @icon-size - @offset-y);} - .btn.disabled > .@{icon-class} {background-position: (-2 * @icon-size - @offset-x) -(@index * @icon-size - @offset-y);} -} - -.menu-btn-icon(@icon-class, @index, @icon-size) { - .menu-item-icon.@{icon-class} {background-position: 0 -@index*@icon-size;} - li > a.checked > .menu-item-icon.@{icon-class} {background-position: -1*@icon-size -@index*@icon-size;} -} - -.options-btn-icon(@icon-class, @index, @icon-size) { - .@{icon-class} {background-position: 0 -@index*@icon-size;} - button.over > .@{icon-class} {background-position: -1*@icon-size -@index*@icon-size;} -// .btn-group.open > .@{icon-class}, - button.active > .@{icon-class}, - button:active > .@{icon-class} {background-position: -2*@icon-size -@index*@icon-size;} - button.disabled > .@{icon-class} {background-position: -3*@icon-size -@index*@icon-size;} -} - -/** -*/ -:root { - --bgX: 0px; - - --pixel-ratio-factor: 1; - - .pixel-ratio__1_5 { - @ratio: 1.5; - @one-px: (1px / @ratio); - @two-px: (2px / @ratio); - - --pixel-ratio-factor: @ratio; - --scaled-one-pixel: @one-px; - --scaled-two-pixel: @two-px; - } - - .pixel-ratio__2 { - } - - .pixel-ratio__1_25 { - @ratio: 1.25; - @one-px: (1px / @ratio); - @two-px: (2px / @ratio); - - --pixel-ratio-factor: @ratio; - --scaled-one-pixel: @one-px; - --scaled-two-pixel: @two-px; - } - - .pixel-ratio__1_75 { - @ratio: 1.75; - @one-px: (1px / @ratio); - @two-px: (2px / @ratio); - - --pixel-ratio-factor: @ratio; - --scaled-one-pixel: @one-px; - --scaled-two-pixel: @two-px; - } -} - -.button-normal-icon(@icon-class, @index, @icon-size, @normal-h-offset: 0px) { - .@{icon-class} { - background-position: -0*@icon-size -@index*@icon-size; - background-position: @normal-h-offset -@index*@icon-size; - } -} - -.button-otherstates-icon(@icon-class, @icon-size) { - .btn { - &:active, &.active { - &:not(:disabled):not(.disabled) { - > .@{icon-class} { - @iconsize: -1*@icon-size; - - background-position-x: @iconsize; - --bgX: @iconsize; - } - } - } - } -} - -.mx-button-otherstates-icon2(@offset) { - &.active, &:active{ - &:not(:disabled):not(.disabled) { - .icon { - background-position-x: @offset; - } - } - } -} - -.button-otherstates-icon2(@icon-class, @icon-size) { - button.@{icon-class} { - .mx-button-otherstates-icon2(@icon-size); - } -} - -.menu-icon-normal(@icon-class, @index, @icon-size) { - .menu-item-icon.@{icon-class} { - background-position: 0 -@index*@icon-size; - background-position: var(--bgX) -@index*@icon-size; - } -} - -.menu-otherstates-icon(@menu-class, @icon-size) { - .@{menu-class} li > a.checked > .menu-item-icon {background-position-x: -1*@icon-size; --bgX: calc(-1*@icon-size);} - .@{menu-class} li.disabled .menu-item-icon {background-position-x: -2*@icon-size; --bgX: calc(-2*@icon-size);} -} - -/**/ - -.background-ximage(@image, @image2x, @w: auto, @h: auto, @repeat: no-repeat) { - background-image: data-uri(%("%s",@image)); - background-repeat: @repeat; - - @media - only screen and (-webkit-min-device-pixel-ratio: 2), - only screen and (min-resolution: 2dppx), - only screen and (min-resolution: 192dpi) { - background-image: data-uri(%("%s",@image2x)); - background-size: @w @h; - } -} - -.choose-image-path(@fromcommon) when (@fromcommon = false) { - @path: if(@icon-src-base64, @app-image-path, @app-image-const-path); -}; - -.choose-image-path(@fromcommon) when (@fromcommon = true) { - @path: if(@icon-src-base64, @common-image-path, @common-image-const-path); -} - -.background-ximage-v2(@image, @w: auto, @h: auto, @repeat: no-repeat, @commonimage: true) { - .choose-image-path(@commonimage); - @imagepath: '@{path}/@{image}'; - - background-image: if(@icon-src-base64, data-uri(%("%s", '@{imagepath}')), ~"url(@{imagepath})"); - background-repeat: @repeat; - - @1d5ximage: replace(@imagepath, '\.png$', '@1.5x.png'); - @1d75ximage: replace(@imagepath, '\.png$', '@1.75x.png'); - @1d25ximage: replace(@imagepath, '\.png$', '@1.25x.png'); - @2ximage: replace(@imagepath, '\.png$', '@2x.png'); - - @media only screen { - @media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), - (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx), - (min-resolution: 144dpi) and (max-resolution: 191dpi) - { - background-image: ~"url(@{1d5ximage})"; - background-size: @w @h; - } - - @media (-webkit-min-device-pixel-ratio: 2), - (min-resolution: 2dppx), - (min-resolution: 192dpi) - { - background-image: ~"url(@{2ximage})"; - background-size: @w @h; - } - } -} - -.background-ximage-all(@image, @w: auto, @h: auto, @repeat: no-repeat, @commonimage: true) { - .choose-image-path(@commonimage); - @imagepath: '@{path}/@{image}'; - - background-image: if(@icon-src-base64, data-uri(%("%s", '@{imagepath}')), ~"url(@{imagepath})"); - background-repeat: @repeat; - - @1d5ximage: replace(@imagepath, '\.png$', '@1.5x.png'); - @1d75ximage: replace(@imagepath, '\.png$', '@1.75x.png'); - @1d25ximage: replace(@imagepath, '\.png$', '@1.25x.png'); - @2ximage: replace(@imagepath, '\.png$', '@2x.png'); - - @media only screen { - @media (-webkit-min-device-pixel-ratio: 1.25) and (-webkit-max-device-pixel-ratio: 1.49), - (min-resolution: 1.25dppx) and (max-resolution: 1.49dppx), - (min-resolution: 120dpi) and (max-resolution: 143dpi) - { - background-image: ~"url(@{1d25ximage})"; - background-size: @w @h; - } - - @media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.74), - (min-resolution: 1.5dppx) and (max-resolution: 1.74dppx), - (min-resolution: 144dpi) and (max-resolution: 167dpi) - { - background-image: ~"url(@{1d5ximage})"; - background-size: @w @h; - } - - @media (-webkit-min-device-pixel-ratio: 1.75) and (-webkit-max-device-pixel-ratio: 1.9), - (min-resolution: 1.75dppx) and (max-resolution: 1.9dppx), - (min-resolution: 168dpi) and (max-resolution: 191dpi) - { - background-image: ~"url(@{1d75ximage})"; - background-size: @w @h; - } - - @media (-webkit-min-device-pixel-ratio: 2), - (min-resolution: 2dppx), - (min-resolution: 192dpi) - { - background-image: ~"url(@{2ximage})"; - background-size: @w @h; - } - } -} - -.img-commonctrl { - &.img-colored { - filter: none; - } -} - -@common-controls-width: 100px; -.img-commonctrl, - .dropdown-menu li .checked:before, .input-error:before, .input-warning:before, - .btn-toolbar .icon.img-commonctrl, .list-item div.checked:before -{ - background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/@{common-controls}')), ~"url(@{common-image-const-path}/@{common-controls})"); - background-repeat: no-repeat; - filter: @component-normal-icon-filter; - - @1d25ximage: replace(@common-controls, '\.png$', '@1.25x.png'); - @1d5ximage: replace(@common-controls, '\.png$', '@1.5x.png'); - @1d75ximage: replace(@common-controls, '\.png$', '@1.75x.png'); - @2ximage: replace(@common-controls, '\.png$', '@2x.png'); - - @media only screen { - @media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), - (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx), - (min-resolution: 144dpi) and (max-resolution: 191dpi) - { - background-image: ~"url(@{common-image-const-path}/@{1d5ximage})"; - background-size: @common-controls-width auto; - } - - @media (-webkit-min-device-pixel-ratio: 2), - (min-resolution: 2dppx), - (min-resolution: 192dpi) - { - background-image: ~"url(@{common-image-const-path}/@{2ximage})"; - background-size: @common-controls-width auto; - } - } - - .pixel-ratio__1_25 & { - background-image: ~"url(@{common-image-const-path}/@{1d25ximage})"; - background-size: @common-controls-width auto; - } - - .pixel-ratio__1_75 & { - background-image: ~"url(@{common-image-const-path}/@{1d75ximage})"; - background-size: @common-controls-width auto; - } -} - -@img-colorpicker-width: 205px; -.img-colorpicker, .hsb-colorpicker .empty-color:before -{ - background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/hsbcolorpicker/hsb-colorpicker.png')), ~"url(@{common-image-const-path}/hsbcolorpicker/hsb-colorpicker.png)"); - background-repeat: no-repeat; - - @media only screen { - @media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), - (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx), - (min-resolution: 144dpi) and (max-resolution: 191dpi) - { - background-image: ~"url(@{common-image-const-path}/hsbcolorpicker/hsb-colorpicker@1.5x.png)"; - background-size: @img-colorpicker-width auto; - } - - @media (-webkit-min-device-pixel-ratio: 2), - (min-resolution: 2dppx), - (min-resolution: 192dpi) - { - background-image: ~"url(@{common-image-const-path}/hsbcolorpicker/hsb-colorpicker@2x.png)"; - background-size: @img-colorpicker-width auto; - } - } -} - -.icon.lang-flag { - @img-flags-width: 48px; - - width: 16px; - height: 12px; - - background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/controls/flags.png')), ~"url(@{common-image-const-path}/controls/flags.png)"); - background-repeat: no-repeat; - - @media only screen { - @media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), - (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx), - (min-resolution: 144dpi) and (max-resolution: 191dpi) - { - background-image: ~"url(@{common-image-const-path}/controls/flags@1.5x.png)"; - background-size: @img-flags-width auto; - } - - @media (-webkit-min-device-pixel-ratio: 2), - (min-resolution: 2dppx), - (min-resolution: 192dpi) - { - background-image: ~"url(@{common-image-const-path}/controls/flags@2x.png)"; - background-size: @img-flags-width auto; - } - } -} \ No newline at end of file diff --git a/test/spreadsheeteditor/main/resources/less/celleditor.less b/test/spreadsheeteditor/main/resources/less/celleditor.less deleted file mode 100644 index f278663c8..000000000 --- a/test/spreadsheeteditor/main/resources/less/celleditor.less +++ /dev/null @@ -1,167 +0,0 @@ -// Common styles -@import "colors-table-ie-fix.less"; -@import "variables.less"; -@import "colors-table.less"; -@import "asc-mixins.less"; -#cell-editing-box { - border-bottom: solid @scaled-one-px-value-ie @border-toolbar-ie; - border-bottom: solid @scaled-one-px-value @border-toolbar; - border-left: solid @scaled-one-px-value-ie @border-toolbar-ie; - border-left: solid @scaled-one-px-value @border-toolbar; - min-height: 20px; - background-color: @background-toolbar-ie; - background-color: @background-toolbar; - - .ce-group-name { - float: left; - height: 20px; - background-color: @background-toolbar-ie; - background-color: @background-toolbar; - - #ce-cell-name { - width: 100px; - height: 19px; - //height: calc(19px + (1px - 1px/var(--pixel-ratio-factor,1))); - padding: 0px 19px 0 4px; - vertical-align: top; - display: inline-block; - border: 0 none; - border-right: @scaled-one-px-value-ie solid @border-toolbar-ie; - border-right: @scaled-one-px-value solid @border-toolbar; - transition: none; - -webkit-transition: none; - box-shadow: 0 @scaled-one-px-value-ie 0 0 @border-toolbar-ie; - box-shadow: 0 @scaled-one-px-value 0 0 @border-toolbar; - - &[disabled] { - color: @border-preview-select-ie; - color: @border-preview-select; - opacity: 0.5; - } - } - - #ce-cell-name-menu { - display: inline-block; - position: absolute; - left: 80px; - background-color: @background-toolbar-ie; - background-color: @background-toolbar; - - button { - background-color: @background-normal-ie; - background-color: @background-normal; - height: 19px; - - &.disabled { - opacity: 0.5; - } - - &:active:not(.disabled), - &.active:not(.disabled){ - .caret { - border-color: @icon-normal; - } - } - } - - .dropdown-menu a { - overflow: hidden; - text-overflow: ellipsis; - } - } - - #ce-func-label { - height: 20px; - margin-left: -3px; - .border-radius(0); - - &.disabled { - opacity: 0.4; - } - } - } - - &:not(.expanded) { - #ce-func-label { - border-bottom: @scaled-one-px-value-ie solid @border-toolbar-ie; - border-bottom: @scaled-one-px-value solid @border-toolbar; - } - } - - .ce-group-expand { - float: right; - //height: 20px; - height: 100%; - background-color: @background-normal-ie; - background-color: @background-normal; - } - - .ce-group-content { - margin: 0 2px 0 120px; - height: 100%; - border-left: @scaled-one-px-value-ie solid @border-toolbar-ie; - border-left: @scaled-one-px-value solid @border-toolbar; - #ce-cell-content { - height: 100%; - resize: none; - min-height: 19px; - border: 0 none; - font-size: 12px; - line-height: 18px; - padding-bottom: 0; - padding-top: 0; - &[disabled] { - color: @border-preview-select-ie; - color: @border-preview-select; - opacity: 0.5; - } - } - } - - #ce-cell-name, #ce-cell-content { - border-radius: 0; - } - - &+.layout-resizer { - border-top: 0 none; - border-bottom: 0 none; - - &.move { - border-top: @scaled-one-px-value-ie solid @border-toolbar-ie; - border-top: @scaled-one-px-value solid @border-toolbar; - border-bottom: @scaled-one-px-value-ie solid @border-toolbar-ie; - border-bottom: @scaled-one-px-value solid @border-toolbar; - opacity: 0.4; - } - } -} - -#ce-btn-expand { - width: 16px; - height: 18px; - .border-radius(0); - background: transparent; - padding: 0 2px 0; - - .caret { - transition: transform .2s; - border-color: @icon-normal; - } - - &.btn-collapse { - .caret { - transform: rotate(45deg); - } - } -} - -.layout-resizer { - z-index: @zindex-dropdown - 10; - background: @background-toolbar-ie; - background: @background-toolbar; - border: 0 none; - - &.move { - opacity: 0.4; - } -} diff --git a/test/spreadsheeteditor/main/resources/less/colors-table-ie-fix.less b/test/spreadsheeteditor/main/resources/less/colors-table-ie-fix.less deleted file mode 100644 index 442ff10da..000000000 --- a/test/spreadsheeteditor/main/resources/less/colors-table-ie-fix.less +++ /dev/null @@ -1,70 +0,0 @@ - -@toolbar-header-document-ie: #446995; -@toolbar-header-spreadsheet-ie: #40865c; -@toolbar-header-presentation-ie: #aa5252; - -@background-normal-ie: #fff; -@background-toolbar-ie: #f1f1f1; -@background-toolbar-additional-ie: #f1f1f1; -@background-primary-dialog-button-ie: #7d858c; -@background-tab-underline-ie: #444; -@background-notification-popover-ie: #fcfed7; -@background-notification-badge-ie: #ffd112; -@background-scrim-ie: fade(#000, 20%); -@background-loader-ie: fade(#000, 65%); -@background-alt-key-hint-ie: #FFD938; - -@highlight-button-hover-ie: #d8dadc; -@highlight-button-pressed-ie: #7d858c; -@highlight-button-pressed-hover-ie: #7d858c; -@highlight-primary-dialog-button-hover-ie: #666d73; -@highlight-header-button-hover-ie: fade(#fff, 20%); -@highlight-header-button-pressed-ie: fade(#000, 20%); -@highlight-toolbar-tab-underline-ie: #444; -@highlight-text-select-ie: #3494fb; - -@border-toolbar-ie: #cbcbcb; -@border-divider-ie: #cbcbcb; -@border-regular-control-ie: #cfcfcf; -@border-toolbar-button-hover-ie: #d8dadc; -@border-preview-hover-ie: #cfcfcf; -@border-preview-select-ie: #848484; -@border-control-focus-ie: #848484; -@border-color-shading-ie: fade(#000, 20%); -@border-error-ie: #d9534f; - -@text-normal-ie: #444; -@text-normal-pressed-ie: #fff; -@text-secondary-ie: #a5a5a5; -@text-tertiary-ie: #a5a5a5; -@text-link-ie: #acbfff; -@text-inverse-ie: #fff; -@text-toolbar-header-ie: #fff; -@text-contrast-background-ie: #fff; - -@icon-normal-ie: #444; -@icon-normal-pressed-ie: #fff; -@icon-inverse-ie: #444; -@icon-toolbar-header-ie: fade(#fff, 80%); -@icon-notification-badge-ie: #000; -@icon-contrast-popover-ie: #fff; -@icon-success-ie: #5b9f27; - -@canvas-scroll-thumb-hover-ie: #c0c0c0; -@canvas-scroll-thumb-border-hover-ie: #cbcbcb; - -@button-header-normal-icon-offset-x-ie: -20px; -@button-header-active-icon-offset-x-ie: -20px; -@scaled-one-px-value-ie: 1px; - -@component-disabled-opacity-ie: .4; - -/*.ie { - .toolbar__icon.toolbar__icon-big { - @big-icon-background-image-ie: ~"url(@{app-image-const-path}/iconsbig.png)"; - background-image: @big-icon-background-image-ie; - } -}*/ - -//@huge-icon-background-image-ie: ~"url(@{app-image-const-path}/iconshuge.png)"; - diff --git a/test/spreadsheeteditor/main/resources/less/colors-table.less b/test/spreadsheeteditor/main/resources/less/colors-table.less deleted file mode 100644 index 7c0c7e4d4..000000000 --- a/test/spreadsheeteditor/main/resources/less/colors-table.less +++ /dev/null @@ -1,239 +0,0 @@ -@import "colors-table-ie-fix.less"; - -// Brand colors -// ------------------------- - -@brand-primary: #428bca; -@brand-success: #5cb85c; -@brand-warning: #f0ad4e; -@brand-danger: #d9534f; -@brand-info: #5bc0de; - - -:root { - --toolbar-header-document: #446995; - --toolbar-header-spreadsheet: #40865c; - --toolbar-header-presentation: #aa5252; - - --background-normal: #fff; - --background-toolbar: #f7f7f7; - --background-toolbar-additional: #efefef; - --background-primary-dialog-button: #444; - --background-tab-underline: #444; - --background-notification-popover: #fcfed7; - --background-notification-badge: #ffd112; - --background-scrim: fade(#000, 20%); - --background-loader: fade(#181818, 90%); - --background-alt-key-hint: #FFD938; - - --highlight-button-hover: #e0e0e0; - --highlight-button-pressed: #cbcbcb; - --highlight-button-pressed-hover: #bababa; - --highlight-primary-dialog-button-hover: #1c1c1c; - --highlight-header-button-hover: fade(#fff, 15%); - --highlight-header-button-pressed: fade(#fff, 25%); - --highlight-toolbar-tab-underline: #444; - --highlight-text-select: #3494fb; - - --border-toolbar: #cbcbcb; - --border-divider: #dfdfdf; - --border-regular-control: #c0c0c0; - --border-toolbar-button-hover: #e0e0e0; - --border-preview-hover: #bababa; - --border-preview-select: #888; - --border-control-focus: #848484; - --border-color-shading: fade(#000, 15%); - --border-error: #f62211; - - --text-normal: fade(#000, 80%); - --text-normal-pressed: fade(#000, 80%); - --text-secondary: fade(#000, 60%); - --text-tertiary: fade(#000, 40%); - --text-link: #445799; - --text-link-hover: #445799; - --text-link-active: #445799; - --text-link-visited: #445799; - --text-inverse: #fff; - --text-toolbar-header: #fff; - --text-contrast-background: #fff; - - --icon-normal: #444; - --icon-normal-pressed: #444; - --icon-inverse: #fff; - --icon-toolbar-header: #fff; - --icon-notification-badge: #000; - --icon-contrast-popover: #fff; - --icon-success: #090; - - // Canvas - - --canvas-background: #eee; - --canvas-content-background: #fff; - --canvas-page-border: #ccc; - - --canvas-ruler-background: #fff; - --canvas-ruler-margins-background: #d9d9d9; - --canvas-ruler-mark: #555; - --canvas-ruler-handle-border: #555; - --canvas-ruler-handle-border-disabled: #aaa; - - --canvas-high-contrast: #000; - --canvas-high-contrast-disabled: #666; - - --canvas-cell-border: fade(#000, 10%); - --canvas-cell-title-hover: #dfdfdf; - --canvas-cell-title-selected: #cfcfcf; - --canvas-cell-title-border: #d8d8d8; - --canvas-cell-title-border-hover: #c9c9c9; - --canvas-cell-title-border-selected: #bbb; - - --canvas-dark-cell-title: #444; - --canvas-dark-cell-title-hover: #666 ; - --canvas-dark-cell-title-selected: #111; - --canvas-dark-cell-title-border: #3d3d3d; - --canvas-dark-cell-title-border-hover: #5c5c5c; - --canvas-dark-cell-title-border-selected: #0f0f0f; - - --canvas-scroll-thumb: #f7f7f7; - --canvas-scroll-thumb-hover: #c0c0c0; - --canvas-scroll-thumb-pressed: #adadad; - --canvas-scroll-thumb-border: #cbcbcb; - --canvas-scroll-thumb-border-hover: #cbcbcb; - --canvas-scroll-thumb-border-pressed: #adadad; - --canvas-scroll-arrow: #adadad; - --canvas-scroll-arrow-hover: #f7f7f7; - --canvas-scroll-arrow-pressed: #f7f7f7; - --canvas-scroll-thumb-target: #c0c0c0; - --canvas-scroll-thumb-target-hover: #f7f7f7; - --canvas-scroll-thumb-target-pressed: #f7f7f7; - - // Others - - //--button-small-normal-icon-offset-x: 0; - //--button-small-active-icon-offset-x: 0; - //--button-large-normal-icon-offset-x: 0; - //--button-large-active-icon-offset-x: 0; - //--button-huge-normal-icon-offset-x: 0; - //--button-huge-active-icon-offset-x: 0; - //--button-xhuge-normal-icon-offset-x: 0; - //--button-xhuge-active-icon-offset-x: 0; - --button-header-normal-icon-offset-x: -20px; - --button-header-active-icon-offset-x: -20px; - //--menu-icon-item-checked-offset-x: 0; - - --modal-window-mask-opacity: 0.2; - --image-border-types-filter: none; - --image-border-types-filter-selected: none; - --component-normal-icon-filter: none; - - --component-normal-icon-opacity: .8; - --component-hover-icon-opacity: .8; - --component-active-icon-opacity: 1; - --component-active-hover-icon-opacity: 1; - --component-disabled-opacity: .4; - - --header-component-normal-icon-opacity: 1; - --header-component-hover-icon-opacity: 1; - --header-component-active-icon-opacity: 1; - --header-component-active-hover-icon-opacity: 1; - //--button-icon-opacity: 1; -} - -// Background -// ------------------------- -@background-normal: var(--background-normal); -@background-toolbar: var(--background-toolbar); -@background-toolbar-additional: var(--background-toolbar-additional); -@background-primary-dialog-button: var(--background-primary-dialog-button); -@background-tab-underline: var(--background-tab-underline); -@background-notification-popover: var(--background-notification-popover); -@background-notification-badge: var(--background-notification-badge); -@background-scrim: var(--background-scrim); -@background-loader: var(--background-loader); -@background-alt-key-hint: var(--background-alt-key-hint); - -// Highlight -// ------------------------- -@highlight-button-hover: var(--highlight-button-hover); -@highlight-button-pressed: var(--highlight-button-pressed); -@highlight-button-pressed-hover: var(--highlight-button-pressed-hover); -@highlight-primary-dialog-button-hover: var(--highlight-primary-dialog-button-hover); -@highlight-header-button-hover: var(--highlight-header-button-hover); -@highlight-header-button-pressed: var(--highlight-header-button-pressed); -@highlight-toolbar-tab-underline: var(--highlight-toolbar-tab-underline); -@highlight-text-select: var(--highlight-text-select); - -// Border -// ------------------------- -@border-toolbar: var(--border-toolbar); -@border-divider: var(--border-divider); -@border-regular-control: var(--border-regular-control); -@border-toolbar-button-hover: var(--border-toolbar-button-hover); -@border-preview-hover: var(--border-preview-hover); -@border-preview-select: var(--border-preview-select); -@border-control-focus: var(--border-control-focus); -@border-color-shading: var(--border-color-shading); -@border-error: var(--border-error); - -// Text -// ------------------------- -@text-normal: var(--text-normal); -@text-normal-pressed: var(--text-normal-pressed); -@text-secondary: var(--text-secondary); -@text-tertiary: var(--text-tertiary); -@text-link: var(--text-link); -@text-link-hover: var(--text-link-hover); -@text-link-active: var(--text-link-active); -@text-link-visited: var(--text-link-visited); -@text-inverse: var(--text-inverse); -@text-toolbar-header: var(--text-toolbar-header); -@text-contrast-background: var(--text-contrast-background); -@text-alt-key-hint: var(--text-alt-key-hint); - -// Icon -// ------------------------- -@icon-normal: var(--icon-normal); -@icon-normal-pressed: var(--icon-normal-pressed); -@icon-inverse: var(--icon-inverse); -@icon-toolbar-header: var(--icon-toolbar-header); -@icon-contrast-popover: var(--icon-contrast-popover); -@icon-notification-badge: var(--icon-notification-badge); -@icon-success: var(--icon-success); - -@button-small-normal-icon-offset-x: var(--button-small-normal-icon-offset-x,0); -@button-small-active-icon-offset-x: var(--button-small-active-icon-offset-x,0); -@button-large-normal-icon-offset-x: var(--button-large-normal-icon-offset-x, 0); -@button-large-active-icon-offset-x: var(--button-large-active-icon-offset-x, 0); -@button-huge-normal-icon-offset-x: var(--button-huge-normal-icon-offset-x, 0); -@button-xhuge-normal-icon-offset-x: var(--button-xhuge-normal-icon-offset-x, 0); -@button-xhuge-active-icon-offset-x: var(--button-xhuge-active-icon-offset-x, 0); -//@button-huge-normal-icon-offset-x: var(--button-huge-normal-icon-offset-x, 0); -//@button-huge-active-icon-offset-x: var(--button-huge-active-icon-offset-x, 0); - -@button-header-normal-icon-offset-x: var(--button-header-normal-icon-offset-x, -20px); -@button-header-active-icon-offset-x: var(--button-header-active-icon-offset-x, -20px); - -@component-normal-icon-filter: var(--component-normal-icon-filter); -@component-normal-icon-opacity: var(--component-normal-icon-opacity, .8); -@component-hover-icon-opacity: var(--component-hover-icon-opacity, .8); -@component-active-icon-opacity: var(--component-active-icon-opacity, .8); -@component-active-hover-icon-opacity: var(--component-active-hover-icon-opacity, .8); -@component-disabled-opacity: var(--component-disabled-opacity, .4); -//@button-icon-opacity: var(--button-icon-opacity, 1); - -@header-component-normal-icon-opacity: var(--header-component-normal-icon-opacity, 1); -@header-component-hover-icon-opacity: var(--header-component-hover-icon-opacity, 1); -@header-component-active-icon-opacity: var(--header-component-active-icon-opacity, 1); -@header-component-active-hover-icon-opacity: var(--header-component-active-hover-icon-opacity, 1); - -@menu-icon-item-checked-offset-x: var(--menu-icon-item-checked-offset-x, 0); -@img-border-type-filter: var(--image-border-types-filter, none); -@img-border-type-filter-selected: var(--image-border-types-filter-selected, none); - -// Canvas -// --------------------------- -@canvas-background: var(--canvas-background); -@canvas-content-background: var(--canvas-content-background); -@canvas-page-border: var(--canvas-page-border); -@canvas-scroll-thumb-hover: var(--canvas-scroll-thumb-hover); -@canvas-scroll-thumb-border-hover: var(--canvas-scroll-thumb-border-hover); diff --git a/test/spreadsheeteditor/main/resources/less/variables.less b/test/spreadsheeteditor/main/resources/less/variables.less deleted file mode 100644 index 42eac33a7..000000000 --- a/test/spreadsheeteditor/main/resources/less/variables.less +++ /dev/null @@ -1,799 +0,0 @@ -// -// Global values -// -------------------------------------------------- -@pixel-ratio-factor: var(--pixel-ratio-factor, 1); -@scaled-one-px-value: var(--scaled-one-pixel, 1px); -@scaled-two-px-value: var(--scaled-two-pixel, 2px); - -// Paths -// ------------------------- - -@app-image-path: "../../resources/img"; // use for data-uri(...) -@common-image-path: "../../../../common/main/resources/img"; // use for data-uri(...) -@app-image-const-path: "resources/img"; // use for url(...) -@common-image-const-path: "../../common/main/resources/img"; // use for url(...) - -// Grays -// ------------------------- - -//@gray-deep: #444444; //rgb(68, 68, 68) -//@gray-darker: #848484; //rgb(132, 132, 132) -//@gray-dark: #cbcbcb; //rgb(203, 203, 203) -//@gray: #cfcfcf; //rgb(207, 207, 207) -//@gray-light: #f1f1f1; //rgb(241, 241, 241) -//@gray-lighter: #ededed; //rgb(237, 237, 237) -//@gray-soft: #adadad; //rgb(173, 173, 173) - -//@primary: #7d858c; //rgb(125, 133, 140) -//@primary-hover: #666d73; //rgb(102, 109, 115) -//@secondary: #d8dadc; //rgb(216, 218, 220) -//@secondary-hover: #cbced1; //rgb(203, 206, 209) - -//@black: #000000; - -// Brand colors -// ------------------------- - -@brand-primary: #428bca; -@brand-success: #5cb85c; -@brand-warning: #f0ad4e; -@brand-danger: #d9534f; -@brand-info: #5bc0de; - -// Scaffolding -// ------------------------- - -@body-bg: #fff; -@text-color: #cbcbcb; // @gray-dark - -// Links -// ------------------------- - -@link-color: @brand-primary; -@link-hover-color: darken(@link-color, 15%); -@link-hover-decoration: underline; - -// Typography -// ------------------------- - -@font-family-sans-serif: Arial, Helvetica, "Helvetica Neue", sans-serif; -@font-family-serif: Georgia, "Times New Roman", Times, serif; -@font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace; -@font-family-tahoma: tahoma, arial, verdana, sans-serif; -@font-family-base: @font-family-sans-serif; - -@font-size-base: 11px; -@font-size-large: 13px; -@font-size-small: 9px; - -@font-size-h1: floor(@font-size-base * 2.6); -@font-size-h2: floor(@font-size-base * 2.15); -@font-size-h3: ceil(@font-size-base * 1.7); -@font-size-h4: ceil(@font-size-base * 1.25); -@font-size-h5: @font-size-base; -@font-size-h6: ceil(@font-size-base * 0.85); - -@line-height-base: 1.428571429; // 20/14 -@line-height-computed: floor(@font-size-base * @line-height-base); - -@headings-font-family: @font-family-base; -@headings-font-weight: 500; -@headings-line-height: 1.1; -@headings-color: inherit; - - -// Iconography -// ------------------------- - -@icon-font-path: "../fonts/"; -@icon-font-name: "glyphicons-halflings-regular"; -@icon-font-svg-id: "glyphicons_halflingsregular"; - -@icon-src-base64: false; -@huge-icon-size: 37px; -@x-huge-icon-size: 45px; - -// Components -// ------------------------- -// Based on 14px font-size and 1.428 line-height (~20px to start) - -@padding-base-vertical: 1px; -@padding-base-horizontal: 3px; - -@padding-large-vertical: 10px; -@padding-large-horizontal: 16px; - -@padding-small-vertical: 1px; -@padding-small-horizontal: 3px; - -@padding-xs-vertical: 1px; -@padding-xs-horizontal: 5px; - -@line-height-large: 1.33; -@line-height-small: 1.5; - -@border-radius-base: 4px; -@border-radius-large: 6px; -@border-radius-small: 2px; - -@component-active-color: #fff; -@component-active-bg: #7d858c; // @primary; - -@caret-width-base: 4px; -@caret-width-large: 5px; - -// Tables -// ------------------------- - -@table-cell-padding: 8px; -@table-condensed-cell-padding: 5px; - -@table-bg: transparent; // overall background-color -@table-bg-accent: #f9f9f9; // for striping -@table-bg-hover: #f5f5f5; -@table-bg-active: @table-bg-hover; - -@table-border-color: #ddd; // table and cell border - - -// Buttons -// ------------------------- - -@btn-font-weight: normal; - -@btn-default-color: #333; -@btn-default-bg: #fff; -@btn-default-border: #ccc; - -@btn-primary-color: #fff; -@btn-primary-bg: @brand-primary; -@btn-primary-border: darken(@btn-primary-bg, 5%); - -@btn-success-color: #fff; -@btn-success-bg: @brand-success; -@btn-success-border: darken(@btn-success-bg, 5%); - -@btn-warning-color: #fff; -@btn-warning-bg: @brand-warning; -@btn-warning-border: darken(@btn-warning-bg, 5%); - -@btn-danger-color: #fff; -@btn-danger-bg: @brand-danger; -@btn-danger-border: darken(@btn-danger-bg, 5%); - -@btn-info-color: #fff; -@btn-info-bg: @brand-info; -@btn-info-border: darken(@btn-info-bg, 5%); - -@btn-link-disabled-color: #f1f1f1; // @gray-light; - -// Allows for customizing button radius independently from global border radius -@btn-border-radius-base: @border-radius-base; -@btn-border-radius-large: @border-radius-large; -@btn-border-radius-small: @border-radius-small; - -// Forms -// ------------------------- - -@input-bg: #fff; -@input-bg-disabled: #ededed; // @gray-lighter; - -@input-color: #000; -@input-border: #cfcfcf; // @gray; -@input-border-radius: @border-radius-base; -@input-border-radius-large: @border-radius-large; -@input-border-radius-small: @border-radius-small; -@input-border-focus: #66afe9; - -// TODO: Rename `@input-border-radius` to `@input-border-radius-base` in v4 -//** Default `.form-control` border radius -// This has no effect on ``s in CSS. -@input-border-radius: @border-radius-base; -//** Large `.form-control` border radius -@input-border-radius-large: @border-radius-large; -//** Small `.form-control` border radius -@input-border-radius-small: @border-radius-small; - -@input-color-placeholder: #cfcfcf; // @gray; - -@input-height-base: (floor(@font-size-base * @line-height-base) + (@padding-base-vertical * 2) + 5); -@input-height-large: (ceil(@font-size-large * @line-height-large) + (@padding-large-vertical * 2) + 2); -@input-height-small: (floor(@font-size-small * @line-height-small) + (@padding-small-vertical * 2) + 2); - -@form-group-margin-bottom: 15px; - -@legend-color: #cbcbcb; // @gray-dark -@legend-border-color: #e5e5e5; - -@input-group-addon-bg: @input-bg; -@input-group-addon-border-color: @input-border; - -// Disabled cursor for form controls and buttons. -@cursor-disabled: default; - -// Dropdowns -// ------------------------- - -@dropdown-bg: #fff; -@dropdown-border: rgba(0,0,0,.15); -@dropdown-fallback-border: #ccc; -@dropdown-divider-bg: #e5e5e5; - -@dropdown-link-color: #444; // @gray-deep; -@dropdown-link-hover-color: darken(#444, 5%); // darken(@gray-deep, 5%); -@dropdown-link-hover-bg: #d8dadc; // @secondary; - -@dropdown-link-active-color: @component-active-color; -@dropdown-link-active-bg: @component-active-bg; - -@dropdown-link-disabled-color: #cfcfcf; // @gray; - -@dropdown-header-color: #cfcfcf; // @gray; - - -// COMPONENT VARIABLES -// -------------------------------------------------- - - -// Z-index master list -// ------------------------- -// Used for a bird's eye view of components dependent on the z-axis -// Try to avoid customizing these :) - -@zindex-navbar: 1000; -@zindex-dropdown: 1000; -@zindex-popover: 1010; -@zindex-tooltip: 1030; -@zindex-navbar-fixed: 1030; -@zindex-modal-background: 1040; -@zindex-modal: 1050; - -// Media queries breakpoints -// -------------------------------------------------- - -// Extra small screen / phone -// Note: Deprecated @screen-xs and @screen-phone as of v3.0.1 -@screen-xs: 480px; -@screen-xs-min: @screen-xs; -@screen-phone: @screen-xs-min; - -// Small screen / tablet -// Note: Deprecated @screen-sm and @screen-tablet as of v3.0.1 -@screen-sm: 768px; -@screen-sm-min: @screen-sm; -@screen-tablet: @screen-sm-min; - -// Medium screen / desktop -// Note: Deprecated @screen-md and @screen-desktop as of v3.0.1 -@screen-md: 992px; -@screen-md-min: @screen-md; -@screen-desktop: @screen-md-min; - -// Large screen / wide desktop -// Note: Deprecated @screen-lg and @screen-lg-desktop as of v3.0.1 -@screen-lg: 1200px; -@screen-lg-min: @screen-lg; -@screen-lg-desktop: @screen-lg-min; - -// So media queries don't overlap when required, provide a maximum -@screen-xs-max: (@screen-sm-min - 1); -@screen-sm-max: (@screen-md-min - 1); -@screen-md-max: (@screen-lg-min - 1); - - -// Grid system -// -------------------------------------------------- - -// Number of columns in the grid system -@grid-columns: 12; -// Padding, to be divided by two and applied to the left and right of all columns -@grid-gutter-width: 30px; - -// Navbar collapse - -// Point at which the navbar becomes uncollapsed -@grid-float-breakpoint: @screen-sm-min; -// Point at which the navbar begins collapsing -@grid-float-breakpoint-max: (@grid-float-breakpoint - 1); - - -// Navbar -// ------------------------- - -// Basics of a navbar -@navbar-height: 50px; -@navbar-margin-bottom: @line-height-computed; -@navbar-border-radius: @border-radius-base; -@navbar-padding-horizontal: floor(@grid-gutter-width / 2); -@navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2); -@navbar-collapse-max-height: 340px; - -@navbar-default-color: #777; -@navbar-default-bg: #f8f8f8; -@navbar-default-border: darken(@navbar-default-bg, 6.5%); - -// Navbar links -@navbar-default-link-color: #777; -@navbar-default-link-hover-color: #333; -@navbar-default-link-hover-bg: transparent; -@navbar-default-link-active-color: #555; -@navbar-default-link-active-bg: darken(@navbar-default-bg, 6.5%); -@navbar-default-link-disabled-color: #ccc; -@navbar-default-link-disabled-bg: transparent; - -// Navbar brand label -@navbar-default-brand-color: @navbar-default-link-color; -@navbar-default-brand-hover-color: darken(@navbar-default-brand-color, 10%); -@navbar-default-brand-hover-bg: transparent; - -// Navbar toggle -@navbar-default-toggle-hover-bg: #ddd; -@navbar-default-toggle-icon-bar-bg: #ccc; -@navbar-default-toggle-border-color: #ddd; - - -// Inverted navbar -// -// Reset inverted navbar basics -@navbar-inverse-color: #f1f1f1; // @gray-light; -@navbar-inverse-bg: #222; -@navbar-inverse-border: darken(@navbar-inverse-bg, 10%); - -// Inverted navbar links -@navbar-inverse-link-color: #f1f1f1; // @gray-light; -@navbar-inverse-link-hover-color: #fff; -@navbar-inverse-link-hover-bg: transparent; -@navbar-inverse-link-active-color: @navbar-inverse-link-hover-color; -@navbar-inverse-link-active-bg: darken(@navbar-inverse-bg, 10%); -@navbar-inverse-link-disabled-color: #444; -@navbar-inverse-link-disabled-bg: transparent; - -// Inverted navbar brand label -@navbar-inverse-brand-color: @navbar-inverse-link-color; -@navbar-inverse-brand-hover-color: #fff; -@navbar-inverse-brand-hover-bg: transparent; - -// Inverted navbar toggle -@navbar-inverse-toggle-hover-bg: #333; -@navbar-inverse-toggle-icon-bar-bg: #fff; -@navbar-inverse-toggle-border-color: #333; - - -// Navs -// ------------------------- - -@nav-link-padding: 10px 15px; -@nav-link-hover-bg: #ededed; // @gray-lighter; - -@nav-disabled-link-color: #f1f1f1; // @gray-light; -@nav-disabled-link-hover-color: #f1f1f1; // @gray-light; - -@nav-open-link-hover-color: #fff; - -// Tabs -@nav-tabs-border-color: #ddd; - -@nav-tabs-link-hover-border-color: #ededed; // @gray-lighter; - -@nav-tabs-active-link-hover-bg: @body-bg; -@nav-tabs-active-link-hover-color: #cfcfcf; // @gray; -@nav-tabs-active-link-hover-border-color: #ddd; - -@nav-tabs-justified-link-border-color: #ddd; -@nav-tabs-justified-active-link-border-color: @body-bg; - -// Pills -@nav-pills-border-radius: @border-radius-base; -@nav-pills-active-link-hover-bg: @component-active-bg; -@nav-pills-active-link-hover-color: @component-active-color; - - -// Pagination -// ------------------------- -@pagination-color: @link-color; -@pagination-bg: #fff; -@pagination-border: #ddd; - -@pagination-hover-color: @link-hover-color; -@pagination-hover-bg: #ededed; // @gray-lighter; -@pagination-hover-border: #ddd; - -@pagination-active-bg: @brand-primary; -@pagination-active-color: #fff; -@pagination-active-border: @brand-primary; - -@pagination-disabled-color: #f1f1f1; // @gray-light; -@pagination-disabled-bg: #fff; -@pagination-disabled-border: #ddd; - -// Pager -// ------------------------- -@pager-bg: @pagination-bg; -@pager-border: @pagination-border; -@pager-border-radius: 15px; - -@pager-hover-bg: @pagination-hover-bg; - -@pager-active-bg: @pagination-active-bg; -@pager-active-color: @pagination-active-color; - -@pager-disabled-color: #f1f1f1; // @gray-light; - - -// Jumbotron -// ------------------------- - -@jumbotron-padding: 30px; -@jumbotron-color: inherit; -@jumbotron-bg: #ededed; // @gray-lighter; -@jumbotron-heading-color: inherit; -@jumbotron-font-size: ceil(@font-size-base * 1.5); -@jumbotron-heading-font-size: ceil((@font-size-base * 4.5)); - -// Form states and alerts -// ------------------------- - -@state-success-text: #3c763d; -@state-success-bg: #dff0d8; -@state-success-border: darken(spin(@state-success-bg, -10), 5%); - -@state-info-text: #31708f; -@state-info-bg: #d9edf7; -@state-info-border: darken(spin(@state-info-bg, -10), 7%); - -@state-warning-text: #8a6d3b; -@state-warning-bg: #fcf8e3; -@state-warning-border: darken(spin(@state-warning-bg, -10), 5%); - -@state-danger-text: #a94442; -@state-danger-bg: #f2dede; -@state-danger-border: darken(spin(@state-danger-bg, -10), 5%); - - -// Tooltips -// ------------------------- -@tooltip-max-width: 200px; -@tooltip-color: #fff; -@tooltip-bg: #000; -@tooltip-opacity: .9; - -@tooltip-arrow-width: 5px; -@tooltip-arrow-color: @tooltip-bg; - - -// Popovers -// ------------------------- -@popover-bg: #fff; -@popover-max-width: 276px; -@popover-border-color: rgba(0,0,0,.2); -@popover-fallback-border-color: #ccc; - -@popover-title-bg: darken(@popover-bg, 3%); - -@popover-arrow-width: 10px; -@popover-arrow-color: #fff; - -@popover-arrow-outer-width: (@popover-arrow-width + 1); -@popover-arrow-outer-color: rgba(0,0,0,.25); -@popover-arrow-outer-fallback-color: #999; - - -// Labels -// ------------------------- - -@label-default-bg: #f1f1f1; // @gray-light; -@label-primary-bg: @brand-primary; -@label-success-bg: @brand-success; -@label-info-bg: @brand-info; -@label-warning-bg: @brand-warning; -@label-danger-bg: @brand-danger; - -@label-color: #fff; -@label-link-hover-color: #fff; - - -// Modals -// ------------------------- -@modal-inner-padding: 20px; - -@modal-title-padding: 15px; -@modal-title-line-height: @line-height-base; - -@modal-content-bg: #fff; -@modal-content-border-color: rgba(0,0,0,.2); -@modal-content-fallback-border-color: #999; - -@modal-backdrop-bg: #000; -@modal-backdrop-opacity: .5; -@modal-header-border-color: #e5e5e5; -@modal-footer-border-color: @modal-header-border-color; - -@modal-lg: 900px; -@modal-md: 600px; -@modal-sm: 300px; - -// Alerts -// ------------------------- -@alert-padding: 15px; -@alert-border-radius: @border-radius-base; -@alert-link-font-weight: bold; - -@alert-success-bg: @state-success-bg; -@alert-success-text: @state-success-text; -@alert-success-border: @state-success-border; - -@alert-info-bg: @state-info-bg; -@alert-info-text: @state-info-text; -@alert-info-border: @state-info-border; - -@alert-warning-bg: @state-warning-bg; -@alert-warning-text: @state-warning-text; -@alert-warning-border: @state-warning-border; - -@alert-danger-bg: @state-danger-bg; -@alert-danger-text: @state-danger-text; -@alert-danger-border: @state-danger-border; - - -// Progress bars -// ------------------------- -@progress-bg: #f5f5f5; -@progress-bar-color: #fff; -@progress-border-radius: @border-radius-base; - -@progress-bar-bg: @brand-primary; -@progress-bar-success-bg: @brand-success; -@progress-bar-warning-bg: @brand-warning; -@progress-bar-danger-bg: @brand-danger; -@progress-bar-info-bg: @brand-info; - - -// List group -// ------------------------- -@list-group-bg: #fff; -@list-group-border: #ddd; -@list-group-border-radius: @border-radius-base; - -@list-group-hover-bg: #f5f5f5; -@list-group-active-color: @component-active-color; -@list-group-active-bg: @component-active-bg; -@list-group-active-border: @list-group-active-bg; -@list-group-active-text-color: lighten(@list-group-active-bg, 40%); - -@list-group-disabled-color: #f1f1f1; // @gray-light; -@list-group-disabled-bg: #ededed; // @gray-lighter; -@list-group-disabled-text-color: @list-group-disabled-color; - -@list-group-link-color: #555; -@list-group-link-hover-color: @list-group-link-color; -@list-group-link-heading-color: #333; - - -// Panels -// ------------------------- -@panel-bg: #fff; -@panel-body-padding: 15px; -@panel-heading-padding: 10px 15px; -@panel-footer-padding: @panel-heading-padding; -@panel-inner-border: #ddd; -@panel-border-radius: @border-radius-base; -@panel-footer-bg: #f5f5f5; - -//@panel-default-text: @gray-dark; -@panel-default-border: #ddd; -@panel-default-heading-bg: #f5f5f5; - -@panel-primary-text: #fff; -@panel-primary-border: @brand-primary; -@panel-primary-heading-bg: @brand-primary; - -@panel-success-text: @state-success-text; -@panel-success-border: @state-success-border; -@panel-success-heading-bg: @state-success-bg; - -@panel-warning-text: @state-warning-text; -@panel-warning-border: @state-warning-border; -@panel-warning-heading-bg: @state-warning-bg; - -@panel-danger-text: @state-danger-text; -@panel-danger-border: @state-danger-border; -@panel-danger-heading-bg: @state-danger-bg; - -@panel-info-text: @state-info-text; -@panel-info-border: @state-info-border; -@panel-info-heading-bg: @state-info-bg; - - -// Thumbnails -// ------------------------- -@thumbnail-padding: 4px; -@thumbnail-bg: @body-bg; -@thumbnail-border: #ddd; -@thumbnail-border-radius: @border-radius-base; - -//@thumbnail-caption-color: @text-color; -@thumbnail-caption-padding: 9px; - - -// Wells -// ------------------------- -@well-bg: #f5f5f5; -@well-border: darken(@well-bg, 7%); - -// Badges -// ------------------------- -@badge-color: #fff; -@badge-link-hover-color: #fff; -@badge-bg: #f1f1f1; // @gray-light; - -@badge-active-color: @link-color; -@badge-active-bg: #fff; - -@badge-font-weight: bold; -@badge-line-height: 1; -@badge-border-radius: 10px; - - -// Breadcrumbs -// ------------------------- -@breadcrumb-padding-vertical: 8px; -@breadcrumb-padding-horizontal: 15px; -@breadcrumb-bg: #f5f5f5; -@breadcrumb-color: #ccc; -@breadcrumb-active-color: #f1f1f1; // @gray-light; -@breadcrumb-separator: "/"; - - -// Carousel -// ------------------------ - -@carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6); - -@carousel-control-color: #fff; -@carousel-control-width: 15%; -@carousel-control-opacity: .5; -@carousel-control-font-size: 20px; - -@carousel-indicator-active-bg: #fff; -@carousel-indicator-border-color: #fff; - -@carousel-caption-color: #fff; - - -// Close -// ------------------------ -@close-font-weight: bold; -@close-color: #000; -@close-text-shadow: 0 1px 0 #fff; - - -// Code -// ------------------------ -@code-color: #c7254e; -@code-bg: #f9f2f4; - -@kbd-color: #fff; -@kbd-bg: #333; - -@pre-bg: #f5f5f5; -//@pre-color: @gray-dark; -@pre-border-color: #ccc; -@pre-scrollable-max-height: 340px; - -// Type -// ------------------------ -@text-muted: #f1f1f1; // @gray-light; -@abbr-border-color: #f1f1f1; // @gray-light; -@headings-small-color: #f1f1f1; // @gray-light; -@blockquote-small-color: #f1f1f1; // @gray-light; -@blockquote-font-size: (@font-size-base * 1.25); -@blockquote-border-color: #ededed; // @gray-lighter; -@page-header-border-color: #ededed; // @gray-lighter; - -// Miscellaneous -// ------------------------- - -// Hr border color -@hr-border: #ededed; // @gray-lighter; - -// Horizontal forms & lists -@component-offset-horizontal: 180px; -@blockquote-font-size: (@font-size-base * 1.25); -@dl-horizontal-offset: @component-offset-horizontal; -@dl-horizontal-breakpoint: @grid-float-breakpoint; - - -// Container sizes -// -------------------------------------------------- - -// Small screen / tablet -@container-tablet: ((720px + @grid-gutter-width)); -@container-sm: @container-tablet; - -// Medium screen / desktop -@container-desktop: ((940px + @grid-gutter-width)); -@container-md: @container-desktop; - -// Large screen / wide desktop -@container-large-desktop: ((1140px + @grid-gutter-width)); -@container-lg: @container-large-desktop; - - -// Texture offsets -// -------------------------------------------------- - -// Common components texture -@common-controls: "controls/common-controls.png"; -@common-controls2x: "controls/common-controls@2x.png"; - -// Dialog alerts -@alerts-offset-x: 0; -@alerts-offset-y: 0; - -// Dialog close -@but-close-offset-x: -26px; -@but-close-offset-y: -151px; - -// Dropdown arrow -@arrow-small-offset-x: -85px; -@arrow-small-offset-y: -96px; - -// Dropdown arrow up -@arrow-up-small-offset-x: -85px; -@arrow-up-small-offset-y: -104px; - -// Dropdown arrow big -@arrow-big-offset-x: -41px; -@arrow-big-offset-y: -144px; - -// Checkbox -@checkbox-offset-x: -35px; -@checkbox-offset-y: 0px; - -// Radio button -@radio-offset-x: -35px; -@radio-offset-y: -65px; - -// Menu check -@menu-check-offset-x: -41px; -@menu-check-offset-y: -172px; - -// Multislider thumb -@slide-thumb-offset-x: -13px; -@slide-thumb-offset-y: -150px; - -// Slider thumb -@multislide-thumb-offset-x: 0px; -@multislide-thumb-offset-y: -150px; - -// Slider track -@slide-track-offset-x: 0px; -@slide-track-offset-y: -195px; - -// Input error -@input-error-offset-x: -73px; -@input-error-offset-y: -170px; - -// Input warning -@input-warning-offset-x: -57px; -@input-warning-offset-y: -170px; - -// Spinner -@spinner-offset-x: -41px; -@spinner-offset-y: -187px; - -// Search dialog -@search-dlg-offset-x: -36px; -@search-dlg-offset-y: -96px; - -// No color -@nocolor-offset-x: 0; -@nocolor-offset-y: -137px; - -// Plus -@plus-offset-x: -80px; -@plus-offset-y: -184px; - -@dl-horizontal-offset: @component-offset-horizontal; -// Point at which .dl-horizontal becomes horizontal -@dl-horizontal-breakpoint: @grid-float-breakpoint; \ No newline at end of file From f53450ee2e770c64a004582f8aac2fb6e87dd174 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 18 Nov 2022 22:33:43 +0300 Subject: [PATCH 020/179] Open test app in edit or view mode --- test/documenteditor/main/js/ApplicationController.js | 5 ++--- test/presentationeditor/main/js/ApplicationController.js | 7 ++++++- test/spreadsheeteditor/main/js/ApplicationController.js | 6 ++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/test/documenteditor/main/js/ApplicationController.js b/test/documenteditor/main/js/ApplicationController.js index df27eae8d..452224835 100644 --- a/test/documenteditor/main/js/ApplicationController.js +++ b/test/documenteditor/main/js/ApplicationController.js @@ -124,17 +124,16 @@ DE.ApplicationController = new(function(){ } function onEditorPermissions(params) { - var licType = params.asc_getLicenseType(); appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); - appOptions.canFillForms = appOptions.canLicense && (permissions.fillForms===true) && (config.mode !== 'view'); - appOptions.canSubmitForms = appOptions.canLicense && (typeof (config.customization) == 'object') && !!config.customization.submitForm; + appOptions.isEdit = appOptions.canLicense && (permissions.edit !== false) && (config.mode !== 'view'); api.asc_SetFastCollaborative(true); api.asc_setAutoSaveGap(1); onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); + api.asc_setViewMode(!appOptions.isEdit); api.asc_LoadDocument(); api.Resize(); } diff --git a/test/presentationeditor/main/js/ApplicationController.js b/test/presentationeditor/main/js/ApplicationController.js index 4cd6509fc..5554da96b 100644 --- a/test/presentationeditor/main/js/ApplicationController.js +++ b/test/presentationeditor/main/js/ApplicationController.js @@ -36,6 +36,7 @@ PE.ApplicationController = new(function(){ config = {}, docConfig = {}, permissions = {}, + appOptions = {}, created = false; var LoadingDocument = -256; @@ -118,8 +119,12 @@ PE.ApplicationController = new(function(){ } function onEditorPermissions(params) { + var licType = params.asc_getLicenseType(); + appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); + appOptions.isEdit = appOptions.canLicense && (permissions.edit !== false) && (config.mode !== 'view'); + onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); - api.asc_setViewMode(false); + api.asc_setViewMode(!appOptions.isEdit); api.asc_LoadDocument(); api.Resize(); diff --git a/test/spreadsheeteditor/main/js/ApplicationController.js b/test/spreadsheeteditor/main/js/ApplicationController.js index 6a00d654f..e8e583996 100644 --- a/test/spreadsheeteditor/main/js/ApplicationController.js +++ b/test/spreadsheeteditor/main/js/ApplicationController.js @@ -36,6 +36,7 @@ SSE.ApplicationController = new(function(){ config = {}, docConfig = {}, permissions = {}, + appOptions = {}, maxPages = 0, created = false; @@ -149,10 +150,15 @@ SSE.ApplicationController = new(function(){ } function onEditorPermissions(params) { + var licType = params.asc_getLicenseType(); + appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); + appOptions.isEdit = appOptions.canLicense && (permissions.edit !== false) && (config.mode !== 'view'); + api.asc_SetFastCollaborative(true); api.asc_setAutoSaveGap(1); onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); + api.asc_setViewMode(!appOptions.isEdit); api.asc_LoadDocument(); } From b689546e9428dd47eb995833dcfabd6ebfb682f2 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 18 Nov 2022 23:11:41 +0300 Subject: [PATCH 021/179] [DE test] Add deploy files --- build/documenteditor.json | 30 ++++++++++- test/documenteditor/main/index.html.deploy | 59 ++++++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 test/documenteditor/main/index.html.deploy diff --git a/build/documenteditor.json b/build/documenteditor.json index 3ebde78d9..44076fcab 100644 --- a/build/documenteditor.json +++ b/build/documenteditor.json @@ -1,7 +1,7 @@ { "name": "documenteditor", "version": "4.3.0", - "build": 1149, + "build": 1150, "homepage": "http://www.onlyoffice.com", "private": true, "main": { @@ -364,6 +364,34 @@ ] } }, + "test": { + "clean": { + "prebuild": [ + "../deploy/web-apps/test/documenteditor/main" + ] + }, + "js": { + "src": [ + "../test/common/Gateway.js", + "../test/common/main/lib/util/utils.js", + "../test/documenteditor/main/js/ApplicationView.js", + "../test/documenteditor/main/js/ApplicationController.js", + "../test/documenteditor/main/js/application.js" + ], + "dist": "../deploy/web-apps/test/documenteditor/main/app-all.js" + }, + "less": { + "files": { + "src": "../test/documenteditor/main/resources/less/application.less", + "dist": "../deploy/web-apps/test/documenteditor/main/resources/css/app-all.css" + } + }, + "copy": { + "index-page": { + "../deploy/web-apps/test/documenteditor/main/index.html": "../test/documenteditor/main/index.html.deploy" + } + } + }, "tasks": { "deploy": [ "increment-build", diff --git a/test/documenteditor/main/index.html.deploy b/test/documenteditor/main/index.html.deploy new file mode 100644 index 000000000..dd4e3a597 --- /dev/null +++ b/test/documenteditor/main/index.html.deploy @@ -0,0 +1,59 @@ + + + + + Documents + + + + + + + + + + + +
    + + + + + + + + + + + + + + From a9f285b50ee8a7892087aecf7c0225295869bdfc Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 18 Nov 2022 23:33:09 +0300 Subject: [PATCH 022/179] Fix build test app --- build/Gruntfile.js | 48 ++++++++++++++++++++++++++++++++++++++- build/documenteditor.json | 28 ----------------------- build/testeditor.json | 41 +++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 29 deletions(-) create mode 100644 build/testeditor.json diff --git a/build/Gruntfile.js b/build/Gruntfile.js index a5e9b2649..bef9d497b 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -656,6 +656,49 @@ module.exports = function(grunt) { }); }); + grunt.registerTask('test-app-init', function() { + grunt.initConfig({ + pkg: packageFile, + + clean: { + options: { + force: true + }, + prebuild: packageFile['test']['clean']['prebuild'] + }, + + terser: { + options: { + format: { + comments: false, + preamble: copyright, + }, + }, + build: { + src: packageFile['test']['js']['src'], + dest: packageFile['test']['js']['dist'] + } + }, + + less: { + production: { + options: { + compress: true, + ieCompat: false + }, + files: { + "<%= pkg.test.less.files.dist %>": packageFile['test']['less']['files']['src'] + } + } + }, + + copy: { + 'index-page': { + files: packageFile['test']['copy']['index-page'] + } + } + }); + }); grunt.registerTask('increment-build', function() { var pkg = grunt.file.readJSON(defaultConfig); @@ -696,12 +739,13 @@ module.exports = function(grunt) { /*'replace:writeVersion', 'replace:fixResourceUrl'*/]); grunt.registerTask('deploy-app-embed', ['embed-app-init', 'clean:prebuild', 'terser', 'less', 'copy', 'clean:postbuild']); + grunt.registerTask('deploy-app-test', ['test-app-init', 'clean:prebuild', 'terser', 'less', 'copy']); doRegisterInitializeAppTask('common', 'Common', 'common.json'); doRegisterInitializeAppTask('documenteditor', 'DocumentEditor', 'documenteditor.json'); doRegisterInitializeAppTask('spreadsheeteditor', 'SpreadsheetEditor', 'spreadsheeteditor.json'); doRegisterInitializeAppTask('presentationeditor', 'PresentationEditor', 'presentationeditor.json'); - + doRegisterInitializeAppTask('testeditor', 'TestEditor', 'testeditor.json'); grunt.registerTask('deploy-app', 'Deploy application.', function(){ if (packageFile) { @@ -725,6 +769,8 @@ module.exports = function(grunt) { grunt.registerTask('deploy-spreadsheeteditor', ['deploy-common-component', 'deploy-spreadsheeteditor-component']); grunt.registerTask('deploy-presentationeditor', ['deploy-common-component', 'deploy-presentationeditor-component']); + grunt.registerTask('deploy-testeditor', ['init-build-testeditor', 'deploy-app']); + grunt.registerTask('default', ['deploy-common-component', 'deploy-documenteditor-component', 'deploy-spreadsheeteditor-component', diff --git a/build/documenteditor.json b/build/documenteditor.json index 44076fcab..af6d73319 100644 --- a/build/documenteditor.json +++ b/build/documenteditor.json @@ -364,34 +364,6 @@ ] } }, - "test": { - "clean": { - "prebuild": [ - "../deploy/web-apps/test/documenteditor/main" - ] - }, - "js": { - "src": [ - "../test/common/Gateway.js", - "../test/common/main/lib/util/utils.js", - "../test/documenteditor/main/js/ApplicationView.js", - "../test/documenteditor/main/js/ApplicationController.js", - "../test/documenteditor/main/js/application.js" - ], - "dist": "../deploy/web-apps/test/documenteditor/main/app-all.js" - }, - "less": { - "files": { - "src": "../test/documenteditor/main/resources/less/application.less", - "dist": "../deploy/web-apps/test/documenteditor/main/resources/css/app-all.css" - } - }, - "copy": { - "index-page": { - "../deploy/web-apps/test/documenteditor/main/index.html": "../test/documenteditor/main/index.html.deploy" - } - } - }, "tasks": { "deploy": [ "increment-build", diff --git a/build/testeditor.json b/build/testeditor.json new file mode 100644 index 000000000..6692de090 --- /dev/null +++ b/build/testeditor.json @@ -0,0 +1,41 @@ +{ + "name": "testeditor", + "version": "4.3.0", + "build": 1152, + "homepage": "http://www.onlyoffice.com", + "private": true, + "test": { + "clean": { + "prebuild": [ + "../deploy/web-apps/test/documenteditor/main" + ] + }, + "js": { + "src": [ + "../test/common/Gateway.js", + "../test/common/main/lib/util/utils.js", + "../test/documenteditor/main/js/ApplicationView.js", + "../test/documenteditor/main/js/ApplicationController.js", + "../test/documenteditor/main/js/application.js" + ], + "dist": "../deploy/web-apps/test/documenteditor/main/app-all.js" + }, + "less": { + "files": { + "src": "../test/documenteditor/main/resources/less/application.less", + "dist": "../deploy/web-apps/test/documenteditor/main/resources/css/app-all.css" + } + }, + "copy": { + "index-page": { + "../deploy/web-apps/test/documenteditor/main/index.html": "../test/documenteditor/main/index.html.deploy" + } + } + }, + "tasks": { + "deploy": [ + "increment-build", + "deploy-app-test" + ] + } +} \ No newline at end of file From fb52589aba340e83551b2453dd98c5741f34181c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Sat, 19 Nov 2022 00:14:45 +0300 Subject: [PATCH 023/179] Build test editors --- build/Gruntfile.js | 9 ++- ...esteditor.json => testdocumenteditor.json} | 4 +- build/testpresentationeditor.json | 41 +++++++++++ build/testspreadsheeteditor.json | 43 +++++++++++ test/presentationeditor/main/index.html | 9 --- .../presentationeditor/main/index.html.deploy | 57 +++++++++++++++ test/spreadsheeteditor/main/index.html | 6 -- test/spreadsheeteditor/main/index.html.deploy | 71 +++++++++++++++++++ 8 files changed, 221 insertions(+), 19 deletions(-) rename build/{testeditor.json => testdocumenteditor.json} (95%) create mode 100644 build/testpresentationeditor.json create mode 100644 build/testspreadsheeteditor.json create mode 100644 test/presentationeditor/main/index.html.deploy create mode 100644 test/spreadsheeteditor/main/index.html.deploy diff --git a/build/Gruntfile.js b/build/Gruntfile.js index bef9d497b..fd50df90d 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -745,7 +745,10 @@ module.exports = function(grunt) { doRegisterInitializeAppTask('documenteditor', 'DocumentEditor', 'documenteditor.json'); doRegisterInitializeAppTask('spreadsheeteditor', 'SpreadsheetEditor', 'spreadsheeteditor.json'); doRegisterInitializeAppTask('presentationeditor', 'PresentationEditor', 'presentationeditor.json'); - doRegisterInitializeAppTask('testeditor', 'TestEditor', 'testeditor.json'); + + doRegisterInitializeAppTask('testdocumenteditor', 'TestDocumentEditor', 'testdocumenteditor.json'); + doRegisterInitializeAppTask('testpresentationeditor', 'TestPresentationEditor', 'testpresentationeditor.json'); + doRegisterInitializeAppTask('testspreadsheeteditor', 'TestSpreadsheetEditor', 'testspreadsheeteditor.json'); grunt.registerTask('deploy-app', 'Deploy application.', function(){ if (packageFile) { @@ -769,7 +772,9 @@ module.exports = function(grunt) { grunt.registerTask('deploy-spreadsheeteditor', ['deploy-common-component', 'deploy-spreadsheeteditor-component']); grunt.registerTask('deploy-presentationeditor', ['deploy-common-component', 'deploy-presentationeditor-component']); - grunt.registerTask('deploy-testeditor', ['init-build-testeditor', 'deploy-app']); + grunt.registerTask('deploy-testdocumenteditor', ['init-build-testdocumenteditor', 'deploy-app']); + grunt.registerTask('deploy-testpresentationeditor', ['init-build-testpresentationeditor', 'deploy-app']); + grunt.registerTask('deploy-testspreadsheeteditor', ['init-build-testspreadsheeteditor', 'deploy-app']); grunt.registerTask('default', ['deploy-common-component', 'deploy-documenteditor-component', diff --git a/build/testeditor.json b/build/testdocumenteditor.json similarity index 95% rename from build/testeditor.json rename to build/testdocumenteditor.json index 6692de090..d54ed3c74 100644 --- a/build/testeditor.json +++ b/build/testdocumenteditor.json @@ -1,7 +1,7 @@ { - "name": "testeditor", + "name": "testdocumenteditor", "version": "4.3.0", - "build": 1152, + "build": 1153, "homepage": "http://www.onlyoffice.com", "private": true, "test": { diff --git a/build/testpresentationeditor.json b/build/testpresentationeditor.json new file mode 100644 index 000000000..265b9644c --- /dev/null +++ b/build/testpresentationeditor.json @@ -0,0 +1,41 @@ +{ + "name": "testpresentationeditor", + "version": "4.3.0", + "build": 1153, + "homepage": "http://www.onlyoffice.com", + "private": true, + "test": { + "clean": { + "prebuild": [ + "../deploy/web-apps/test/presentationeditor/main" + ] + }, + "js": { + "src": [ + "../test/common/Gateway.js", + "../test/common/main/lib/util/utils.js", + "../test/presentationeditor/main/js/ApplicationView.js", + "../test/presentationeditor/main/js/ApplicationController.js", + "../test/presentationeditor/main/js/application.js" + ], + "dist": "../deploy/web-apps/test/presentationeditor/main/app-all.js" + }, + "less": { + "files": { + "src": "../test/presentationeditor/main/resources/less/application.less", + "dist": "../deploy/web-apps/test/presentationeditor/main/resources/css/app-all.css" + } + }, + "copy": { + "index-page": { + "../deploy/web-apps/test/presentationeditor/main/index.html": "../test/presentationeditor/main/index.html.deploy" + } + } + }, + "tasks": { + "deploy": [ + "increment-build", + "deploy-app-test" + ] + } +} \ No newline at end of file diff --git a/build/testspreadsheeteditor.json b/build/testspreadsheeteditor.json new file mode 100644 index 000000000..30f491351 --- /dev/null +++ b/build/testspreadsheeteditor.json @@ -0,0 +1,43 @@ +{ + "name": "testspreadsheeteditor", + "version": "4.3.0", + "build": 1153, + "homepage": "http://www.onlyoffice.com", + "private": true, + "test": { + "clean": { + "prebuild": [ + "../deploy/web-apps/test/spreadsheeteditor/main" + ] + }, + "js": { + "src": [ + "../test/common/Gateway.js", + "../test/common/main/lib/util/utils.js", + "../test/spreadsheeteditor/main/js/CellEditorView.js", + "../test/spreadsheeteditor/main/js/CellEditorController.js", + "../test/spreadsheeteditor/main/js/ApplicationView.js", + "../test/spreadsheeteditor/main/js/ApplicationController.js", + "../test/spreadsheeteditor/main/js/application.js" + ], + "dist": "../deploy/web-apps/test/spreadsheeteditor/main/app-all.js" + }, + "less": { + "files": { + "src": "../test/spreadsheeteditor/main/resources/less/application.less", + "dist": "../deploy/web-apps/test/spreadsheeteditor/main/resources/css/app-all.css" + } + }, + "copy": { + "index-page": { + "../deploy/web-apps/test/spreadsheeteditor/main/index.html": "../test/spreadsheeteditor/main/index.html.deploy" + } + } + }, + "tasks": { + "deploy": [ + "increment-build", + "deploy-app-test" + ] + } +} \ No newline at end of file diff --git a/test/presentationeditor/main/index.html b/test/presentationeditor/main/index.html index cf25a4c1d..f95483e69 100644 --- a/test/presentationeditor/main/index.html +++ b/test/presentationeditor/main/index.html @@ -13,8 +13,6 @@ -
    -
    @@ -56,13 +54,6 @@ - - - + +
    + + + + + + + + + + + + + + diff --git a/test/spreadsheeteditor/main/index.html b/test/spreadsheeteditor/main/index.html index 4bee12046..9ab144afd 100644 --- a/test/spreadsheeteditor/main/index.html +++ b/test/spreadsheeteditor/main/index.html @@ -68,12 +68,6 @@ - - + +
    + +
    +
      +
      + + + + + + + + + + + + + + + + From fc8e344dd99d28f35fec2129c170428e23f36788 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Thu, 24 Nov 2022 08:21:13 +0300 Subject: [PATCH 024/179] QuickPrint for compactHeader --- .../main/app/controller/Toolbar.js | 29 +++++++++++++++++-- apps/documenteditor/main/app/view/Toolbar.js | 28 +++++++++++++++++- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 1caab736f..0f8b0142e 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -372,6 +372,7 @@ define([ Common.Gateway.on('setmailmergerecipients', _.bind(this.setMailMergeRecipients, this)); $('#id-toolbar-menu-new-control-color').on('click', _.bind(this.onNewControlsColor, this)); toolbar.listStylesAdditionalMenuItem.on('click', this.onMenuSaveStyle.bind(this)); + toolbar.btnPrint.menu && toolbar.btnPrint.menu.on('item:click', _.bind(this.onPrintMenu, this)); this.onSetupCopyStyleButton(); this.onBtnChangeState('undo:disabled', toolbar.btnUndo, toolbar.btnUndo.isDisabled()); @@ -1061,11 +1062,35 @@ define([ }, onPrint: function(e) { - Common.NotificationCenter.trigger('file:print', this.toolbar); - Common.NotificationCenter.trigger('edit:complete', this.toolbar); + if (this.toolbar.btnPrint.options.printType == 'print') { + Common.NotificationCenter.trigger('file:print', this.toolbar); + Common.NotificationCenter.trigger('edit:complete', this.toolbar); + } else { + var _main = this.getApplication().getController('Main'); + _main.onPrintQuick(); + + } + Common.component.Analytics.trackEvent('Print'); Common.component.Analytics.trackEvent('ToolBar', 'Print'); + + }, + + onPrintMenu: function (btn, e){ + var oldType = this.toolbar.btnPrint.options.printType; + var newType = e.value; + //this.toolbar.btnPrint.toggle(true); + + if(newType != oldType) { + this.toolbar.btnPrint.changeIcon({ + next: e.options.iconClsForMainBtn, + curr: this.toolbar.btnPrint.menu.items.filter(function(item){return item.value == oldType;})[0].options.iconClsForMainBtn + }); + this.toolbar.btnPrint.updateHint([e.caption, this.views.Toolbar.prototype.tipInsertText]); + this.toolbar.btnPrint.options.printType = newType; + } + this.onPrint(e); }, onSave: function(e) { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 7017370ce..d350ec53e 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -192,8 +192,11 @@ define([ lock: [_set.cantPrint, _set.disableOnStart], signals: ['disabled'], dataHint: '1', + split: config.canQuickPrint && Common.localStorage.getBool("de-settings-quick-print-button",false), + menu: config.canQuickPrint && Common.localStorage.getBool("de-settings-quick-print-button",false), dataHintDirection: 'top', - dataHintTitle: 'P' + dataHintTitle: 'P', + printType: 'print' }); this.toolbarControls.push(this.btnPrint); @@ -1744,6 +1747,28 @@ define([ })).then(function () { if ( !config.isEdit ) return; + if(me.btnPrint && config.canQuickPrint && Common.localStorage.getBool("de-settings-quick-print-button",false)){ + me.btnPrint.setMenu( + new Common.UI.Menu({ + items:[ + { + caption: 'Print', + iconCls: 'menu__icon btn-print', + toggleGroup: 'viewPrint', + value: 'print', + iconClsForMainBtn: 'btn-print' + }, + { + caption: 'QuickPrint', + iconCls: 'menu__icon btn-quick-print', + toggleGroup: 'viewPrint', + value: 'print-quick', + iconClsForMainBtn: 'btn-quick-print' + } + ] + })); + } + me.btnsPageBreak.forEach( function(btn) { btn.updateHint( [me.textInsPageBreak, me.tipPageBreak] ); @@ -2030,6 +2055,7 @@ define([ ids.push('id-toolbar-menu-markers-level-' + i); items.push({template: levelTemplate, previewId: ids[i], level: i, checkable: true }); } + this.btnMarkers.setMenu( new Common.UI.Menu({ cls: 'shifted-left', From 68e7e292b5675745753de79cee7795e1ea1a005a Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 24 Nov 2022 23:08:52 +0300 Subject: [PATCH 025/179] Fix bugs --- .../documenteditor/main/app/template/RolesManagerDlg.template | 2 +- apps/documenteditor/main/app/view/RolesManagerDlg.js | 4 ++-- .../documenteditor/main/resources/less/advanced-settings.less | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/template/RolesManagerDlg.template b/apps/documenteditor/main/app/template/RolesManagerDlg.template index 3a618452f..06577e87e 100644 --- a/apps/documenteditor/main/app/template/RolesManagerDlg.template +++ b/apps/documenteditor/main/app/template/RolesManagerDlg.template @@ -12,7 +12,7 @@ -
      +
      diff --git a/apps/documenteditor/main/app/view/RolesManagerDlg.js b/apps/documenteditor/main/app/view/RolesManagerDlg.js index 70a2282bd..b8d78e449 100644 --- a/apps/documenteditor/main/app/view/RolesManagerDlg.js +++ b/apps/documenteditor/main/app/view/RolesManagerDlg.js @@ -387,8 +387,8 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', }, onKeyDown: function (lisvView, record, e) { - if (e.keyCode==Common.UI.Keys.DELETE && !this.btnDeleteRange.isDisabled()) - this.onDeleteRange(); + if (e.keyCode==Common.UI.Keys.DELETE && !this.btnDeleteRole.isDisabled()) + this.onDeleteRole(); }, onDblClickItem: function (lisvView, record, e) { diff --git a/apps/documenteditor/main/resources/less/advanced-settings.less b/apps/documenteditor/main/resources/less/advanced-settings.less index 21d5bae6b..37a144aa3 100644 --- a/apps/documenteditor/main/resources/less/advanced-settings.less +++ b/apps/documenteditor/main/resources/less/advanced-settings.less @@ -76,6 +76,9 @@ .advanced-settings-dlg { .roles-tableview { + &.no-borders > .listview .item { + border-width: 0 !important; + } .list-item { display: flex; align-items: center; From 5251f9f5e3cd9343b6f4c93cb854048d2054ce21 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 25 Nov 2022 13:02:20 +0300 Subject: [PATCH 026/179] [DE] Update icons for roles windows --- .../main/app/view/RolesManagerDlg.js | 6 +++-- .../main/app/view/SaveFormDlg.js | 6 +++-- apps/documenteditor/main/index.html | 1 + apps/documenteditor/main/index.html.deploy | 1 + apps/documenteditor/main/index_loader.html | 1 + .../main/index_loader.html.deploy | 2 +- .../main/resources/img/form-points.svg | 22 ++++++++++++++++ .../resources/less/advanced-settings.less | 25 +++++++++++++++---- 8 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 apps/documenteditor/main/resources/img/form-points.svg diff --git a/apps/documenteditor/main/app/view/RolesManagerDlg.js b/apps/documenteditor/main/app/view/RolesManagerDlg.js index b8d78e449..26b4cfd9e 100644 --- a/apps/documenteditor/main/app/view/RolesManagerDlg.js +++ b/apps/documenteditor/main/app/view/RolesManagerDlg.js @@ -93,7 +93,7 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', emptyText: this.textEmpty, itemTemplate: _.template([ '
      ', - '
      ', + '
      ', '
      <%= index+1 %>
      ', '
      ', '', @@ -197,7 +197,9 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', }, getIconCls: function(index) { - return (index===0) ? 'btn-arrow-up' : (index===this.rolesList.store.length-1 ? 'btn-arrow-down' : 'btn-border-insidevert'); + if (this.rolesList.store.length===1) + return 'Point'; + return (index===0) ? 'StartPoint' : (index===this.rolesList.store.length-1 ? 'EndPoint' : 'MiddlePoint'); }, onEditRole: function (isEdit) { diff --git a/apps/documenteditor/main/app/view/SaveFormDlg.js b/apps/documenteditor/main/app/view/SaveFormDlg.js index 454c65898..c3cd953c2 100644 --- a/apps/documenteditor/main/app/view/SaveFormDlg.js +++ b/apps/documenteditor/main/app/view/SaveFormDlg.js @@ -112,7 +112,7 @@ define([ 'common/main/lib/view/AdvancedSettingsWindow', emptyText: this.textEmpty, itemTemplate: _.template([ '
      ', - '
      ', + '
      ', '
      <%= Common.Utils.String.htmlEncode(name) %>
      ', '
      ' ].join('')) @@ -144,7 +144,9 @@ define([ 'common/main/lib/view/AdvancedSettingsWindow', }, getIconCls: function(index) { - return (index===0) ? 'btn-arrow-up' : (index===this.rolesList.store.length-1 ? 'btn-arrow-down' : 'btn-border-insidevert'); + if (this.rolesList.store.length===1) + return 'Point'; + return (index===0) ? 'StartPoint' : (index===this.rolesList.store.length-1 ? 'EndPoint' : 'MiddlePoint'); }, txtTitle: 'Save as Form', diff --git a/apps/documenteditor/main/index.html b/apps/documenteditor/main/index.html index e0a2a1814..e2c5a6fcf 100644 --- a/apps/documenteditor/main/index.html +++ b/apps/documenteditor/main/index.html @@ -332,6 +332,7 @@ + diff --git a/apps/documenteditor/main/index_loader.html b/apps/documenteditor/main/index_loader.html index 80c10c94a..b25428556 100644 --- a/apps/documenteditor/main/index_loader.html +++ b/apps/documenteditor/main/index_loader.html @@ -272,6 +272,7 @@ + diff --git a/apps/documenteditor/main/resources/img/form-points.svg b/apps/documenteditor/main/resources/img/form-points.svg new file mode 100644 index 000000000..2a1c6ac75 --- /dev/null +++ b/apps/documenteditor/main/resources/img/form-points.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/documenteditor/main/resources/less/advanced-settings.less b/apps/documenteditor/main/resources/less/advanced-settings.less index 37a144aa3..0ab664c52 100644 --- a/apps/documenteditor/main/resources/less/advanced-settings.less +++ b/apps/documenteditor/main/resources/less/advanced-settings.less @@ -79,9 +79,16 @@ &.no-borders > .listview .item { border-width: 0 !important; } + .item { + padding: 0 6px; + } + + @item-width: 20px; + @item-height: 28px; .list-item { display: flex; align-items: center; + height: @item-height; span.color { display: block; @@ -100,16 +107,24 @@ } .listitem-icon { - width: 20px; - height: 20px; - vertical-align: middle; + width: @item-width; + height: @item-height; margin-right: 5px; + + svg { + width: @item-width; + height: @item-height; + fill: @text-normal-ie; + fill: @text-normal; + } } .selected { .listitem-icon { - background-position-x: -20px; - background-position-x: @button-small-active-icon-offset-x; + svg { + fill: @text-normal-pressed-ie; + fill: @text-normal-pressed; + } } } } From 07390eb4280ac0e9b0f440053cecb526e7103ebb Mon Sep 17 00:00:00 2001 From: OVSharova Date: Sat, 26 Nov 2022 17:11:39 +0300 Subject: [PATCH 027/179] Quick Print for all editors --- .../main/app/controller/Main.js | 3 +- .../main/app/controller/Toolbar.js | 6 +--- .../main/app/view/FileMenuPanels.js | 2 +- apps/documenteditor/main/app/view/Toolbar.js | 17 ++++++---- apps/documenteditor/main/locale/en.json | 1 + .../main/app/controller/Main.js | 3 +- .../main/app/controller/Toolbar.js | 25 ++++++++++++-- .../main/app/view/FileMenuPanels.js | 2 +- .../main/app/view/Toolbar.js | 30 ++++++++++++++++- apps/presentationeditor/main/locale/en.json | 1 + .../main/app/controller/Main.js | 3 +- .../main/app/controller/Toolbar.js | 23 ++++++++++++- .../main/app/view/FileMenuPanels.js | 2 +- .../main/app/view/Toolbar.js | 33 +++++++++++++++++-- apps/spreadsheeteditor/main/locale/en.json | 1 + 15 files changed, 125 insertions(+), 27 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index ea4d3dbec..278cc9ffb 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1495,8 +1495,7 @@ define([ this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit; this.appOptions.canPrint = (this.permissions.print !== false); this.appOptions.canPreviewPrint = this.appOptions.canPrint && !Common.Utils.isMac && this.appOptions.isDesktopApp; - this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp && - !(this.editorConfig.customization && this.editorConfig.customization.compactHeader); + this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp && !this.editorConfig.customization; this.appOptions.canRename = this.editorConfig.canRename; this.appOptions.buildVersion = params.asc_getBuildVersion(); this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 0f8b0142e..c3ebfbae6 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1068,10 +1068,7 @@ define([ } else { var _main = this.getApplication().getController('Main'); _main.onPrintQuick(); - } - - Common.component.Analytics.trackEvent('Print'); Common.component.Analytics.trackEvent('ToolBar', 'Print'); @@ -1080,14 +1077,13 @@ define([ onPrintMenu: function (btn, e){ var oldType = this.toolbar.btnPrint.options.printType; var newType = e.value; - //this.toolbar.btnPrint.toggle(true); if(newType != oldType) { this.toolbar.btnPrint.changeIcon({ next: e.options.iconClsForMainBtn, curr: this.toolbar.btnPrint.menu.items.filter(function(item){return item.value == oldType;})[0].options.iconClsForMainBtn }); - this.toolbar.btnPrint.updateHint([e.caption, this.views.Toolbar.prototype.tipInsertText]); + this.toolbar.btnPrint.updateHint([e.caption + e.options.platformKey, this.views.Toolbar.prototype.tipInsertText]); this.toolbar.btnPrint.options.printType = newType; } this.onPrint(e); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 76b6be72d..efa86f224 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -781,7 +781,7 @@ define([ $('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide'](); /** coauthoring end **/ - $('tr.quick-print', this.el)[mode.canQuickPrint ? 'show' : 'hide'](); + $('tr.quick-print', this.el)[mode.canQuickPrint && !mode.customization.compactHeader ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index d350ec53e..e048a58c4 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -191,9 +191,9 @@ define([ iconCls: 'toolbar__icon btn-print no-mask', lock: [_set.cantPrint, _set.disableOnStart], signals: ['disabled'], + split: config.canQuickPrint, + menu: config.canQuickPrint, dataHint: '1', - split: config.canQuickPrint && Common.localStorage.getBool("de-settings-quick-print-button",false), - menu: config.canQuickPrint && Common.localStorage.getBool("de-settings-quick-print-button",false), dataHintDirection: 'top', dataHintTitle: 'P', printType: 'print' @@ -1747,23 +1747,25 @@ define([ })).then(function () { if ( !config.isEdit ) return; - if(me.btnPrint && config.canQuickPrint && Common.localStorage.getBool("de-settings-quick-print-button",false)){ + if(me.btnPrint.menu){ me.btnPrint.setMenu( new Common.UI.Menu({ items:[ { - caption: 'Print', + caption: me.tipPrint, iconCls: 'menu__icon btn-print', toggleGroup: 'viewPrint', value: 'print', - iconClsForMainBtn: 'btn-print' + iconClsForMainBtn: 'btn-print', + platformKey: Common.Utils.String.platformKey('Ctrl+P') }, { - caption: 'QuickPrint', + caption: me.tipPrintQuick, iconCls: 'menu__icon btn-quick-print', toggleGroup: 'viewPrint', value: 'print-quick', - iconClsForMainBtn: 'btn-quick-print' + iconClsForMainBtn: 'btn-quick-print', + platformKey: '' } ] })); @@ -2695,6 +2697,7 @@ define([ tipUndo: 'Undo', tipRedo: 'Redo', tipPrint: 'Print', + tipPrintQuick: 'Quick print', tipSave: 'Save', tipIncFont: 'Increment font size', tipDecFont: 'Decrement font size', diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 3e9789aab..c9d56fd3e 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -2934,6 +2934,7 @@ "DE.Views.Toolbar.tipPaste": "Paste", "DE.Views.Toolbar.tipPrColor": "Paragraph background color", "DE.Views.Toolbar.tipPrint": "Print", + "DE.Views.Toolbar.tipPrintQuick": "Quick print", "DE.Views.Toolbar.tipRedo": "Redo", "DE.Views.Toolbar.tipSave": "Save", "DE.Views.Toolbar.tipSaveCoauth": "Save your changes for the other users to see them.", diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 317a4cf52..4825c903e 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1166,8 +1166,7 @@ define([ } this.appOptions.canPrint = (this.permissions.print !== false); this.appOptions.canPreviewPrint = this.appOptions.canPrint && !Common.Utils.isMac && this.appOptions.isDesktopApp; - this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp && - !(this.editorConfig.customization && this.editorConfig.customization.compactHeader); + this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp && !this.editorConfig.customization; this.appOptions.canRename = this.editorConfig.canRename; this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); this.appOptions.forcesave = this.appOptions.canForcesave; diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 4ab653747..dd525e36c 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -284,6 +284,7 @@ define([ toolbar.btnPreview.menu.on('item:click', _.bind(this.onPreviewItemClick, this)); toolbar.btnPrint.on('click', _.bind(this.onPrint, this)); toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled')); + toolbar.btnPrint.menu && toolbar.btnPrint.menu.on('item:click', _.bind(this.onPrintMenu, this)); toolbar.btnSave.on('click', _.bind(this.onSave, this)); toolbar.btnUndo.on('click', _.bind(this.onUndo, this)); toolbar.btnUndo.on('disabled', _.bind(this.onBtnChangeState, this, 'undo:disabled')); @@ -1065,13 +1066,33 @@ define([ }, onPrint: function(e) { - Common.NotificationCenter.trigger('file:print', this.toolbar); - Common.NotificationCenter.trigger('edit:complete', this.toolbar); + if (this.toolbar.btnPrint.options.printType == 'print') { + Common.NotificationCenter.trigger('file:print', this.toolbar); + Common.NotificationCenter.trigger('edit:complete', this.toolbar); + } else { + var _main = this.getApplication().getController('Main'); + _main.onPrintQuick(); + } Common.component.Analytics.trackEvent('Print'); Common.component.Analytics.trackEvent('ToolBar', 'Print'); }, + onPrintMenu: function (btn, e){ + var oldType = this.toolbar.btnPrint.options.printType; + var newType = e.value; + + if(newType != oldType) { + this.toolbar.btnPrint.changeIcon({ + next: e.options.iconClsForMainBtn, + curr: this.toolbar.btnPrint.menu.items.filter(function(item){return item.value == oldType;})[0].options.iconClsForMainBtn + }); + this.toolbar.btnPrint.updateHint([e.caption + e.options.platformKey, this.views.Toolbar.prototype.tipInsertText]); + this.toolbar.btnPrint.options.printType = newType; + } + this.onPrint(e); + }, + onSave: function(e) { var toolbar = this.toolbar; if (this.api && this.api.asc_isDocumentCanSave) { diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 0c2699780..07a579645 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -612,7 +612,7 @@ define([ $('tr.live-viewer', this.el)[mode.canLiveView && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); $('tr.spellcheck', this.el)[mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide'](); - $('tr.quick-print', this.el)[mode.canQuickPrint ? 'show' : 'hide'](); + $('tr.quick-print', this.el)[mode.canQuickPrint && !mode.customization.compactHeader ? 'show' : 'hide'](); if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 66cb3de83..64bbc3ee5 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -211,9 +211,12 @@ define([ iconCls: 'toolbar__icon btn-print no-mask', lock: [_set.slideDeleted, _set.noSlides, _set.cantPrint, _set.disableOnStart], signals: ['disabled'], + split: config.canQuickPrint, + menu: config.canQuickPrint, dataHint: '1', dataHintDirection: 'top', - dataHintTitle: 'P' + dataHintTitle: 'P', + printType: 'print' }); me.slideOnlyControls.push(me.btnPrint); @@ -1301,6 +1304,30 @@ define([ var me = this; if (!config.isEdit) return; + if(me.btnPrint.menu) { + me.btnPrint.setMenu( + new Common.UI.Menu({ + items:[ + { + caption: me.tipPrint, + iconCls: 'menu__icon btn-print', + toggleGroup: 'viewPrint', + value: 'print', + iconClsForMainBtn: 'btn-print', + platformKey: Common.Utils.String.platformKey('Ctrl+P') + }, + { + caption: me.tipPrintQuick, + iconCls: 'menu__icon btn-quick-print', + toggleGroup: 'viewPrint', + value: 'print-quick', + iconClsForMainBtn: 'btn-quick-print', + platformKey: '' + } + ] + })); + } + me.btnsInsertImage.forEach(function (btn) { btn.updateHint(me.tipInsertImage); btn.setMenu( @@ -1907,6 +1934,7 @@ define([ tipUndo: 'Undo', tipRedo: 'Redo', tipPrint: 'Print', + tipPrintQuick: 'Quick print', tipSave: 'Save', tipFontColor: 'Font color', tipMarkers: 'Bullets', diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 038a71687..1c58b43ca 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -2319,6 +2319,7 @@ "PE.Views.Toolbar.tipPaste": "Paste", "PE.Views.Toolbar.tipPreview": "Start slideshow", "PE.Views.Toolbar.tipPrint": "Print", + "PE.Views.Toolbar.tipPrintQuick": "Quick print", "PE.Views.Toolbar.tipRedo": "Redo", "PE.Views.Toolbar.tipSave": "Save", "PE.Views.Toolbar.tipSaveCoauth": "Save your changes for the other users to see them.", diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 5cf541689..74db5ca0c 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1291,8 +1291,7 @@ define([ this.appOptions.isEdit = (this.appOptions.canLicense || this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.permissions.edit !== false && this.editorConfig.mode !== 'view'; this.appOptions.canDownload = (this.permissions.download !== false); this.appOptions.canPrint = (this.permissions.print !== false); - this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp && - !(this.editorConfig.customization && this.editorConfig.customization.compactHeader); + this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp && !this.editorConfig.customization; this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); this.appOptions.forcesave = this.appOptions.canForcesave; diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 7285f80de..9aede9004 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -359,6 +359,7 @@ define([ } else { toolbar.btnPrint.on('click', _.bind(this.onPrint, this)); toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled')); + toolbar.btnPrint.menu && toolbar.btnPrint.menu.on('item:click', _.bind(this.onPrintMenu, this)); toolbar.btnSave.on('click', _.bind(this.onSave, this)); toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled')); toolbar.btnUndo.on('click', _.bind(this.onUndo, this)); @@ -523,7 +524,27 @@ define([ }, onPrint: function(e) { - Common.NotificationCenter.trigger('print', this.toolbar); + if (this.toolbar.btnPrint.options.printType == 'print') { + Common.NotificationCenter.trigger('print', this.toolbar); + } else { + var _main = this.getApplication().getController('Main'); + _main.onPrintQuick(); + } + }, + + onPrintMenu: function (btn, e){ + var oldType = this.toolbar.btnPrint.options.printType; + var newType = e.value; + + if(newType != oldType) { + this.toolbar.btnPrint.changeIcon({ + next: e.options.iconClsForMainBtn, + curr: this.toolbar.btnPrint.menu.items.filter(function(item){return item.value == oldType;})[0].options.iconClsForMainBtn + }); + this.toolbar.btnPrint.updateHint([e.caption + e.options.platformKey, this.views.Toolbar.prototype.tipInsertText]); + this.toolbar.btnPrint.options.printType = newType; + } + this.onPrint(e); }, onSave: function(e) { diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 0a42ae9bf..9888aed94 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -799,7 +799,7 @@ define([ $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.live-viewer', this.el)[mode.canLiveView && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); - $('tr.quick-print', this.el)[mode.canQuickPrint ? 'show' : 'hide'](); + $('tr.quick-print', this.el)[mode.canQuickPrint && !mode.customization.compactHeader ? 'show' : 'hide'](); if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 3e11fe62f..565688f16 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -800,10 +800,13 @@ define([ cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-print no-mask', lock : [_set.editCell, _set.cantPrint, _set.disableOnStart], - signals: ['disabled'], + signals : ['disabled'], + split : config.canQuickPrint, + menu : config.canQuickPrint, dataHint : '1', dataHintDirection: 'top', - dataHintTitle: 'P' + dataHintTitle: 'P', + printType: 'print' }); me.btnSave = new Common.UI.Button({ @@ -2963,6 +2966,31 @@ define([ if (!this.mode.isEdit || this.mode.isEditMailMerge || this.mode.isEditDiagram || this.mode.isEditOle) return; var me = this; + + if(me.btnPrint.menu) { + me.btnPrint.setMenu( + new Common.UI.Menu({ + items:[ + { + caption: me.tipPrint, + iconCls: 'menu__icon btn-print', + toggleGroup: 'viewPrint', + value: 'print', + iconClsForMainBtn: 'btn-print', + platformKey: Common.Utils.String.platformKey('Ctrl+P') + }, + { + caption: me.tipPrintQuick, + iconCls: 'menu__icon btn-quick-print', + toggleGroup: 'viewPrint', + value: 'print-quick', + iconClsForMainBtn: 'btn-quick-print', + platformKey: '' + } + ] + })); + } + var _holder_view = SSE.getController('DocumentHolder').getView('DocumentHolder'); me.btnImgForward.updateHint(me.tipSendForward); me.btnImgForward.setMenu(new Common.UI.Menu({ @@ -3061,6 +3089,7 @@ define([ tipUndo: 'Undo', tipRedo: 'Redo', tipPrint: 'Print', + tipPrintQuick: 'Quick print', tipSave: 'Save', tipFontColor: 'Font color', tipPrColor: 'Background color', diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 2b1e64c04..ad104c211 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -3538,6 +3538,7 @@ "SSE.Views.Toolbar.tipPrColor": "Fill color", "SSE.Views.Toolbar.tipPrint": "Print", "SSE.Views.Toolbar.tipPrintArea": "Print area", + "SSE.Views.Toolbar.tipPrintQuick": "Quick print", "SSE.Views.Toolbar.tipPrintTitles": "Print titles", "SSE.Views.Toolbar.tipRedo": "Redo", "SSE.Views.Toolbar.tipSave": "Save", From fa29dd9a48a623399cb34a53f67719d39812aa95 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 28 Nov 2022 18:25:02 +0300 Subject: [PATCH 028/179] [DE] Use sdk methods --- .../main/app/controller/FormsTab.js | 36 +++--- .../main/app/view/FormSettings.js | 28 +++-- apps/documenteditor/main/app/view/FormsTab.js | 27 +++- .../main/app/view/RolesManagerDlg.js | 118 ++++++++++-------- .../main/app/view/SaveFormDlg.js | 10 +- 5 files changed, 135 insertions(+), 84 deletions(-) diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 53d3d4d39..3b7263d8a 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -60,7 +60,6 @@ define([ }, onLaunch: function () { this._state = {}; - this.roles = []; }, setApi: function (api) { @@ -75,7 +74,7 @@ define([ this.api.asc_registerCallback('asc_onEndAction', _.bind(this.onLongActionEnd, this)); this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this)); this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this)); - this.api.asc_registerCallback('asc_onRefreshRolesList', _.bind(this.onRefreshRolesList, this)); + this.api.asc_registerCallback('asc_onUpdateOFormRoles', _.bind(this.onRefreshRolesList, this)); // this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this)); // this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this)); @@ -395,11 +394,12 @@ define([ // } config.isEdit && config.canFeatureContentControl && config.isFormCreator && me.showCreateFormTip(); // show tip only when create form in docxf // change to event asc_onRefreshRolesList - me.onRefreshRolesList([ - {name: 'employee 1', color: Common.Utils.ThemeColor.getRgbColor('ff0000'), fields: 5}, - {name: 'employee 2', color: Common.Utils.ThemeColor.getRgbColor('00ff00'), fields: 1}, - {name: 'manager', color: null, fields: 10} - ]); + me.onRefreshRolesList(); + // me.onRefreshRolesList([ + // {name: 'employee 1', color: Common.Utils.ThemeColor.getRgbColor('ff0000'), fields: 5}, + // {name: 'employee 2', color: Common.Utils.ThemeColor.getRgbColor('00ff00'), fields: 1}, + // {name: 'manager', color: null, fields: 10} + // ]); me.onChangeProtectDocument(); }); }, @@ -451,36 +451,40 @@ define([ }, onRefreshRolesList: function(roles) { - this.roles = roles; + if (!roles) { + var oform = this.api.asc_GetOForm(); + oform && (roles = oform.asc_getAllRoles()); + } this.view && this.view.fillRolesMenu(roles, this._state.lastRole); }, onManagerClick: function() { var me = this; - (new DE.Views.RolesManagerDlg({ + this.api.asc_GetOForm() && (new DE.Views.RolesManagerDlg({ api: me.api, handler: function(result, settings) { - me.roles = settings; - me.onRefreshRolesList(me.roles); - Common.component.Analytics.trackEvent('ToolBar', 'Roles Manager'); + // me.roles = settings; + // me.onRefreshRolesList(me.roles); + // Common.component.Analytics.trackEvent('ToolBar', 'Roles Manager'); Common.NotificationCenter.trigger('edit:complete', me.toolbar); }, - roles: me.roles, + // roles: me.roles, props : undefined })).on('close', function(win){ }).show(); }, showRolesList: function(callback) { - var me = this; - (new DE.Views.SaveFormDlg({ + var me = this, + oform = this.api.asc_GetOForm(); + oform && (new DE.Views.SaveFormDlg({ handler: function(result, settings) { if (result=='ok') callback.call(me); else Common.NotificationCenter.trigger('edit:complete', me.toolbar); }, - roles: me.roles + roles: oform.asc_getAllRoles() })).show(); }, diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index 4a6d3511b..ca1e1b6c3 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -611,7 +611,7 @@ define([ this.api = api; if (this.api) { // this.api.asc_registerCallback('asc_onParaSpacingLine', _.bind(this._onLineSpacing, this)); - this.api.asc_registerCallback('asc_onRefreshRolesList', _.bind(this.onRefreshRolesList, this)); + this.api.asc_registerCallback('asc_onUpdateOFormRoles', _.bind(this.onRefreshRolesList, this)); } Common.NotificationCenter.on('storage:image-insert', _.bind(this.insertImageFromStorage, this)); return this; @@ -1585,23 +1585,28 @@ define([ } if (!roles) { + roles = this.api.asc_GetOForm().asc_getAllRoles(); + // change to event asc_onRefreshRolesList - roles = [ - {name: 'employee 1', color: Common.Utils.ThemeColor.getRgbColor('ff0000'), fields: 5}, - {name: 'employee 2', color: Common.Utils.ThemeColor.getRgbColor('00ff00'), fields: 1}, - {name: 'manager', color: null, fields: 10} - ]; + // roles = [ + // {name: 'employee 1', color: Common.Utils.ThemeColor.getRgbColor('ff0000'), fields: 5}, + // {name: 'employee 2', color: Common.Utils.ThemeColor.getRgbColor('00ff00'), fields: 1}, + // {name: 'manager', color: null, fields: 10} + // ]; } var lastrole = this.cmbRoles.getSelectedRecord(); - lastrole = lastrole ? lastrole.get('value') : ''; + lastrole = lastrole ? lastrole.value : ''; var arr = []; + var me = this; roles && roles.forEach(function(item) { + var role = item.asc_getSettings(), + color = role.asc_getColor(); arr.push({ - displayValue: item.name, - value: item.name, - color: item.color ? '#' + Common.Utils.ThemeColor.getHexColor(item.color.get_r(), item.color.get_g(), item.color.get_b()) : 'transparent' + displayValue: role.asc_getName() || me.textAnyone, + value: role.asc_getName(), + color: color ? '#' + Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()) : 'transparent' }); }); this.cmbRoles.setData(arr); @@ -1671,7 +1676,8 @@ define([ textLetters: 'Letters', textDigits: 'Digits', textNone: 'None', - textComplex: 'Complex Field' + textComplex: 'Complex Field', + textAnyone: 'Anyone' }, DE.Views.FormSettings || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index 0cf268afe..09d0396ed 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -117,6 +117,10 @@ define([ me.fireEvent('forms:mode', [true, item.caption]); } }, me)); + this.btnViewFormRoles.menu.on('show:after', function (menu) { + me.fillRolesMenu(); + }); + this.btnManager && this.btnManager.on('click', function (b, e) { me.fireEvent('forms:manager'); }); @@ -155,6 +159,7 @@ define([ this.appConfig = options.config; this.paragraphControls = []; + this._state = {}; var me = this; var _set = Common.enumLock; @@ -457,17 +462,30 @@ define([ }, fillRolesMenu: function(roles, lastRole) { + if (!(this.btnViewFormRoles && this.btnViewFormRoles.menu && this.btnViewFormRoles.menu.isVisible())) { + this._state.roles = roles; + this._state.lastRole = lastRole; + return; + } + roles = roles || this._state.roles; + lastRole = lastRole || this._state.lastRole; + this._state.roles = this._state.lastRole = undefined; + + if (!roles) return; + var checkedIndex = 0, me = this; this.btnViewFormRoles.menu.removeAll(); roles && roles.forEach(function(item, index) { - if (item.name===lastRole) + var role = item.asc_getSettings(), + color = role.asc_getColor(); + if (role.asc_getName()===lastRole) checkedIndex = index; me.btnViewFormRoles.menu.addItem(new Common.UI.MenuItem({ - caption: item.name, - color: item.color ? '#' + Common.Utils.ThemeColor.getHexColor(item.color.get_r(), item.color.get_g(), item.color.get_b()) : 'transparent', + caption: role.asc_getName() || me.textAnyone, + color: color ? '#' + Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()) : 'transparent', checkable: true, toggleGroup: 'formtab-view-role', template: _.template([ @@ -550,7 +568,8 @@ define([ capBtnComplex: 'Complex Field', tipEmailField: 'Insert email address', tipPhoneField: 'Insert phone number', - tipComplexField: 'Insert complex field' + tipComplexField: 'Insert complex field', + textAnyone: 'Anyone' } }()), DE.Views.FormsTab || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/RolesManagerDlg.js b/apps/documenteditor/main/app/view/RolesManagerDlg.js index 26b4cfd9e..53fb86b53 100644 --- a/apps/documenteditor/main/app/view/RolesManagerDlg.js +++ b/apps/documenteditor/main/app/view/RolesManagerDlg.js @@ -75,7 +75,6 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', this.api = options.api; this.handler = options.handler; this.props = options.props; - this.roles = options.roles; this.wrapEvents = { onRefreshRolesList: _.bind(this.onRefreshRolesList, this) @@ -156,24 +155,29 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', }, _setDefaults: function (props) { - this.refreshRolesList(this.roles, 0); - this.api.asc_registerCallback('asc_onRefreshRolesList', this.wrapEvents.onRefreshRolesList); + this.refreshRolesList(this.api.asc_GetOForm().asc_getAllRoles(), 0); + this.api.asc_registerCallback('asc_onUpdateOFormRoles', this.wrapEvents.onRefreshRolesList); }, onRefreshRolesList: function(roles) { this.refreshRolesList(roles); }, - refreshRolesList: function(roles, selectedItem) { + refreshRolesList: function(roles, selectedRole) { + (selectedRole===undefined) && (selectedRole = this.lastSelectedRole); // when add or delete roles + this.lastSelectedRole = undefined; + if (selectedRole===undefined && this.rolesList.store.length>0) { + var rec = this.rolesList.getSelectedRec(); + rec && (selectedRole = rec.get('name')); + } if (roles) { - this.roles = roles; var arr = []; - for (var i=0; i0) { - var me = this; - this.rolesList.selectByIndex(0); + var me = this, + rec; + (selectedRole===undefined) && (selectedRole = 0); + if (typeof selectedRole === 'string') { // name + rec = this.rolesList.store.findWhere({name: selectedRole}); + this.rolesList.selectRecord(rec); + } else { + selectedRole = Math.min(selectedRole, this.rolesList.store.length-1); + rec = this.rolesList.selectByIndex(selectedRole); + } setTimeout(function() { - me.rolesList.scrollToRecord(me.rolesList.store.at(0)); + me.rolesList.scrollToRecord(rec || me.rolesList.store.at(0)); }, 50); } this.updateButtons(); @@ -219,25 +231,29 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', var color = settings.color, name = settings.name, store = me.rolesList.store; + this.lastSelectedRole = name; if (isEdit) { // me.api.asc_editRole(settings); rec.set('name', name); rec.set('color', color); } else { - // me.api.asc_addRole(settings); - rec = store.push({ - name: name, - color: color, - fields: 0, - index: store.length, - scope: me - }); - if (rec) { - me.rolesList.selectRecord(rec); - setTimeout(function() { - me.rolesList.scrollToRecord(rec); - }, 50); - } + var role = new AscCommon.CRoleSettings(); + role.asc_putName(name); + role.asc_putColor(color); + me.api.asc_GetOForm().asc_addRole(role); + // rec = store.push({ + // name: name, + // color: color, + // fields: 0, + // index: store.length, + // scope: me + // }); + // if (rec) { + // me.rolesList.selectRecord(rec); + // setTimeout(function() { + // me.rolesList.scrollToRecord(rec); + // }, 50); + // } } me.updateButtons(); } @@ -268,17 +284,20 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', var callback = function(toRole) { var index = store.indexOf(rec); - if (toRole) { - var item = store.findWhere({name: toRole}); - item && item.set('fields', item.get('fields') + rec.get('fields')); - // me.api.asc_moveFieldsToRole(rec.get('name'), toRole); // from - to - } - // me.api.asc_delRole(rec.get('name')); - store.remove(rec); - me.refreshRolesIndexes(); - (store.length>0) && me.rolesList.selectByIndex(index0) && me.rolesList.selectByIndex(index0) && arr.push({ - name: role.name,//role.asc_getName(), - color: role.color,//role.asc_getColor(), + name: role.asc_getName() || me.textAnyone, + color: role.asc_getColor(), fields: role.fields,//role.asc_getFields(), index: i, scope: this @@ -153,7 +154,8 @@ define([ 'common/main/lib/view/AdvancedSettingsWindow', saveButtonText : 'Save', textEmpty: 'There are no roles associated with fields.', textDescription: 'When saving to the oform, only roles with fields are added to the filling list', - textFill: 'Filling list' + textFill: 'Filling list', + textAnyone: 'Anyone' }, DE.Views.SaveFormDlg || {})); }); \ No newline at end of file From 19358f81e662ce60f56f9b66922581ca94da62bb Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 28 Nov 2022 19:10:19 +0300 Subject: [PATCH 029/179] [DE] Move form roles --- .../main/app/view/RolesManagerDlg.js | 47 ++++--------------- 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/apps/documenteditor/main/app/view/RolesManagerDlg.js b/apps/documenteditor/main/app/view/RolesManagerDlg.js index 53fb86b53..f585efc27 100644 --- a/apps/documenteditor/main/app/view/RolesManagerDlg.js +++ b/apps/documenteditor/main/app/view/RolesManagerDlg.js @@ -75,6 +75,7 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', this.api = options.api; this.handler = options.handler; this.props = options.props; + this.oformManager = this.api.asc_GetOForm(); this.wrapEvents = { onRefreshRolesList: _.bind(this.onRefreshRolesList, this) @@ -155,7 +156,7 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', }, _setDefaults: function (props) { - this.refreshRolesList(this.api.asc_GetOForm().asc_getAllRoles(), 0); + this.refreshRolesList(this.oformManager.asc_getAllRoles(), 0); this.api.asc_registerCallback('asc_onUpdateOFormRoles', this.wrapEvents.onRefreshRolesList); }, @@ -202,12 +203,6 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', this.updateButtons(); }, - refreshRolesIndexes: function() { - this.rolesList.store.each(function(item, index) { - item.set('index', index); - }); - }, - getIconCls: function(index) { if (this.rolesList.store.length===1) return 'Point'; @@ -223,7 +218,7 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', props = (isEdit && rec) ? {name: rec.get('name'), color: rec.get('color')} : null; var win = new DE.Views.RoleEditDlg({ - api: me.api, + oformManager: me.oformManager, props : props, isEdit : isEdit, handler : function(result, settings) { @@ -240,7 +235,7 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', var role = new AscCommon.CRoleSettings(); role.asc_putName(name); role.asc_putColor(color); - me.api.asc_GetOForm().asc_addRole(role); + me.oformManager.asc_addRole(role); // rec = store.push({ // name: name, // color: color, @@ -294,7 +289,6 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', // } // me.api.asc_delRole(rec.get('name'), toRole); // remove role and move it's fields // store.remove(rec); - // me.refreshRolesIndexes(); // (store.length>0) && me.rolesList.selectByIndex(index Date: Mon, 28 Nov 2022 19:10:44 +0300 Subject: [PATCH 030/179] [DE] Check role name --- apps/documenteditor/main/app/view/RoleEditDlg.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/view/RoleEditDlg.js b/apps/documenteditor/main/app/view/RoleEditDlg.js index 8909fc7bb..21f47fd18 100644 --- a/apps/documenteditor/main/app/view/RoleEditDlg.js +++ b/apps/documenteditor/main/app/view/RoleEditDlg.js @@ -73,6 +73,7 @@ define([ this.options.tpl = _.template(this.template)(this.options); this.props = this.options.props; this.lastColor = 'C9C8FF'; + this.oformManager = this.options.oformManager; Common.UI.Window.prototype.initialize.call(this, this.options); }, @@ -91,7 +92,12 @@ define([ style : 'width: 100%;', validateOnBlur: false, validation : function(value) { - return value ? true : ''; + value = value.trim(); + if (_.isEmpty(value)) + return ''; + if (!(me.props && value === me.props.name) && me.oformManager.asc_haveRole(value)) + return me.errNameExists; + return true; } }); @@ -200,6 +206,7 @@ define([ txtTitleNew: 'Create New Role', textName: 'Role name', textEmptyError: 'Role name must not be empty.', - textNoHighlight: 'No highlighting' + textNoHighlight: 'No highlighting', + errNameExists: 'Role with such a name already exists.' }, DE.Views.RoleEditDlg || {})); }); \ No newline at end of file From ef5a145c7669c7d815c99befec444bf46a32a364 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 28 Nov 2022 22:19:29 +0300 Subject: [PATCH 031/179] Refactoring --- .../main/app/view/RolesManagerDlg.js | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/apps/documenteditor/main/app/view/RolesManagerDlg.js b/apps/documenteditor/main/app/view/RolesManagerDlg.js index f585efc27..e36647623 100644 --- a/apps/documenteditor/main/app/view/RolesManagerDlg.js +++ b/apps/documenteditor/main/app/view/RolesManagerDlg.js @@ -224,9 +224,8 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', handler : function(result, settings) { if (result == 'ok' && settings) { var color = settings.color, - name = settings.name, - store = me.rolesList.store; - this.lastSelectedRole = name; + name = settings.name; + me.lastSelectedRole = name; if (isEdit) { // me.api.asc_editRole(settings); rec.set('name', name); @@ -236,19 +235,6 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', role.asc_putName(name); role.asc_putColor(color); me.oformManager.asc_addRole(role); - // rec = store.push({ - // name: name, - // color: color, - // fields: 0, - // index: store.length, - // scope: me - // }); - // if (rec) { - // me.rolesList.selectRecord(rec); - // setTimeout(function() { - // me.rolesList.scrollToRecord(rec); - // }, 50); - // } } me.updateButtons(); } @@ -279,7 +265,7 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', var callback = function(toRole) { var index = store.indexOf(rec); - this.lastSelectedRole = index; + me.lastSelectedRole = index; me.api.asc_delRole(rec.get('name'), toRole); // remove role and move it's fields // if (toRole) { From 04002a766eaed4212ad888ae48d5ca5893f41336 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 29 Nov 2022 13:32:55 +0300 Subject: [PATCH 032/179] [DE] Edit and remove role --- .../main/app/view/RolesManagerDlg.js | 41 ++++++------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/apps/documenteditor/main/app/view/RolesManagerDlg.js b/apps/documenteditor/main/app/view/RolesManagerDlg.js index e36647623..dc66fbdec 100644 --- a/apps/documenteditor/main/app/view/RolesManagerDlg.js +++ b/apps/documenteditor/main/app/view/RolesManagerDlg.js @@ -214,29 +214,24 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', var me = this, xy = me.$window.offset(), - rec = this.rolesList.getSelectedRec(), - props = (isEdit && rec) ? {name: rec.get('name'), color: rec.get('color')} : null; + rec = this.rolesList.getSelectedRec(); var win = new DE.Views.RoleEditDlg({ oformManager: me.oformManager, - props : props, - isEdit : isEdit, + props : (isEdit && rec) ? {name: rec.get('name'), color: rec.get('color')} : null, + isEdit : (isEdit && rec), handler : function(result, settings) { if (result == 'ok' && settings) { - var color = settings.color, - name = settings.name; - me.lastSelectedRole = name; - if (isEdit) { - // me.api.asc_editRole(settings); - rec.set('name', name); - rec.set('color', color); + me.lastSelectedRole = settings.name; + + var role = new AscCommon.CRoleSettings(); + role.asc_putName(settings.name); + role.asc_putColor(settings.color); + if (isEdit && rec) { + me.oformManager.asc_editRole(rec.get('name'), role); } else { - var role = new AscCommon.CRoleSettings(); - role.asc_putName(name); - role.asc_putColor(color); me.oformManager.asc_addRole(role); } - me.updateButtons(); } } }).on('close', function() { @@ -264,20 +259,8 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', } var callback = function(toRole) { - var index = store.indexOf(rec); - me.lastSelectedRole = index; - me.api.asc_delRole(rec.get('name'), toRole); // remove role and move it's fields - - // if (toRole) { - // var item = store.findWhere({name: toRole}); - // item && item.set('fields', item.get('fields') + rec.get('fields')); - // // me.api.asc_moveFieldsToRole(rec.get('name'), toRole); // from - to - // } - // me.api.asc_delRole(rec.get('name'), toRole); // remove role and move it's fields - // store.remove(rec); - // (store.length>0) && me.rolesList.selectByIndex(index Date: Tue, 29 Nov 2022 14:42:47 +0300 Subject: [PATCH 033/179] [DE] Show fields count --- apps/documenteditor/main/app/view/RolesManagerDlg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/view/RolesManagerDlg.js b/apps/documenteditor/main/app/view/RolesManagerDlg.js index dc66fbdec..cf17c2030 100644 --- a/apps/documenteditor/main/app/view/RolesManagerDlg.js +++ b/apps/documenteditor/main/app/view/RolesManagerDlg.js @@ -178,7 +178,7 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template', arr.push({ name: role.asc_getName() || this.textAnyone, color: role.asc_getColor(), - fields: role.fields || 0,//role.asc_getFields(), + fields: role.asc_getFieldCount() || 0, index: i, scope: this }); From 9d08c6bfcbb1892aed848b223590842c461bff25 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Tue, 29 Nov 2022 18:11:36 +0400 Subject: [PATCH 034/179] [DE mobile] For Bug 58655 --- .../mobile/src/controller/Toolbar.jsx | 4 +- apps/documenteditor/mobile/src/less/app.less | 42 ++++++++++--------- apps/documenteditor/mobile/src/page/main.jsx | 25 ++++++++--- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/Toolbar.jsx b/apps/documenteditor/mobile/src/controller/Toolbar.jsx index 98565f426..bb1cf0cb5 100644 --- a/apps/documenteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/controller/Toolbar.jsx @@ -79,9 +79,11 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto if(offset > navbarHeight) { f7.navbar.hide('.main-navbar'); + props.closeOptions('fab'); api.SetMobileTopOffset(undefined, 0); - } else { + } else if(offset < -navbarHeight) { f7.navbar.show('.main-navbar'); + props.openOptions('fab'); api.SetMobileTopOffset(undefined, navbarHeight); } } diff --git a/apps/documenteditor/mobile/src/less/app.less b/apps/documenteditor/mobile/src/less/app.less index dbf4e46fe..c7bf299fc 100644 --- a/apps/documenteditor/mobile/src/less/app.less +++ b/apps/documenteditor/mobile/src/less/app.less @@ -347,28 +347,32 @@ } } -// Snackbar animation -.snackbar-enter { - opacity: 0; -} -.snackbar-enter-active { - opacity: 1; - transition: opacity 300ms; -} -.snackbar-exit { - opacity: 1; -} -.snackbar-exit-active { - opacity: 0; - transition: opacity 300ms; -} - // FAB -.fab a { - background-color: @background-primary; - &:focus, &:focus-within, &:active, &.active-state { +.fab { + z-index: 10000; + a { background-color: @background-primary; + + &:focus, &:focus-within, &:active, &.active-state { + background-color: @background-primary; + } } } +// Snackbar and FAB animation +.snackbar-enter, fab-enter { + opacity: 0; +} +.snackbar-enter-active, fab-enter-active { + opacity: 1; + transition: opacity 300ms; +} +.snackbar-exit, .fab-exit { + opacity: 1; +} +.snackbar-exit-active, .fab-exit-active { + opacity: 0; + transition: opacity 300ms; +} + diff --git a/apps/documenteditor/mobile/src/page/main.jsx b/apps/documenteditor/mobile/src/page/main.jsx index b9f28198d..cdefe693b 100644 --- a/apps/documenteditor/mobile/src/page/main.jsx +++ b/apps/documenteditor/mobile/src/page/main.jsx @@ -29,7 +29,8 @@ class MainPage extends Component { navigationVisible: false, addLinkSettingsVisible: false, editLinkSettingsVisible: false, - snackbarVisible: false + snackbarVisible: false, + fabVisible: true }; } @@ -64,6 +65,9 @@ class MainPage extends Component { } else if( opts === 'snackbar') { this.state.snackbarVisible && (opened = true); newState.snackbarVisible = true; + } else if( opts === 'fab') { + this.state.fabVisible && (opened = true); + newState.fabVisible = true; } for (let key in this.state) { @@ -103,6 +107,8 @@ class MainPage extends Component { return {editLinkSettingsVisible: false}; else if( opts == 'snackbar') return {snackbarVisible: false} + else if( opts == 'fab') + return {fabVisible: false} }); if ((opts === 'edit' || opts === 'coauth') && Device.phone) { f7.navbar.show('.main-navbar'); @@ -135,6 +141,7 @@ class MainPage extends Component { const isMobileView = appOptions.isMobileView; const disabledControls = storeToolbarSettings.disabledControls; const disabledSettings = storeToolbarSettings.disabledSettings; + const isFabShow = isViewer && !disabledSettings && !disabledControls && !isDisconnected && isAvailableExt && isEdit; const config = appOptions.config; let showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo))); @@ -240,10 +247,18 @@ class MainPage extends Component { text={isMobileView ? t("Toolbar.textSwitchedMobileView") : t("Toolbar.textSwitchedStandardView")}/> } - {isViewer && !disabledSettings && !disabledControls && !isDisconnected && isAvailableExt && isEdit && - this.turnOffViewerMode()}> - - + {isFabShow && + + this.turnOffViewerMode()}> + + + } {appOptions.isDocReady && } From 2a94c622d426f963dbe91df528bd1388c14eaa2f Mon Sep 17 00:00:00 2001 From: OVSharova Date: Tue, 29 Nov 2022 18:10:48 +0300 Subject: [PATCH 035/179] fix bug --- apps/documenteditor/main/app/controller/Main.js | 2 +- apps/documenteditor/main/app/view/FileMenuPanels.js | 2 +- apps/presentationeditor/main/app/controller/Main.js | 2 +- apps/presentationeditor/main/app/view/FileMenuPanels.js | 2 +- apps/spreadsheeteditor/main/app/controller/Main.js | 2 +- apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 278cc9ffb..f04deb67c 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1495,7 +1495,7 @@ define([ this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit; this.appOptions.canPrint = (this.permissions.print !== false); this.appOptions.canPreviewPrint = this.appOptions.canPrint && !Common.Utils.isMac && this.appOptions.isDesktopApp; - this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp && !this.editorConfig.customization; + this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp; this.appOptions.canRename = this.editorConfig.canRename; this.appOptions.buildVersion = params.asc_getBuildVersion(); this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index efa86f224..bcdf3ce01 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -781,7 +781,7 @@ define([ $('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide'](); /** coauthoring end **/ - $('tr.quick-print', this.el)[mode.canQuickPrint && !mode.customization.compactHeader ? 'show' : 'hide'](); + $('tr.quick-print', this.el)[mode.canQuickPrint && !(mode.customization && mode.customization.compactHeader) ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 4825c903e..5db4ec885 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1166,7 +1166,7 @@ define([ } this.appOptions.canPrint = (this.permissions.print !== false); this.appOptions.canPreviewPrint = this.appOptions.canPrint && !Common.Utils.isMac && this.appOptions.isDesktopApp; - this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp && !this.editorConfig.customization; + this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp; this.appOptions.canRename = this.editorConfig.canRename; this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); this.appOptions.forcesave = this.appOptions.canForcesave; diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 07a579645..c3a5e1220 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -612,7 +612,7 @@ define([ $('tr.live-viewer', this.el)[mode.canLiveView && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); $('tr.spellcheck', this.el)[mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide'](); - $('tr.quick-print', this.el)[mode.canQuickPrint && !mode.customization.compactHeader ? 'show' : 'hide'](); + $('tr.quick-print', this.el)[mode.canQuickPrint && !(mode.customization && mode.customization.compactHeader) ? 'show' : 'hide'](); if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 74db5ca0c..b894e9284 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1291,7 +1291,7 @@ define([ this.appOptions.isEdit = (this.appOptions.canLicense || this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.permissions.edit !== false && this.editorConfig.mode !== 'view'; this.appOptions.canDownload = (this.permissions.download !== false); this.appOptions.canPrint = (this.permissions.print !== false); - this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp && !this.editorConfig.customization; + this.appOptions.canQuickPrint = this.appOptions.canPrint && this.appOptions.isDesktopApp; this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); this.appOptions.forcesave = this.appOptions.canForcesave; diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 9888aed94..15dc54afe 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -799,7 +799,7 @@ define([ $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.live-viewer', this.el)[mode.canLiveView && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); - $('tr.quick-print', this.el)[mode.canQuickPrint && !mode.customization.compactHeader ? 'show' : 'hide'](); + $('tr.quick-print', this.el)[mode.canQuickPrint && !(mode.customization && mode.customization.compactHeader) ? 'show' : 'hide'](); if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); From 7878e05c0d368976b76799ce46ba871073e0dfda Mon Sep 17 00:00:00 2001 From: OVSharova Date: Wed, 30 Nov 2022 13:10:34 +0300 Subject: [PATCH 036/179] corrections --- apps/documenteditor/main/app/controller/Toolbar.js | 2 +- apps/documenteditor/main/app/view/FileMenuPanels.js | 2 +- apps/documenteditor/main/app/view/Toolbar.js | 2 +- apps/presentationeditor/main/app/controller/Toolbar.js | 2 +- apps/presentationeditor/main/app/view/FileMenuPanels.js | 2 +- apps/presentationeditor/main/app/view/Toolbar.js | 1 + apps/spreadsheeteditor/main/app/controller/Toolbar.js | 2 +- apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 2 +- apps/spreadsheeteditor/main/app/view/Toolbar.js | 1 + 9 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index c3ebfbae6..b609762e9 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1083,7 +1083,7 @@ define([ next: e.options.iconClsForMainBtn, curr: this.toolbar.btnPrint.menu.items.filter(function(item){return item.value == oldType;})[0].options.iconClsForMainBtn }); - this.toolbar.btnPrint.updateHint([e.caption + e.options.platformKey, this.views.Toolbar.prototype.tipInsertText]); + this.toolbar.btnPrint.updateHint([e.caption + e.options.platformKey]); this.toolbar.btnPrint.options.printType = newType; } this.onPrint(e); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index bcdf3ce01..da1c69ab4 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -781,7 +781,7 @@ define([ $('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide'](); /** coauthoring end **/ - $('tr.quick-print', this.el)[mode.canQuickPrint && !(mode.customization && mode.customization.compactHeader) ? 'show' : 'hide'](); + $('tr.quick-print', this.el)[mode.canQuickPrint && !(mode.customization && mode.customization.compactHeader && mode.isEdit) ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index e048a58c4..9f066e680 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1736,7 +1736,7 @@ define([ true, true, undefined, '1', 'bottom', 'small'); Array.prototype.push.apply(this.paragraphControls, this.btnsPageBreak); Array.prototype.push.apply(this.lockControls, this.btnsPageBreak); - + this.btnPrint.menu && this.btnPrint.$el.toggleClass('btn-slot','btn-split'); return $host; }, diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index dd525e36c..79c6f50ad 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1087,7 +1087,7 @@ define([ next: e.options.iconClsForMainBtn, curr: this.toolbar.btnPrint.menu.items.filter(function(item){return item.value == oldType;})[0].options.iconClsForMainBtn }); - this.toolbar.btnPrint.updateHint([e.caption + e.options.platformKey, this.views.Toolbar.prototype.tipInsertText]); + this.toolbar.btnPrint.updateHint([e.caption + e.options.platformKey]); this.toolbar.btnPrint.options.printType = newType; } this.onPrint(e); diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index c3a5e1220..b946015b1 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -612,7 +612,7 @@ define([ $('tr.live-viewer', this.el)[mode.canLiveView && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); $('tr.spellcheck', this.el)[mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide'](); - $('tr.quick-print', this.el)[mode.canQuickPrint && !(mode.customization && mode.customization.compactHeader) ? 'show' : 'hide'](); + $('tr.quick-print', this.el)[mode.canQuickPrint && !(mode.customization && mode.customization.compactHeader && mode.isEdit) ? 'show' : 'hide'](); if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 64bbc3ee5..9a740f4fa 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1297,6 +1297,7 @@ define([ Array.prototype.push.apply(this.slideOnlyControls, created); Array.prototype.push.apply(this.lockControls, created); + this.btnPrint.menu && this.btnPrint.$el.toggleClass('btn-slot','btn-split'); return $host; }, diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 9aede9004..1cf3a2be9 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -541,7 +541,7 @@ define([ next: e.options.iconClsForMainBtn, curr: this.toolbar.btnPrint.menu.items.filter(function(item){return item.value == oldType;})[0].options.iconClsForMainBtn }); - this.toolbar.btnPrint.updateHint([e.caption + e.options.platformKey, this.views.Toolbar.prototype.tipInsertText]); + this.toolbar.btnPrint.updateHint([e.caption + e.options.platformKey]); this.toolbar.btnPrint.options.printType = newType; } this.onPrint(e); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 15dc54afe..8f738837d 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -799,7 +799,7 @@ define([ $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.live-viewer', this.el)[mode.canLiveView && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); - $('tr.quick-print', this.el)[mode.canQuickPrint && !(mode.customization && mode.customization.compactHeader) ? 'show' : 'hide'](); + $('tr.quick-print', this.el)[mode.canQuickPrint && !(mode.customization && mode.customization.compactHeader && mode.isEdit) ? 'show' : 'hide'](); if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 565688f16..9c581d13e 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2289,6 +2289,7 @@ define([ [Common.enumLock.editCell, Common.enumLock.selRangeEdit, Common.enumLock.headerLock, Common.enumLock.lostConnect, Common.enumLock.coAuth], undefined, undefined, undefined, '1', 'bottom', 'small'); Array.prototype.push.apply(this.lockControls, this.btnsEditHeader); + this.btnPrint.menu && this.btnPrint.$el.toggleClass('btn-slot','btn-split'); return $host; }, From ff4a3f24bda35ccfab3cb355ed36b51532567660 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 30 Nov 2022 19:53:27 +0300 Subject: [PATCH 037/179] [Forms] Add undo/redo buttons to the toolbar, add Clear field to context menu --- apps/common/forms/resources/less/common.less | 7 +++++ .../app/controller/ApplicationController.js | 29 +++++++++++++++++-- .../forms/app/view/ApplicationView.js | 21 +++++++++++++- apps/documenteditor/forms/index.html | 5 +++- apps/documenteditor/forms/index.html.deploy | 5 +++- apps/documenteditor/forms/locale/en.json | 5 +++- 6 files changed, 65 insertions(+), 7 deletions(-) diff --git a/apps/common/forms/resources/less/common.less b/apps/common/forms/resources/less/common.less index e2580c7f0..3c819ef8b 100644 --- a/apps/common/forms/resources/less/common.less +++ b/apps/common/forms/resources/less/common.less @@ -202,6 +202,13 @@ text-overflow: ellipsis; } } + + .separator { + height: 22px; + margin: 0 9px; + border-left: 1px solid @border-divider-ie; + border-left: 1px solid @border-divider; + } } .margin-right-small { diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 3938469ce..2e6639f31 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -603,6 +603,9 @@ define([ me.view.btnPrev.setVisible(false); me.view.btnNext.setVisible(false); me.view.btnClear.setVisible(false); + me.view.btnUndo.setVisible(false); + me.view.btnRedo.setVisible(false); + me.view.btnRedo.$el.next().hide(); } else { me.view.btnPrev.on('click', function(){ me.api.asc_MoveToFillingForm(false); @@ -626,6 +629,12 @@ define([ } } }); + me.view.btnUndo.on('click', function(){ + me.api.Undo(false); + }); + me.view.btnRedo.on('click', function(){ + me.api.Redo(false); + }); this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms); this.api.asc_SetFastCollaborative(true); @@ -1363,6 +1372,8 @@ define([ if (this.appOptions.canFillForms) { this.api.asc_registerCallback('asc_onShowContentControlsActions', _.bind(this.onShowContentControlsActions, this)); this.api.asc_registerCallback('asc_onHideContentControlsActions', _.bind(this.onHideContentControlsActions, this)); + this.api.asc_registerCallback('asc_onCanUndo', _.bind(this.onApiCanRevert, this, 'undo')); + this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo')); this.api.asc_SetHighlightRequiredFields(true); Common.Gateway.on('insertimage', _.bind(this.insertImage, this)); Common.NotificationCenter.on('storage:image-load', _.bind(this.openImageFromStorage, this)); // try to load image from storage @@ -1800,9 +1811,10 @@ define([ this.textMenu.items[0].setDisabled(disabled || !this.api.asc_getCanUndo()); // undo this.textMenu.items[1].setDisabled(disabled || !this.api.asc_getCanRedo()); // redo - this.textMenu.items[3].setDisabled(disabled || !cancopy); // cut - this.textMenu.items[4].setDisabled(!cancopy); // copy - this.textMenu.items[5].setDisabled(disabled) // paste; + this.textMenu.items[3].setDisabled(disabled); // clear + this.textMenu.items[5].setDisabled(disabled || !cancopy); // cut + this.textMenu.items[6].setDisabled(!cancopy); // copy + this.textMenu.items[7].setDisabled(disabled) // paste; this.showPopupMenu(this.textMenu, {}, event); } @@ -1832,6 +1844,9 @@ define([ } } break; + case 'clear': + this.api && this.api.asc_ClearSpecialForm(); + break; } }, @@ -1839,6 +1854,8 @@ define([ this._state.isDisconnected = true; this._isDisabled = true; this.view && this.view.btnClear && this.view.btnClear.setDisabled(true); + this.view && this.view.btnUndo && this.view.btnUndo.setDisabled(true); + this.view && this.view.btnRedo && this.view.btnRedo.setDisabled(true); if (!enableDownload) { this.appOptions.canPrint = this.appOptions.canDownload = false; this.view && this.view.btnDownload.setDisabled(true); @@ -1852,6 +1869,12 @@ define([ } }, + onApiCanRevert: function(which, can) { + if (!this.view) return; + + (which=='undo') ? this.view.btnUndo.setDisabled(!can) : this.view.btnRedo.setDisabled(!can); + }, + errorDefaultMessage : 'Error code: %1', unknownErrorText : 'Unknown error.', convertationTimeoutText : 'Conversion timeout exceeded.', diff --git a/apps/documenteditor/forms/app/view/ApplicationView.js b/apps/documenteditor/forms/app/view/ApplicationView.js index f8975a4bb..cc1e4217f 100644 --- a/apps/documenteditor/forms/app/view/ApplicationView.js +++ b/apps/documenteditor/forms/app/view/ApplicationView.js @@ -89,6 +89,20 @@ define([ }); this.btnPrev.render($('#id-btn-prev-field')); + this.btnUndo = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'svg-icon undo', + hint: this.tipUndo + Common.Utils.String.platformKey('Ctrl+Z') + }); + this.btnUndo.render($('#id-btn-undo')); + + this.btnRedo = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'svg-icon redo', + hint: this.tipRedo + Common.Utils.String.platformKey('Ctrl+Y') + }); + this.btnRedo.render($('#id-btn-redo')); + this.btnSubmit = new Common.UI.Button({ cls: 'btn-text-default colored margin-left-small margin-right-small', caption: this.textSubmit @@ -121,6 +135,8 @@ define([ { caption: this.textUndo, value: 'undo', iconCls: 'mi-icon svg-icon undo' }, { caption: this.textRedo, value: 'redo', iconCls: 'mi-icon svg-icon redo' }, { caption: '--' }, + { caption: this.textClearField, value: 'clear', iconCls: 'mi-icon svg-icon clear-style' }, + { caption: '--' }, { caption: this.textCut, value: 'cut', iconCls: 'mi-icon svg-icon cut' }, { caption: this.textCopy, value: 'copy', iconCls: 'mi-icon svg-icon copy' }, { caption: this.textPaste, value: 'paste', iconCls: 'mi-icon svg-icon paste' } @@ -150,7 +166,10 @@ define([ textZoom: 'Zoom', textFitToPage: 'Fit to Page', textFitToWidth: 'Fit to Width', - txtSearch: 'Search' + txtSearch: 'Search', + tipUndo: 'Undo', + tipRedo: 'Redo', + textClearField: 'Clear field' }, DE.Views.ApplicationView || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/forms/index.html b/apps/documenteditor/forms/index.html index 4268c8188..a9ba39ce0 100644 --- a/apps/documenteditor/forms/index.html +++ b/apps/documenteditor/forms/index.html @@ -259,7 +259,10 @@
      - + + +
      +
      diff --git a/apps/documenteditor/forms/index.html.deploy b/apps/documenteditor/forms/index.html.deploy index e596da871..5ac0df2e0 100644 --- a/apps/documenteditor/forms/index.html.deploy +++ b/apps/documenteditor/forms/index.html.deploy @@ -241,7 +241,10 @@
      - + + +
      +
      diff --git a/apps/documenteditor/forms/locale/en.json b/apps/documenteditor/forms/locale/en.json index b0e29eb68..7dab4ee20 100644 --- a/apps/documenteditor/forms/locale/en.json +++ b/apps/documenteditor/forms/locale/en.json @@ -180,5 +180,8 @@ "DE.Views.ApplicationView.txtPrint": "Print", "DE.Views.ApplicationView.txtSearch": "Search", "DE.Views.ApplicationView.txtShare": "Share", - "DE.Views.ApplicationView.txtTheme": "Interface theme" + "DE.Views.ApplicationView.txtTheme": "Interface theme", + "DE.Views.ApplicationView.tipUndo": "Undo", + "DE.Views.ApplicationView.tipRedo": "Redo", + "DE.Views.ApplicationView.textClearField": "Clear field" } \ No newline at end of file From 228497c1d5839aaaf4a7cdf252ee248288c8f915 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Wed, 30 Nov 2022 22:58:47 +0300 Subject: [PATCH 038/179] fix bug --- apps/documenteditor/main/app/view/Toolbar.js | 2 +- apps/presentationeditor/main/app/view/Toolbar.js | 2 +- apps/spreadsheeteditor/main/app/view/Toolbar.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 9f066e680..04380438b 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1736,7 +1736,7 @@ define([ true, true, undefined, '1', 'bottom', 'small'); Array.prototype.push.apply(this.paragraphControls, this.btnsPageBreak); Array.prototype.push.apply(this.lockControls, this.btnsPageBreak); - this.btnPrint.menu && this.btnPrint.$el.toggleClass('btn-slot','btn-split'); + this.btnPrint.menu && this.btnPrint.$el.addClass('split'); return $host; }, diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 9a740f4fa..a34762743 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1297,7 +1297,7 @@ define([ Array.prototype.push.apply(this.slideOnlyControls, created); Array.prototype.push.apply(this.lockControls, created); - this.btnPrint.menu && this.btnPrint.$el.toggleClass('btn-slot','btn-split'); + this.btnPrint.menu && this.btnPrint.$el.addClass('split'); return $host; }, diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 9c581d13e..9388f77c5 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2289,7 +2289,7 @@ define([ [Common.enumLock.editCell, Common.enumLock.selRangeEdit, Common.enumLock.headerLock, Common.enumLock.lostConnect, Common.enumLock.coAuth], undefined, undefined, undefined, '1', 'bottom', 'small'); Array.prototype.push.apply(this.lockControls, this.btnsEditHeader); - this.btnPrint.menu && this.btnPrint.$el.toggleClass('btn-slot','btn-split'); + this.btnPrint.menu && this.btnPrint.$el.addClass('split'); return $host; }, From 62c8531dc11dd127439bd65dd1ff263da08d3565 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Dec 2022 15:49:44 +0300 Subject: [PATCH 039/179] [DE] Get/set roles for forms --- .../main/app/view/FormSettings.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index ca1e1b6c3..4179fd679 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -1129,11 +1129,11 @@ define([ this._state.arrKey=data; } - // val = formPr.get_Role(); - // if (this._state.Role!==val) { - // this.cmbRole.setValue(val ? val : ''); - // this._state.Role=val; - // } + val = formPr.get_Role(); + if (this._state.Role!==val) { + this.cmbRoles.setValue(val ? val : ''); + this._state.Role=val; + } val = formPr.get_Key(); if (this._state.Key!==val) { @@ -1615,12 +1615,12 @@ define([ onRolesChanged: function(combo, record) { if (this.api && !this._noApply) { - // var props = this._originalProps || new AscCommon.CContentControlPr(); - // var formPr = this._originalFormProps || new AscCommon.CSdtFormPr(); - // formPr.put_Role(record.value); - // props.put_FormPr(formPr); - // this.api.asc_SetContentControlProperties(props, this.internalId); - // this.fireEvent('editcomplete', this); + var props = this._originalProps || new AscCommon.CContentControlPr(); + var formPr = this._originalFormProps || new AscCommon.CSdtFormPr(); + formPr.put_Role(record.value); + props.put_FormPr(formPr); + this.api.asc_SetContentControlProperties(props, this.internalId); + this.fireEvent('editcomplete', this); } }, From a5cf901aa0cd09765647a804ed9e6cacdfc760b1 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Dec 2022 18:05:24 +0300 Subject: [PATCH 040/179] [DE] Insert inline or fixed text field --- .../main/app/controller/FormsTab.js | 2 + apps/documenteditor/main/app/view/FormsTab.js | 63 +++++++++++++++++-- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 3b7263d8a..9b0c72e3b 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -196,6 +196,8 @@ define([ oPr.put_MaskFormat(options.mask); if (options.placeholder) props.put_PlaceholderText(options.placeholder); + if (options.fixed!==undefined) + oFormPr.put_Fixed && oFormPr.put_Fixed(options.fixed); } props.put_TextFormPr(oPr); props.put_FormPr(oFormPr); diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index 09d0396ed..ea1259238 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -81,7 +81,22 @@ define([ function setEvents() { var me = this; this.btnTextField && this.btnTextField.on('click', function (b, e) { - me.fireEvent('forms:insert', ['text']); + me.fireEvent('forms:insert', ['text', {fixed: b.options.fieldType==='fixed'}]); + }); + this.btnTextField && this.btnTextField.menu.on('item:click', function (menu, item) { + var oldType = me.btnTextField.options.fieldType; + var newType = item.value; + + if(newType !== oldType){ + me.btnTextField.changeIcon({ + next: item.options.iconClsForMainBtn, + curr: me.btnTextField.menu.items.filter(function(mnu){return mnu.value === oldType})[0].options.iconClsForMainBtn + }); + me.btnTextField.updateHint(item.options.hintForMainBtn); + me.btnTextField.options.fieldType = newType; + Common.localStorage.setBool("de-text-form-fixed", newType==='fixed') + } + me.fireEvent('forms:insert', ['text', {fixed: newType==='fixed'}]); }); this.btnComboBox && this.btnComboBox.on('click', function (b, e) { me.fireEvent('forms:insert', ['combobox']); @@ -167,11 +182,15 @@ define([ if (this.appConfig.isRestrictedEdit && this.appConfig.canFillForms) { } else { + var isfixed = Common.localStorage.getBool("de-text-form-fixed", true); this.btnTextField = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', - iconCls: 'toolbar__icon btn-text-field', + iconCls: 'toolbar__icon ' + (isfixed ? 'btn-text' : 'btn-text-field'), lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments], caption: this.capBtnText, + fieldType: isfixed ? 'fixed' : 'inline', + split: true, + menu: true, dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -407,8 +426,38 @@ define([ // } else { // me.btnHighlight.cmpEl.parents('.group').hide().prev('.separator').hide(); // } + var menuTemplate = _.template(''+ + '<% if (!_.isEmpty(iconCls)) { %>'+ + ''+ + '<% } %>'+ + '
      <%= caption %>
      ' + + '<% if (options.description !== null) { %>' + + '<% } %>
      '); + + me.btnTextField.setMenu(new Common.UI.Menu({ + items: [ + { + caption: me.txtInlineText, + template: menuTemplate, + description: me.txtInlineDesc, + iconCls : 'menu__icon page-landscape', + value: 'inline', + iconClsForMainBtn: 'btn-text-field', + hintForMainBtn: [me.tipInlineText, me.tipTextField] + }, + { + caption: me.txtFixedText, + template: menuTemplate, + description: me.txtFixedDesc, + iconCls : 'menu__icon btn-text', + value: 'fixed', + iconClsForMainBtn: 'btn-text', + hintForMainBtn: [me.tipFixedText, me.tipTextField] + } + ] + })); + me.btnTextField.updateHint([Common.localStorage.getBool("de-text-form-fixed", true) ? me.tipFixedText : me.tipInlineText, me.tipTextField]); - me.btnTextField.updateHint(me.tipTextField); me.btnComboBox.updateHint(me.tipComboBox); me.btnDropDown.updateHint(me.tipDropDown); me.btnCheckBox.updateHint(me.tipCheckBox); @@ -569,7 +618,13 @@ define([ tipEmailField: 'Insert email address', tipPhoneField: 'Insert phone number', tipComplexField: 'Insert complex field', - textAnyone: 'Anyone' + textAnyone: 'Anyone', + txtInlineText: 'Inline', + txtInlineDesc: 'Insert inline text field', + txtFixedText: 'Fixed', + txtFixedDesc: 'Insert fixed text field', + tipInlineText: 'Insert inline text field', + tipFixedText: 'Insert fixed text field' } }()), DE.Views.FormsTab || {})); }); \ No newline at end of file From a58534687a2990282bd533ffeda1042f40cbc05f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Dec 2022 18:38:42 +0300 Subject: [PATCH 041/179] [DE] Add new form with last selected role or the last role in list --- .../main/app/controller/FormsTab.js | 25 ++++++++----------- .../main/app/view/FormSettings.js | 1 + apps/documenteditor/main/app/view/FormsTab.js | 10 ++++---- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 9b0c72e3b..2cfc2aa77 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -59,7 +59,10 @@ define([ initialize: function () { }, onLaunch: function () { - this._state = {}; + this._state = { + lastViewRole: undefined, // last selected role in the preview mode + lastRoleInList: undefined // last role in the roles list + }; }, setApi: function (api) { @@ -177,6 +180,7 @@ define([ var oPr, oFormPr = new AscCommon.CSdtFormPr(); + oFormPr.put_Role(Common.Utils.InternalSettings.get('de-last-form-role') || this._state.lastRoleInList); this.toolbar.toolbar.fireEvent('insertcontrol', this.toolbar.toolbar); if (type == 'picture') this.api.asc_AddContentControlPicture(oFormPr); @@ -213,14 +217,14 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, - onModeClick: function(state, lastRole) { + onModeClick: function(state, lastViewRole) { if (this.api) { this.disableEditing(state); - this.view && this.view.setPreviewMode(state); // sent role name - lastRole + this.view && this.view.setPreviewMode(state); // send role name - lastViewRole this.api.asc_setRestriction(state ? Asc.c_oAscRestrictionType.OnlyForms : Asc.c_oAscRestrictionType.None); this.api.asc_SetPerformContentControlActionByClick(state); this.api.asc_SetHighlightRequiredFields(state); - state && (this._state.lastRole = lastRole); + state && (this._state.lastViewRole = lastViewRole); } Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, @@ -395,13 +399,7 @@ define([ // me.view.btnHighlight.currentColor = clr; // } config.isEdit && config.canFeatureContentControl && config.isFormCreator && me.showCreateFormTip(); // show tip only when create form in docxf - // change to event asc_onRefreshRolesList me.onRefreshRolesList(); - // me.onRefreshRolesList([ - // {name: 'employee 1', color: Common.Utils.ThemeColor.getRgbColor('ff0000'), fields: 5}, - // {name: 'employee 2', color: Common.Utils.ThemeColor.getRgbColor('00ff00'), fields: 1}, - // {name: 'manager', color: null, fields: 10} - // ]); me.onChangeProtectDocument(); }); }, @@ -457,7 +455,8 @@ define([ var oform = this.api.asc_GetOForm(); oform && (roles = oform.asc_getAllRoles()); } - this.view && this.view.fillRolesMenu(roles, this._state.lastRole); + this._state.lastRoleInList = (roles && roles.length>0) ? roles[roles.length-1].asc_getSettings().asc_getName() : undefined; + this.view && this.view.fillRolesMenu(roles, this._state.lastViewRole); }, onManagerClick: function() { @@ -465,12 +464,8 @@ define([ this.api.asc_GetOForm() && (new DE.Views.RolesManagerDlg({ api: me.api, handler: function(result, settings) { - // me.roles = settings; - // me.onRefreshRolesList(me.roles); - // Common.component.Analytics.trackEvent('ToolBar', 'Roles Manager'); Common.NotificationCenter.trigger('edit:complete', me.toolbar); }, - // roles: me.roles, props : undefined })).on('close', function(win){ }).show(); diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index 4179fd679..d3140a4e5 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -1620,6 +1620,7 @@ define([ formPr.put_Role(record.value); props.put_FormPr(formPr); this.api.asc_SetContentControlProperties(props, this.internalId); + Common.Utils.InternalSettings.set('de-last-form-role', record.value) this.fireEvent('editcomplete', this); } }, diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index ea1259238..49c31f943 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -510,15 +510,15 @@ define([ return this.$el; }, - fillRolesMenu: function(roles, lastRole) { + fillRolesMenu: function(roles, lastViewRole) { if (!(this.btnViewFormRoles && this.btnViewFormRoles.menu && this.btnViewFormRoles.menu.isVisible())) { this._state.roles = roles; - this._state.lastRole = lastRole; + this._state.lastViewRole = lastViewRole; return; } roles = roles || this._state.roles; - lastRole = lastRole || this._state.lastRole; - this._state.roles = this._state.lastRole = undefined; + lastViewRole = lastViewRole || this._state.lastViewRole; + this._state.roles = this._state.lastViewRole = undefined; if (!roles) return; @@ -530,7 +530,7 @@ define([ roles && roles.forEach(function(item, index) { var role = item.asc_getSettings(), color = role.asc_getColor(); - if (role.asc_getName()===lastRole) + if (role.asc_getName()===lastViewRole) checkedIndex = index; me.btnViewFormRoles.menu.addItem(new Common.UI.MenuItem({ caption: role.asc_getName() || me.textAnyone, From 7504378d7397f45e3d2c271296486c819fb707fa Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Dec 2022 20:26:08 +0300 Subject: [PATCH 042/179] [DE] Add zip code and credit card forms --- .../main/app/controller/FormsTab.js | 3 +- apps/documenteditor/main/app/view/FormsTab.js | 40 ++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 2cfc2aa77..8e7d98bcf 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -152,7 +152,8 @@ define([ (lock_type===undefined) && (lock_type = Asc.c_oAscSdtLockType.Unlocked); var content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked; var arr = [ this.view.btnTextField, this.view.btnComboBox, this.view.btnDropDown, this.view.btnCheckBox, - this.view.btnRadioBox, this.view.btnImageField, this.view.btnEmailField, this.view.btnPhoneField, this.view.btnComplexField ]; + this.view.btnRadioBox, this.view.btnImageField, this.view.btnEmailField, this.view.btnPhoneField, this.view.btnComplexField, + this.view.btnCreditCard, this.view.btnZipCode]; Common.Utils.lockControls(Common.enumLock.paragraphLock, paragraph_locked, {array: arr}); Common.Utils.lockControls(Common.enumLock.headerLock, header_locked, {array: arr}); Common.Utils.lockControls(Common.enumLock.controlPlain, control_plain, {array: arr}); diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index 49c31f943..4d5e6da35 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -61,6 +61,8 @@ define([ '' + '' + @@ -122,6 +124,12 @@ define([ this.btnPhoneField && this.btnPhoneField.on('click', function (b, e) { me.fireEvent('forms:insert', ['text', {mask: "(999)999-9999", placeholder: '(999)999-9999'}]); }); + this.btnCreditCard && this.btnCreditCard.on('click', function (b, e) { + me.fireEvent('forms:insert', ['text', {mask: "9999-9999-9999-9999", placeholder: '9999-9999-9999-9999'}]); + }); + this.btnZipCode && this.btnZipCode.on('click', function (b, e) { + me.fireEvent('forms:insert', ['text', {mask: "99999-9999", placeholder: '99999-9999'}]); + }); this.btnViewFormRoles && this.btnViewFormRoles.on('click', function (b, e) { var item = b.menu.getChecked(); me.fireEvent('forms:mode', [b.pressed, item ? item.caption : undefined]); @@ -285,6 +293,28 @@ define([ }); this.paragraphControls.push(this.btnPhoneField); + this.btnZipCode = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-zip-code', + lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments], + caption: this.capZipCode, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.paragraphControls.push(this.btnZipCode); + + this.btnCreditCard = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-zip-credit', + lock: [_set.paragraphLock, _set.headerLock, _set.controlPlain, _set.contentLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments], + caption: this.capCreditCard, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.paragraphControls.push(this.btnCreditCard); + this.btnComplexField = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon complex-field', @@ -468,6 +498,8 @@ define([ me.btnEmailField.updateHint(me.tipEmailField); me.btnPhoneField.updateHint(me.tipPhoneField); me.btnComplexField.updateHint(me.tipComplexField); + me.btnZipCode.updateHint(me.tipZipCode); + me.btnCreditCard.updateHint(me.tipCreditCard); } me.btnClear.updateHint(me.textClearFields); me.btnPrevForm.updateHint(me.tipPrevForm); @@ -500,6 +532,8 @@ define([ this.btnEmailField.render($host.find('#slot-btn-form-email')); this.btnPhoneField.render($host.find('#slot-btn-form-phone')); this.btnComplexField.render($host.find('#slot-btn-form-complex')); + this.btnZipCode.render($host.find('#slot-btn-form-zipcode')); + this.btnCreditCard.render($host.find('#slot-btn-form-credit')); $host.find('.forms-buttons').show(); } @@ -624,7 +658,11 @@ define([ txtFixedText: 'Fixed', txtFixedDesc: 'Insert fixed text field', tipInlineText: 'Insert inline text field', - tipFixedText: 'Insert fixed text field' + tipFixedText: 'Insert fixed text field', + capZipCode: 'Zip Code', + capCreditCard: 'Credit Card', + tipZipCode: 'Insert zip code', + tipCreditCard: 'Insert credit card number' } }()), DE.Views.FormsTab || {})); }); \ No newline at end of file From 53e66de9635534d7839ce701d5c296666fc1dc11 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Dec 2022 20:27:46 +0300 Subject: [PATCH 043/179] [DE] Add presets for forms mask --- .../main/app/template/FormSettings.template | 5 + .../main/app/view/FormSettings.js | 99 ++++++++++++++----- 2 files changed, 82 insertions(+), 22 deletions(-) diff --git a/apps/documenteditor/main/app/template/FormSettings.template b/apps/documenteditor/main/app/template/FormSettings.template index 65b7e342d..c9e880ce0 100644 --- a/apps/documenteditor/main/app/template/FormSettings.template +++ b/apps/documenteditor/main/app/template/FormSettings.template @@ -62,6 +62,11 @@
      + + +
      + + diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index d3140a4e5..119ac6d3f 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -98,6 +98,7 @@ define([ this.TextOnlySettings = el.find('.form-textfield'); this.TextOnlySimpleSettings = el.find('.form-textfield-simple'); // text field not in complex form this.TextOnlySettingsMask = el.find('.form-textfield-mask'); + this.TextOnlySettingsRegExp = el.find('.form-textfield-regexp'); this.PlaceholderSettings = el.find('.form-placeholder'); this.KeySettings = el.find('.form-keyfield'); this.KeySettingsTd = this.KeySettings.find('td'); @@ -567,8 +568,8 @@ define([ this.cmbFormat.setValue(Asc.TextFormFormatType.None); this.cmbFormat.on('selected', this.onFormatSelect.bind(this)); - this.txtMask = new Common.UI.InputField({ - el : $markup.findById('#form-txt-mask'), + this.txtRegExp = new Common.UI.InputField({ + el : $markup.findById('#form-txt-regexp'), allowBlank : true, validateOnChange: false, validateOnBlur: false, @@ -578,11 +579,40 @@ define([ dataHintDirection: 'left', dataHintOffset: 'small' }); - this.lockedControls.push(this.txtMask); - this.txtMask.on('changed:after', this.onMaskChanged.bind(this)); - this.txtMask.on('inputleave', function(){ me.fireEvent('editcomplete', me);}); - this.txtMask.cmpEl.on('focus', 'input.form-control', function() { - setTimeout(function(){me.txtMask._input && me.txtMask._input.select();}, 1); + this.lockedControls.push(this.txtRegExp); + this.txtRegExp.on('changed:after', this.onRegExpChanged.bind(this)); + this.txtRegExp.on('inputleave', function(){ me.fireEvent('editcomplete', me);}); + this.txtRegExp.cmpEl.on('focus', 'input.form-control', function() { + setTimeout(function(){me.txtRegExp._input && me.txtRegExp._input.select();}, 1); + }); + + this.cmbMask = new Common.UI.ComboBoxCustom({ + el: $markup.findById('#form-txt-mask'), + cls: 'input-group-nr', + menuStyle: 'min-width: 100%;', + editable: true, + data: [ + { displayValue: this.textPhone1, value: '(999)999-9999' }, + { displayValue: this.textPhone2, value: '+999999999999' }, + { displayValue: this.textZipCodeUS, value: '99999-9999' }, + { displayValue: this.textUSSSN, value: '999-99-9999' }, + { displayValue: this.textUKPassport, value: '999999999' }, + { displayValue: this.textCreditCard, value: '9999-9999-9999-9999' }], + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'big', + updateFormControl: function(record) { + record && this.setRawValue(record.get('value')); + // $('.selected', $(this.el)).removeClass('selected'); + } + }); + this.cmbMask.setValue(''); + this.lockedControls.push(this.cmbMask); + this.cmbMask.on('selected', this.onMaskChanged.bind(this)); + this.cmbMask.on('changed:after', this.onMaskChanged.bind(this)); + this.cmbMask.on('hide:after', this.onHideMenus.bind(this)); + this.cmbMask.cmpEl.on('focus', 'input.form-control', function() { + setTimeout(function(){me.cmbMask._input && me.cmbMask._input.select();}, 1); }); this.txtFormatSymbols = new Common.UI.InputField({ @@ -998,12 +1028,12 @@ define([ formTextPr.put_LetterFormat(); break; case Asc.TextFormFormatType.Mask: - this.txtMask.setValue('*'); - formTextPr.put_MaskFormat(this.txtMask.getValue()); + this.cmbMask.setValue('*'); + formTextPr.put_MaskFormat(this.cmbMask.getValue()); break; case Asc.TextFormFormatType.RegExp: - this.txtMask.setValue('.'); - formTextPr.put_RegExpFormat(this.txtMask.getValue()); + this.txtRegExp.setValue('.'); + formTextPr.put_RegExpFormat(this.txtRegExp.getValue()); break; } props.put_TextFormPr(formTextPr); @@ -1012,15 +1042,27 @@ define([ } }, - onMaskChanged: function(input, newValue, oldValue, e) { + onMaskChanged: function(combo, record) { + if (this.api && !this._noApply) { + var props = this._originalProps || new AscCommon.CContentControlPr(); + var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr(); + formTextPr.put_MaskFormat(record.value); + if (this._state.placeholder===this._state.Mask) + props.put_PlaceholderText(record.value); + props.put_TextFormPr(formTextPr); + this.api.asc_SetContentControlProperties(props, this.internalId); + this.fireEvent('editcomplete', this); + } else { + this.cmbMask.setValue(this._state.Mask ? this._state.Mask : ''); + this.fireEvent('editcomplete', this); + } + }, + + onRegExpChanged: function(input, newValue, oldValue, e) { if (this.api && !this._noApply && (newValue!==oldValue)) { var props = this._originalProps || new AscCommon.CContentControlPr(); var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr(); - if (this.cmbFormat.getValue()===Asc.TextFormFormatType.Mask) { - formTextPr.put_MaskFormat(newValue); - } else if (this.cmbFormat.getValue()===Asc.TextFormFormatType.RegExp) { - formTextPr.put_RegExpFormat(newValue); - } + formTextPr.put_RegExpFormat(newValue); props.put_TextFormPr(formTextPr); this.api.asc_SetContentControlProperties(props, this.internalId); if (!e.relatedTarget || (e.relatedTarget.localName != 'input' && e.relatedTarget.localName != 'textarea') || !/form-control/.test(e.relatedTarget.className)) @@ -1347,12 +1389,18 @@ define([ this._state.FormatType=val; } - if ( this._state.FormatType===Asc.TextFormFormatType.Mask || this._state.FormatType===Asc.TextFormFormatType.RegExp ) { - val = (this._state.FormatType===Asc.TextFormFormatType.Mask) ? formTextPr.get_MaskFormat() : formTextPr.get_RegExpFormat(); - this.txtMask.setValue((val !== null && val !== undefined) ? val : ''); + if ( this._state.FormatType===Asc.TextFormFormatType.Mask ) { + val = formTextPr.get_MaskFormat(); + this.cmbMask.setValue((val !== null && val !== undefined) ? val : ''); this._state.Mask=val; } + if ( this._state.FormatType===Asc.TextFormFormatType.RegExp ) { + val = formTextPr.get_RegExpFormat(); + this.txtRegExp.setValue((val !== null && val !== undefined) ? val : ''); + this._state.RegExp=val; + } + val = formTextPr.get_FormatSymbols(); if ( this._state.FormatSymbols!==val ) { this.txtFormatSymbols.setValue((val !== null && val !== undefined) ? val : ''); @@ -1380,7 +1428,8 @@ define([ this.KeySettingsTd.toggleClass('padding-small', !connected); this.ConnectedSettings.toggleClass('hidden', !connected); - this.TextOnlySettingsMask.toggleClass('hidden', !(type === Asc.c_oAscContentControlSpecificType.None && !!formTextPr) || !(this._state.FormatType===Asc.TextFormFormatType.Mask || this._state.FormatType===Asc.TextFormFormatType.RegExp)); + this.TextOnlySettingsMask.toggleClass('hidden', !(type === Asc.c_oAscContentControlSpecificType.None && !!formTextPr) || this._state.FormatType!==Asc.TextFormFormatType.Mask); + this.TextOnlySettingsRegExp.toggleClass('hidden', !(type === Asc.c_oAscContentControlSpecificType.None && !!formTextPr) || this._state.FormatType!==Asc.TextFormFormatType.RegExp); if (this.type !== type || this.isSimpleInsideComplex !== isSimpleInsideComplex || needUpdateTextControls || type == Asc.c_oAscContentControlSpecificType.CheckBox) this.showHideControls(type, formTextPr, specProps, isSimpleInsideComplex); this.type = type; @@ -1678,7 +1727,13 @@ define([ textDigits: 'Digits', textNone: 'None', textComplex: 'Complex Field', - textAnyone: 'Anyone' + textAnyone: 'Anyone', + textPhone1: 'Phone Number (e.g. (123) 456-7890)', + textPhone2: 'Phone Number (e.g. +447911123456)', + textZipCodeUS: 'US Zip Code (e.g. 92663 or 92663-1234)', + textUSSSN: 'US SSN (e.g. 123-45-6789)', + textUKPassport: 'UK Passport Number (e.g. 925665416)', + textCreditCard: 'Credit Card Number (e.g 4111-1111-1111-1111)' }, DE.Views.FormSettings || {})); }); \ No newline at end of file From abba157cbf33a39c1a1e4e73576f99b234222fe7 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Dec 2022 21:02:37 +0300 Subject: [PATCH 044/179] [DE] Forms: fix alignment for mask combobox --- apps/common/main/lib/component/ComboBox.js | 5 ++++- apps/documenteditor/main/app/view/FormSettings.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/component/ComboBox.js b/apps/common/main/lib/component/ComboBox.js index 1eb060eb2..42bd19a0e 100644 --- a/apps/common/main/lib/component/ComboBox.js +++ b/apps/common/main/lib/component/ComboBox.js @@ -311,7 +311,10 @@ define([ var $list = this.cmpEl.find('ul'); if ($list.hasClass('menu-absolute')) { var offset = this.cmpEl.offset(); - $list.css({left: offset.left, top: offset.top + this.cmpEl.outerHeight() + 2}); + var left = offset.left; + if (left + $list.outerWidth()>Common.Utils.innerWidth()) + left += (this.cmpEl.outerWidth() - $list.outerWidth()); + $list.css({left: left, top: offset.top + this.cmpEl.outerHeight() + 2}); } else if ($list.hasClass('menu-aligned')) { var offset = this.cmpEl.offset(); $list.toggleClass('show-top', offset.top + this.cmpEl.outerHeight() + $list.outerHeight() > Common.Utils.innerHeight()); diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index 119ac6d3f..2c7e786c4 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -589,7 +589,8 @@ define([ this.cmbMask = new Common.UI.ComboBoxCustom({ el: $markup.findById('#form-txt-mask'), cls: 'input-group-nr', - menuStyle: 'min-width: 100%;', + menuCls: 'menu-absolute', + menuStyle: 'min-width: 195px;', editable: true, data: [ { displayValue: this.textPhone1, value: '(999)999-9999' }, From 59ca7637100e199767d5abdcfd730bf5e6a05435 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Dec 2022 21:15:23 +0300 Subject: [PATCH 045/179] Fix icon --- apps/documenteditor/main/app/view/FormsTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index 4d5e6da35..0b9690434 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -470,7 +470,7 @@ define([ caption: me.txtInlineText, template: menuTemplate, description: me.txtInlineDesc, - iconCls : 'menu__icon page-landscape', + iconCls : 'menu__icon btn-field', value: 'inline', iconClsForMainBtn: 'btn-text-field', hintForMainBtn: [me.tipInlineText, me.tipTextField] From 525b0f62231ba4ce7897eadb46a1d05dcd177c17 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Dec 2022 21:39:15 +0300 Subject: [PATCH 046/179] [DE] Insert datetime form --- .../main/app/controller/FormsTab.js | 4 +++- .../main/app/controller/RightMenu.js | 3 ++- apps/documenteditor/main/app/view/FormsTab.js | 21 ++++++++++++++++++- .../main/app/view/ImageSettingsAdvanced.js | 3 ++- .../main/app/view/ShapeSettings.js | 3 ++- 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 8e7d98bcf..63287cf5b 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -153,7 +153,7 @@ define([ var content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked; var arr = [ this.view.btnTextField, this.view.btnComboBox, this.view.btnDropDown, this.view.btnCheckBox, this.view.btnRadioBox, this.view.btnImageField, this.view.btnEmailField, this.view.btnPhoneField, this.view.btnComplexField, - this.view.btnCreditCard, this.view.btnZipCode]; + this.view.btnCreditCard, this.view.btnZipCode, this.view.btnDateTime]; Common.Utils.lockControls(Common.enumLock.paragraphLock, paragraph_locked, {array: arr}); Common.Utils.lockControls(Common.enumLock.headerLock, header_locked, {array: arr}); Common.Utils.lockControls(Common.enumLock.controlPlain, control_plain, {array: arr}); @@ -191,6 +191,8 @@ define([ this.api.asc_AddContentControlCheckBox(oPr, oFormPr); } else if (type == 'combobox' || type == 'dropdown') this.api.asc_AddContentControlList(type == 'combobox', oPr, oFormPr); + else if (type == 'datetime') + this.api.asc_AddContentControlDatePicker(); // !!!! change for datetime form else if (type == 'text') { var props = new AscCommon.CContentControlPr(); oPr = new AscCommon.CSdtTextFormPr(); diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index 1261c0156..97ef644ac 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -220,7 +220,8 @@ define([ if (control_props && control_props.get_FormPr() && this.rightmenu.formSettings) { var spectype = control_props.get_SpecificType(); if (spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture || spectype==Asc.c_oAscContentControlSpecificType.Complex || - spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.None) { + spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.None || + spectype==Asc.c_oAscContentControlSpecificType.DateTime) { settingsType = Common.Utils.documentSettingsType.Form; this._settings[settingsType].props = control_props; this._settings[settingsType].locked = control_lock || isProtected; diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index 0b9690434..a3ffb0f9b 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -61,6 +61,7 @@ define([ '