[DE PE SSE] Change layout of Protect panel

This commit is contained in:
JuliaSvinareva 2022-11-26 22:59:01 +03:00
parent 33b358f931
commit ca0a2609c9
10 changed files with 235 additions and 98 deletions

View file

@ -239,8 +239,7 @@ define([
var me = this; var me = this;
if ( type == 'signature' ) { if ( type == 'signature' ) {
var button = new Common.UI.Button({ var button = new Common.UI.Button({
cls: 'btn-text-default', cls: 'btn-text-default auto',
style: 'width: 100%;',
caption: this.txtInvisibleSignature, caption: this.txtInvisibleSignature,
disabled: this._state.invisibleSignDisabled, disabled: this._state.invisibleSignDisabled,
dataHint: '2', dataHint: '2',
@ -256,8 +255,7 @@ define([
return button; return button;
} else if ( type == 'add-password' ) { } else if ( type == 'add-password' ) {
var button = new Common.UI.Button({ var button = new Common.UI.Button({
cls: 'btn-text-default', cls: 'btn-text-default auto',
style: 'width: 100%;',
caption: this.txtAddPwd, caption: this.txtAddPwd,
disabled: this._state.disabled || this._state.disabledPassword, disabled: this._state.disabled || this._state.disabledPassword,
visible: !this._state.hasPassword, visible: !this._state.hasPassword,
@ -274,8 +272,7 @@ define([
return button; return button;
} else if ( type == 'del-password' ) { } else if ( type == 'del-password' ) {
var button = new Common.UI.Button({ var button = new Common.UI.Button({
cls: 'btn-text-default', cls: 'btn-text-default auto',
style: 'width: 100%;',
caption: this.txtDeletePwd, caption: this.txtDeletePwd,
disabled: this._state.disabled || this._state.disabledPassword, disabled: this._state.disabled || this._state.disabledPassword,
visible: this._state.hasPassword, visible: this._state.hasPassword,
@ -292,8 +289,7 @@ define([
return button; return button;
} else if ( type == 'change-password' ) { } else if ( type == 'change-password' ) {
var button = new Common.UI.Button({ var button = new Common.UI.Button({
cls: 'btn-text-default', cls: 'btn-text-default auto',
style: 'width: 100%;',
caption: this.txtChangePwd, caption: this.txtChangePwd,
disabled: this._state.disabled || this._state.disabledPassword, disabled: this._state.disabled || this._state.disabledPassword,
visible: this._state.hasPassword, visible: this._state.hasPassword,

View file

@ -2272,20 +2272,27 @@ define([
'<label id="id-fms-lbl-protect-header"><%= scope.strProtect %></label>', '<label id="id-fms-lbl-protect-header"><%= scope.strProtect %></label>',
'<div id="id-fms-password">', '<div id="id-fms-password">',
'<label class="header"><%= scope.strEncrypt %></label>', '<label class="header"><%= scope.strEncrypt %></label>',
'<div id="fms-btn-add-pwd" style="width:190px;"></div>', '<div class="encrypt-block">',
'<table id="id-fms-view-pwd" cols="2" width="300">', '<div class="description"><%= scope.txtProtectDocument %></div>',
'<tr>', '<div id="fms-btn-add-pwd"></div>',
'<td colspan="2"><label style="cursor: default;"><%= scope.txtEncrypted %></label></td>', '</div>',
'</tr>', '<div class="encrypted-block">',
'<tr>', '<div class="description"><%= scope.txtEncrypted %></div>',
'<td><div id="fms-btn-change-pwd" style="width:190px;"></div></td>', '<div class="buttons">',
'<td align="right"><div id="fms-btn-delete-pwd" style="width:190px; margin-left:20px;"></div></td>', '<div id="fms-btn-change-pwd"></div>',
'</tr>', '<div id="fms-btn-delete-pwd"></div>',
'</table>', '</div>',
'</div>',
'</div>', '</div>',
'<div id="id-fms-signature">', '<div id="id-fms-signature">',
'<label class="header"><%= scope.strSignature %></label>', '<label class="header"><%= scope.strSignature %></label>',
'<div id="fms-btn-invisible-sign" style="width:190px; margin-bottom: 20px;"></div>', '<div class="add-signature-block">',
'<div class="description"><%= scope.txtAddSignature %></div>',
'<div id="fms-btn-invisible-sign"></div>',
'</div>',
'<div class="added-signature-block">',
'<div class="description"><%= scope.txtAddedSignature %></div>',
'</div>',
'<div id="id-fms-signature-view"></div>', '<div id="id-fms-signature-view"></div>',
'</div>' '</div>'
].join('')), ].join('')),
@ -2297,15 +2304,13 @@ define([
var me = this; var me = this;
this.templateSignature = _.template([ this.templateSignature = _.template([
'<table cols="2" width="300" class="<% if (!hasRequested && !hasSigned) { %>hidden<% } %>"">', '<div class="<% if (!hasRequested && !hasSigned) { %>hidden<% } %>"">',
'<tr>', '<div class="signature-tip"><%= tipText %></div>',
'<td colspan="2"><label style="cursor: default;"><%= tipText %></label></td>', '<div class="buttons">',
'<label class="link signature-view-link" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtView + '</label>',
'<label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtEdit + '</label>',
'</tr>', '</tr>',
'<tr>', '</div>'
'<td><label class="link signature-view-link" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtView + '</label></td>',
'<td align="right"><label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtEdit + '</label></td>',
'</tr>',
'</table>'
].join('')); ].join(''));
}, },
@ -2327,7 +2332,8 @@ define([
this.btnDeletePwd.on('click', _.bind(this.closeMenu, this)); this.btnDeletePwd.on('click', _.bind(this.closeMenu, this));
this.cntPassword = $('#id-fms-password'); this.cntPassword = $('#id-fms-password');
this.cntPasswordView = $('#id-fms-view-pwd'); this.cntEncryptBlock = this.$el.find('.encrypt-block');
this.cntEncryptedBlock = this.$el.find('.encrypted-block');
this.btnAddInvisibleSign = protection.getButton('signature'); this.btnAddInvisibleSign = protection.getButton('signature');
this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign')); this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign'));
@ -2335,6 +2341,10 @@ define([
this.cntSignature = $('#id-fms-signature'); this.cntSignature = $('#id-fms-signature');
this.cntSignatureView = $('#id-fms-signature-view'); this.cntSignatureView = $('#id-fms-signature-view');
this.cntAddSignature = this.$el.find('.add-signature-block');
this.cntAddedSignature = this.$el.find('.added-signature-block');
if (_.isUndefined(this.scroller)) { if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({ this.scroller = new Common.UI.Scroller({
el: this.$el, el: this.$el,
@ -2417,10 +2427,16 @@ define([
tipText = this.txtRequestedSignatures + (tipText!="" ? "<br><br>" : "")+ tipText; tipText = this.txtRequestedSignatures + (tipText!="" ? "<br><br>" : "")+ tipText;
this.cntSignatureView.html(this.templateSignature({tipText: tipText, hasSigned: (hasValid || hasInvalid), hasRequested: hasRequested})); this.cntSignatureView.html(this.templateSignature({tipText: tipText, hasSigned: (hasValid || hasInvalid), hasRequested: hasRequested}));
var isAddedSignature = this.btnAddInvisibleSign.$el.find('button').hasClass('hidden');
this.cntAddSignature.toggleClass('hidden', isAddedSignature);
this.cntAddedSignature.toggleClass('hidden', !isAddedSignature);
}, },
updateEncrypt: function() { updateEncrypt: function() {
this.cntPasswordView.toggleClass('hidden', this.btnAddPwd.isVisible()); var isProtected = this.btnAddPwd.$el.find('button').hasClass('hidden');
this.cntEncryptBlock.toggleClass('hidden', isProtected);
this.cntEncryptedBlock.toggleClass('hidden', !isProtected);
}, },
strProtect: 'Protect Document', strProtect: 'Protect Document',
@ -2433,7 +2449,10 @@ define([
notcriticalErrorTitle: 'Warning', notcriticalErrorTitle: 'Warning',
txtEditWarning: 'Editing will remove the signatures from the document.<br>Are you sure you want to continue?', txtEditWarning: 'Editing will remove the signatures from the document.<br>Are you sure you want to continue?',
strEncrypt: 'With Password', strEncrypt: 'With Password',
txtEncrypted: 'This document has been protected by password' txtProtectDocument: 'Protect this document with a password',
txtEncrypted: 'A password is required to open this document',
txtAddSignature: 'Ensure the integrity of the document by adding an<br>invisible digital signature',
txtAddedSignature: 'Valid signatures have been added to the document.<br>The document is protected from editing.'
}, DE.Views.FileMenuPanels.ProtectDoc || {})); }, DE.Views.FileMenuPanels.ProtectDoc || {}));

View file

@ -1965,11 +1965,14 @@
"DE.Views.FileMenuPanels.ProtectDoc.strSignature": "With signature", "DE.Views.FileMenuPanels.ProtectDoc.strSignature": "With signature",
"DE.Views.FileMenuPanels.ProtectDoc.txtEdit": "Edit document", "DE.Views.FileMenuPanels.ProtectDoc.txtEdit": "Edit document",
"DE.Views.FileMenuPanels.ProtectDoc.txtEditWarning": "Editing will remove signatures from the document.<br>Continue?", "DE.Views.FileMenuPanels.ProtectDoc.txtEditWarning": "Editing will remove signatures from the document.<br>Continue?",
"DE.Views.FileMenuPanels.ProtectDoc.txtEncrypted": "This document has been protected with password", "DE.Views.FileMenuPanels.ProtectDoc.txtEncrypted": "A password is required to open this document",
"DE.Views.FileMenuPanels.ProtectDoc.txtRequestedSignatures": "This document needs to be signed.", "DE.Views.FileMenuPanels.ProtectDoc.txtRequestedSignatures": "This document needs to be signed.",
"DE.Views.FileMenuPanels.ProtectDoc.txtSigned": "Valid signatures have been added to the document. The document is protected from editing.", "DE.Views.FileMenuPanels.ProtectDoc.txtSigned": "Valid signatures have been added to the document. The document is protected from editing.",
"DE.Views.FileMenuPanels.ProtectDoc.txtSignedInvalid": "Some of the digital signatures in the document are invalid or could not be verified. The document is protected from editing.", "DE.Views.FileMenuPanels.ProtectDoc.txtSignedInvalid": "Some of the digital signatures in the document are invalid or could not be verified. The document is protected from editing.",
"DE.Views.FileMenuPanels.ProtectDoc.txtView": "View signatures", "DE.Views.FileMenuPanels.ProtectDoc.txtView": "View signatures",
"DE.Views.FileMenuPanels.ProtectDoc.txtProtectDocument": "Protect this document with a password",
"DE.Views.FileMenuPanels.ProtectDoc.txtAddSignature": "Ensure the integrity of the document by adding an<br>invisible digital signature",
"DE.Views.FileMenuPanels.ProtectDoc.txtAddedSignature": "Valid signatures have been added to the document.<br>The document is protected from editing.",
"DE.Views.FileMenuPanels.Settings.okButtonText": "Apply", "DE.Views.FileMenuPanels.Settings.okButtonText": "Apply",
"DE.Views.FileMenuPanels.Settings.strCoAuthMode": "Co-editing Mode", "DE.Views.FileMenuPanels.Settings.strCoAuthMode": "Co-editing Mode",
"DE.Views.FileMenuPanels.Settings.strFast": "Fast", "DE.Views.FileMenuPanels.Settings.strFast": "Fast",

View file

@ -564,16 +564,41 @@
.header { .header {
.font-weight-bold(); .font-weight-bold();
margin: 20px 0 10px; margin: 20px 0 4px 0;
} }
table { .description {
td { color: @text-secondary-ie;
padding: 5px 0; color: @text-secondary;
} margin-bottom: 12px;
}
.buttons {
display: flex;
}
#fms-btn-delete-pwd {
margin-left: 16px;
}
.signature-view-link {
margin-right: 20px;
}
.signature-tip {
margin-bottom: 6px;
}
#fms-btn-invisible-sign {
margin-bottom: 20px;
} }
#id-fms-lbl-protect-header { #id-fms-lbl-protect-header {
font-size: 16px; font-size: 16px;
} }
.btn-text-default.auto {
padding-left: 12px;
padding-right: 12px;
}
} }

View file

@ -1749,20 +1749,27 @@ define([
'<label id="id-fms-lbl-protect-header"><%= scope.strProtect %></label>', '<label id="id-fms-lbl-protect-header"><%= scope.strProtect %></label>',
'<div id="id-fms-password">', '<div id="id-fms-password">',
'<label class="header"><%= scope.strEncrypt %></label>', '<label class="header"><%= scope.strEncrypt %></label>',
'<div id="fms-btn-add-pwd" style="width:190px;"></div>', '<div class="encrypt-block">',
'<table id="id-fms-view-pwd" cols="2" width="300">', '<div class="description"><%= scope.txtProtectPresentation %></div>',
'<tr>', '<div id="fms-btn-add-pwd"></div>',
'<td colspan="2"><label style="cursor: default;"><%= scope.txtEncrypted %></label></td>', '</div>',
'</tr>', '<div class="encrypted-block">',
'<tr>', '<div class="description"><%= scope.txtEncrypted %></div>',
'<td><div id="fms-btn-change-pwd" style="width:190px;"></div></td>', '<div class="buttons">',
'<td align="right"><div id="fms-btn-delete-pwd" style="width:190px; margin-left:20px;"></div></td>', '<div id="fms-btn-change-pwd"></div>',
'</tr>', '<div id="fms-btn-delete-pwd"></div>',
'</table>', '</div>',
'</div>',
'</div>', '</div>',
'<div id="id-fms-signature">', '<div id="id-fms-signature">',
'<label class="header"><%= scope.strSignature %></label>', '<label class="header"><%= scope.strSignature %></label>',
'<div id="fms-btn-invisible-sign" style="width:190px; margin-bottom: 20px;"></div>', '<div class="add-signature-block">',
'<div class="description"><%= scope.txtAddSignature %></div>',
'<div id="fms-btn-invisible-sign"></div>',
'</div>',
'<div class="added-signature-block">',
'<div class="description"><%= scope.txtAddedSignature %></div>',
'</div>',
'<div id="id-fms-signature-view"></div>', '<div id="id-fms-signature-view"></div>',
'</div>' '</div>'
].join('')), ].join('')),
@ -1774,15 +1781,13 @@ define([
var me = this; var me = this;
this.templateSignature = _.template([ this.templateSignature = _.template([
'<table cols="2" width="300" class="<% if (!hasSigned) { %>hidden<% } %>"">', '<div class="<% if (!hasSigned) { %>hidden<% } %>"">',
'<tr>', '<div class="signature-tip"><%= tipText %></div>',
'<td colspan="2"><label style="cursor: default;"><%= tipText %></label></td>', '<div class="buttons">',
'</tr>', '<label class="link signature-view-link" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtView + '</label>',
'<tr>', '<label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtEdit + '</label>',
'<td><label class="link signature-view-link" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtView + '</label></td>', '</div>',
'<td align="right"><label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtEdit + '</label></td>', '</div>'
'</tr>',
'</table>'
].join('')); ].join(''));
}, },
@ -1804,7 +1809,8 @@ define([
this.btnDeletePwd.on('click', _.bind(this.closeMenu, this)); this.btnDeletePwd.on('click', _.bind(this.closeMenu, this));
this.cntPassword = $('#id-fms-password'); this.cntPassword = $('#id-fms-password');
this.cntPasswordView = $('#id-fms-view-pwd'); this.cntEncryptBlock = this.$el.find('.encrypt-block');
this.cntEncryptedBlock = this.$el.find('.encrypted-block');
this.btnAddInvisibleSign = protection.getButton('signature'); this.btnAddInvisibleSign = protection.getButton('signature');
this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign')); this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign'));
@ -1812,6 +1818,10 @@ define([
this.cntSignature = $('#id-fms-signature'); this.cntSignature = $('#id-fms-signature');
this.cntSignatureView = $('#id-fms-signature-view'); this.cntSignatureView = $('#id-fms-signature-view');
this.cntAddSignature = this.$el.find('.add-signature-block');
this.cntAddedSignature = this.$el.find('.added-signature-block');
if (_.isUndefined(this.scroller)) { if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({ this.scroller = new Common.UI.Scroller({
el: this.$el, el: this.$el,
@ -1888,10 +1898,16 @@ define([
var tipText = (hasInvalid) ? this.txtSignedInvalid : (hasValid ? this.txtSigned : ""); var tipText = (hasInvalid) ? this.txtSignedInvalid : (hasValid ? this.txtSigned : "");
this.cntSignatureView.html(this.templateSignature({tipText: tipText, hasSigned: (hasValid || hasInvalid)})); this.cntSignatureView.html(this.templateSignature({tipText: tipText, hasSigned: (hasValid || hasInvalid)}));
var isAddedSignature = this.btnAddInvisibleSign.$el.find('button').hasClass('hidden');
this.cntAddSignature.toggleClass('hidden', isAddedSignature);
this.cntAddedSignature.toggleClass('hidden', !isAddedSignature);
}, },
updateEncrypt: function() { updateEncrypt: function() {
this.cntPasswordView.toggleClass('hidden', this.btnAddPwd.isVisible()); var isProtected = this.btnAddPwd.$el.find('button').hasClass('hidden');
this.cntEncryptBlock.toggleClass('hidden', isProtected);
this.cntEncryptedBlock.toggleClass('hidden', !isProtected);
}, },
strProtect: 'Protect Presentation', strProtect: 'Protect Presentation',
@ -1903,7 +1919,10 @@ define([
notcriticalErrorTitle: 'Warning', notcriticalErrorTitle: 'Warning',
txtEditWarning: 'Editing will remove the signatures from the presentation.<br>Are you sure you want to continue?', txtEditWarning: 'Editing will remove the signatures from the presentation.<br>Are you sure you want to continue?',
strEncrypt: 'With Password', strEncrypt: 'With Password',
txtEncrypted: 'This presentation has been protected by password' txtProtectPresentation: 'Protect this presentation with a password',
txtEncrypted: 'A password is required to open this presentation',
txtAddSignature: 'Ensure the integrity of the presentation by adding an<br>invisible digital signature',
txtAddedSignature: 'Valid signatures have been added to the presentation.<br>The presentation is protected from editing.'
}, PE.Views.FileMenuPanels.ProtectDoc || {})); }, PE.Views.FileMenuPanels.ProtectDoc || {}));

View file

@ -1857,10 +1857,13 @@
"PE.Views.FileMenuPanels.ProtectDoc.strSignature": "With signature", "PE.Views.FileMenuPanels.ProtectDoc.strSignature": "With signature",
"PE.Views.FileMenuPanels.ProtectDoc.txtEdit": "Edit presentation", "PE.Views.FileMenuPanels.ProtectDoc.txtEdit": "Edit presentation",
"PE.Views.FileMenuPanels.ProtectDoc.txtEditWarning": "Editing will remove signatures from the presentation.<br>Continue?", "PE.Views.FileMenuPanels.ProtectDoc.txtEditWarning": "Editing will remove signatures from the presentation.<br>Continue?",
"PE.Views.FileMenuPanels.ProtectDoc.txtEncrypted": "This presentation has been protected by password", "PE.Views.FileMenuPanels.ProtectDoc.txtEncrypted": "A password is required to open this presentation",
"PE.Views.FileMenuPanels.ProtectDoc.txtSigned": "Valid signatures have been added to the presentation. The presentation is protected from editing.", "PE.Views.FileMenuPanels.ProtectDoc.txtSigned": "Valid signatures have been added to the presentation. The presentation is protected from editing.",
"PE.Views.FileMenuPanels.ProtectDoc.txtSignedInvalid": "Some of the digital signatures in presentation are invalid or could not be verified. The presentation is protected from editing.", "PE.Views.FileMenuPanels.ProtectDoc.txtSignedInvalid": "Some of the digital signatures in presentation are invalid or could not be verified. The presentation is protected from editing.",
"PE.Views.FileMenuPanels.ProtectDoc.txtView": "View signatures", "PE.Views.FileMenuPanels.ProtectDoc.txtView": "View signatures",
"PE.Views.FileMenuPanels.ProtectDoc.txtProtectPresentation": "Protect this presentation with a password",
"PE.Views.FileMenuPanels.ProtectDoc.txtAddSignature": "Ensure the integrity of the presentation by adding an<br>invisible digital signature",
"PE.Views.FileMenuPanels.ProtectDoc.txtAddedSignature": "Valid signatures have been added to the presentation.<br>The presentation is protected from editing.",
"PE.Views.FileMenuPanels.Settings.okButtonText": "Apply", "PE.Views.FileMenuPanels.Settings.okButtonText": "Apply",
"PE.Views.FileMenuPanels.Settings.strCoAuthMode": "Co-editing Mode", "PE.Views.FileMenuPanels.Settings.strCoAuthMode": "Co-editing Mode",
"PE.Views.FileMenuPanels.Settings.strFast": "Fast", "PE.Views.FileMenuPanels.Settings.strFast": "Fast",

View file

@ -537,26 +537,51 @@
} }
#panel-protect { #panel-protect {
padding: 30px 30px;
label { label {
font-size: 12px; font-size: 12px;
} }
padding: 30px 30px;
.header { .header {
.font-weight-bold(); .font-weight-bold();
margin: 20px 0 10px; margin: 20px 0 4px 0;
} }
table { .description {
td { color: @text-secondary-ie;
padding: 5px 0; color: @text-secondary;
} margin-bottom: 12px;
}
.buttons {
display: flex;
}
#fms-btn-delete-pwd {
margin-left: 16px;
}
.signature-view-link {
margin-right: 20px;
}
.signature-tip {
margin-bottom: 6px;
}
#fms-btn-invisible-sign {
margin-bottom: 20px;
} }
#id-fms-lbl-protect-header { #id-fms-lbl-protect-header {
font-size: 16px; font-size: 16px;
} }
.btn-text-default.auto {
padding-left: 12px;
padding-right: 12px;
}
} }
} }
} }

View file

@ -2139,20 +2139,27 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
'<label id="id-fms-lbl-protect-header"><%= scope.strProtect %></label>', '<label id="id-fms-lbl-protect-header"><%= scope.strProtect %></label>',
'<div id="id-fms-password">', '<div id="id-fms-password">',
'<label class="header"><%= scope.strEncrypt %></label>', '<label class="header"><%= scope.strEncrypt %></label>',
'<div id="fms-btn-add-pwd" style="width:190px;"></div>', '<div class="encrypt-block">',
'<table id="id-fms-view-pwd" cols="2" width="300">', '<div class="description"><%= scope.txtProtectSpreadsheet %></div>',
'<tr>', '<div id="fms-btn-add-pwd"></div>',
'<td colspan="2"><label style="cursor: default;"><%= scope.txtEncrypted %></label></td>', '</div>',
'</tr>', '<div class="encrypted-block">',
'<tr>', '<div class="description"><%= scope.txtEncrypted %></div>',
'<td><div id="fms-btn-change-pwd" style="width:190px;"></div></td>', '<div class="buttons">',
'<td align="right"><div id="fms-btn-delete-pwd" style="width:190px; margin-left:20px;"></div></td>', '<div id="fms-btn-change-pwd"></div>',
'</tr>', '<div id="fms-btn-delete-pwd"></div>',
'</table>', '</div>',
'</div>',
'</div>', '</div>',
'<div id="id-fms-signature">', '<div id="id-fms-signature">',
'<label class="header"><%= scope.strSignature %></label>', '<label class="header"><%= scope.strSignature %></label>',
'<div id="fms-btn-invisible-sign" style="width:190px; margin-bottom: 20px;"></div>', '<div class="add-signature-block">',
'<div class="description"><%= scope.txtAddSignature %></div>',
'<div id="fms-btn-invisible-sign"></div>',
'</div>',
'<div class="added-signature-block">',
'<div class="description"><%= scope.txtAddedSignature %></div>',
'</div>',
'<div id="id-fms-signature-view"></div>', '<div id="id-fms-signature-view"></div>',
'</div>' '</div>'
].join('')), ].join('')),
@ -2164,15 +2171,13 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
var me = this; var me = this;
this.templateSignature = _.template([ this.templateSignature = _.template([
'<table cols="2" width="300" class="<% if (!hasRequested && !hasSigned) { %>hidden<% } %>"">', '<div class="<% if (!hasRequested && !hasSigned) { %>hidden<% } %>"">',
'<tr>', '<div class="signature-tip"><%= tipText %></div>',
'<td colspan="2"><label style="cursor: default;"><%= tipText %></label></td>', '<div class="buttons">',
'</tr>', '<label class="link signature-view-link" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtView + '</label>',
'<tr>', '<label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtEdit + '</label>',
'<td><label class="link signature-view-link" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtView + '</label></td>', '</div>',
'<td align="right"><label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtEdit + '</label></td>', '</div>'
'</tr>',
'</table>'
].join('')); ].join(''));
}, },
@ -2194,7 +2199,8 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
this.btnDeletePwd.on('click', _.bind(this.closeMenu, this)); this.btnDeletePwd.on('click', _.bind(this.closeMenu, this));
this.cntPassword = $('#id-fms-password'); this.cntPassword = $('#id-fms-password');
this.cntPasswordView = $('#id-fms-view-pwd'); this.cntEncryptBlock = this.$el.find('.encrypt-block');
this.cntEncryptedBlock = this.$el.find('.encrypted-block');
this.btnAddInvisibleSign = protection.getButton('signature'); this.btnAddInvisibleSign = protection.getButton('signature');
this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign')); this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign'));
@ -2202,6 +2208,10 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
this.cntSignature = $('#id-fms-signature'); this.cntSignature = $('#id-fms-signature');
this.cntSignatureView = $('#id-fms-signature-view'); this.cntSignatureView = $('#id-fms-signature-view');
this.cntAddSignature = this.$el.find('.add-signature-block');
this.cntAddedSignature = this.$el.find('.added-signature-block');
if (_.isUndefined(this.scroller)) { if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({ this.scroller = new Common.UI.Scroller({
el: this.$el, el: this.$el,
@ -2284,10 +2294,16 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
tipText = this.txtRequestedSignatures + (tipText!="" ? "<br><br>" : "")+ tipText; tipText = this.txtRequestedSignatures + (tipText!="" ? "<br><br>" : "")+ tipText;
this.cntSignatureView.html(this.templateSignature({tipText: tipText, hasSigned: (hasValid || hasInvalid), hasRequested: hasRequested})); this.cntSignatureView.html(this.templateSignature({tipText: tipText, hasSigned: (hasValid || hasInvalid), hasRequested: hasRequested}));
var isAddedSignature = this.btnAddInvisibleSign.$el.find('button').hasClass('hidden');
this.cntAddSignature.toggleClass('hidden', isAddedSignature);
this.cntAddedSignature.toggleClass('hidden', !isAddedSignature);
}, },
updateEncrypt: function() { updateEncrypt: function() {
this.cntPasswordView.toggleClass('hidden', this.btnAddPwd.isVisible()); var isProtected = this.btnAddPwd.$el.find('button').hasClass('hidden');
this.cntEncryptBlock.toggleClass('hidden', isProtected);
this.cntEncryptedBlock.toggleClass('hidden', !isProtected);
}, },
strProtect: 'Protect Workbook', strProtect: 'Protect Workbook',
@ -2300,7 +2316,10 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
notcriticalErrorTitle: 'Warning', notcriticalErrorTitle: 'Warning',
txtEditWarning: 'Editing will remove the signatures from the workbook.<br>Are you sure you want to continue?', txtEditWarning: 'Editing will remove the signatures from the workbook.<br>Are you sure you want to continue?',
strEncrypt: 'With Password', strEncrypt: 'With Password',
txtEncrypted: 'This workbook has been protected by password' txtProtectSpreadsheet: 'Protect this spreadsheet with a password',
txtEncrypted: 'A password is required to open this spreadsheet',
txtAddSignature: 'Ensure the integrity of the spreadsheet by adding an<br>invisible digital signature',
txtAddedSignature: 'Valid signatures have been added to the spreadsheet.<br>The spreadsheet is protected from editing.'
}, SSE.Views.FileMenuPanels.ProtectDoc || {})); }, SSE.Views.FileMenuPanels.ProtectDoc || {}));

View file

@ -2445,11 +2445,14 @@
"SSE.Views.FileMenuPanels.ProtectDoc.strSignature": "With signature", "SSE.Views.FileMenuPanels.ProtectDoc.strSignature": "With signature",
"SSE.Views.FileMenuPanels.ProtectDoc.txtEdit": "Edit spreadsheet", "SSE.Views.FileMenuPanels.ProtectDoc.txtEdit": "Edit spreadsheet",
"SSE.Views.FileMenuPanels.ProtectDoc.txtEditWarning": "Editing will remove signatures from the spreadsheet.<br>Continue?", "SSE.Views.FileMenuPanels.ProtectDoc.txtEditWarning": "Editing will remove signatures from the spreadsheet.<br>Continue?",
"SSE.Views.FileMenuPanels.ProtectDoc.txtEncrypted": "This spreadsheet has been protected by password", "SSE.Views.FileMenuPanels.ProtectDoc.txtEncrypted": "A password is required to open this spreadsheet",
"SSE.Views.FileMenuPanels.ProtectDoc.txtRequestedSignatures": "This spreadsheet needs to be signed.", "SSE.Views.FileMenuPanels.ProtectDoc.txtRequestedSignatures": "This spreadsheet needs to be signed.",
"SSE.Views.FileMenuPanels.ProtectDoc.txtSigned": "Valid signatures have been added to the spreadsheet. The spreadsheet is protected from editing.", "SSE.Views.FileMenuPanels.ProtectDoc.txtSigned": "Valid signatures have been added to the spreadsheet. The spreadsheet is protected from editing.",
"SSE.Views.FileMenuPanels.ProtectDoc.txtSignedInvalid": "Some of the digital signatures in spreadsheet are invalid or could not be verified. The spreadsheet is protected from editing.", "SSE.Views.FileMenuPanels.ProtectDoc.txtSignedInvalid": "Some of the digital signatures in spreadsheet are invalid or could not be verified. The spreadsheet is protected from editing.",
"SSE.Views.FileMenuPanels.ProtectDoc.txtView": "View signatures", "SSE.Views.FileMenuPanels.ProtectDoc.txtView": "View signatures",
"SSE.Views.FileMenuPanels.ProtectDoc.txtProtectSpreadsheet": "Protect this spreadsheet with a password",
"SSE.Views.FileMenuPanels.ProtectDoc.txtAddSignature": "Ensure the integrity of the spreadsheet by adding an<br>invisible digital signature",
"SSE.Views.FileMenuPanels.ProtectDoc.txtAddedSignature": "Valid signatures have been added to the spreadsheet.<br>The spreadsheet is protected from editing.",
"SSE.Views.FileMenuPanels.ViewSaveAs.textDownloadAs": "Download as", "SSE.Views.FileMenuPanels.ViewSaveAs.textDownloadAs": "Download as",
"SSE.Views.FileMenuPanels.ViewSaveCopy.textSaveCopyAs": "Save Copy as", "SSE.Views.FileMenuPanels.ViewSaveCopy.textSaveCopyAs": "Save Copy as",
"SSE.Views.FileMenuPanels.RecentFiles.txtOpenRecent": "Open Recent", "SSE.Views.FileMenuPanels.RecentFiles.txtOpenRecent": "Open Recent",

View file

@ -596,26 +596,51 @@
} }
#panel-protect { #panel-protect {
padding: 30px 30px;
label { label {
font-size: 12px; font-size: 12px;
} }
padding: 30px 30px;
.header { .header {
.font-weight-bold(); .font-weight-bold();
margin: 20px 0 10px; margin: 20px 0 4px 0;
} }
table { .description {
td { color: @text-secondary-ie;
padding: 5px 0; color: @text-secondary;
} margin-bottom: 12px;
}
.buttons {
display: flex;
}
#fms-btn-delete-pwd {
margin-left: 16px;
}
.signature-view-link {
margin-right: 20px;
}
.signature-tip {
margin-bottom: 6px;
}
#fms-btn-invisible-sign {
margin-bottom: 20px;
} }
#id-fms-lbl-protect-header { #id-fms-lbl-protect-header {
font-size: 16px; font-size: 16px;
} }
.btn-text-default.auto {
padding-left: 12px;
padding-right: 12px;
}
} }
#panel-print { #panel-print {