feat: add jQuery and UI support

- Introduce jQuery and jQuery UI libraries
- Create an add_jquery.js for global availability
- Import active_admin.js to initialize the setup

These changes integrate jQuery and jQuery UI into the project, which
will facilitate more interactive user interface features. The jQuery
object is made globally accessible to use within other scripts.
This commit is contained in:
songtianlun 2025-01-25 01:11:15 +08:00
parent 3203face6b
commit 032ff0552a
5 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,6 @@
import './add_jquery'
import "jquery/dist/jquery"
import "jquery-ui/dist/jquery-ui"
import "jquery-ujs"
import "@activeadmin/activeadmin"

View File

@ -0,0 +1,4 @@
import jquery from 'jquery'
import $ from 'jquery'
window.jQuery = jquery
window.$ = $

View File

@ -6,3 +6,4 @@ import "@fontsource/raleway/400.css";
import "@fontsource/raleway/600.css";
import "./controllers"
import "./active_admin"

View File

@ -16,6 +16,8 @@
"@hotwired/stimulus": "^3.2.2",
"@hotwired/turbo-rails": "^8.0.12",
"autoprefixer": "^10.4.20",
"jquery": "^3.7.1",
"jquery-ui": "^1.14.1",
"postcss": "^8.5.1",
"sass": "^1.83.4",
"tailwindcss": "^3.4.17"

View File

@ -729,12 +729,19 @@ jquery-ui@^1.13.3:
dependencies:
jquery ">=1.12.0 <5.0.0"
jquery-ui@^1.14.1:
version "1.14.1"
resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.14.1.tgz#ba342ea3ffff662b787595391f607d923313e040"
integrity sha512-DhzsYH8VeIvOaxwi+B/2BCsFFT5EGjShdzOcm5DssWjtcpGWIMsn66rJciDA6jBruzNiLf1q0KvwMoX1uGNvnQ==
dependencies:
jquery ">=1.12.0 <5.0.0"
jquery-ujs@^1.2.2:
version "1.2.3"
resolved "https://registry.npmjs.org/jquery-ujs/-/jquery-ujs-1.2.3.tgz"
integrity sha512-59wvfx5vcCTHMeQT1/OwFiAj+UffLIwjRIoXdpO7Z7BCFGepzq9T9oLVeoItjTqjoXfUrHJvV7QU6pUR+UzOoA==
"jquery@>=1.12.0 <5.0.0", jquery@^3.4.1:
"jquery@>=1.12.0 <5.0.0", jquery@^3.4.1, jquery@^3.7.1:
version "3.7.1"
resolved "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz"
integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==