Skip to content

Commit 0b9f5d0

Browse files
committed
Fix spelling & add reset button link
1 parent c888031 commit 0b9f5d0

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ It is also designed to be used with settings pages that save their settings auto
99
* can automatically save all options in a useful data format (number values are also saved as numbers, not strings)
1010
* [saving multiple options grouped together in JS objects](#option-groups)
1111
* [MessageHandler integration](https://github.com/TinyWebEx/MessageHandler), e.g. to show errors when saving or loading an option fails, or to show a message if some managed options are used.
12+
* [can automatically let your reset button spring to live](#reset-button)
1213

1314
## Usage
1415

@@ -156,7 +157,7 @@ In both cases, you get the `optionValue` of the setting, the option name and the
156157

157158
This is mostly useful if some options depend on each other (that happens often when using [option groups](#option-groups) e.g.), so you can interactively disable elements based on the user selection/input; or, if you want top verify the data the user entered and show some warnings or so.
158159

159-
Note however, that this way is seperate from the whole loading & saving of the data, so you cannot prevent an invalid value from being saved or so, here. Do [overwrite the loading or saving behaviour](#overwriting-loading-and-saving-behaviour) if you want to do this.
160+
Note however, that this way is separate from the whole loading & saving of the data, so you cannot prevent an invalid value from being saved or so, here. Do [overwrite the loading or saving behaviour](#overwriting-loading-and-saving-behaviour) if you want to do this.
160161

161162
Note that you need to add the additional classes `trigger-on-update` (for the update trigger/`registerUpdate`) or `trigger-on-change` (for the input trigger/`registerChange`) to the respective options, to make this feature work. Without it, the library does not bind to these elements.
162163

@@ -165,7 +166,7 @@ Note that you need to add the additional classes `trigger-on-update` (for the up
165166
You can use `AutomaticSettings.Trigger.registerSave` to register a "save trigger" that is executed when an option is saved (actually directly before it is saved).
166167
It is thus quite useful to automatically apply the option or send it to other parts of the browser extension, so they are notified that a the value of the option changed. This is a useful feature for your usability, because the `AutomaticSetings` module automatically saves all options, so they should also automatically be applied, so the user immediately sees the difference.
167168

168-
You can also use it to validate the input and cancel saving, you need to throw some errors then. Note that you should then show an appropiate error message yourself, as this error is not catched by the library - in contrast to everything else that happens afterwards, i.e. the saving of the option itself, e.g.
169+
You can also use it to validate the input and cancel saving, you need to throw some errors then. Note that you should then show an appropriate error message yourself, as this error is not catched by the library - in contrast to everything else that happens afterwards, i.e. the saving of the option itself, e.g.
169170

170171
### Triggers before and after loading
171172

@@ -175,7 +176,7 @@ To solve this, there is `AutomaticSettings.Trigger.registerAfterLoad`, which can
175176

176177
Similarly there is `AutomaticSettings.Trigger.registerBeforeLoad` to let you execute stuff before any option is loaded.
177178

178-
### Overwriting loading and saving behaviour
179+
### Overwriting loading and saving behavior
179180

180181
Sometimes it is needed to present data to the user in one way, but save it in another way. Thus, you need to manipulate how data is loaded or saved.
181182
If [option groups](#option-groups) are not enough for you, you can use `AutomaticSettings.Trigger.addCustomLoadOverride` and `AutomaticSettings.Trigger.addCustomSaveOverride` to override the respective features.
@@ -207,6 +208,10 @@ function saveOptionXy(param) {
207208
}
208209
```
209210

211+
## Reset buttons
212+
213+
Doc is TODO…
214+
210215
## API note
211216

212217
Everything in the `internal` dir is considered to be an internal module/file and thus not be considered to be an API under _semantic versioning_. That means the API there can change at any time, do _not_ import anything from there!

0 commit comments

Comments
 (0)