Renamed and updated the js_lang_script and js_vars_script components

This commit is contained in:
Alex Tselegidis 2021-12-17 10:55:10 +01:00
parent 16cea9e6a9
commit 74c48e8a9a
6 changed files with 12 additions and 13 deletions

View file

@ -4,6 +4,6 @@
*/
?>
<script <?= $attributes ?>>
window.App.Config = <?= json_encode(js_config()) ?>
window.App.Vars = <?= json_encode(script_vars()) ?>
</script>

View file

@ -54,8 +54,8 @@
<script src="<?= asset_url('assets/js/layouts/account_layout.js') ?>"></script>
<script src="<?= asset_url('assets/js/utils/general_functions.js') ?>"></script>
<?php component('js_config_script') ?>
<?php component('js_language_script') ?>
<?php component('js_vars_script') ?>
<?php component('js_lang_script') ?>
<script>
const GlobalVariables = {

View file

@ -58,8 +58,8 @@
<script src="<?= asset_url('assets/js/layouts/backend_layout.js') ?>"></script>
<script src="<?= asset_url('assets/js/utils/general_functions.js') ?>"></script>
<?php component('js_config_script') ?>
<?php component('js_language_script') ?>
<?php component('js_vars_script') ?>
<?php component('js_lang_script') ?>
<?php slot('scripts') ?>

View file

@ -69,10 +69,11 @@
<script>
const GlobalVariables = {
availableServices: <?= json_encode($available_services) ?>,
availableProviders: <?= json_encode($available_providers) ?>,
csrfToken: <?= json_encode($this->security->get_csrf_hash()) ?>,
baseUrl: <?= json_encode(config('base_url')) ?>,
manageMode: <?= $manage_mode ? 'true' : 'false' ?>,
availableServices: <?= json_encode($available_services) ?>,
availableProviders: <?= json_encode($available_providers) ?>,
customerToken: <?= json_encode($customer_token) ?>,
dateFormat: <?= json_encode($date_format) ?>,
timeFormat: <?= json_encode($time_format) ?>,
@ -81,8 +82,6 @@
appointmentData: <?= json_encode($appointment_data) ?>,
providerData: <?= json_encode($provider_data) ?>,
customerData: <?= json_encode($customer_data) ?>,
displayAnyProvider: <?= json_encode($display_any_provider) ?>,
csrfToken: <?= json_encode($this->security->get_csrf_hash()) ?>
};
const availableLanguages = <?= json_encode(config('available_languages')) ?>;
@ -103,8 +102,8 @@
<script src="<?= asset_url('assets/js/layouts/booking_layout.js') ?>"></script>
<script src="<?= asset_url('assets/js/utils/general_functions.js') ?>"></script>
<?php component('js_config_script') ?>
<?php component('js_language_script') ?>
<?php component('js_vars_script') ?>
<?php component('js_lang_script') ?>
<script>
$(function () {

View file

@ -59,8 +59,8 @@
<script src="<?= asset_url('assets/js/layouts/message_layout.js') ?>"></script>
<script src="<?= asset_url('assets/js/utils/general_functions.js') ?>"></script>
<?php component('js_config_script') ?>
<?php component('js_language_script') ?>
<?php component('js_vars_script') ?>
<?php component('js_lang_script') ?>
<?php google_analytics_script() ?>