-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Laravel precognition and update form a11y (#359)
* Use Laravel precognition and update a11y * Use rewritten Peak Tools form handler
- Loading branch information
Showing
22 changed files
with
359 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,11 @@ | ||
import Alpine from 'alpinejs' | ||
import collapse from '@alpinejs/collapse' | ||
import focus from '@alpinejs/focus' | ||
import morph from '@alpinejs/morph' | ||
import persist from '@alpinejs/persist' | ||
import focus from '@alpinejs/focus' | ||
|
||
// Global get CSRF token function (used by forms). | ||
window.getToken = async () => { | ||
return await fetch('/!/statamic-peak-tools/dynamic-token/refresh') | ||
.then((res) => res.json()) | ||
.then((data) => { | ||
return data.csrf_token | ||
}) | ||
.catch((error) => { | ||
this.error = 'Something went wrong. Please try again later.' | ||
}) | ||
} | ||
import precognition from 'laravel-precognition-alpine'; | ||
|
||
// Call Alpine. | ||
window.Alpine = Alpine | ||
Alpine.plugin([collapse, focus, morph, persist]) | ||
Alpine.plugin([collapse, focus, morph, persist, precognition]) | ||
Alpine.start() |
Oops, something went wrong.