From c29ff07293ba84e8b986c1f9f9c3d9a94b367f97 Mon Sep 17 00:00:00 2001 From: Thijs Kinkhorst Date: Thu, 26 Sep 2024 11:35:39 +0200 Subject: [PATCH] Remove external dependency on JQuery, rather install it locally. Loading JQuery remotely not only creates an undesirable external dependency, it also does not work with the default CSP so a new install is broken unless you change this config. Better to just let it work locally. --- composer.json | 3 ++- public/assets/components/jquery-ui.min.css | 1 + public/assets/components/jquery-ui.min.js | 1 + public/assets/components/jquery.min.js | 1 + public/assets/components/jquery.min.map | 1 + templates/disco.twig | 6 +++--- 6 files changed, 9 insertions(+), 4 deletions(-) create mode 120000 public/assets/components/jquery-ui.min.css create mode 120000 public/assets/components/jquery-ui.min.js create mode 120000 public/assets/components/jquery.min.js create mode 120000 public/assets/components/jquery.min.map diff --git a/composer.json b/composer.json index c7e11af..0f85cf0 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,8 @@ "simplesamlphp/simplesamlphp": "^2.2.0", "simplesamlphp/composer-module-installer": "^1.3.4", "symfony/http-foundation": "^6.4.0", - "components/jquery": "^3.7" + "components/jquery": "^3.7", + "components/jqueryui": "^1.12" }, "require-dev": { "simplesamlphp/simplesamlphp-test-framework": "^1.7.0" diff --git a/public/assets/components/jquery-ui.min.css b/public/assets/components/jquery-ui.min.css new file mode 120000 index 0000000..d53e00d --- /dev/null +++ b/public/assets/components/jquery-ui.min.css @@ -0,0 +1 @@ +../../../../../vendor/components/jqueryui/themes/base/jquery-ui.min.css \ No newline at end of file diff --git a/public/assets/components/jquery-ui.min.js b/public/assets/components/jquery-ui.min.js new file mode 120000 index 0000000..88f0deb --- /dev/null +++ b/public/assets/components/jquery-ui.min.js @@ -0,0 +1 @@ +../../../../../vendor/components/jqueryui/jquery-ui.min.js \ No newline at end of file diff --git a/public/assets/components/jquery.min.js b/public/assets/components/jquery.min.js new file mode 120000 index 0000000..5822c49 --- /dev/null +++ b/public/assets/components/jquery.min.js @@ -0,0 +1 @@ +../../../../../vendor/components/jquery/jquery.min.js \ No newline at end of file diff --git a/public/assets/components/jquery.min.map b/public/assets/components/jquery.min.map new file mode 120000 index 0000000..189eda1 --- /dev/null +++ b/public/assets/components/jquery.min.map @@ -0,0 +1 @@ +../../../../../vendor/components/jquery/jquery.min.map \ No newline at end of file diff --git a/templates/disco.twig b/templates/disco.twig index 8f4f8e5..c11f100 100644 --- a/templates/disco.twig +++ b/templates/disco.twig @@ -2,12 +2,12 @@ {% extends "base.twig" %} {% block preload %} - + {% endblock %} {% block postload %} - - + +