From b56d75b1e9570db12b0b0a2eb616fba079629bb0 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+SamTV12345@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:12:41 +0200 Subject: [PATCH] Use parse instead of parseJSON. (#5869) --- src/static/js/admin/settings.js | 2 +- src/static/js/vendors/farbtastic.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/js/admin/settings.js b/src/static/js/admin/settings.js index 0d9031602..4123546e1 100644 --- a/src/static/js/admin/settings.js +++ b/src/static/js/admin/settings.js @@ -62,7 +62,7 @@ const isJSONClean = (data) => { // this is a bit naive. In theory some key/value might contain the sequences ',]' or ',}' cleanSettings = cleanSettings.replace(',]', ']').replace(',}', '}'); try { - return typeof JSON.parseJSON(cleanSettings) === 'object'; + return typeof JSON.parse(cleanSettings) === 'object'; } catch (e) { return false; // the JSON failed to be parsed } diff --git a/src/static/js/vendors/farbtastic.js b/src/static/js/vendors/farbtastic.js index 9e167d6bb..367e91cda 100644 --- a/src/static/js/vendors/farbtastic.js +++ b/src/static/js/vendors/farbtastic.js @@ -33,7 +33,7 @@ $._farbtastic = function (container, options) { fb.linkTo = function (callback) { // Unbind previous nodes if (typeof fb.callback == 'object') { - $(fb.callback).off('keyup').on('keyup').on('keyup', fb.updateValue); + $(fb.callback).off('keyup').on('keyup', fb.updateValue); } // Reset color