Add event onRequestSharingSettings: use instead editorConfig.sharingSettingsUrl.
This commit is contained in:
parent
12400295fd
commit
019dffbceb
|
@ -209,6 +209,7 @@
|
||||||
_config.editorConfig.canRequestInsertImage = _config.events && !!_config.events.onRequestInsertImage;
|
_config.editorConfig.canRequestInsertImage = _config.events && !!_config.events.onRequestInsertImage;
|
||||||
_config.editorConfig.canRequestMailMergeRecipients = _config.events && !!_config.events.onRequestMailMergeRecipients;
|
_config.editorConfig.canRequestMailMergeRecipients = _config.events && !!_config.events.onRequestMailMergeRecipients;
|
||||||
_config.editorConfig.canRequestCompareFile = _config.events && !!_config.events.onRequestCompareFile;
|
_config.editorConfig.canRequestCompareFile = _config.events && !!_config.events.onRequestCompareFile;
|
||||||
|
_config.editorConfig.canRequestSharingSettings = _config.events && !!_config.events.onRequestSharingSettings;
|
||||||
_config.frameEditorId = placeholderId;
|
_config.frameEditorId = placeholderId;
|
||||||
|
|
||||||
var onMouseUp = function (evt) {
|
var onMouseUp = function (evt) {
|
||||||
|
|
|
@ -293,27 +293,31 @@ if (Common === undefined) {
|
||||||
},
|
},
|
||||||
|
|
||||||
requestMakeActionLink: function (config) {
|
requestMakeActionLink: function (config) {
|
||||||
_postMessage({event:'onMakeActionLink', data: config})
|
_postMessage({event:'onMakeActionLink', data: config});
|
||||||
},
|
},
|
||||||
|
|
||||||
requestUsers: function () {
|
requestUsers: function () {
|
||||||
_postMessage({event:'onRequestUsers'})
|
_postMessage({event:'onRequestUsers'});
|
||||||
},
|
},
|
||||||
|
|
||||||
requestSendNotify: function (emails) {
|
requestSendNotify: function (emails) {
|
||||||
_postMessage({event:'onRequestSendNotify', data: emails})
|
_postMessage({event:'onRequestSendNotify', data: emails});
|
||||||
},
|
},
|
||||||
|
|
||||||
requestInsertImage: function () {
|
requestInsertImage: function () {
|
||||||
_postMessage({event:'onRequestInsertImage'})
|
_postMessage({event:'onRequestInsertImage'});
|
||||||
},
|
},
|
||||||
|
|
||||||
requestMailMergeRecipients: function () {
|
requestMailMergeRecipients: function () {
|
||||||
_postMessage({event:'onRequestMailMergeRecipients'})
|
_postMessage({event:'onRequestMailMergeRecipients'});
|
||||||
},
|
},
|
||||||
|
|
||||||
requestCompareFile: function () {
|
requestCompareFile: function () {
|
||||||
_postMessage({event:'onRequestCompareFile'})
|
_postMessage({event:'onRequestCompareFile'});
|
||||||
|
},
|
||||||
|
|
||||||
|
requestSharingSettings: function () {
|
||||||
|
_postMessage({event:'onRequestSharingSettings'});
|
||||||
},
|
},
|
||||||
|
|
||||||
on: function(event, handler){
|
on: function(event, handler){
|
||||||
|
|
|
@ -143,8 +143,10 @@ define([
|
||||||
this.popoverChanges = new Common.Collections.ReviewChanges();
|
this.popoverChanges = new Common.Collections.ReviewChanges();
|
||||||
this.view = this.createView('Common.Views.ReviewChanges', { mode: mode });
|
this.view = this.createView('Common.Views.ReviewChanges', { mode: mode });
|
||||||
|
|
||||||
!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length && Common.Gateway.on('showsharingsettings', _.bind(this.changeAccessRights, this));
|
if (!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length || this.appConfig.canRequestSharingSettings) {
|
||||||
!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length && Common.Gateway.on('setsharingsettings', _.bind(this.setSharingSettings, this));
|
Common.Gateway.on('showsharingsettings', _.bind(this.changeAccessRights, this));
|
||||||
|
Common.Gateway.on('setsharingsettings', _.bind(this.setSharingSettings, this));
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
@ -831,6 +833,9 @@ define([
|
||||||
changeAccessRights: function(btn,event,opts) {
|
changeAccessRights: function(btn,event,opts) {
|
||||||
if (this._docAccessDlg || this._readonlyRights) return;
|
if (this._docAccessDlg || this._readonlyRights) return;
|
||||||
|
|
||||||
|
if (this.appConfig.canRequestSharingSettings) {
|
||||||
|
Common.Gateway.requestSharingSettings();
|
||||||
|
} else {
|
||||||
var me = this;
|
var me = this;
|
||||||
me._docAccessDlg = new Common.Views.DocumentAccessDialog({
|
me._docAccessDlg = new Common.Views.DocumentAccessDialog({
|
||||||
settingsurl: this.appConfig.sharingSettingsUrl
|
settingsurl: this.appConfig.sharingSettingsUrl
|
||||||
|
@ -842,6 +847,7 @@ define([
|
||||||
});
|
});
|
||||||
|
|
||||||
me._docAccessDlg.show();
|
me._docAccessDlg.show();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setSharingSettings: function(data) {
|
setSharingSettings: function(data) {
|
||||||
|
|
|
@ -166,7 +166,7 @@ define([
|
||||||
.removeClass('dropdown-toggle')
|
.removeClass('dropdown-toggle')
|
||||||
.menu = false;
|
.menu = false;
|
||||||
|
|
||||||
$panelUsers[(!_readonlyRights && appConfig && !appConfig.isReviewOnly && appConfig.sharingSettingsUrl && appConfig.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
$panelUsers[(!_readonlyRights && appConfig && !appConfig.isReviewOnly && (appConfig.sharingSettingsUrl && appConfig.sharingSettingsUrl.length || appConfig.canRequestSharingSettings)) ? 'show' : 'hide']();
|
||||||
}
|
}
|
||||||
|
|
||||||
$btnUsers.find('.caption')
|
$btnUsers.find('.caption')
|
||||||
|
@ -248,8 +248,8 @@ define([
|
||||||
Common.NotificationCenter.trigger('collaboration:sharing');
|
Common.NotificationCenter.trigger('collaboration:sharing');
|
||||||
});
|
});
|
||||||
|
|
||||||
$labelChangeRights[(!mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length)?'show':'hide']();
|
$labelChangeRights[(!mode.isOffline && !mode.isReviewOnly && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings))?'show':'hide']();
|
||||||
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && !mode.isReviewOnly && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings)) ? 'show' : 'hide']();
|
||||||
|
|
||||||
if ( $saveStatus ) {
|
if ( $saveStatus ) {
|
||||||
$saveStatus.attr('data-width', me.textSaveExpander);
|
$saveStatus.attr('data-width', me.textSaveExpander);
|
||||||
|
|
|
@ -287,7 +287,7 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length && this._readonlyRights!==true) {
|
if ((!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length || this.appConfig.canRequestSharingSettings) && this._readonlyRights!==true) {
|
||||||
this.btnSharing = new Common.UI.Button({
|
this.btnSharing = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'btn-ic-sharing',
|
iconCls: 'btn-ic-sharing',
|
||||||
|
|
|
@ -354,6 +354,7 @@ define([
|
||||||
this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage;
|
this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage;
|
||||||
this.appOptions.canRequestCompareFile = this.editorConfig.canRequestCompareFile;
|
this.appOptions.canRequestCompareFile = this.editorConfig.canRequestCompareFile;
|
||||||
this.appOptions.canRequestMailMergeRecipients = this.editorConfig.canRequestMailMergeRecipients;
|
this.appOptions.canRequestMailMergeRecipients = this.editorConfig.canRequestMailMergeRecipients;
|
||||||
|
this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings;
|
||||||
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
|
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
|
||||||
this.appOptions.canFeatureComparison = !!this.api.asc_isSupportFeature("comparison");
|
this.appOptions.canFeatureComparison = !!this.api.asc_isSupportFeature("comparison");
|
||||||
|
|
||||||
|
|
|
@ -297,7 +297,7 @@ define([
|
||||||
|
|
||||||
this.miAccess[(!this.mode.isOffline && !this.mode.isReviewOnly && this.document&&this.document.info &&
|
this.miAccess[(!this.mode.isOffline && !this.mode.isReviewOnly && this.document&&this.document.info &&
|
||||||
(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
|
(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
|
||||||
this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length))?'show':'hide']();
|
(this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length || this.mode.canRequestSharingSettings)))?'show':'hide']();
|
||||||
|
|
||||||
this.miHelp[this.mode.canHelp ?'show':'hide']();
|
this.miHelp[this.mode.canHelp ?'show':'hide']();
|
||||||
this.miHelp.$el.prev()[this.mode.canHelp ?'show':'hide']();
|
this.miHelp.$el.prev()[this.mode.canHelp ?'show':'hide']();
|
||||||
|
|
|
@ -1231,7 +1231,7 @@ define([
|
||||||
if (doc.info.sharingSettings)
|
if (doc.info.sharingSettings)
|
||||||
this.cntRights.html(this.templateRights({users: doc.info.sharingSettings}));
|
this.cntRights.html(this.templateRights({users: doc.info.sharingSettings}));
|
||||||
this._ShowHideInfoItem('rights', doc.info.sharingSettings!==undefined && doc.info.sharingSettings!==null && doc.info.sharingSettings.length>0);
|
this._ShowHideInfoItem('rights', doc.info.sharingSettings!==undefined && doc.info.sharingSettings!==null && doc.info.sharingSettings.length>0);
|
||||||
this._ShowHideInfoItem('edit-rights', !!this.sharingSettingsUrl && this.sharingSettingsUrl.length && this._readonlyRights!==true);
|
this._ShowHideInfoItem('edit-rights', (!!this.sharingSettingsUrl && this.sharingSettingsUrl.length || this.mode.canRequestSharingSettings) && this._readonlyRights!==true);
|
||||||
} else
|
} else
|
||||||
this._ShowHideDocInfo(false);
|
this._ShowHideDocInfo(false);
|
||||||
},
|
},
|
||||||
|
@ -1251,6 +1251,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setMode: function(mode) {
|
setMode: function(mode) {
|
||||||
|
this.mode = mode;
|
||||||
this.sharingSettingsUrl = mode.sharingSettingsUrl;
|
this.sharingSettingsUrl = mode.sharingSettingsUrl;
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
|
@ -321,6 +321,7 @@ define([
|
||||||
this.appOptions.canRequestSaveAs = this.editorConfig.canRequestSaveAs;
|
this.appOptions.canRequestSaveAs = this.editorConfig.canRequestSaveAs;
|
||||||
this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage;
|
this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage;
|
||||||
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
|
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
|
||||||
|
this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings;
|
||||||
|
|
||||||
appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header');
|
appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header');
|
||||||
appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
|
appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
|
||||||
|
|
|
@ -280,7 +280,7 @@ define([
|
||||||
this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
|
this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
|
||||||
|
|
||||||
this.miAccess[(!this.mode.isOffline && this.document&&this.document.info&&(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
|
this.miAccess[(!this.mode.isOffline && this.document&&this.document.info&&(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
|
||||||
this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length))?'show':'hide']();
|
(this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length || this.mode.canRequestSharingSettings)))?'show':'hide']();
|
||||||
|
|
||||||
this.mode.canBack ? this.$el.find('#fm-btn-back').show().prev().show() :
|
this.mode.canBack ? this.$el.find('#fm-btn-back').show().prev().show() :
|
||||||
this.$el.find('#fm-btn-back').hide().prev().hide();
|
this.$el.find('#fm-btn-back').hide().prev().hide();
|
||||||
|
|
|
@ -1042,7 +1042,7 @@ define([
|
||||||
if (doc.info.sharingSettings)
|
if (doc.info.sharingSettings)
|
||||||
this.cntRights.html(this.templateRights({users: doc.info.sharingSettings}));
|
this.cntRights.html(this.templateRights({users: doc.info.sharingSettings}));
|
||||||
this._ShowHideInfoItem('rights', doc.info.sharingSettings!==undefined && doc.info.sharingSettings!==null && doc.info.sharingSettings.length>0);
|
this._ShowHideInfoItem('rights', doc.info.sharingSettings!==undefined && doc.info.sharingSettings!==null && doc.info.sharingSettings.length>0);
|
||||||
this._ShowHideInfoItem('edit-rights', !!this.sharingSettingsUrl && this.sharingSettingsUrl.length && this._readonlyRights!==true);
|
this._ShowHideInfoItem('edit-rights', (!!this.sharingSettingsUrl && this.sharingSettingsUrl.length || this.mode.canRequestSharingSettings) && this._readonlyRights!==true);
|
||||||
} else
|
} else
|
||||||
this._ShowHideDocInfo(false);
|
this._ShowHideDocInfo(false);
|
||||||
},
|
},
|
||||||
|
@ -1057,6 +1057,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setMode: function(mode) {
|
setMode: function(mode) {
|
||||||
|
this.mode = mode;
|
||||||
this.sharingSettingsUrl = mode.sharingSettingsUrl;
|
this.sharingSettingsUrl = mode.sharingSettingsUrl;
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
|
@ -337,6 +337,7 @@ define([
|
||||||
this.appOptions.canRequestSaveAs = this.editorConfig.canRequestSaveAs;
|
this.appOptions.canRequestSaveAs = this.editorConfig.canRequestSaveAs;
|
||||||
this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage;
|
this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage;
|
||||||
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
|
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
|
||||||
|
this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings;
|
||||||
|
|
||||||
this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header');
|
this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header');
|
||||||
this.headerView.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
|
this.headerView.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
|
||||||
|
|
|
@ -271,7 +271,7 @@ define([
|
||||||
this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
|
this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide']();
|
||||||
|
|
||||||
this.miAccess[(!this.mode.isOffline && this.document&&this.document.info&&(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
|
this.miAccess[(!this.mode.isOffline && this.document&&this.document.info&&(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
|
||||||
this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length))?'show':'hide']();
|
(this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length || this.mode.canRequestSharingSettings)))?'show':'hide']();
|
||||||
|
|
||||||
this.mode.canBack ? this.$el.find('#fm-btn-back').show().prev().show() :
|
this.mode.canBack ? this.$el.find('#fm-btn-back').show().prev().show() :
|
||||||
this.$el.find('#fm-btn-back').hide().prev().hide();
|
this.$el.find('#fm-btn-back').hide().prev().hide();
|
||||||
|
|
|
@ -1523,7 +1523,7 @@ define([
|
||||||
if (doc.info.sharingSettings)
|
if (doc.info.sharingSettings)
|
||||||
this.cntRights.html(this.templateRights({users: doc.info.sharingSettings}));
|
this.cntRights.html(this.templateRights({users: doc.info.sharingSettings}));
|
||||||
this._ShowHideInfoItem('rights', doc.info.sharingSettings!==undefined && doc.info.sharingSettings!==null && doc.info.sharingSettings.length>0);
|
this._ShowHideInfoItem('rights', doc.info.sharingSettings!==undefined && doc.info.sharingSettings!==null && doc.info.sharingSettings.length>0);
|
||||||
this._ShowHideInfoItem('edit-rights', !!this.sharingSettingsUrl && this.sharingSettingsUrl.length && this._readonlyRights!==true);
|
this._ShowHideInfoItem('edit-rights', (!!this.sharingSettingsUrl && this.sharingSettingsUrl.length || this.mode.canRequestSharingSettings) && this._readonlyRights!==true);
|
||||||
} else
|
} else
|
||||||
this._ShowHideDocInfo(false);
|
this._ShowHideDocInfo(false);
|
||||||
},
|
},
|
||||||
|
@ -1538,6 +1538,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setMode: function(mode) {
|
setMode: function(mode) {
|
||||||
|
this.mode = mode;
|
||||||
this.sharingSettingsUrl = mode.sharingSettingsUrl;
|
this.sharingSettingsUrl = mode.sharingSettingsUrl;
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue