| 1480 | } |
| 1481 | |
| 1482 | function captureProfileDraft() { |
| 1483 | const ids = [ |
| 1484 | "profileUserId", |
| 1485 | "scholarUrl", |
| 1486 | "homepageUrl", |
| 1487 | "pdfPaths", |
| 1488 | "profileDirectionsInput", |
| 1489 | "profileKeywordsInput", |
| 1490 | "profileAuthorsInput", |
| 1491 | "profileInstitutionsInput", |
| 1492 | "profileTopicsInput" |
| 1493 | ]; |
| 1494 | const draft = {}; |
| 1495 | ids.forEach((id) => { |
| 1496 | if ($(id)) draft[id] = $(id).value; |
| 1497 | }); |
| 1498 | if ($("resetProfile")) draft.resetProfile = $("resetProfile").checked; |
| 1499 | return draft; |
| 1500 | } |
| 1501 | |
| 1502 | function restoreProfileDraft(draft = {}) { |
| 1503 | Object.entries(draft).forEach(([id, value]) => { |