Fix mv-sync path; pre-fill PDF display name from filename on upload
- Fix MV_SYNC path: ../tools resolved to /workspace/tools, should be ./tools relative to server.mjs entry point - Pre-populate display name input when file is selected (strips .pdf extension), only if the field is currently empty so manual edits are not overwritten Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2058,6 +2058,15 @@ async function init() {
|
||||
document.getElementById('dialog-file-picker').close();
|
||||
});
|
||||
|
||||
document.getElementById('fp-file-input').addEventListener('change', (e) => {
|
||||
const file = e.target.files[0];
|
||||
if (!file) return;
|
||||
const name_input = document.getElementById('fp-upload-name');
|
||||
if (!name_input.value.trim()) {
|
||||
name_input.value = file.name.replace(/\.pdf$/i, '');
|
||||
}
|
||||
});
|
||||
|
||||
qs(document.getElementById('dialog-file-picker'), '#fp-upload-btn').addEventListener('click', async () => {
|
||||
const file_input = document.getElementById('fp-file-input');
|
||||
const name_input = document.getElementById('fp-upload-name');
|
||||
|
||||
Reference in New Issue
Block a user