From 7024473acd1a04cb977b8a68bb8a1fc270fadb0b Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Thu, 24 Mar 2022 17:06:41 +0100 Subject: [PATCH] Fix linting --- site/source/iframe-integration-script.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/site/source/iframe-integration-script.js b/site/source/iframe-integration-script.js index 8d540c3ec..8c8d9fb0d 100644 --- a/site/source/iframe-integration-script.js +++ b/site/source/iframe-integration-script.js @@ -1,29 +1,33 @@ import { hexToHSL } from './hexToHSL' -const script = document.currentScript; -const moduleName = script.dataset.module || 'simulateur-embauche'; +const script = document.currentScript +const moduleName = script.dataset.module || 'simulateur-embauche' const couleur = script.dataset.couleur && encodeURIComponent( JSON.stringify(hexToHSL(script.dataset.couleur.toUpperCase())) - ); - -const lang = script.dataset.lang || 'fr'; + ) +const lang = script.dataset.lang || 'fr' const src = new URL( - (lang === 'fr' ? import.meta.env.VITE_FR_BASE_URL : import.meta.env.VITE_EN_BASE_URL) + - '/iframes/' + - moduleName) + (lang === 'fr' + ? import.meta.env.VITE_FR_BASE_URL + : import.meta.env.VITE_EN_BASE_URL) + + '/iframes/' + + moduleName +) src.searchParams.set('iframe', true) -src.searchParams.set('integratorUrl', encodeURIComponent(window.location.href.toString())) +src.searchParams.set( + 'integratorUrl', + encodeURIComponent(window.location.href.toString()) +) src.searchParams.set('lang', lang) if (couleur) { src.searchParams.set('couleur', couleur) } - const iframe = document.createElement('iframe') const iframeAttributes = { id: 'simulateurEmbauche',