Remove jQuery dependency, convert to vanilla JavaScript
This commit is contained in:
parent
4bc0c67e3a
commit
42241d79b7
6 changed files with 59 additions and 70 deletions
|
|
@ -8,17 +8,12 @@ This project minimizes JavaScript usage, preferring pure CSS solutions where pos
|
|||
- Use `<details>` elements for toggles instead of JS
|
||||
- External SDKs loaded only when payment method is enabled
|
||||
- No build step - vanilla JS only
|
||||
- jQuery used minimally (legacy, being phased out)
|
||||
- No jQuery - all vanilla JavaScript
|
||||
|
||||
## Static JavaScript Files
|
||||
|
||||
Located in `make_post_sell/static/js/`:
|
||||
|
||||
### jquery-3.6.0.min.js
|
||||
- jQuery library (legacy dependency)
|
||||
- Used by: Stripe card form, markdown preview
|
||||
- Loaded via `snippets/optional-javascript.j2` and `snippets/stripe.j2`
|
||||
|
||||
### qrcode.min.js
|
||||
- QRious library for QR code generation
|
||||
- Used by: Crypto checkout page
|
||||
|
|
@ -27,7 +22,7 @@ Located in `make_post_sell/static/js/`:
|
|||
### custom.js
|
||||
- Markdown preview functionality
|
||||
- Functions: `previewAjax()`, `sendPreview()`
|
||||
- Uses jQuery for AJAX calls to `/markup-editor-preview`
|
||||
- Uses fetch API for AJAX calls to `/markup-editor-preview`
|
||||
|
||||
## Inline JavaScript by Template
|
||||
|
||||
|
|
@ -43,7 +38,7 @@ Located in `make_post_sell/static/js/`:
|
|||
|
||||
- Crypto wallets toggle (checkbox + localStorage)
|
||||
- Theme preview for shop default theme radio buttons
|
||||
- Note: Payment provider toggles now use pure CSS `<details>` elements
|
||||
- Note: Payment provider toggles use pure CSS `<details>` elements
|
||||
|
||||
### user_settings.j2
|
||||
**Purpose:** User theme preference sync
|
||||
|
|
@ -80,7 +75,7 @@ Located in `make_post_sell/static/js/`:
|
|||
- Loads Stripe.js SDK
|
||||
- Creates Payment Element for card input
|
||||
- Handles `stripe.confirmSetup()` flow
|
||||
- Requires jQuery
|
||||
- Uses vanilla JS with `DOMContentLoaded`
|
||||
|
||||
### snippets/analytics.j2
|
||||
**Purpose:** Analytics tracking (optional)
|
||||
|
|
@ -92,7 +87,7 @@ Located in `make_post_sell/static/js/`:
|
|||
### snippets/optional-javascript.j2
|
||||
**Purpose:** Optional JS loading
|
||||
|
||||
- Loads jQuery and custom.js async
|
||||
- Loads custom.js async
|
||||
- Used for markdown preview functionality
|
||||
|
||||
## External SDKs
|
||||
|
|
@ -119,6 +114,5 @@ Pages work without JavaScript where possible:
|
|||
|
||||
## Future Improvements
|
||||
|
||||
- Remove jQuery dependency (replace with vanilla JS)
|
||||
- Convert remaining checkbox toggles to `<details>` elements
|
||||
- Consider removing Google Analytics option (privacy)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue