(e)
| 315 | |
| 316 | // Commit save config. |
| 317 | function commitSave(e) { |
| 318 | const name = saveInput.value; |
| 319 | const url = new URL(document.URL); |
| 320 | // Set path relative to existing path. |
| 321 | url.pathname = new URL('./saveconfig', document.URL).pathname; |
| 322 | url.searchParams.set('config', name); |
| 323 | saveError.innerText = ''; |
| 324 | sendURL('POST', url, (ok) => { |
| 325 | if (!ok) { |
| 326 | saveError.innerText = 'Save failed'; |
| 327 | } else { |
| 328 | showDialog(null); |
| 329 | location.reload(); // Reload to show updated config menu |
| 330 | } |
| 331 | }); |
| 332 | } |
| 333 | |
| 334 | function handleSaveInputKey(e) { |
| 335 | if (e.key === 'Enter') commitSave(e); |
no test coverage detected
searching dependent graphs…