feat(csharp): refresh file config

This commit is contained in:
sshakndr
2024-12-09 16:54:45 +07:00
parent 05b4e9d63d
commit a6a1c4a4cc
4 changed files with 96 additions and 2 deletions

View File

@ -199,6 +199,18 @@
}
};
var onRequestRefreshFile = function(event) {
let xhr = new XMLHttpRequest();
xhr.open("GET", "webeditor.ashx?type=config&fileName=" + encodeURIComponent(config.document.title) +
"&directUrl=" + !!config.document.directUrl +
"&permissions=" + encodeURIComponent(JSON.stringify(config.document.permissions)));
xhr.send();
xhr.onload = function () {
innerAlert(xhr.responseText);
docEditor.refreshFile(JSON.parse(xhr.responseText));
};
};
var onRequestOpen = function (event) { // user open external data source
innerAlert("onRequestOpen");
var windowName = event.data.windowName;
@ -337,7 +349,7 @@
};
if (config.editorConfig.user.id) {
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
config.events['onRequestClose'] = onRequestClose;
config.events['onRequestHistory'] = function (event) { // the user is trying to show the document version history