php: add request rename in doceditor + add function renamefile() in webeditor

This commit is contained in:
Olga Larinova
2022-03-03 14:34:57 +03:00
parent b8b375a19a
commit 4b72e0a664
2 changed files with 24 additions and 0 deletions

View File

@ -461,6 +461,17 @@
}
};
var onRequestRename = function(event) {
var filename = event.data;
let xhr = new XMLHttpRequest();
xhr.open("POST", "webeditor-ajax.php?type=rename");
xhr.setRequestHeader( 'Content-Type', 'application/json');
xhr.send(JSON.stringify({filename : filename}));
xhr.onload = function () {
innerAlert(xhr.responseText);
}
};
var сonnectEditor = function () {
<?php
@ -485,6 +496,7 @@
'onRequestInsertImage': onRequestInsertImage,
'onRequestCompareFile': onRequestCompareFile,
'onRequestMailMergeRecipients': onRequestMailMergeRecipients,
"onRequestRename": onRequestRename
};
<?php