- Issue created by @ressa
- 🇩🇰Denmark ressa Copenhagen
Include adding the file directly in the module, as a proposed solution.
- Status changed to Needs review
9 months ago 10:38am 1 October 2023 - 🇩🇰Denmark ressa Copenhagen
Since it is just a single file (js.cookie.min.js), the Tagify solution method of checking for a local library file might be overkill, so here's a proof of concept, with the file included in the module.
- 🇩🇰Denmark ressa Copenhagen
Update issue summary, adding inclusion of the file in the module as an option.
- 🇨🇦Canada danrod
Tested this on Drupal 10, I can see that the new library has been added in the module.
- 🇩🇰Denmark ressa Copenhagen
Thanks for confirming @danrod. If you want to check if the JS Cookie module is loaded and works in another module, you can try https://www.drupal.org/project/autologout/ → which requires the JS Cookie module.
- 🇩🇰Denmark ressa Copenhagen
@danrod: I just found out including the file is discouraged, so we probably need to add support for local file, checking if it is available and use the CDN as fallback.
- Status changed to Needs work
9 months ago 10:17am 2 October 2023 - Assigned to ressa
- 🇩🇰Denmark ressa Copenhagen
I just discovered that the module already supports a local file, with the CDN as fallback, so the task now is documenting it.
- Issue was unassigned.
- Status changed to Needs review
9 months ago 10:54am 3 October 2023 - 🇩🇰Denmark ressa Copenhagen
Here's a one-liner, which will download the file and create the needed directories, if they don't exist:
curl --create-dirs -o libraries/js-cookie/dist/js.cookie.min.js https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.min.js
- 🇩🇰Denmark ressa Copenhagen
PS. Use the dev-release of Automated Logout → to check if JS Cookie module is loaded, the current release (8.x-1.4, July 2022) doesn't use it.