From 7c082689ea2492d6d1529095d49efab7fb43aecd Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 28 Oct 2021 13:30:39 +0200 Subject: [PATCH] More formatting changes --- assets/css/backend.css | 8 ++++---- assets/js/backend_calendar_appointments_modal.js | 4 ++-- assets/js/backend_calendar_default_view.js | 2 +- assets/js/backend_settings.js | 12 ++++++------ assets/js/backend_settings_system.js | 8 ++++---- assets/js/frontend_book_api.js | 8 ++++---- assets/js/login.js | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/assets/css/backend.css b/assets/css/backend.css index a18d8f6c..a262853e 100644 --- a/assets/css/backend.css +++ b/assets/css/backend.css @@ -284,16 +284,16 @@ body legend { width: auto; } -.form-sub-button img{ +.form-sub-button img { margin-top: -.25rem; } -.hidden{ +.hidden { visibility: hidden; height: 0; } -.hide-toggle div{ +.hide-toggle div { display: flex; } @@ -444,7 +444,7 @@ body legend { #calendar .fc-event { border: 1px solid #4790CA; background-color: #4790CA; - min-height: 12px; + min-height: 12px; } #existing-customers-list { diff --git a/assets/js/backend_calendar_appointments_modal.js b/assets/js/backend_calendar_appointments_modal.js index 9e47fabe..8458a363 100755 --- a/assets/js/backend_calendar_appointments_modal.js +++ b/assets/js/backend_calendar_appointments_modal.js @@ -235,7 +235,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa var key = $(this).val().toLowerCase(); - filterExistingCustomersTimeout = setTimeout(function() { + filterExistingCustomersTimeout = setTimeout(function () { var $list = $('#existing-customers-list'); var url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_customers'; @@ -291,7 +291,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa } }); }) - .always(function() { + .always(function () { $('#loading').css('visibility', ''); }); }, 1000); diff --git a/assets/js/backend_calendar_default_view.js b/assets/js/backend_calendar_default_view.js index c598a726..57c0f432 100755 --- a/assets/js/backend_calendar_default_view.js +++ b/assets/js/backend_calendar_default_view.js @@ -1413,7 +1413,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; height: getCalendarHeight(), editable: true, firstDay: firstWeekdayNumber, - slotDuration: '00:15:00', + slotDuration: '00:15:00', snapDuration: '00:15:00', slotLabelInterval: '01:00', timeFormat: timeFormat, diff --git a/assets/js/backend_settings.js b/assets/js/backend_settings.js index 2e6092db..122195c7 100644 --- a/assets/js/backend_settings.js +++ b/assets/js/backend_settings.js @@ -224,8 +224,8 @@ window.BackendSettings = window.BackendSettings || {}; * @argument isVisible a boolean which is true if the button should display 'visible' and false when the button should display 'hidden' * */ - function setShowToggleValue($element, isVisible){ - if (getShowToggleValue($element) !== isVisible){ + function setShowToggleValue($element, isVisible) { + if (getShowToggleValue($element) !== isVisible) { $element.find("div").toggleClass("hidden"); } } @@ -237,7 +237,7 @@ window.BackendSettings = window.BackendSettings || {}; * * @return the state of the button. True for visible, false for hidden. */ - function getShowToggleValue($element){ + function getShowToggleValue($element) { var visiblePartArray = $element.find(".hide-toggle-visible"); return !visiblePartArray.hasClass("hidden"); } @@ -248,7 +248,7 @@ window.BackendSettings = window.BackendSettings || {}; * make sure that our phone number is visible when it is required. */ $('#show-phone-number').on('click', function () { - if (!getShowToggleValue($(this))){//if button is set to hidden + if (!getShowToggleValue($(this))) {//if button is set to hidden $('#require-phone-number').prop('checked', false); } }); @@ -259,7 +259,7 @@ window.BackendSettings = window.BackendSettings || {}; * make sure that our phone number is visible when it is required. */ $('#require-phone-number').on('click', function () { - if ($(this).prop('checked')){ + if ($(this).prop('checked')) { setShowToggleValue($('#show-phone-number'), true); } }); @@ -287,7 +287,7 @@ window.BackendSettings = window.BackendSettings || {}; $.post(url, data) .done(function (response) { - if (response === 'false') { + if (response.is_valid === 'false') { $input.closest('.form-group').addClass('has-error'); Backend.displayNotification(EALang.username_already_exists); $input.attr('already-exists', 'true'); diff --git a/assets/js/backend_settings_system.js b/assets/js/backend_settings_system.js index 7dd6e791..2ae08e79 100644 --- a/assets/js/backend_settings_system.js +++ b/assets/js/backend_settings_system.js @@ -32,7 +32,7 @@ if (!this.validate()) { return; // Validation failed, do not proceed. } - + var url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_settings'; var data = { @@ -80,12 +80,12 @@ var visiblePartArray = $element.find(".hide-toggle-visible"); var invisiblePartArray = $element.find(".hide-toggle-hidden"); if (!(visiblePartArray.length === 0 || invisiblePartArray.length === 0)) { - if (visiblePartArray.hasClass("hidden")){//our button is currently invisible + if (visiblePartArray.hasClass("hidden")) {//our button is currently invisible return '0';//invisible - }else{//our button is currently visible + } else {//our button is currently visible return '1';//visible } - }else{ + } else { return '0';//invisible } } diff --git a/assets/js/frontend_book_api.js b/assets/js/frontend_book_api.js index f544011b..73b12dd3 100755 --- a/assets/js/frontend_book_api.js +++ b/assets/js/frontend_book_api.js @@ -69,14 +69,14 @@ window.FrontendBookApi = window.FrontendBookApi || {}; $.post(url, data) .done(function (response) { - // The response contains the available hours for the selected provider and - // service. Fill the available hours div with response data. + // The response contains the available hours for the selected provider and service. Fill the available + // hours div with response data. if (response.length > 0) { var providerId = $('#select-provider').val(); if (providerId === 'any-provider') { for (var availableProvider of GlobalVariables.availableProviders) { - if (availableProvider.services.indexOf(serviceId) !== -1) { + if (availableProvider.services.indexOf(Number(serviceId)) !== -1) { providerId = availableProvider.id; // Use first available provider. break; } @@ -99,7 +99,7 @@ window.FrontendBookApi = window.FrontendBookApi || {}; var availableHourMoment = moment .tz(selectedDate + ' ' + availableHour + ':00', providerTimezone) .tz(selectedTimezone); - + if (availableHourMoment.format('YYYY-MM-DD') !== selectedDate) { return; // Due to the selected timezone the available hour belongs to another date. } diff --git a/assets/js/login.js b/assets/js/login.js index 46a19c24..f3b81b10 100644 --- a/assets/js/login.js +++ b/assets/js/login.js @@ -8,7 +8,7 @@ * @link http://easyappointments.org * @since v1.4.0 * ---------------------------------------------------------------------------- */ - + $(function () { 'use strict';