/*
*
* (c) Copyright Ascensio System Limited 2010-2017
*
* 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 Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* 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
*
*/
/**
* SignatureSettings.js
*
* Created by Julia Radzhabova on 5/24/17
* Copyright (c) 2017 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!documenteditor/main/app/template/SignatureSettings.template',
'jquery',
'underscore',
'backbone',
'common/main/lib/component/Button',
'common/main/lib/view/SignDialog',
'common/main/lib/view/SignSettingsDialog'
], function (menuTemplate, $, _, Backbone) {
'use strict';
DE.Views.SignatureSettings = Backbone.View.extend(_.extend({
el: '#id-signature-settings',
// Compile our stats template
template: _.template(menuTemplate),
// Delegated events for creating new items, and clearing completed ones.
events: {
},
options: {
alias: 'SignatureSettings'
},
initialize: function () {
var me = this;
this._state = {
DisabledControls: false,
DisabledInsertControls: false,
requestedSignatures: undefined,
validSignatures: undefined,
invalidSignatures: undefined,
DisabledEditing: false,
ready: false
};
this._locked = false;
this._noApply = false;
this._originalProps = null;
this.templateRequested = _.template([
'
" + tipText;
var me = this,
tip = new Common.UI.SynchronizeTip({
target : DE.getController('RightMenu').getView('RightMenu').btnSignature.btnEl,
text : tipText,
showLink: hasValid || hasInvalid,
textLink: this.txtContinueEditing,
placement: 'left'
});
tip.on({
'dontshowclick': function() {
Common.UI.warning({
title: me.notcriticalErrorTitle,
msg: me.txtEditWarning,
buttons: ['ok', 'cancel'],
primary: 'ok',
callback: function(btn) {
if (btn == 'ok') {
tip.close();
me.api.asc_RemoveAllSignatures();
}
}
});
},
'closeclick': function() {
tip.close();
}
});
tip.show();
},
disableEditing: function(disable) {
if (this._state.DisabledEditing != disable) {
this._state.DisabledEditing = disable;
var rightMenuController = DE.getController('RightMenu');
if (disable && rightMenuController.rightmenu.GetActivePane() !== 'id-signature-settings')
rightMenuController.rightmenu.clearSelection();
rightMenuController.SetDisabled(disable, false, true);
DE.getController('Toolbar').DisableToolbar(disable, disable);
DE.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
DE.getController('Common.Controllers.ReviewChanges').SetDisabled(disable);
DE.getController('DocumentHolder').getView().SetDisabled(disable);
var leftMenu = DE.getController('LeftMenu').leftMenu;
leftMenu.btnComments.setDisabled(disable);
var comments = DE.getController('Common.Controllers.Comments');
if (comments)
comments.setPreviewMode(disable);
}
},
strSignature: 'Signature',
strRequested: 'Requested signatures',
strValid: 'Valid signatures',
strInvalid: 'Invalid signatures',
strSign: 'Sign',
strView: 'View',
txtSigned: 'Valid signatures has been added to the document. The document is protected from editing.',
txtSignedInvalid: 'Some of the digital signatures in document are invalid or could not be verified. The document is protected from editing.',
txtRequestedSignatures: 'This document needs to be signed.',
txtContinueEditing: 'Edit anyway',
notcriticalErrorTitle: 'Warning',
txtEditWarning: 'Editing will remove the signatures from the document. Are you sure you want to continue?'
}, DE.Views.SignatureSettings || {}));
});