A Patternslib pattern.
For example:
<form class="pat-doclock"
data-pat-doclock="url: mock/toggle-lock.html"
>
...
</form>For standalone development run (installation and starting a server):
> make allTo clean up local directory (after running make all) run:
> make cleanThis pattern is Quaive specific and is meant to lock a document in order to prevent concurrent edits.
Every time a user starts typing or pastes content in a form that
has the class pat-doclock, an ajax call to the url specified
using the data-pat-doclock option is performed.
The document is unlocked by calling the same url when:
- the user leaves the page,
- the form is removed from the DOM, also when one of its ancestors is removed (the pattern is destroyed automatically by Patternslib),
- the
<dialog>the form is placed in is closed.
Requires Patternslib 9.12 or later for the automatic destroy on DOM removal.