WebClient: remove inline onclick from file edit page

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2023-11-14 19:41:20 +01:00
parent 2d9e7dfba2
commit 3c522961af
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -52,7 +52,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
<div class="card-toolbar">
<a class="btn btn-light-primary px-10 me-5" href='{{.FilesURL}}?path={{.CurrentDir}}' role="button">Back</a>
{{- if not .ReadOnly}}
<a id="save_button" type="button" class="btn btn-primary px-10" href="#" role="button" onclick="saveFile();">
<a id="save_button" type="button" class="btn btn-primary px-10" href="#" role="button">
<span class="indicator-label">Save</span>
<span class="indicator-progress">Please wait...
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
@ -159,6 +159,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
cmView = cm6.createEditorView(undefined, document.getElementById("editor"));
cmView.setState(cm6.createEditorState("{{.Data}}", options));
var saveBtn = $('#save_button');
if (saveBtn){
saveBtn.on("click", function(){
saveFile();
});
}
setInterval(keepAlive, 300000);
});
</script>