[DE] create url with data for action/command

This commit is contained in:
Julia Radzhabova 2019-03-18 14:47:41 +03:00
parent 38cbca0ebe
commit 2f5951aaaf
4 changed files with 23 additions and 0 deletions

View file

@ -197,6 +197,7 @@
_config.editorConfig.canRequestEditRights = _config.events && !!_config.events.onRequestEditRights; _config.editorConfig.canRequestEditRights = _config.events && !!_config.events.onRequestEditRights;
_config.editorConfig.canRequestClose = _config.events && !!_config.events.onRequestClose; _config.editorConfig.canRequestClose = _config.events && !!_config.events.onRequestClose;
_config.editorConfig.canRename = _config.events && !!_config.events.onRequestRename; _config.editorConfig.canRename = _config.events && !!_config.events.onRequestRename;
_config.editorConfig.canMakeActionLink = _config.events && !!_config.events.onMakeActionLink;
_config.editorConfig.mergeFolderUrl = _config.editorConfig.mergeFolderUrl || _config.editorConfig.saveAsUrl; _config.editorConfig.mergeFolderUrl = _config.editorConfig.mergeFolderUrl || _config.editorConfig.saveAsUrl;
_config.frameEditorId = placeholderId; _config.frameEditorId = placeholderId;
@ -509,6 +510,15 @@
}); });
}; };
var _setActionLink = function (data) {
_sendCommand({
command: 'setActionLink',
data: {
url: data
}
});
};
var _processMailMerge = function(enabled, message) { var _processMailMerge = function(enabled, message) {
_sendCommand({ _sendCommand({
command: 'processMailMerge', command: 'processMailMerge',
@ -559,6 +569,7 @@
refreshHistory : _refreshHistory, refreshHistory : _refreshHistory,
setHistoryData : _setHistoryData, setHistoryData : _setHistoryData,
setEmailAddresses : _setEmailAddresses, setEmailAddresses : _setEmailAddresses,
setActionLink : _setActionLink,
processMailMerge : _processMailMerge, processMailMerge : _processMailMerge,
downloadAs : _downloadAs, downloadAs : _downloadAs,
serviceCommand : _serviceCommand, serviceCommand : _serviceCommand,

View file

@ -76,6 +76,10 @@ if (Common === undefined) {
$me.trigger('setemailaddresses', data); $me.trigger('setemailaddresses', data);
}, },
'setActionLink': function (data) {
$me.trigger('setactionlink', data.url);
},
'processMailMerge': function(data) { 'processMailMerge': function(data) {
$me.trigger('processmailmerge', data); $me.trigger('processmailmerge', data);
}, },
@ -254,6 +258,10 @@ if (Common === undefined) {
_postMessage({event: 'onRequestClose'}); _postMessage({event: 'onRequestClose'});
}, },
requestMakeActionLink: function (config) {
_postMessage({event:'onMakeActionLink', data: config})
},
on: function(event, handler){ on: function(event, handler){
var localHandler = function(event, data){ var localHandler = function(event, data){
handler.call(me, data) handler.call(me, data)

View file

@ -78,6 +78,9 @@ define([
this._state = { this._state = {
prcontrolsdisable:undefined prcontrolsdisable:undefined
}; };
Common.Gateway.on('setactionlink', function (url) {
console.log('url with actions: ' + url);
}.bind(this));
}, },
setApi: function (api) { setApi: function (api) {

View file

@ -332,6 +332,7 @@ define([
this.appOptions.canBack = this.appOptions.canBackToFolder === true; this.appOptions.canBack = this.appOptions.canBackToFolder === true;
this.appOptions.canPlugins = false; this.appOptions.canPlugins = false;
this.plugins = this.editorConfig.plugins; this.plugins = this.editorConfig.plugins;
this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink;
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 : '')