This commit is contained in:
Sergey Linnik
2022-03-28 13:26:17 +03:00
parent 4b0ad1a192
commit 54bb5b0a24
5 changed files with 19 additions and 13 deletions

View File

@ -219,14 +219,17 @@
document.location.reload();
};
<% } %>
// add mentions for not anonymous users
<% if (!string.IsNullOrEmpty(usersForMentions)) { %>
<% if (!string.IsNullOrEmpty(usersForMentions))
{ %>
config.events['onRequestUsers'] = function () {
docEditor.setUsers({ // set a list of users to mention in the comments
"users": <%= usersForMentions %>
"users": <%= usersForMentions %>
});
};
<% } %>
<% } %>
// the user is mentioned in a comment
config.events['onRequestSendNotify'] = function (event) {
event.data.actionLink = replaceActionLink(location.href, JSON.stringify(event.data.actionLink));
@ -235,8 +238,8 @@
};
// prevent file renaming for anonymous users
config.events['onRequestRename'] = onRequestRename;
}
}
if (config.editorConfig.createUrl) {
config.events.onRequestSaveAs = onRequestSaveAs;
};

View File

@ -208,7 +208,8 @@
};
if (config.editorConfig.user.id) {
<% if (!string.IsNullOrEmpty(History) && !string.IsNullOrEmpty(HistoryData)) { %>
<% if (!string.IsNullOrEmpty(History) && !string.IsNullOrEmpty(HistoryData))
{ %>
config.events['onRequestHistory'] = function () { // the user is trying to show the document version history
docEditor.refreshHistory(<%= History %>); // show the document version history
};
@ -221,15 +222,17 @@
document.location.reload();
};
<% } %>
// add mentions for not anonymous users
<% if (!string.IsNullOrEmpty(UsersForMentions)) { %>
<% if (!string.IsNullOrEmpty(UsersForMentions))
{ %>
config.events['onRequestUsers'] = function () {
docEditor.setUsers({ // set a list of users to mention in the comments
"users": <%= UsersForMentions %>
});
};
<% } %>
<% } %>
// the user is mentioned in a comment
config.events['onRequestSendNotify'] = function (event) {
event.data.actionLink = replaceActionLink(location.href, JSON.stringify(event.data.actionLink));
@ -239,7 +242,7 @@
// prevent file renaming for anonymous users
config.events['onRequestRename'] = onRequestRename;
}
if (config.editorConfig.createUrl) {
config.events.onRequestSaveAs = onRequestSaveAs;
};

View File

@ -179,7 +179,7 @@
var historyData = histArray[1];
var usersForMentions = [[${usersForMentions}]];
if(config.editorConfig.user.id != 4){
if (config.editorConfig.user.id != 4) {
if (hist && historyData) {
// the user is trying to show the document version history
config.events['onRequestHistory'] = function () {

View File

@ -196,7 +196,7 @@
if (config.editorConfig.user.id) {
{% if history and historyData %}
// the user is trying to show the document version history

View File

@ -172,7 +172,7 @@
<%
history = @file.get_history
usersMentions = @file.get_users_mentions %>
if (config.editorConfig.user.id) {
<% if history %>
// the user is trying to show the document version history