From 32b605254698b63fcae91213ff5f9722d5e014c9 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 14 Jan 2022 09:26:44 +0100 Subject: [PATCH] Update the js doc content of the javascript files. --- assets/js/app.js | 5 ++ assets/js/components/appointments_modal.js | 15 +++- .../js/components/unavailabilities_modal.js | 10 ++- .../working_plan_exceptions_modal.js | 81 +++++++++++++++++++ assets/js/http/account_http_client.js | 5 ++ assets/js/http/admins_http_client.js | 5 ++ assets/js/http/appointments_http_client.js | 17 ++++ assets/js/http/booking_http_client.js | 4 +- .../js/http/booking_settings_http_client.js | 5 ++ .../js/http/business_settings_http_client.js | 5 ++ assets/js/http/calendar_http_client.js | 6 +- assets/js/http/categories_http_client.js | 5 ++ assets/js/http/customers_http_client.js | 5 ++ .../js/http/general_settings_http_client.js | 5 ++ assets/js/http/legal_settings_http_client.js | 5 ++ assets/js/http/providers_http_client.js | 5 ++ assets/js/http/secretaries_http_client.js | 5 ++ assets/js/http/services_http_client.js | 5 ++ assets/js/http/settings_http_client.js | 17 ++++ .../js/http/unavailabilities_http_client.js | 17 ++++ assets/js/layouts/account_layout.js | 5 ++ assets/js/layouts/backend_layout.js | 5 ++ assets/js/layouts/booking_layout.js | 5 ++ assets/js/layouts/message_layout.js | 5 ++ assets/js/pages/account.js | 4 +- assets/js/pages/admins.js | 9 ++- assets/js/pages/booking.js | 9 +-- assets/js/pages/booking_confirmation.js | 11 +++ assets/js/pages/booking_settings.js | 6 +- assets/js/pages/business_settings.js | 7 +- assets/js/pages/calendar.js | 13 +-- assets/js/pages/categories.js | 10 ++- assets/js/pages/customers.js | 9 ++- assets/js/pages/general_settings.js | 7 +- assets/js/pages/installation.js | 5 ++ assets/js/pages/legal_settings.js | 7 +- assets/js/pages/login.js | 9 ++- assets/js/pages/providers.js | 12 ++- assets/js/pages/recovery.js | 9 ++- assets/js/pages/secretaries.js | 9 ++- assets/js/pages/services.js | 11 +++ assets/js/utils/calendar_default_view.js | 6 +- assets/js/utils/calendar_event_popover.js | 5 ++ assets/js/utils/calendar_google_sync.js | 6 +- assets/js/utils/calendar_table_view.js | 6 +- assets/js/utils/date.js | 5 ++ assets/js/utils/http.js | 5 ++ assets/js/utils/message.js | 5 ++ assets/js/utils/string.js | 12 +++ assets/js/utils/url.js | 5 ++ assets/js/utils/validation.js | 5 ++ assets/js/utils/working_plan.js | 7 +- 52 files changed, 407 insertions(+), 54 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 2e6bf3dc..793cec62 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * App global namespace object. + * + * This script should be loaded before the other modules in order to define the global application namespace. + */ window.App = (function () { return { Components: {}, diff --git a/assets/js/components/appointments_modal.js b/assets/js/components/appointments_modal.js index 81a22978..80bf0472 100755 --- a/assets/js/components/appointments_modal.js +++ b/assets/js/components/appointments_modal.js @@ -10,13 +10,16 @@ * ---------------------------------------------------------------------------- */ /** - * Backend Calendar Appointments Modal + * Appointments modal component. * * This module implements the appointments modal functionality. * * Old Name: BackendCalendarAppointmentsModal */ App.Components.AppointmentsModal = (function () { + /** + * Update the displayed timezone. + */ function updateTimezone() { const providerId = $('#select-provider').val(); @@ -29,6 +32,9 @@ App.Components.AppointmentsModal = (function () { } } + /** + * Bind the event handlers. + */ function bindEventHandlers() { /** * Event: Manage Appointments Dialog Save Button "Click" @@ -213,6 +219,8 @@ App.Components.AppointmentsModal = (function () { /** * Event: Select Existing Customer From List "Click" + * + * @param {jQuery.Event} */ $('#appointments-modal').on('click', '#existing-customers-list div', (event) => { const customerId = $(event.target).attr('data-id'); @@ -240,6 +248,8 @@ App.Components.AppointmentsModal = (function () { /** * Event: Filter Existing Customers "Change" + * + * @param {jQuery.Event} */ $('#filter-existing-customers').on('keyup', (event) => { if (filterExistingCustomersTimeout) { @@ -616,6 +626,9 @@ App.Components.AppointmentsModal = (function () { } } + /** + * Initialize the module. + */ function initialize() { bindEventHandlers(); } diff --git a/assets/js/components/unavailabilities_modal.js b/assets/js/components/unavailabilities_modal.js index 4157cff2..80fc0412 100755 --- a/assets/js/components/unavailabilities_modal.js +++ b/assets/js/components/unavailabilities_modal.js @@ -10,13 +10,16 @@ * ---------------------------------------------------------------------------- */ /** - * Unavailabilities Modal + * Unavailabilities modal component. * - * This module implements the unavailability events modal functionality. + * This module implements the unavailabilities modal functionality. * * Old Name: BackendCalendarUnavailabilityEventsModal */ App.Components.UnavailabilitiesModal = (function () { + /** + * Bind the event handlers. + */ function bindEventHandlers() { /** * Event: Manage Unavailable Dialog Save Button "Click" @@ -292,6 +295,9 @@ App.Components.UnavailabilitiesModal = (function () { $dialog.find('#unavailable-notes').val(''); } + /** + * Initialize the module. + */ function initialize() { const $unavailabilityProvider = $('#unavailable-provider'); diff --git a/assets/js/components/working_plan_exceptions_modal.js b/assets/js/components/working_plan_exceptions_modal.js index 7f6a704e..a9cd3c6f 100644 --- a/assets/js/components/working_plan_exceptions_modal.js +++ b/assets/js/components/working_plan_exceptions_modal.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Working plan exceptions modal component. + * + * This module implements the working plan exceptions modal functionality. + */ App.Components.WorkingPlanExceptionsModal = (function () { const $modal = $('#working-plan-exceptions-modal'); const $date = $('#working-plan-exceptions-date'); @@ -20,6 +25,9 @@ App.Components.WorkingPlanExceptionsModal = (function () { let enableSubmit = false; let enableCancel = false; + /** + * Reset the modal fields back to the original empty state. + */ function resetModal() { $date.val(''); $start.val(''); @@ -27,6 +35,11 @@ App.Components.WorkingPlanExceptionsModal = (function () { $breaks.find('tbody').empty(); } + /** + * Validate the modal form fields and return false if the validation fails. + * + * @returns {Boolean} + */ function validate() { $modal.find('.is-invalid').removeClass('is-invalid'); @@ -51,10 +64,20 @@ App.Components.WorkingPlanExceptionsModal = (function () { return !$modal.find('.is-invalid').length; } + /** + * Event: On Modal "Hidden" + * + * This event is used to automatically reset the modal back to the original state. + */ function onModalHidden() { resetModal(); } + /** + * Serialize the entered break entries. + * + * @returns {Array} + */ function getBreaks() { const breaks = []; @@ -83,6 +106,11 @@ App.Components.WorkingPlanExceptionsModal = (function () { return breaks; } + /** + * Event: On Save "Click" + * + * Serialize the entire working plan exception and resolved the promise so that external code can save it. + */ function onSaveClick() { if (!deferred) { return; @@ -106,6 +134,11 @@ App.Components.WorkingPlanExceptionsModal = (function () { resetModal(); } + /** + * Enable the inline-editable table cell functionality for the provided target element.. + * + * @param {jQuery} $target + */ function editableTimeCell($target) { $target.editable( function (value) { @@ -140,6 +173,11 @@ App.Components.WorkingPlanExceptionsModal = (function () { ); } + /** + * Open the modal and start adding a new working plan exception. + * + * @returns {jQuery.Deferred} + */ function add() { deferred = $.Deferred(); @@ -152,6 +190,14 @@ App.Components.WorkingPlanExceptionsModal = (function () { return deferred.promise(); } + /** + * Modify the provided working plan exception for the selected date. + * + * @param {String} date + * @param {Object} workingPlanException + * + * @return {jQuery.Deferred} + */ function edit(date, workingPlanException) { deferred = $.Deferred(); @@ -172,6 +218,13 @@ App.Components.WorkingPlanExceptionsModal = (function () { return deferred.promise(); } + /** + * Render a break table row based on the provided break period object. + * + * @param {Object} breakPeriod + * + * @return {jQuery} + */ function renderBreakRow(breakPeriod) { const timeFormat = App.Vars.time_format === 'regular' ? 'h:mm a' : 'HH:mm'; @@ -233,6 +286,9 @@ App.Components.WorkingPlanExceptionsModal = (function () { }); } + /** + * Event: Add Break "Click" + */ function onAddBreakClick() { const $newBreak = renderBreakRow({ start: '12:00', @@ -245,6 +301,9 @@ App.Components.WorkingPlanExceptionsModal = (function () { $('.working-plan-exceptions-add-break').prop('disabled', true); } + /** + * Event: Edit Break "Click" + */ function onEditBreakClick() { // Reset previous editable table cells. const $previousEdits = $(this).closest('table').find('.editable'); @@ -272,10 +331,16 @@ App.Components.WorkingPlanExceptionsModal = (function () { $('.working-plan-exceptions-add-break').prop('disabled', true); } + /** + * Event: Delete Break "Click" + */ function onDeleteBreakClick() { $(this).closest('tr').remove(); } + /** + * Event: Save Break "Click" + */ function onSaveBreakClick() { // Break's start time must always be prior to break's end. const $tr = $(this).closest('tr'); @@ -305,6 +370,9 @@ App.Components.WorkingPlanExceptionsModal = (function () { $('.working-plan-exceptions-add-break').prop('disabled', false); } + /** + * Event: Cancel Break "Click" + */ function onCancelBreakClick() { const $tr = $(this).closest('tr'); enableCancel = true; @@ -318,6 +386,11 @@ App.Components.WorkingPlanExceptionsModal = (function () { $('.working-plan-exceptions-add-break').prop('disabled', false); } + /** + * Initialize a datepicker instance on the provided target selector. + * + * @param {jQuery} $target + */ function initializeDatepicker($target) { let dateFormat; @@ -391,6 +464,11 @@ App.Components.WorkingPlanExceptionsModal = (function () { }); } + /** + * Initialize a timepicker on the provided target selector. + * + * @param {jQuery} $target + */ function initializeTimepicker($target) { $target.timepicker({ timeFormat: App.Vars.time_format === 'regular' ? 'h:mm tt' : 'HH:mm', @@ -403,6 +481,9 @@ App.Components.WorkingPlanExceptionsModal = (function () { }); } + /** + * Initialize the module. + */ function initialize() { initializeDatepicker($date); initializeTimepicker($start); diff --git a/assets/js/http/account_http_client.js b/assets/js/http/account_http_client.js index bb7f65ff..33e357ab 100644 --- a/assets/js/http/account_http_client.js +++ b/assets/js/http/account_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Account HTTP client. + * + * This module implements the account related HTTP requests. + */ App.Http.Account = (function () { /** * Save account. diff --git a/assets/js/http/admins_http_client.js b/assets/js/http/admins_http_client.js index 2455f90a..6b7b74e2 100644 --- a/assets/js/http/admins_http_client.js +++ b/assets/js/http/admins_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Admins HTTP client. + * + * This module implements the admins related HTTP requests. + */ App.Http.Admins = (function () { /** * Save (create or update) a admin. diff --git a/assets/js/http/appointments_http_client.js b/assets/js/http/appointments_http_client.js index 3c58fd4d..9ee44c1d 100644 --- a/assets/js/http/appointments_http_client.js +++ b/assets/js/http/appointments_http_client.js @@ -9,7 +9,23 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Appointments HTTP client. + * + * This module implements the appointments related HTTP requests. + */ App.Http.Appointments = (function () { + /** + * Save (create or update) an appointment. + * + * @param {Object} appointment + * + * @return {Object} + */ + function save(appointment) { + return appointment.id ? update(appointment) : create(appointment); + } + /** * Create an appointment. * @@ -107,6 +123,7 @@ App.Http.Appointments = (function () { } return { + save, create, update, destroy, diff --git a/assets/js/http/booking_http_client.js b/assets/js/http/booking_http_client.js index 1c5bdc15..6e4b1c3c 100755 --- a/assets/js/http/booking_http_client.js +++ b/assets/js/http/booking_http_client.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Booking HTTP Client + * Booking HTTP client. * - * This module serves as the API consumer for the booking wizard of the app. + * This module implements the booking related HTTP requests. * * Old Name: FrontendBookApi */ diff --git a/assets/js/http/booking_settings_http_client.js b/assets/js/http/booking_settings_http_client.js index a5dddfc5..c06550c9 100644 --- a/assets/js/http/booking_settings_http_client.js +++ b/assets/js/http/booking_settings_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Booking Settings HTTP client. + * + * This module implements the booking settings related HTTP requests. + */ App.Http.BookingSettings = (function () { /** * Save booking settings. diff --git a/assets/js/http/business_settings_http_client.js b/assets/js/http/business_settings_http_client.js index 7513504e..3a3d8974 100644 --- a/assets/js/http/business_settings_http_client.js +++ b/assets/js/http/business_settings_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Business Settings HTTP client. + * + * This module implements the business settings related HTTP requests. + */ App.Http.BusinessSettings = (function () { /** * Save business settings. diff --git a/assets/js/http/calendar_http_client.js b/assets/js/http/calendar_http_client.js index fac779f8..7e5a394f 100755 --- a/assets/js/http/calendar_http_client.js +++ b/assets/js/http/calendar_http_client.js @@ -10,9 +10,11 @@ * ---------------------------------------------------------------------------- */ /** - * Calendar HTTP Client + * Calendar HTTP client. * - * Old Module Name: BackendCalendarApi + * This module implements the calendar related HTTP requests. + * + * Old Name: BackendCalendarApi */ App.Http.Calendar = (function () { /** diff --git a/assets/js/http/categories_http_client.js b/assets/js/http/categories_http_client.js index b0878e2d..6e64490a 100644 --- a/assets/js/http/categories_http_client.js +++ b/assets/js/http/categories_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Categories HTTP client. + * + * This module implements the categories related HTTP requests. + */ App.Http.Categories = (function () { /** * Save (create or update) a category. diff --git a/assets/js/http/customers_http_client.js b/assets/js/http/customers_http_client.js index 268ec70e..10602826 100644 --- a/assets/js/http/customers_http_client.js +++ b/assets/js/http/customers_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Customers HTTP client. + * + * This module implements the customers related HTTP requests. + */ App.Http.Customers = (function () { /** * Save (create or update) a customer. diff --git a/assets/js/http/general_settings_http_client.js b/assets/js/http/general_settings_http_client.js index aa08ae11..f96d5ab3 100644 --- a/assets/js/http/general_settings_http_client.js +++ b/assets/js/http/general_settings_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * General Settings HTTP client. + * + * This module implements the general settings related HTTP requests. + */ App.Http.GeneralSettings = (function () { /** * Save general settings. diff --git a/assets/js/http/legal_settings_http_client.js b/assets/js/http/legal_settings_http_client.js index 8fc8ec70..24cd62bb 100644 --- a/assets/js/http/legal_settings_http_client.js +++ b/assets/js/http/legal_settings_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Legal Settings HTTP client. + * + * This module implements the legal settings related HTTP requests. + */ App.Http.LegalSettings = (function () { /** * Save legal settings. diff --git a/assets/js/http/providers_http_client.js b/assets/js/http/providers_http_client.js index 369d4f0e..85ad03a7 100644 --- a/assets/js/http/providers_http_client.js +++ b/assets/js/http/providers_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Providers HTTP client. + * + * This module implements the providers related HTTP requests. + */ App.Http.Providers = (function () { /** * Save (create or update) a provider. diff --git a/assets/js/http/secretaries_http_client.js b/assets/js/http/secretaries_http_client.js index d8c238bd..1ba5794a 100644 --- a/assets/js/http/secretaries_http_client.js +++ b/assets/js/http/secretaries_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Secretaries HTTP client. + * + * This module implements the secretaries related HTTP requests. + */ App.Http.Secretaries = (function () { /** * Save (create or update) a secretary. diff --git a/assets/js/http/services_http_client.js b/assets/js/http/services_http_client.js index e44c2452..d305a10b 100644 --- a/assets/js/http/services_http_client.js +++ b/assets/js/http/services_http_client.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Services HTTP client. + * + * This module implements the services related HTTP requests. + */ App.Http.Services = (function () { /** * Save (create or update) a service. diff --git a/assets/js/http/settings_http_client.js b/assets/js/http/settings_http_client.js index 11894b90..f7b60e32 100644 --- a/assets/js/http/settings_http_client.js +++ b/assets/js/http/settings_http_client.js @@ -9,7 +9,23 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Settings HTTP client. + * + * This module implements the settings related HTTP requests. + */ App.Http.Settings = (function () { + /** + * Save (create or update) a setting. + * + * @param {Object} setting + * + * @return {Object} + */ + function save(setting) { + return setting.id ? update(setting) : create(setting); + } + /** * Create an setting. * @@ -107,6 +123,7 @@ App.Http.Settings = (function () { } return { + save, create, update, destroy, diff --git a/assets/js/http/unavailabilities_http_client.js b/assets/js/http/unavailabilities_http_client.js index b7683d8e..e802d9ee 100644 --- a/assets/js/http/unavailabilities_http_client.js +++ b/assets/js/http/unavailabilities_http_client.js @@ -9,7 +9,23 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Unavailabilities HTTP client. + * + * This module implements the unavailabilities related HTTP requests. + */ App.Http.Unavailabilities = (function () { + /** + * Save (create or update) an unavailability. + * + * @param {Object} unavailability + * + * @return {Object} + */ + function save(unavailability) { + return unavailability.id ? update(unavailability) : create(unavailability); + } + /** * Create an unavailability. * @@ -107,6 +123,7 @@ App.Http.Unavailabilities = (function () { } return { + save, create, update, destroy, diff --git a/assets/js/layouts/account_layout.js b/assets/js/layouts/account_layout.js index 7f52f33c..ce14b2dc 100644 --- a/assets/js/layouts/account_layout.js +++ b/assets/js/layouts/account_layout.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Account layout. + * + * This module implements the account layout functionality. + */ window.App.Layouts.Account = (function () { return {}; })(); diff --git a/assets/js/layouts/backend_layout.js b/assets/js/layouts/backend_layout.js index 6db7bb4b..1ea08c5b 100644 --- a/assets/js/layouts/backend_layout.js +++ b/assets/js/layouts/backend_layout.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Backend layout. + * + * This module implements the backend layout functionality. + */ window.App.Layouts.Backend = (function () { return {}; })(); diff --git a/assets/js/layouts/booking_layout.js b/assets/js/layouts/booking_layout.js index 9b723e9c..9a4d6c65 100644 --- a/assets/js/layouts/booking_layout.js +++ b/assets/js/layouts/booking_layout.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Booking layout. + * + * This module implements the booking layout functionality. + */ window.App.Layouts.Booking = (function () { return {}; })(); diff --git a/assets/js/layouts/message_layout.js b/assets/js/layouts/message_layout.js index a373bcaa..64e48357 100644 --- a/assets/js/layouts/message_layout.js +++ b/assets/js/layouts/message_layout.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Message layout. + * + * This module implements the message layout functionality. + */ window.App.Layouts.Message = (function () { return {}; })(); diff --git a/assets/js/pages/account.js b/assets/js/pages/account.js index ceb31721..23f5a3ff 100644 --- a/assets/js/pages/account.js +++ b/assets/js/pages/account.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Account + * Account page. * - * Contains the functionality of the account page. + * This module implements the functionality of the account page. */ App.Pages.Account = (function () { const $userId = $('#user-id'); diff --git a/assets/js/pages/admins.js b/assets/js/pages/admins.js index a46840c1..0e462b6f 100644 --- a/assets/js/pages/admins.js +++ b/assets/js/pages/admins.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Admins page module. + * Admins page. * - * This module contains the methods that are used in the admins page. + * This module implements the functionality of admins page. */ App.Pages.Admins = (function () { const $admins = $('#admins'); @@ -20,7 +20,7 @@ App.Pages.Admins = (function () { let filterLimit = 20; /** - * Bind the event handlers for the backend/users "Admins" tab. + * Bind the event handlers. */ function bindEventHandlers() { /** @@ -427,6 +427,9 @@ App.Pages.Admins = (function () { } } + /** + * Initialize the module. + */ function initialize() { resetForm(); filter(''); diff --git a/assets/js/pages/booking.js b/assets/js/pages/booking.js index 05a93390..db1b3399 100644 --- a/assets/js/pages/booking.js +++ b/assets/js/pages/booking.js @@ -10,10 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Booking Page + * Booking page. * - * This module contains functions that implement the book appointment page functionality. Once the "initialize" method - * is called the page is fully functional and can serve the appointment booking process. + * This module implements the functionality of the booking page * * Old Name: FrontendBook */ @@ -40,7 +39,7 @@ App.Pages.Booking = (function () { let manageMode = false; /** - * This method initializes the book appointment page. + * Initialize the module. */ function initialize() { if (App.Vars.display_cookie_notice) { @@ -193,7 +192,7 @@ App.Pages.Booking = (function () { } /** - * This method binds the necessary event handlers for the book appointments page. + * Bind the event handlers. */ function bindEventHandlers() { /** diff --git a/assets/js/pages/booking_confirmation.js b/assets/js/pages/booking_confirmation.js index 428a4b94..efac92cf 100644 --- a/assets/js/pages/booking_confirmation.js +++ b/assets/js/pages/booking_confirmation.js @@ -9,6 +9,11 @@ * @since v1.0.0 * ---------------------------------------------------------------------------- */ +/** + * Booking confirmation page. + * + * This module implements the functionality of the booking confirmation page. + */ App.Pages.BookingConfirmation = (function () { /** * Handle Authorization Result @@ -102,6 +107,9 @@ App.Pages.BookingConfirmation = (function () { } } + /** + * Bind the event handlers. + */ function bindEventHandlers() { /** * Event: Add Appointment to Google Calendar "Click" @@ -124,6 +132,9 @@ App.Pages.BookingConfirmation = (function () { }); } + /** + * Initialize the module. + */ function initialize() { bindEventHandlers(); } diff --git a/assets/js/pages/booking_settings.js b/assets/js/pages/booking_settings.js index 6d2f470a..9ca0f8af 100644 --- a/assets/js/pages/booking_settings.js +++ b/assets/js/pages/booking_settings.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Booking Settings + * Booking settings page. * - * Contains the functionality of the booking settings page. + * This module implements the functionality of the booking settings page. */ App.Pages.BookingSettings = (function () { const $bookingSettings = $('#booking-settings'); @@ -178,7 +178,7 @@ App.Pages.BookingSettings = (function () { } /** - * Initialize on document ready. + * Initialize the module. */ function initialize() { const bookingSettings = App.Vars.booking_settings; diff --git a/assets/js/pages/business_settings.js b/assets/js/pages/business_settings.js index ed0f96b4..c8097a12 100644 --- a/assets/js/pages/business_settings.js +++ b/assets/js/pages/business_settings.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Business Settings + * Business settings page. * - * Contains the functionality of the business settings page. + * This module implements the functionality of the business settings page. */ App.Pages.BusinessSettings = (function () { const $saveSettings = $('#save-settings'); @@ -127,6 +127,9 @@ App.Pages.BusinessSettings = (function () { App.Utils.Message.show(App.Lang.working_plan, App.Lang.overwrite_existing_working_plans, buttons); } + /** + * Initialize the module. + */ function initialize() { const businessSettings = App.Vars.business_settings; diff --git a/assets/js/pages/calendar.js b/assets/js/pages/calendar.js index 8eb5fd7c..ea73432b 100755 --- a/assets/js/pages/calendar.js +++ b/assets/js/pages/calendar.js @@ -10,13 +10,13 @@ * ---------------------------------------------------------------------------- */ /** - * Calendar Page + * Calendar page. * - * This module contains functions that are used by the backend calendar page. + * This module implements the functionality of the backend calendar page. */ App.Pages.Calendar = (function () { /** - * Bind common event handlers. + * Bind the event handlers. */ function bindEventHandlers() { const $calendarPage = $('#calendar-page'); @@ -98,10 +98,11 @@ App.Pages.Calendar = (function () { } /** - * Initialize Module + * Initialize the module. * - * This function makes the necessary initialization for the default backend calendar page. If this module - * is used in another page then this function might not be needed. + * This function makes the necessary initialization for the default backend calendar page. + * + * If this module is used in another page then this function might not be needed. * * @param {String} view Optional (default), the calendar view to be loaded. */ diff --git a/assets/js/pages/categories.js b/assets/js/pages/categories.js index e71533cc..60da3c42 100644 --- a/assets/js/pages/categories.js +++ b/assets/js/pages/categories.js @@ -9,13 +9,18 @@ * @since v1.0.0 * ---------------------------------------------------------------------------- */ +/** + * Categories page. + * + * This module implements the functionality of the categories page. + */ App.Pages.Categories = (function () { const $categories = $('#categories'); let filterResults = {}; let filterLimit = 20; /** - * Binds the default event handlers of the categories tab. + * Bind the event handlers. */ function bindEventHandlers() { /** @@ -325,6 +330,9 @@ App.Pages.Categories = (function () { } } + /** + * Initialize the module. + */ function initialize() { resetForm(); filter(''); diff --git a/assets/js/pages/customers.js b/assets/js/pages/customers.js index ef46127f..209df05e 100644 --- a/assets/js/pages/customers.js +++ b/assets/js/pages/customers.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Customers page module. + * Customers page. * - * This module contains the methods that are used in the customers page. + * This module implements the functionality of the customers page. */ App.Pages.Customers = (function () { const $customers = $('#customers'); @@ -20,7 +20,7 @@ App.Pages.Customers = (function () { let filterLimit = 20; /** - * Binds the default event handlers of the backend customers page. + * Bind the event handlers. */ function bindEventHandlers() { /** @@ -431,6 +431,9 @@ App.Pages.Customers = (function () { } } + /** + * Initialize the module. + */ function initialize() { resetForm(); bindEventHandlers(); diff --git a/assets/js/pages/general_settings.js b/assets/js/pages/general_settings.js index 420e8d1e..110e77a4 100644 --- a/assets/js/pages/general_settings.js +++ b/assets/js/pages/general_settings.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * General Settings + * General settings page. * - * Contains the functionality of the general settings page. + * This module implements the functionality of the general settings page. */ App.Pages.GeneralSettings = (function () { const $saveSettings = $('#save-settings'); @@ -88,6 +88,9 @@ App.Pages.GeneralSettings = (function () { }); } + /** + * Initialize the module. + */ function initialize() { const generalSettings = App.Vars.general_settings; diff --git a/assets/js/pages/installation.js b/assets/js/pages/installation.js index 050b39d5..55459b99 100644 --- a/assets/js/pages/installation.js +++ b/assets/js/pages/installation.js @@ -9,6 +9,11 @@ * @since v1.0.0 * ---------------------------------------------------------------------------- */ +/** + * Installation page. + * + * This module implements the functionality of the installation page. + */ App.Pages.Installation = (function () { const MIN_PASSWORD_LENGTH = 7; const $install = $('#install'); diff --git a/assets/js/pages/legal_settings.js b/assets/js/pages/legal_settings.js index 0c74ce5b..fcc5e315 100644 --- a/assets/js/pages/legal_settings.js +++ b/assets/js/pages/legal_settings.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Legal Settings + * Legal settings page. * - * Contains the functionality of the legal settings page. + * This module implements the functionality of the legal settings page. */ App.Pages.LegalSettings = (function () { const $saveSettings = $('#save-settings'); @@ -137,6 +137,9 @@ App.Pages.LegalSettings = (function () { }); } + /** + * Initialize the module. + */ function initialize() { $cookieNoticeContent.trumbowyg(); $termsAndConditionsContent.trumbowyg(); diff --git a/assets/js/pages/login.js b/assets/js/pages/login.js index 4c35754a..db0ea75f 100644 --- a/assets/js/pages/login.js +++ b/assets/js/pages/login.js @@ -9,7 +9,12 @@ * @since v1.4.0 * ---------------------------------------------------------------------------- */ -(function () { +/** + * Login page. + * + * This module implements the functionality of the login page. + */ +App.Pages.Login = (function () { const $loginForm = $('#login-form'); /** @@ -44,4 +49,6 @@ } $loginForm.on('submit', onLoginFormSubmit); + + return {}; })(); diff --git a/assets/js/pages/providers.js b/assets/js/pages/providers.js index 1495b9d9..10b37a42 100755 --- a/assets/js/pages/providers.js +++ b/assets/js/pages/providers.js @@ -9,16 +9,19 @@ * @since v1.0.0 * ---------------------------------------------------------------------------- */ +/** + * Providers page. + * + * This module implements the functionality of the providers page. + */ App.Pages.Providers = (function () { const $providers = $('#providers'); let filterResults = {}; let filterLimit = 20; - let enableSubmit; - let enableCancel; let workingPlanManager; /** - * Bind the event handlers for the backend/users "Providers" tab. + * Bind the event handlers. */ function bindEventHandlers() { /** @@ -503,6 +506,9 @@ App.Pages.Providers = (function () { } } + /** + * Initialize the module. + */ function initialize() { workingPlanManager = new App.Utils.WorkingPlan(); workingPlanManager.bindEventHandlers(); diff --git a/assets/js/pages/recovery.js b/assets/js/pages/recovery.js index 17b1e170..a5e66624 100644 --- a/assets/js/pages/recovery.js +++ b/assets/js/pages/recovery.js @@ -9,7 +9,12 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ -(function () { +/** + * Recovery page. + * + * This module implements the functionality of the recovery page. + */ +App.Pages.Recovery = (function () { const $form = $('form'); /** @@ -54,4 +59,6 @@ } $form.on('submit', onFormSubmit); + + return {}; })(); diff --git a/assets/js/pages/secretaries.js b/assets/js/pages/secretaries.js index ff7c028e..d3bc9ba2 100644 --- a/assets/js/pages/secretaries.js +++ b/assets/js/pages/secretaries.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Secretaries page module. + * Secretaries page. * - * This module contains the methods that are used in the admins page. + * This module implements the functionality of the secretaries page. */ App.Pages.Secretaries = (function () { const $secretaries = $('#secretaries'); @@ -20,7 +20,7 @@ App.Pages.Secretaries = (function () { let filterLimit = 20; /** - * Bind the event handlers for the backend/users "Secretaries" tab. + * Bind the event handlers. */ function bindEventHandlers() { /** @@ -482,6 +482,9 @@ App.Pages.Secretaries = (function () { } } + /** + * Initialize the module. + */ function initialize() { resetForm(); filter(''); diff --git a/assets/js/pages/services.js b/assets/js/pages/services.js index 16b15317..59897c56 100644 --- a/assets/js/pages/services.js +++ b/assets/js/pages/services.js @@ -9,11 +9,19 @@ * @since v1.0.0 * ---------------------------------------------------------------------------- */ +/** + * Services page. + * + * This module implements the functionality of the services page. + */ App.Pages.Services = (function () { const $services = $('#services'); let filterResults = {}; let filterLimit = 20; + /** + * Bind the event handlers. + */ function bindEventHandlers() { /** * Event: Filter Services Form "Submit" @@ -380,6 +388,9 @@ App.Pages.Services = (function () { }); } + /** + * Initialize the module. + */ function initialize() { resetForm(); filter(''); diff --git a/assets/js/utils/calendar_default_view.js b/assets/js/utils/calendar_default_view.js index 0039cd81..5309d3c3 100755 --- a/assets/js/utils/calendar_default_view.js +++ b/assets/js/utils/calendar_default_view.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Calendar Default View + * Working plan utility. * - * This module implements the default calendar view of backend. + * This module implements the functionality of the default calendar view. * * Old Name: BackendCalendarDefaultView */ @@ -22,7 +22,7 @@ App.Utils.CalendarDefaultView = (function () { let lastFocusedEventData; // Contains event data for later use. /** - * Bind event handlers for the calendar view. + * Bind the event handlers. */ function bindEventHandlers() { const $calendarPage = $('#calendar-page'); diff --git a/assets/js/utils/calendar_event_popover.js b/assets/js/utils/calendar_event_popover.js index 56d832e5..6d34eb2e 100644 --- a/assets/js/utils/calendar_event_popover.js +++ b/assets/js/utils/calendar_event_popover.js @@ -9,6 +9,11 @@ * @since v1.2.0 * ---------------------------------------------------------------------------- */ +/** + * Calendar event popover utility. + * + * This module implements the functionality of calendar event popovers. + */ App.Utils.CalendarEventPopover = (function () { /** * Render a map icon that links to Google maps. diff --git a/assets/js/utils/calendar_google_sync.js b/assets/js/utils/calendar_google_sync.js index 5128eebd..c485069f 100644 --- a/assets/js/utils/calendar_google_sync.js +++ b/assets/js/utils/calendar_google_sync.js @@ -10,15 +10,15 @@ * ---------------------------------------------------------------------------- */ /** - * Backend Calendar Google Sync + * Calendar Google sync utility. * - * This module implements the Google Calendar sync operations. + * This module implements the functionality of calendar google sync. * * Old Name: BackendCalendarGoogleSync */ App.Utils.CalendarGoogleSync = (function () { /** - * Bind event handlers. + * Bind the event handlers. */ function bindEventHandlers() { /** diff --git a/assets/js/utils/calendar_table_view.js b/assets/js/utils/calendar_table_view.js index d89a6613..044cbc93 100755 --- a/assets/js/utils/calendar_table_view.js +++ b/assets/js/utils/calendar_table_view.js @@ -10,9 +10,9 @@ * ---------------------------------------------------------------------------- */ /** - * Backend Calendar + * Working plan utility. * - * This module implements the table calendar view of backend. + * This module implements the functionality of table calendar view. * * Old Name: BackendCalendarTableView */ @@ -22,7 +22,7 @@ App.Utils.CalendarTableView = (function () { let lastFocusedEventData; /** - * Bind page event handlers. + * Bind the event handlers. */ function bindEventHandlers() { const $calendarToolbar = $('#calendar-toolbar'); diff --git a/assets/js/utils/date.js b/assets/js/utils/date.js index 025cef70..6c571b43 100644 --- a/assets/js/utils/date.js +++ b/assets/js/utils/date.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Date utility. + * + * This module implements the functionality of dates. + */ window.App.Utils.Date = (function () { /** * Format a YYYY-MM-DD HH:mm:ss date string. diff --git a/assets/js/utils/http.js b/assets/js/utils/http.js index f592a94a..2314ad42 100644 --- a/assets/js/utils/http.js +++ b/assets/js/utils/http.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * HTTP requests utility. + * + * This module implements the functionality of HTTP requests. + */ window.App.Utils.Http = (function () { function request(method, url, data) { return new Promise((resolve, reject) => { diff --git a/assets/js/utils/message.js b/assets/js/utils/message.js index cee9f17b..e1a276e8 100644 --- a/assets/js/utils/message.js +++ b/assets/js/utils/message.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Messages utility. + * + * This module implements the functionality of messages. + */ window.App.Utils.Message = (function () { /** * Show a message box to the user. diff --git a/assets/js/utils/string.js b/assets/js/utils/string.js index 1ab435db..e03c4e2d 100644 --- a/assets/js/utils/string.js +++ b/assets/js/utils/string.js @@ -9,7 +9,19 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Strings utility. + * + * This module implements the functionality of strings. + */ window.App.Utils.String = (function () { + /** + * Upper case the first letter of the provided string. + * + * @param {String} value + * + * @returns {string} + */ function upperCaseFirstLetter(value) { return value.charAt(0).toUpperCase() + value.slice(1); } diff --git a/assets/js/utils/url.js b/assets/js/utils/url.js index ba5a6e1d..5714c86a 100644 --- a/assets/js/utils/url.js +++ b/assets/js/utils/url.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * URLs utility. + * + * This module implements the functionality of URLs. + */ window.App.Utils.Url = (function () { /** * Get complete URL of the provided URI segment. diff --git a/assets/js/utils/validation.js b/assets/js/utils/validation.js index 8d8660c1..3d298093 100644 --- a/assets/js/utils/validation.js +++ b/assets/js/utils/validation.js @@ -9,6 +9,11 @@ * @since v1.5.0 * ---------------------------------------------------------------------------- */ +/** + * Validation utility. + * + * This module implements the functionality of validation. + */ window.App.Utils.Validation = (function () { /** * Validate the provided email. diff --git a/assets/js/utils/working_plan.js b/assets/js/utils/working_plan.js index b647b2a3..198f82ed 100755 --- a/assets/js/utils/working_plan.js +++ b/assets/js/utils/working_plan.js @@ -9,6 +9,11 @@ * @since v1.0.0 * ---------------------------------------------------------------------------- */ +/** + * Working plan utility. + * + * This module implements the functionality of working plans. + */ App.Utils.WorkingPlan = (function () { /** * Class WorkingPlan @@ -339,7 +344,7 @@ App.Utils.WorkingPlan = (function () { }; /** - * Binds the event handlers for the working plan dom elements. + * Bind the event handlers. */ WorkingPlan.prototype.bindEventHandlers = function () { /**