diff --git a/.eslintrc.json b/.eslintrc.json index 1446ca1..5127e88 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,7 +4,7 @@ "es2020": true }, "globals": { - "SETTINGS": "readonly" + "MOBILIZON_CONNECTOR": "readonly" }, "parser": "@babel/eslint-parser", "extends": [ diff --git a/source/connector-mobilizon.php b/source/connector-mobilizon.php index 0c1affa..942be80 100644 --- a/source/connector-mobilizon.php +++ b/source/connector-mobilizon.php @@ -51,7 +51,7 @@ final class Mobilizon_Connector { 'timeZone' => wp_timezone_string(), 'url' => MobilizonConnector\Settings::getUrl() ); - wp_add_inline_script($scriptName, 'const SETTINGS = ' . json_encode($settings), 'before'); // TODO use different name + wp_add_inline_script($scriptName, 'const MOBILIZON_CONNECTOR = ' . json_encode($settings), 'before'); } public function register_blocks() { diff --git a/source/front/events-displayer-test.js b/source/front/events-displayer-test.js index 331a801..2babb68 100644 --- a/source/front/events-displayer-test.js +++ b/source/front/events-displayer-test.js @@ -8,7 +8,7 @@ let document test.before(() => { const window = new JSDOM().window document = window.document - window.SETTINGS = { + window.MOBILIZON_CONNECTOR = { locale: 'en-GB', timeZone: 'utc', } diff --git a/source/front/events-displayer.js b/source/front/events-displayer.js index 7ece706..9527560 100644 --- a/source/front/events-displayer.js +++ b/source/front/events-displayer.js @@ -9,10 +9,10 @@ export function clearEventsList(container) { export function displayEvents({ data, document, container }) { hideLoadingIndicator(container) - const isShortOffsetNameShown = SETTINGS.isShortOffsetNameShown - const locale = SETTINGS.locale + const isShortOffsetNameShown = MOBILIZON_CONNECTOR.isShortOffsetNameShown + const locale = MOBILIZON_CONNECTOR.locale const maxEventsCount = container.getAttribute('data-maximum') - const timeZone = SETTINGS.timeZone + const timeZone = MOBILIZON_CONNECTOR.timeZone const events = data.events ? data.events.elements diff --git a/source/front/events-loader.js b/source/front/events-loader.js index dc2311c..0d0f29d 100644 --- a/source/front/events-loader.js +++ b/source/front/events-loader.js @@ -19,7 +19,7 @@ function loadEventLists() { } export function loadEventList(container) { - const url = SETTINGS.url + URL_SUFFIX + const url = MOBILIZON_CONNECTOR.url + URL_SUFFIX const limit = parseInt(container.getAttribute('data-maximum')) const groupName = container.getAttribute('data-group-name') clearEventsList(container)