[all] 'Header' markup changed, added 'crypted' icon

This commit is contained in:
Maxim Kadushkin 2020-06-08 14:02:48 +03:00
parent aea1018d01
commit 7a768c8678
6 changed files with 56 additions and 26 deletions

View file

@ -74,7 +74,8 @@ define([
var templateRightBox = '<section>' +
'<section id="box-doc-name">' +
'<input type="text" id="rib-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
// '<input type="text" id="rib-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
'<label id="rib-doc-name" />' +
'</section>' +
'<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' +
'<div class="hedset">' +
@ -115,8 +116,10 @@ define([
'<div class="btn-slot" id="slot-btn-dt-undo"></div>' +
'<div class="btn-slot" id="slot-btn-dt-redo"></div>' +
'</div>' +
'<div class="lr-separator"></div>' +
'<input type="text" id="title-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
'<div class="lr-separator" id="id-box-doc-name">' +
// '<input type="text" id="title-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
'<label id="title-doc-name" />' +
'</div>' +
'<label id="title-user-name" style="pointer-events: none;"></label>' +
'</section>';
@ -202,7 +205,14 @@ define([
}
}
function onAppShowed(config) {}
function onAppShowed(config) {
if ( config.isCrypted && this.labelDocName ) {
this.labelDocName.before(
'<div class="inner-box-icon crypted">' +
'<svg class="icon"><use xlink:href="#svg-icon-crypted"></use></svg>' +
'</div>');
}
}
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);

View file

@ -181,4 +181,7 @@
<path d="M22 3V12H6V3H5V12C5 12.6 5.4 13 6 13H22C22.6 13 23 12.6 23 12V3H22Z"/>
<path d="M6 19H22V25H23V19C23 18.4 22.6 18 22 18H6C5.4 18 5 18.4 5 19V25H6V19Z"/>
</symbol>
<symbol id="svg-icon-crypted" viewBox="0 0 20 20">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 3.00049C6.99987 4.99948 4 5.00023 4 5.00023V8.50023C4 10.5001 4.56284 15.9767 9.99961 17.0001C15.4364 15.9767 16 10.5001 16 8.50023V5.00023C16 5.00023 13.0001 4.99948 10 3.00049ZM14.0232 7.96528L12.9768 7.03517L9.42726 11.0284L6.94813 8.96247L6.05187 10.038L9.57274 12.972L14.0232 7.96528Z" fill="white"/>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -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;
}
}
}

View file

@ -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

View file

@ -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 **/

View file

@ -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 **/