From 7a768c8678468caa7eba8cc82a340cb4359efd72 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Mon, 8 Jun 2020 14:02:48 +0300 Subject: [PATCH] [all] 'Header' markup changed, added 'crypted' icon --- apps/common/main/lib/view/Header.js | 26 ++++++---- .../main/resources/img/header/buttons.svg | 3 ++ apps/common/main/resources/less/header.less | 50 +++++++++++++------ .../main/app/controller/Main.js | 1 + .../main/app/controller/Main.js | 1 + .../main/app/controller/Main.js | 1 + 6 files changed, 56 insertions(+), 26 deletions(-) diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index d04cdd694..e74a0a986 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -74,7 +74,8 @@ define([ var templateRightBox = '
' + '
' + - '' + + // '' + + '
' + '<%= textSaveEnd %>' + '
' + @@ -115,8 +116,10 @@ define([ '
' + '
' + '
' + - '
' + - '' + + '
' + + // '' + + '
' + '' + '
'; @@ -202,7 +205,14 @@ define([ } } - function onAppShowed(config) {} + function onAppShowed(config) { + if ( config.isCrypted && this.labelDocName ) { + this.labelDocName.before( + '
' + + '' + + '
'); + } + } function onAppReady(mode) { appConfig = mode; @@ -463,11 +473,6 @@ define([ if ( !me.labelDocName ) { me.labelDocName = $html.find('#rib-doc-name'); - // this.labelDocName.attr('maxlength', 50); - me.labelDocName.text = function (text) { - this.val(text).attr('size', text.length); - } - if ( me.documentCaption ) { me.labelDocName.text(me.documentCaption); } @@ -511,8 +516,7 @@ define([ var $html = $(_.template(templateTitleBox)()); !!me.labelDocName && me.labelDocName.hide().off(); // hide document title if it was created in right box - me.labelDocName = $html.find('> #title-doc-name'); - me.labelDocName.text = function (str) {this.val(str);}; // redefine text function to lock temporaly rename docuemnt option + me.labelDocName = $html.find('#title-doc-name'); me.labelDocName.text( me.documentCaption ); me.labelUserName = $('> #title-user-name', $html); diff --git a/apps/common/main/resources/img/header/buttons.svg b/apps/common/main/resources/img/header/buttons.svg index e4adbca6e..7f59ecbd4 100644 --- a/apps/common/main/resources/img/header/buttons.svg +++ b/apps/common/main/resources/img/header/buttons.svg @@ -181,4 +181,7 @@ + + + diff --git a/apps/common/main/resources/less/header.less b/apps/common/main/resources/less/header.less index 965d22f73..ff7bb9f6c 100644 --- a/apps/common/main/resources/less/header.less +++ b/apps/common/main/resources/less/header.less @@ -89,6 +89,7 @@ #box-doc-name { flex-grow: 1; display: flex; + justify-content: center; } #rib-doc-name { @@ -102,19 +103,19 @@ background-color: transparent; border: 0 none; cursor: default; + line-height: 32px; - &:hover:not(:disabled) { - border: 1px solid @gray-dark; - background-color: rgba(255,255,255,0.2); - } - - &:focus:not(:active) { - border: 1px solid @gray-dark; - cursor: text; - background-color: white; - color: @gray-deep; - } - width: 100%; + //&:hover:not(:disabled) { + // border: 1px solid @gray-dark; + // background-color: rgba(255,255,255,0.2); + //} + // + //&:focus:not(:active) { + // border: 1px solid @gray-dark; + // cursor: text; + // background-color: white; + // color: @gray-deep; + //} } #rib-save-status { @@ -374,15 +375,19 @@ } } + #id-box-doc-name { + display: flex; + justify-content: center; + overflow: hidden; + } + #title-doc-name { - position: absolute; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; text-align: center; font-size: 12px; - height: 100%; - width: 100%; + line-height: 28px; background-color: transparent; border: 0 none; cursor: default; @@ -403,3 +408,18 @@ flex-grow: 1; } } + +#box-doc-name, #box-document-title { + .inner-box-icon.crypted { + width: 20px; + position: relative; + + > svg { + position: absolute; + width: 20px; + height: 20px; + top: 50%; + margin-top: -10px; + } + } +} diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 2274a064b..426a0a577 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1179,6 +1179,7 @@ define([ this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion; /** coauthoring end **/ this.appOptions.isOffline = this.api.asc_isOffline(); + this.appOptions.isCrypted = this.api.asc_isCrypto(); this.appOptions.isReviewOnly = this.permissions.review === true && this.permissions.edit === false; this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; this.appOptions.canEdit = (this.permissions.edit !== false || this.permissions.review === true) && // can edit or review diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 33a78ba60..152ba33a4 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -911,6 +911,7 @@ define([ this.permissions.edit = false; this.appOptions.isOffline = this.api.asc_isOffline(); + this.appOptions.isCrypted = this.api.asc_isCrypto(); this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); this.appOptions.isLightVersion = params.asc_getIsLight(); /** coauthoring begin **/ diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 554e5beec..ec4b694c2 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -967,6 +967,7 @@ define([ this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable(); this.appOptions.isOffline = this.api.asc_isOffline(); + this.appOptions.isCrypted = this.api.asc_isCrypto(); this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); this.appOptions.isLightVersion = params.asc_getIsLight(); /** coauthoring begin **/