From cd4176a9db533321430058b23c808bda0ef0abc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grabowski?= Date: Fri, 18 Oct 2024 15:26:59 +0200 Subject: [PATCH] IBX-9008: Added language helper (#1370) --- .../Resources/public/js/scripts/helpers/config.loader.js | 2 ++ .../Resources/public/js/scripts/helpers/content.helper.js | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 src/bundle/Resources/public/js/scripts/helpers/content.helper.js diff --git a/src/bundle/Resources/public/js/scripts/helpers/config.loader.js b/src/bundle/Resources/public/js/scripts/helpers/config.loader.js index 4e27206779..7fbfb1a3f5 100644 --- a/src/bundle/Resources/public/js/scripts/helpers/config.loader.js +++ b/src/bundle/Resources/public/js/scripts/helpers/config.loader.js @@ -5,6 +5,7 @@ import * as formError from './form.error.helper'; import * as formValidation from './form.validation.helper'; import * as highlight from './highlight.helper'; import * as icon from './icon.helper'; +import * as content from './content.helper'; import * as location from './location.helper'; import * as middleEllipsis from './middle.ellipsis'; import * as notification from './notification.helper'; @@ -27,6 +28,7 @@ import * as user from './user.helper'; ibexa.addConfig('helpers.formValidation', formValidation); ibexa.addConfig('helpers.highlight', highlight); ibexa.addConfig('helpers.icon', icon); + ibexa.addConfig('helpers.content', content); ibexa.addConfig('helpers.location', location); ibexa.addConfig('helpers.ellipsis.middle', middleEllipsis); ibexa.addConfig('helpers.notification', notification); diff --git a/src/bundle/Resources/public/js/scripts/helpers/content.helper.js b/src/bundle/Resources/public/js/scripts/helpers/content.helper.js new file mode 100644 index 0000000000..9ce4f88c05 --- /dev/null +++ b/src/bundle/Resources/public/js/scripts/helpers/content.helper.js @@ -0,0 +1,5 @@ +const getEditLanguageCode = () => { + return window.document.querySelector('meta[name="LanguageCode"]')?.content; +}; + +export { getEditLanguageCode };