mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
19 lines
535 B
JavaScript
Executable File
19 lines
535 B
JavaScript
Executable File
function deleteFile(event) {
|
|
let filename = event.currentTarget.getAttribute("data");
|
|
filename = encodeURIComponent(filename);
|
|
let url = `webeditor.ashx?type=removeforgotten&filename=${filename}`;
|
|
|
|
fetch(url, {
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
}
|
|
}).then(result => {
|
|
if(result.status == 204) {
|
|
document.location.reload(true);
|
|
}
|
|
});
|
|
}
|
|
|
|
document.querySelectorAll('.delete-file').forEach(el => {
|
|
el.addEventListener('click', deleteFile);
|
|
}); |