From 8fb111190bf30a3ae0ced462e572e520fe8ad82e Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 14 Dec 2020 20:38:17 +0200 Subject: [PATCH] Use the native JSON.parse method instead of the jQuery variation --- assets/js/backend_calendar_default_view.js | 6 +++--- assets/js/backend_calendar_table_view.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/js/backend_calendar_default_view.js b/assets/js/backend_calendar_default_view.js index aff5a3b3..736dbc12 100755 --- a/assets/js/backend_calendar_default_view.js +++ b/assets/js/backend_calendar_default_view.js @@ -181,7 +181,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; var successCallback = function () { Backend.displayNotification(EALang.working_plan_exception_deleted); - var workingPlanExceptions = jQuery.parseJSON(provider.settings.working_plan_exceptions) || {}; + var workingPlanExceptions = JSON.parse(provider.settings.working_plan_exceptions) || {}; delete workingPlanExceptions[date]; for (var index in GlobalVariables.availableProviders) { @@ -1098,8 +1098,8 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; throw new Error('Provider was not found.'); } - var workingPlan = jQuery.parseJSON(provider.settings.working_plan); - var workingPlanExceptions = jQuery.parseJSON(provider.settings.working_plan_exceptions); + var workingPlan = JSON.parse(provider.settings.working_plan); + var workingPlanExceptions = JSON.parse(provider.settings.working_plan_exceptions); var unavailabilityEvent; var viewStart; var viewEnd; diff --git a/assets/js/backend_calendar_table_view.js b/assets/js/backend_calendar_table_view.js index 7724f8b3..0de49d54 100755 --- a/assets/js/backend_calendar_table_view.js +++ b/assets/js/backend_calendar_table_view.js @@ -157,7 +157,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; var successCallback = function () { Backend.displayNotification(EALang.working_plan_exception_saved); - var workingPlanExceptions = jQuery.parseJSON(provider.settings.working_plan_exceptions) || {}; + var workingPlanExceptions = JSON.parse(provider.settings.working_plan_exceptions) || {}; workingPlanExceptions[date] = workingPlanException; @@ -259,7 +259,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; .done(function () { $('#message-box').dialog('close'); - var workingPlanExceptions = jQuery.parseJSON(lastFocusedEventData.data.settings.working_plan_exceptions); + var workingPlanExceptions = JSON.parse(lastFocusedEventData.data.settings.working_plan_exceptions); delete workingPlanExceptions[lastFocusedEventData.start.format('YYYY-MM-DD')]; lastFocusedEventData.data.settings.working_plan_exceptions = JSON.stringify(workingPlanExceptions);