Part-DB-server/assets
Sebastian Almberg 0bfbbc961d Fix update confirmation dialog not blocking form submission
The previous implementation used inline onsubmit handlers with return
confirmVersionChange(...), which could fail silently if any JavaScript
error occurred on the page, causing the form to submit without confirmation.

Fixes:
- Use event.preventDefault() FIRST to ensure form never submits by default
- Use DOMContentLoaded event listeners instead of inline handlers
- Properly escape translation strings using json_encode filter
- Wrap in IIFE with 'use strict' for better error handling
- Use data-attributes to identify forms and pass isDowngrade state

Fix DOMContentLoaded race condition in update form handlers

The event listener was not attaching if DOMContentLoaded had already
fired by the time the script executed. Now checks document.readyState
and attaches handlers immediately if DOM is already ready.

Added console.log statements to help debug form handler attachment.

Use Stimulus controller for update confirmation dialogs

The inline script was blocked by Content Security Policy (CSP).
Stimulus controllers are bundled with webpack and properly allowed by CSP.

- Create update_confirm_controller.js Stimulus controller
- Remove inline script from template
- Pass translation strings via data-* attributes
2026-01-30 23:24:48 +01:00
..
ckeditor Fixed english translation for placeholder plugin and use more modern translation system 2025-10-17 17:57:34 +02:00
controllers Fix update confirmation dialog not blocking form submission 2026-01-30 23:24:48 +01:00
css Made sidebar toggle button smaller 2025-11-30 14:20:50 +01:00
fonts/dompdf Added GNU unifont as fallback font for labels with CJK characters 2023-07-02 03:26:56 +02:00
js Use requestSubmit() in form cleanup controller to avoid CSFR issues 2026-01-18 22:24:17 +01:00
styles Updated symfony recipes. 2021-01-03 20:54:47 +01:00
themes Use webpack entrypoints for bootstrap and bootswatch themes 2023-02-01 22:58:39 +01:00
tomselect Fixed bug in autoselect_typed plugin 2025-02-16 20:24:13 +01:00
controllers.json Removed the deprecated symfony/ux-toggle-password package by replacing it by our own local versions 2025-08-30 21:57:57 +02:00
stimulus_bootstrap.js Updated stimulus recipe 2025-11-30 15:07:59 +01:00
translator.js Move frontend translations to separate domain to reduce bundle size (#1197) 2026-01-18 18:50:38 +01:00
tsconfig.json Added an basic implementation of bootstrap-treeview in typescript 2022-08-06 03:40:24 +02:00