[DE][SSE] Added context menu for signatures.
This commit is contained in:
parent
0c7749b1d1
commit
7d1faecfb2
|
@ -57,7 +57,7 @@ define([
|
|||
if ( sv || opts == 'right' ) {
|
||||
$boxTabs.animate({scrollLeft: opts == 'left' ? sv - 100 : sv + 100}, 200);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function onTabDblclick(e) {
|
||||
this.fireEvent('change:compact', [$(e.target).data('tab')]);
|
||||
|
|
|
@ -80,7 +80,6 @@ define([
|
|||
me._currentMathObj = undefined;
|
||||
me._currentParaObjDisabled = false;
|
||||
me._isDisabled = false;
|
||||
me._currentSignGuid = null;
|
||||
|
||||
var showPopupMenu = function(menu, value, event, docElement, eOpts){
|
||||
if (!_.isUndefined(menu) && menu !== null){
|
||||
|
@ -1814,14 +1813,39 @@ define([
|
|||
caption: me.addCommentText
|
||||
}).on('click', _.bind(me.addComment, me));
|
||||
|
||||
var menuSignatureViewSign = new Common.UI.MenuItem({caption: this.strSign, value: 0 }).on('click', _.bind(me.onSignatureClick, me));
|
||||
var menuSignatureDetails = new Common.UI.MenuItem({caption: this.strDetails, value: 1 }).on('click', _.bind(me.onSignatureClick, me));
|
||||
var menuSignatureViewSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 }).on('click', _.bind(me.onSignatureClick, me));
|
||||
var menuSignatureRemove = new Common.UI.MenuItem({caption: this.strDelete, value: 3 }).on('click', _.bind(me.onSignatureClick, me));
|
||||
var menuViewSignSeparator = new Common.UI.MenuItem({caption: '--' });
|
||||
|
||||
this.viewModeMenu = new Common.UI.Menu({
|
||||
initMenu: function (value) {
|
||||
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties()));
|
||||
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties())),
|
||||
signGuid = (value.imgProps && value.imgProps.value && me.mode.canProtect) ? value.imgProps.value.get_SignatureGuid() : undefined,
|
||||
signProps = (signGuid) ? me.api.asc_getLineInfo(signGuid) : null,
|
||||
isInSign = !!signProps && me._canProtect,
|
||||
canComment = !isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled;
|
||||
|
||||
menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
|
||||
menuViewUndo.setDisabled(!me.api.asc_getCanUndo() && !me._isDisabled);
|
||||
menuViewCopySeparator.setVisible(!isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
|
||||
menuViewAddComment.setVisible(!isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
|
||||
menuViewCopySeparator.setVisible(isInSign);
|
||||
|
||||
var isRequested = (signProps) ? signProps.asc_getRequested() : false;
|
||||
menuSignatureViewSign.setVisible(isInSign && isRequested);
|
||||
menuSignatureDetails.setVisible(isInSign && !isRequested);
|
||||
menuSignatureViewSetup.setVisible(isInSign);
|
||||
menuSignatureRemove.setVisible(isInSign && !isRequested);
|
||||
menuViewSignSeparator.setVisible(canComment);
|
||||
|
||||
if (isInSign) {
|
||||
menuSignatureViewSign.cmpEl.attr('data-value', signGuid); // sign
|
||||
menuSignatureDetails.cmpEl.attr('data-value', signProps.asc_getCertificateId()); // view certificate
|
||||
menuSignatureViewSetup.cmpEl.attr('data-value', signGuid); // view signature settings
|
||||
menuSignatureRemove.cmpEl.attr('data-value', signGuid);
|
||||
}
|
||||
|
||||
menuViewAddComment.setVisible(canComment);
|
||||
menuViewAddComment.setDisabled(value.paraProps && value.paraProps.locked === true);
|
||||
|
||||
var cancopy = me.api && me.api.can_CopyCut();
|
||||
|
@ -1831,6 +1855,11 @@ define([
|
|||
menuViewCopy,
|
||||
menuViewUndo,
|
||||
menuViewCopySeparator,
|
||||
menuSignatureViewSign,
|
||||
menuSignatureDetails,
|
||||
menuSignatureViewSetup,
|
||||
menuSignatureRemove,
|
||||
menuViewSignSeparator,
|
||||
menuViewAddComment
|
||||
]
|
||||
}).on('hide:after', function (menu, e, isFromInputControl) {
|
||||
|
@ -2150,6 +2179,10 @@ define([
|
|||
value : 'cut'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
var menuSignatureEditSign = new Common.UI.MenuItem({caption: this.strSign, value: 0 }).on('click', _.bind(me.onSignatureClick, me));
|
||||
var menuSignatureEditSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 }).on('click', _.bind(me.onSignatureClick, me));
|
||||
var menuEditSignSeparator = new Common.UI.MenuItem({ caption: '--' });
|
||||
|
||||
this.pictureMenu = new Common.UI.Menu({
|
||||
initMenu: function(value){
|
||||
if (_.isUndefined(value.imgProps))
|
||||
|
@ -2210,7 +2243,7 @@ define([
|
|||
|
||||
me.menuOriginalSize.setVisible(_.isNull(value.imgProps.value.get_ChartProperties()) && _.isNull(value.imgProps.value.get_ShapeProperties()) &&
|
||||
!onlyCommonProps);
|
||||
me.pictureMenu.items[7].setVisible(menuChartEdit.isVisible() || me.menuOriginalSize.isVisible());
|
||||
me.pictureMenu.items[10].setVisible(menuChartEdit.isVisible() || me.menuOriginalSize.isVisible());
|
||||
|
||||
var islocked = value.imgProps.locked || (value.headerProps!==undefined && value.headerProps.locked);
|
||||
if (menuChartEdit.isVisible())
|
||||
|
@ -2233,12 +2266,26 @@ define([
|
|||
menuImgCopy.setDisabled(!cancopy);
|
||||
menuImgCut.setDisabled(islocked || !cancopy);
|
||||
menuImgPaste.setDisabled(islocked);
|
||||
|
||||
var signGuid = (value.imgProps && value.imgProps.value && me.mode.canProtect) ? value.imgProps.value.get_SignatureGuid() : undefined,
|
||||
isInSign = (signGuid !== undefined);
|
||||
menuSignatureEditSign.setVisible(isInSign);
|
||||
menuSignatureEditSetup.setVisible(isInSign);
|
||||
menuEditSignSeparator.setVisible(isInSign);
|
||||
|
||||
if (isInSign) {
|
||||
menuSignatureEditSign.cmpEl.attr('data-value', signGuid); // sign
|
||||
menuSignatureEditSetup.cmpEl.attr('data-value', signGuid); // edit signature settings
|
||||
}
|
||||
},
|
||||
items: [
|
||||
menuImgCut,
|
||||
menuImgCopy,
|
||||
menuImgPaste,
|
||||
{ caption: '--' },
|
||||
menuSignatureEditSign,
|
||||
menuSignatureEditSetup,
|
||||
menuEditSignSeparator,
|
||||
menuImageArrange,
|
||||
menuImageAlign,
|
||||
me.menuImageWrap,
|
||||
|
@ -3297,13 +3344,32 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onSignatureClick: function(menu, item) {
|
||||
var datavalue = item.cmpEl.attr('data-value');
|
||||
switch (item.value) {
|
||||
case 0:
|
||||
Common.NotificationCenter.trigger('protect:sign', datavalue); //guid
|
||||
break;
|
||||
case 1:
|
||||
this.api.asc_ViewCertificate(datavalue); //certificate id
|
||||
break;
|
||||
case 2:
|
||||
Common.NotificationCenter.trigger('protect:signature', 'visible', !this._isDisabled, datavalue);//guid, can edit settings for requested signature
|
||||
break;
|
||||
case 3:
|
||||
this.api.asc_RemoveSignature(datavalue); //guid
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
var me = this;
|
||||
_.defer(function(){ me.cmpEl.focus(); }, 50);
|
||||
},
|
||||
|
||||
SetDisabled: function(state) {
|
||||
SetDisabled: function(state, canProtect) {
|
||||
this._isDisabled = state;
|
||||
this._canProtect = canProtect;
|
||||
},
|
||||
|
||||
alignmentText : 'Alignment',
|
||||
|
@ -3475,7 +3541,11 @@ define([
|
|||
txtDeleteChars: 'Delete enclosing characters',
|
||||
txtDeleteCharsAndSeparators: 'Delete enclosing characters and separators',
|
||||
txtKeepTextOnly: 'Keep text only',
|
||||
textUndo: 'Undo'
|
||||
textUndo: 'Undo',
|
||||
strSign: 'Sign',
|
||||
strDetails: 'Signature Details',
|
||||
strSetup: 'Signature Setup',
|
||||
strDelete: 'Remove Signature'
|
||||
|
||||
}, DE.Views.DocumentHolder || {}));
|
||||
});
|
|
@ -358,7 +358,7 @@ define([
|
|||
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);
|
||||
DE.getController('DocumentHolder').getView().SetDisabled(disable, true);
|
||||
|
||||
var leftMenu = DE.getController('LeftMenu').leftMenu;
|
||||
leftMenu.btnComments.setDisabled(disable);
|
||||
|
|
|
@ -970,6 +970,10 @@
|
|||
"DE.Views.DocumentHolder.txtUngroup": "Ungroup",
|
||||
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
|
||||
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
||||
"DE.Views.DocumentHolder.strSign": "Sign",
|
||||
"DE.Views.DocumentHolder.strDetails": "Signature Details",
|
||||
"DE.Views.DocumentHolder.strSetup": "Signature Setup",
|
||||
"DE.Views.DocumentHolder.strDelete": "Remove Signature",
|
||||
"DE.Views.DropcapSettingsAdvanced.cancelButtonText": "Cancel",
|
||||
"DE.Views.DropcapSettingsAdvanced.okButtonText": "Ok",
|
||||
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
|
||||
|
|
|
@ -192,10 +192,16 @@ define([
|
|||
view.mnuChartEdit.on('click', _.bind(me.onChartEdit, me));
|
||||
view.mnuImgAdvanced.on('click', _.bind(me.onImgAdvanced, me));
|
||||
view.textInShapeMenu.on('render:after', _.bind(me.onTextInShapeAfterRender, me));
|
||||
view.menuSignatureEditSign.on('click', _.bind(me.onSignatureClick, me));
|
||||
view.menuSignatureEditSetup.on('click', _.bind(me.onSignatureClick, me));
|
||||
} else {
|
||||
view.menuViewCopy.on('click', _.bind(me.onCopyPaste, me));
|
||||
view.menuViewUndo.on('click', _.bind(me.onUndo, me));
|
||||
view.menuViewAddComment.on('click', _.bind(me.onAddComment, me));
|
||||
view.menuSignatureViewSign.on('click', _.bind(me.onSignatureClick, me));
|
||||
view.menuSignatureDetails.on('click', _.bind(me.onSignatureClick, me));
|
||||
view.menuSignatureViewSetup.on('click', _.bind(me.onSignatureClick, me));
|
||||
view.menuSignatureRemove.on('click', _.bind(me.onSignatureClick, me));
|
||||
}
|
||||
|
||||
var documentHolderEl = view.cmpEl;
|
||||
|
@ -1266,7 +1272,8 @@ define([
|
|||
if (!showMenu && !documentHolder.imgMenu.isVisible()) return;
|
||||
|
||||
isimagemenu = isshapemenu = ischartmenu = false;
|
||||
var has_chartprops = false;
|
||||
var has_chartprops = false,
|
||||
signGuid;
|
||||
var selectedObjects = this.api.asc_getGraphicObjectProps();
|
||||
for (var i = 0; i < selectedObjects.length; i++) {
|
||||
if (selectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) {
|
||||
|
@ -1288,6 +1295,8 @@ define([
|
|||
documentHolder.mnuImgAdvanced.imageInfo = elValue;
|
||||
isimagemenu = true;
|
||||
}
|
||||
if (this.permissions.canProtect)
|
||||
signGuid = elValue.get_SignatureGuid();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1301,6 +1310,16 @@ define([
|
|||
documentHolder.pmiImgPaste.setDisabled(isObjLocked);
|
||||
documentHolder.mnuImgAdvanced.setVisible(isimagemenu && !isshapemenu && !ischartmenu);
|
||||
documentHolder.mnuImgAdvanced.setDisabled(isObjLocked);
|
||||
|
||||
var isInSign = (signGuid !== undefined);
|
||||
documentHolder.menuSignatureEditSign.setVisible(isInSign);
|
||||
documentHolder.menuSignatureEditSetup.setVisible(isInSign);
|
||||
documentHolder.menuEditSignSeparator.setVisible(isInSign);
|
||||
if (isInSign) {
|
||||
documentHolder.menuSignatureEditSign.cmpEl.attr('data-value', signGuid); // sign
|
||||
documentHolder.menuSignatureEditSetup.cmpEl.attr('data-value', signGuid); // edit signature settings
|
||||
}
|
||||
|
||||
if (showMenu) this.showPopupMenu(documentHolder.imgMenu, {}, event);
|
||||
documentHolder.mnuShapeSeparator.setVisible(documentHolder.mnuShapeAdvanced.isVisible() || documentHolder.mnuChartEdit.isVisible() || documentHolder.mnuImgAdvanced.isVisible());
|
||||
} else if (istextshapemenu || istextchartmenu) {
|
||||
|
@ -1492,17 +1511,47 @@ define([
|
|||
isTableLocked = cellinfo.asc_getLockedTable()===true,
|
||||
commentsController = this.getApplication().getController('Common.Controllers.Comments'),
|
||||
iscellmenu = (seltype==Asc.c_oAscSelectionType.RangeCells) && !this.permissions.isEditMailMerge && !this.permissions.isEditDiagram,
|
||||
iscelledit = this.api.isCellEdited;
|
||||
iscelledit = this.api.isCellEdited,
|
||||
isimagemenu = (seltype==Asc.c_oAscSelectionType.RangeImage) && !this.permissions.isEditMailMerge && !this.permissions.isEditDiagram,
|
||||
signGuid;
|
||||
|
||||
if (!documentHolder.viewModeMenu)
|
||||
documentHolder.createDelayedElementsViewer();
|
||||
|
||||
if (!showMenu && !documentHolder.viewModeMenu.isVisible()) return;
|
||||
|
||||
if (isimagemenu && this.permissions.canProtect) {
|
||||
var selectedObjects = this.api.asc_getGraphicObjectProps();
|
||||
for (var i = 0; i < selectedObjects.length; i++) {
|
||||
if (selectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) {
|
||||
signGuid = selectedObjects[i].asc_getObjectValue().get_SignatureGuid();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var signProps = (signGuid) ? this.api.asc_getLineInfo(signGuid) : null,
|
||||
isInSign = !!signProps && this._canProtect,
|
||||
canComment = iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled;
|
||||
|
||||
documentHolder.menuViewUndo.setVisible(this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled);
|
||||
documentHolder.menuViewUndo.setDisabled(!this.api.asc_getCanUndo() && !this._isDisabled);
|
||||
documentHolder.menuViewCopySeparator.setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled);
|
||||
documentHolder.menuViewAddComment.setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled);
|
||||
documentHolder.menuViewCopySeparator.setVisible(isInSign);
|
||||
|
||||
var isRequested = (signProps) ? signProps.asc_getRequested() : false;
|
||||
documentHolder.menuSignatureViewSign.setVisible(isInSign && isRequested);
|
||||
documentHolder.menuSignatureDetails.setVisible(isInSign && !isRequested);
|
||||
documentHolder.menuSignatureViewSetup.setVisible(isInSign);
|
||||
documentHolder.menuSignatureRemove.setVisible(isInSign && !isRequested);
|
||||
documentHolder.menuViewSignSeparator.setVisible(canComment);
|
||||
|
||||
if (isInSign) {
|
||||
documentHolder.menuSignatureViewSign.cmpEl.attr('data-value', signGuid); // sign
|
||||
documentHolder.menuSignatureDetails.cmpEl.attr('data-value', signProps.asc_getCertificateId()); // view certificate
|
||||
documentHolder.menuSignatureViewSetup.cmpEl.attr('data-value', signGuid); // view signature settings
|
||||
documentHolder.menuSignatureRemove.cmpEl.attr('data-value', signGuid);
|
||||
}
|
||||
|
||||
documentHolder.menuViewAddComment.setVisible(canComment);
|
||||
documentHolder.setMenuItemCommentCaptionMode(documentHolder.menuViewAddComment, cellinfo.asc_getComments().length < 1, this.permissions.canEditComments);
|
||||
commentsController && commentsController.blockPopover(true);
|
||||
documentHolder.menuViewAddComment.setDisabled(isCellLocked || isTableLocked);
|
||||
|
@ -2460,8 +2509,27 @@ define([
|
|||
_conf && view.paraBulletsPicker.selectRecord(_conf.rec, true);
|
||||
},
|
||||
|
||||
SetDisabled: function(state) {
|
||||
onSignatureClick: function(menu, item) {
|
||||
var datavalue = item.cmpEl.attr('data-value');
|
||||
switch (item.value) {
|
||||
case 0:
|
||||
Common.NotificationCenter.trigger('protect:sign', datavalue); //guid
|
||||
break;
|
||||
case 1:
|
||||
this.api.asc_ViewCertificate(datavalue); //certificate id
|
||||
break;
|
||||
case 2:
|
||||
Common.NotificationCenter.trigger('protect:signature', 'visible', !this._isDisabled, datavalue);//guid, can edit settings for requested signature
|
||||
break;
|
||||
case 3:
|
||||
this.api.asc_RemoveSignature(datavalue); //guid
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
SetDisabled: function(state, canProtect) {
|
||||
this._isDisabled = state;
|
||||
this._canProtect = canProtect;
|
||||
},
|
||||
|
||||
guestText : 'Guest',
|
||||
|
|
|
@ -107,11 +107,22 @@ define([
|
|||
caption: me.txtAddComment
|
||||
});
|
||||
|
||||
me.menuSignatureViewSign = new Common.UI.MenuItem({caption: this.strSign, value: 0 });
|
||||
me.menuSignatureDetails = new Common.UI.MenuItem({caption: this.strDetails, value: 1 });
|
||||
me.menuSignatureViewSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 });
|
||||
me.menuSignatureRemove = new Common.UI.MenuItem({caption: this.strDelete, value: 3 });
|
||||
me.menuViewSignSeparator = new Common.UI.MenuItem({caption: '--' });
|
||||
|
||||
this.viewModeMenu = new Common.UI.Menu({
|
||||
items: [
|
||||
me.menuViewCopy,
|
||||
me.menuViewUndo,
|
||||
me.menuViewCopySeparator,
|
||||
me.menuSignatureViewSign,
|
||||
me.menuSignatureDetails,
|
||||
me.menuSignatureViewSetup,
|
||||
me.menuSignatureRemove,
|
||||
me.menuViewSignSeparator,
|
||||
me.menuViewAddComment
|
||||
]
|
||||
});
|
||||
|
@ -474,12 +485,19 @@ define([
|
|||
value : 'paste'
|
||||
});
|
||||
|
||||
me.menuSignatureEditSign = new Common.UI.MenuItem({caption: this.strSign, value: 0 });
|
||||
me.menuSignatureEditSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 });
|
||||
me.menuEditSignSeparator = new Common.UI.MenuItem({ caption: '--' });
|
||||
|
||||
this.imgMenu = new Common.UI.Menu({
|
||||
items: [
|
||||
me.pmiImgCut,
|
||||
me.pmiImgCopy,
|
||||
me.pmiImgPaste,
|
||||
{caption: '--'},
|
||||
me.menuSignatureEditSign,
|
||||
me.menuSignatureEditSetup,
|
||||
me.menuEditSignSeparator,
|
||||
{
|
||||
caption : this.textArrangeFront,
|
||||
iconCls : 'mnu-arrange-front',
|
||||
|
@ -788,7 +806,11 @@ define([
|
|||
advancedImgText: 'Image Advanced Settings',
|
||||
textNone: 'None',
|
||||
bulletsText: 'Bullets and Numbering',
|
||||
textUndo: 'Undo'
|
||||
textUndo: 'Undo',
|
||||
strSign: 'Sign',
|
||||
strDetails: 'Signature Details',
|
||||
strSetup: 'Signature Setup',
|
||||
strDelete: 'Remove Signature'
|
||||
|
||||
}, SSE.Views.DocumentHolder || {}));
|
||||
});
|
|
@ -358,7 +358,7 @@ define([
|
|||
SSE.getController('Toolbar').DisableToolbar(disable, disable);
|
||||
SSE.getController('Statusbar').SetDisabled(disable);
|
||||
SSE.getController('Common.Controllers.ReviewChanges').SetDisabled(disable);
|
||||
SSE.getController('DocumentHolder').SetDisabled(disable);
|
||||
SSE.getController('DocumentHolder').SetDisabled(disable, true);
|
||||
|
||||
var leftMenu = SSE.getController('LeftMenu').leftMenu;
|
||||
leftMenu.btnComments.setDisabled(disable);
|
||||
|
|
|
@ -1144,6 +1144,10 @@
|
|||
"SSE.Views.DocumentHolder.txtUngroup": "Ungroup",
|
||||
"SSE.Views.DocumentHolder.txtWidth": "Width",
|
||||
"SSE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
||||
"SSE.Views.DocumentHolder.strSign": "Sign",
|
||||
"SSE.Views.DocumentHolder.strDetails": "Signature Details",
|
||||
"SSE.Views.DocumentHolder.strSetup": "Signature Setup",
|
||||
"SSE.Views.DocumentHolder.strDelete": "Remove Signature",
|
||||
"SSE.Views.FileMenu.btnBackCaption": "Go to Documents",
|
||||
"SSE.Views.FileMenu.btnCloseMenuCaption": "Close Menu",
|
||||
"SSE.Views.FileMenu.btnCreateNewCaption": "Create New",
|
||||
|
|
Loading…
Reference in a new issue