commit
7a88124070
|
@ -806,7 +806,7 @@ define([
|
|||
},
|
||||
|
||||
pickEMail: function (commentId, message) {
|
||||
var arr = Common.Utils.String.htmlEncode(message).match(/\B[@+][A-Z0-9._%+-]+@[A-Z0-9._]+\.[A-Z]+\b/gi);
|
||||
var arr = Common.Utils.String.htmlEncode(message).match(/\B[@+][A-Z0-9._%+-]+@[A-Z0-9._-]+\.[A-Z]+\b/gi);
|
||||
arr = _.map(arr, function(str){
|
||||
return str.slice(1, str.length);
|
||||
});
|
||||
|
|
|
@ -1381,6 +1381,8 @@ define([
|
|||
|
||||
if ( this.onServerVersion(params.asc_getBuildVersion()) || !this.onLanguageLoaded()) return;
|
||||
|
||||
var isPDFViewer = /^(?:(pdf|djvu|xps|oxps))$/.test(this.document.fileType);
|
||||
|
||||
this.permissions.review = (this.permissions.review === undefined) ? (this.permissions.edit !== false) : this.permissions.review;
|
||||
|
||||
if (params.asc_getRights() !== Asc.c_oRights.Edit)
|
||||
|
@ -1409,8 +1411,8 @@ define([
|
|||
this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && !this.appOptions.isOffline;
|
||||
this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring;
|
||||
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
|
||||
this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
||||
this.appOptions.canViewComments = this.appOptions.canComments || !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
||||
this.appOptions.canComments = !isPDFViewer && this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
||||
this.appOptions.canViewComments = this.appOptions.canComments || !isPDFViewer && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
||||
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !(this.permissions.chat===false || (this.permissions.chat===undefined) &&
|
||||
(typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
|
||||
if ((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat!==undefined) {
|
||||
|
@ -1464,7 +1466,7 @@ define([
|
|||
var type = /^(?:(djvu))$/.exec(this.document.fileType);
|
||||
this.appOptions.canDownloadOrigin = this.permissions.download !== false && (type && typeof type[1] === 'string');
|
||||
this.appOptions.canDownload = this.permissions.download !== false && (!type || typeof type[1] !== 'string');
|
||||
this.appOptions.canUseSelectHandTools = this.appOptions.canUseThumbnails = this.appOptions.canUseViwerNavigation = /^(?:(pdf|djvu|xps|oxps))$/.test(this.document.fileType);
|
||||
this.appOptions.canUseSelectHandTools = this.appOptions.canUseThumbnails = this.appOptions.canUseViwerNavigation = isPDFViewer;
|
||||
this.appOptions.canDownloadForms = this.appOptions.canLicense && this.appOptions.canDownload;
|
||||
|
||||
this.appOptions.fileKey = this.document.key;
|
||||
|
|
|
@ -221,6 +221,12 @@ define([
|
|||
menu_props.paraProps.value = elValue;
|
||||
menu_props.paraProps.locked = (elValue) ? elValue.get_Locked() : false;
|
||||
noobject = false;
|
||||
} else if (Asc.c_oAscTypeSelectElement.Text == elType)
|
||||
{
|
||||
if (!me.viewPDFModeMenu)
|
||||
me.createDelayedElementsPDFViewer();
|
||||
menu_to_show = me.viewPDFModeMenu;
|
||||
noobject = false;
|
||||
}
|
||||
}
|
||||
return (!noobject) ? {menu_to_show: menu_to_show, menu_props: menu_props} : null;
|
||||
|
@ -2139,6 +2145,35 @@ define([
|
|||
|
||||
},
|
||||
|
||||
createDelayedElementsPDFViewer: function() {
|
||||
var me = this;
|
||||
|
||||
var menuPDFViewCopy = new Common.UI.MenuItem({
|
||||
iconCls: 'menu__icon btn-copy',
|
||||
caption: me.textCopy,
|
||||
value: 'copy'
|
||||
}).on('click', _.bind(me.onCutCopyPaste, me));
|
||||
|
||||
this.viewPDFModeMenu = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
initMenu: function (value) {
|
||||
menuPDFViewCopy.setDisabled(!(me.api && me.api.can_CopyCut()));
|
||||
},
|
||||
items: [
|
||||
menuPDFViewCopy
|
||||
]
|
||||
}).on('hide:after', function (menu, e, isFromInputControl) {
|
||||
if (me.suppressEditComplete) {
|
||||
me.suppressEditComplete = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isFromInputControl) me.fireEvent('editcomplete', me);
|
||||
me.currentMenu = null;
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
createDelayedElements: function() {
|
||||
var me = this;
|
||||
|
||||
|
|
Loading…
Reference in a new issue