aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorYarden Shoham <git@yardenshoham.com>2024-06-20 23:04:09 +0300
committerGitHub <noreply@github.com>2024-06-20 20:04:09 +0000
commita5a9885f72c0c5be35ff7137cc2e2a60d8d11557 (patch)
tree8c463d10cc2e75c7eb5272fcd802e78126121b1e /web_src
parentc60ef946b1c5ed3347224cda5d3e17592cd16e5e (diff)
downloadgitea-a5a9885f72c0c5be35ff7137cc2e2a60d8d11557.tar.gz
gitea-a5a9885f72c0c5be35ff7137cc2e2a60d8d11557.zip
Bump htmx to 2.0.0 (#31413)
Tested Subscribe, Follow, Star, Watch, and System Status. --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/common-global.js1
-rw-r--r--web_src/js/globals.js5
-rw-r--r--web_src/js/htmx.js1
-rw-r--r--web_src/js/index.js1
-rw-r--r--web_src/js/jquery.js3
5 files changed, 6 insertions, 5 deletions
diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js
index 1ab2a55699..34992c1f5b 100644
--- a/web_src/js/features/common-global.js
+++ b/web_src/js/features/common-global.js
@@ -11,7 +11,6 @@ import {showTemporaryTooltip} from '../modules/tippy.js';
import {confirmModal} from './comp/ConfirmModal.js';
import {showErrorToast} from '../modules/toast.js';
import {request, POST, GET} from '../modules/fetch.js';
-import '../htmx.js';
const {appUrl, appSubUrl, csrfToken, i18n} = window.config;
diff --git a/web_src/js/globals.js b/web_src/js/globals.js
new file mode 100644
index 0000000000..24974da90e
--- /dev/null
+++ b/web_src/js/globals.js
@@ -0,0 +1,5 @@
+import jquery from 'jquery';
+import htmx from 'htmx.org/dist/htmx.esm.js';
+
+window.$ = window.jQuery = jquery;
+window.htmx = htmx;
diff --git a/web_src/js/htmx.js b/web_src/js/htmx.js
index 5ca3018308..6169d2f82f 100644
--- a/web_src/js/htmx.js
+++ b/web_src/js/htmx.js
@@ -1,4 +1,3 @@
-import * as htmx from 'htmx.org';
import {showErrorToast} from './modules/toast.js';
// https://github.com/bigskysoftware/idiomorph#htmx
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 12cd0ee15a..99352727dd 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -1,5 +1,6 @@
// bootstrap module must be the first one to be imported, it handles webpack lazy-loading and global errors
import './bootstrap.js';
+import './htmx.js';
import {initRepoActivityTopAuthorsChart} from './components/RepoActivityTopAuthors.vue';
import {initScopedAccessTokenCategories} from './components/ScopedAccessTokenSelector.vue';
diff --git a/web_src/js/jquery.js b/web_src/js/jquery.js
deleted file mode 100644
index 6b2199896c..0000000000
--- a/web_src/js/jquery.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import $ from 'jquery';
-
-window.$ = window.jQuery = $; // eslint-disable-line no-jquery/variable-pattern