summaryrefslogtreecommitdiffstats
path: root/web_src/js/standalone
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-06-27 04:45:24 +0200
committerGitHub <noreply@github.com>2023-06-27 02:45:24 +0000
commitc71e8abbc331e2a68186aa11a4797ecd24ff6d27 (patch)
tree24488621201c7501bd6056053e9cca3de221fce1 /web_src/js/standalone
parent72c60f94c1a54707ebad2af0f587c08d2e8f992c (diff)
downloadgitea-c71e8abbc331e2a68186aa11a4797ecd24ff6d27.tar.gz
gitea-c71e8abbc331e2a68186aa11a4797ecd24ff6d27.zip
Add toasts to UI (#25449)
Fixes https://github.com/go-gitea/gitea/issues/24353 In some case like async success/error, it is useful to show toasts in UI.
Diffstat (limited to 'web_src/js/standalone')
-rw-r--r--web_src/js/standalone/devtest.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/web_src/js/standalone/devtest.js b/web_src/js/standalone/devtest.js
new file mode 100644
index 0000000000..d0ca511c0f
--- /dev/null
+++ b/web_src/js/standalone/devtest.js
@@ -0,0 +1,11 @@
+import {showInfoToast, showWarningToast, showErrorToast} from '../modules/toast.js';
+
+document.getElementById('info-toast').addEventListener('click', () => {
+ showInfoToast('success 😀');
+});
+document.getElementById('warning-toast').addEventListener('click', () => {
+ showWarningToast('warning 😐');
+});
+document.getElementById('error-toast').addEventListener('click', () => {
+ showErrorToast('error 🙁');
+});