| 105 | |
| 106 | // Invoked when the user clicks the "reset" button next to an option's text field. |
| 107 | function resetInputValue(event) { |
| 108 | const parentDiv = event.target.parentNode.parentNode; |
| 109 | console.assert(parentDiv?.tagName == "DIV", "Expected parent to be a div", event.target); |
| 110 | const input = parentDiv.querySelector("input") || parentDiv.querySelector("textarea"); |
| 111 | const optionName = input.name; |
| 112 | const defaultValue = Settings.defaultOptions[optionName]; |
| 113 | input.value = defaultValue; |
| 114 | event.preventDefault(); |
| 115 | } |
| 116 | |
| 117 | function setFormFromSettings(settings) { |
| 118 | for (const [optionName, optionType] of Object.entries(options)) { |