Merge branch 'release/v5.3.0' of https://github.com/ONLYOFFICE/web-apps-pro into release/v5.3.0

This commit is contained in:
Alexander Yuzhin 2019-03-19 15:40:18 +03:00
commit 3d32e495ea
11 changed files with 70 additions and 17 deletions

View file

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

View file

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

View file

@ -777,7 +777,6 @@ define([
}));
}
replies.sort(function (a,b) { return a.get('time') - b.get('time');});
comment.set('replys', replies);
if (!silentUpdate) {
@ -1246,10 +1245,6 @@ define([
editable : this.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)
}));
}
replies.sort(function (a, b) {
return a.get('time') - b.get('time');
});
}
return replies;

View file

@ -36,8 +36,8 @@
<div class="btns-reply-ct">
<% if (item.get("editable")) { %>
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
<% } %>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
</div>
<%}%>
<% } else { %>
@ -67,8 +67,8 @@
<div class="edit-ct">
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<div class="btn-delete img-commonctrl"></div>
<% if (resolved) { %>
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>
<% } else { %>

View file

@ -36,8 +36,8 @@
<div class="btns-reply-ct">
<% if (item.get("editable")) { %>
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
<%}%>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
</div>
<%}%>
<% } else { %>
@ -68,8 +68,8 @@
<div class="edit-ct">
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<div class="btn-delete img-commonctrl"></div>
<% } %>
<div class="btn-delete img-commonctrl"></div>
<% if (resolved) { %>
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>
<% } else { %>

View file

@ -78,6 +78,16 @@ define([
this._state = {
prcontrolsdisable:undefined
};
Common.Gateway.on('setactionlink', function (url) {
var copytext = document.createElement('input');
copytext.value = url;
document.body.appendChild(copytext);
copytext.select();
try {
document.execCommand("copy");
} catch (err) {}
document.body.removeChild(copytext);
});
},
setApi: function (api) {
@ -325,6 +335,7 @@ define([
var me = this;
(new DE.Views.BookmarksDialog({
api: me.api,
appOptions: me.toolbar.appOptions,
props: me.api.asc_GetBookmarksManager(),
handler: function (result, settings) {
if (settings) {

View file

@ -332,6 +332,7 @@ define([
this.appOptions.canBack = this.appOptions.canBackToFolder === true;
this.appOptions.canPlugins = false;
this.plugins = this.editorConfig.plugins;
this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink;
appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header');
appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
@ -356,7 +357,9 @@ define([
this.permissions = $.extend(this.permissions, data.doc.permissions);
var _permissions = $.extend({}, data.doc.permissions),
_user = new Asc.asc_CUserInfo();
_options = $.extend({}, data.doc.options, {actions: this.editorConfig.actionLink || {}});
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FullName(this.appOptions.user.fullname);
@ -366,7 +369,7 @@ define([
docInfo.put_Title(data.doc.title);
docInfo.put_Format(data.doc.fileType);
docInfo.put_VKey(data.doc.vkey);
docInfo.put_Options(data.doc.options);
docInfo.put_Options(_options);
docInfo.put_UserInfo(_user);
docInfo.put_CallbackUrl(this.editorConfig.callbackUrl);
docInfo.put_Token(data.doc.token);

View file

@ -90,7 +90,8 @@ define([
'<tr>',
'<td class="padding-large">',
'<button type="button" class="btn btn-text-default" id="bookmarks-btn-goto" style="margin-right: 10px;">', me.textGoto,'</button>',
'<button type="button" class="btn btn-text-default" id="bookmarks-btn-delete" style="">', me.textDelete,'</button>',
'<button type="button" class="btn btn-text-default" id="bookmarks-btn-delete" style="margin-right: 10px;">', me.textDelete,'</button>',
'<button type="button" class="btn btn-text-default" id="bookmarks-btn-link" style="">', me.textGetLink,'</button>',
'</td>',
'</tr>',
'<tr>',
@ -111,6 +112,7 @@ define([
this.api = options.api;
this.handler = options.handler;
this.props = options.props;
this.appOptions = options.appOptions;
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
},
@ -137,6 +139,7 @@ define([
me.btnAdd.setDisabled(!check && !exist);
me.btnGoto.setDisabled(!exist);
me.btnDelete.setDisabled(!exist);
me.btnGetLink.setDisabled(!exist);
return (check || _.isEmpty(value)) ? true : me.txtInvalidName;
}
@ -187,6 +190,12 @@ define([
});
this.btnDelete.on('click', _.bind(this.deleteBookmark, this));
this.btnGetLink = new Common.UI.Button({
el: $('#bookmarks-btn-link'),
disabled: true
});
this.btnGetLink.on('click', _.bind(this.getBookmarkLink, this));
this.chHidden = new Common.UI.CheckBox({
el: $('#bookmarks-checkbox-hidden'),
labelText: this.textHidden,
@ -220,6 +229,7 @@ define([
_setDefaults: function (props) {
this.refreshBookmarks();
this.bookmarksList.scrollToRecord(this.bookmarksList.selectByIndex(0));
this.btnGetLink.setVisible(this.appOptions.canMakeActionLink);
},
getSettings: function () {
@ -266,6 +276,7 @@ define([
this.btnAdd.setDisabled(false);
this.btnGoto.setDisabled(false);
this.btnDelete.setDisabled(false);
this.btnGetLink.setDisabled(false);
},
gotoBookmark: function(btn, eOpts){
@ -290,6 +301,14 @@ define([
this.btnAdd.setDisabled(true);
this.btnGoto.setDisabled(true);
this.btnDelete.setDisabled(true);
this.btnGetLink.setDisabled(true);
}
},
getBookmarkLink: function() {
var rec = this.bookmarksList.getSelectedRec();
if (rec.length>0) {
Common.Gateway.requestMakeActionLink({action: "bookmark", data: rec[0].get('value')});
}
},
@ -314,7 +333,8 @@ define([
textDelete: 'Delete',
textClose: 'Close',
textHidden: 'Hidden bookmarks',
txtInvalidName: 'Bookmark name can only contain letters, digits and underscores, and should begin with the letter'
txtInvalidName: 'Bookmark name can only contain letters, digits and underscores, and should begin with the letter',
textGetLink: 'Get link'
}, DE.Views.BookmarksDialog || {}))
});

View file

@ -1009,6 +1009,7 @@
"DE.Views.BookmarksDialog.textName": "Name",
"DE.Views.BookmarksDialog.textSort": "Sort by",
"DE.Views.BookmarksDialog.textTitle": "Bookmarks",
"DE.Views.BookmarksDialog.textGetLink": "Get link",
"DE.Views.BookmarksDialog.txtInvalidName": "Bookmark name can only contain letters, digits and underscores, and should begin with the letter",
"DE.Views.ChartSettings.textAdvanced": "Show advanced settings",
"DE.Views.ChartSettings.textArea": "Area",

View file

@ -336,7 +336,9 @@ define([
this.permissions = $.extend(this.permissions, data.doc.permissions);
var _permissions = $.extend({}, data.doc.permissions),
_user = new Asc.asc_CUserInfo();
_options = $.extend({}, data.doc.options, {actions: this.editorConfig.actionLink || {}});
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FullName(this.appOptions.user.fullname);
@ -346,7 +348,7 @@ define([
docInfo.put_Title(data.doc.title);
docInfo.put_Format(data.doc.fileType);
docInfo.put_VKey(data.doc.vkey);
docInfo.put_Options(data.doc.options);
docInfo.put_Options(_options);
docInfo.put_UserInfo(_user);
docInfo.put_CallbackUrl(this.editorConfig.callbackUrl);
docInfo.put_Token(data.doc.token);

View file

@ -362,7 +362,9 @@ define([
this.permissions = _.extend(this.permissions, data.doc.permissions);
var _permissions = $.extend({}, data.doc.permissions),
_user = new Asc.asc_CUserInfo();
_options = $.extend({}, data.doc.options, {actions: this.editorConfig.actionLink || {}});
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FullName(this.appOptions.user.fullname);
@ -372,7 +374,7 @@ define([
docInfo.put_Title(data.doc.title);
docInfo.put_Format(data.doc.fileType);
docInfo.put_VKey(data.doc.vkey);
docInfo.put_Options(data.doc.options);
docInfo.put_Options(_options);
docInfo.put_UserInfo(_user);
docInfo.put_CallbackUrl(this.editorConfig.callbackUrl);
docInfo.put_Token(data.doc.token);