fixed the no ability to add mentions for anonymous users

This commit is contained in:
metoou
2021-05-28 15:10:06 +03:00
parent 60992ecb38
commit 07d11f0bae
12 changed files with 135 additions and 120 deletions

View File

@ -396,19 +396,6 @@
docEditor.setMailMergeRecipients(<?php echo json_encode($dataMailMergeRecipients) ?>); // insert recipient data for mail merge into the file
};
var onRequestUsers = function () {
docEditor.setUsers({
"users": <?php echo json_encode($usersForMentions) ?>
});
};
var onRequestSendNotify = function (event) {
var actionLink = JSON.stringify(event.data.actionLink);
console.log("onRequestSendNotify:");
console.log(event.data);
console.log("Link to comment: " + replaceActionLink(location.href, actionLink));
};
var сonnectEditor = function () {
<?php
@ -433,8 +420,6 @@
'onRequestInsertImage': onRequestInsertImage,
'onRequestCompareFile': onRequestCompareFile,
'onRequestMailMergeRecipients': onRequestMailMergeRecipients,
"onRequestUsers": onRequestUsers,
"onRequestSendNotify": onRequestSendNotify,
};
<?php
@ -459,6 +444,21 @@
};
<?php endif; ?>
<?php if ($usersForMentions != null): ?>
// add mentions for not anonymous users
config.events['onRequestUsers'] = function () {
docEditor.setUsers({
"users": <?php echo json_encode($usersForMentions) ?>
});
};
config.events['onRequestSendNotify'] = function (event) {
var actionLink = JSON.stringify(event.data.actionLink);
console.log("onRequestSendNotify:");
console.log(event.data);
console.log("Link to comment: " + replaceActionLink(location.href, actionLink));
};
<?php endif; ?>
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};