diff --git a/CHANGELOG.md b/CHANGELOG.md index c0e8f96..53fbbf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [UNRELEASED] - Fix Composer autoloader collisions with other plugins +- Make the plugin compatible with the Content Security Policy ## [3.0.3] - 2026-08-11 diff --git a/setup.php b/setup.php index c460bbb..2672b22 100644 --- a/setup.php +++ b/setup.php @@ -134,6 +134,7 @@ function plugin_version_genericobject() 'author' => "Teclib' & siprossii", 'homepage' => 'https://github.com/pluginsGLPI/genericobject', 'license' => 'GPLv2+', + 'csp_compliant' => true, 'requirements' => [ 'glpi' => [ 'min' => PLUGIN_GENERICOBJECT_MIN_GLPI, diff --git a/templates/migration_status.html.twig b/templates/migration_status.html.twig index bee5cf3..01d1d4a 100644 --- a/templates/migration_status.html.twig +++ b/templates/migration_status.html.twig @@ -256,7 +256,7 @@ data-counter-target="{{ modal_id }}-counter" data-warning-target="{{ modal_id }}-length-warning" data-result-target="{{ modal_id }}-result" - oninput="glpiGenericobjectUpdateCounter(this)" + data-genericobject-update-counter required >
@@ -331,7 +331,7 @@
php bin/console migration:genericobject_plugin_to_core - @@ -505,4 +505,16 @@ copyBtn.classList.add('btn-outline-secondary'); }, 2000); } + + document.addEventListener('input', (e) => { + if (e.target.matches('[data-genericobject-update-counter]')) { + glpiGenericobjectUpdateCounter(e.target); + } + }); + + document.addEventListener('click', (e) => { + if (e.target.closest('[data-genericobject-copy-code]') !== null) { + copyCode(); + } + });