summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-04-25 03:52:12 +0000
committerGerrit Code Review <review@openstack.org>2023-04-25 03:52:12 +0000
commitc151d67c93a5ea670eeaecf62c89bde1458f358e (patch)
tree87ece63c5da5b5e023ab99b4b3138f7f21d86d69
parent9607dfbba4746f7d493f00f6bbfc2c747b5579c3 (diff)
parentde61e2a0493d6eea25ddb9c26a208064ea22d516 (diff)
downloadhorizon-c151d67c93a5ea670eeaecf62c89bde1458f358e.tar.gz
Merge "Fix Deprecated: jQuery.parseJSON() warning by updating to JSON.parse()"
-rw-r--r--horizon/static/horizon/js/horizon.messages.js2
-rw-r--r--horizon/static/horizon/js/horizon.modals.js2
-rw-r--r--openstack_dashboard/static/js/horizon.networktopology.js2
-rw-r--r--openstack_dashboard/static/js/horizon.networktopologycommon.js2
4 files changed, 4 insertions, 4 deletions
diff --git a/horizon/static/horizon/js/horizon.messages.js b/horizon/static/horizon/js/horizon.messages.js
index 049a94273..2e8484585 100644
--- a/horizon/static/horizon/js/horizon.messages.js
+++ b/horizon/static/horizon/js/horizon.messages.js
@@ -93,7 +93,7 @@ horizon.autoDismissAlert = function ($alert) {
horizon.addInitFunction(function () {
// Bind AJAX message handling.
$(document).ajaxComplete(function(event, request){
- var message_array = $.parseJSON(horizon.ajax.get_messages(request));
+ var message_array = JSON.parse(horizon.ajax.get_messages(request));
$(message_array).each(function (index, item) {
horizon.alert(item[0], item[1], item[2]);
});
diff --git a/horizon/static/horizon/js/horizon.modals.js b/horizon/static/horizon/js/horizon.modals.js
index b31a9bbf9..090253e02 100644
--- a/horizon/static/horizon/js/horizon.modals.js
+++ b/horizon/static/horizon/js/horizon.modals.js
@@ -346,7 +346,7 @@ horizon.addInitFunction(horizon.modals.init = function() {
} else if (redirect_header) {
location.href = redirect_header;
} else if (add_to_field_header) {
- json_data = $.parseJSON(data);
+ json_data = JSON.parse(data);
field_to_update = $("#" + add_to_field_header);
field_to_update.append("<option value='" + json_data[0] + "'>" + json_data[1] + "</option>");
field_to_update.change();
diff --git a/openstack_dashboard/static/js/horizon.networktopology.js b/openstack_dashboard/static/js/horizon.networktopology.js
index 02cba863d..bcccb7bc1 100644
--- a/openstack_dashboard/static/js/horizon.networktopology.js
+++ b/openstack_dashboard/static/js/horizon.networktopology.js
@@ -157,7 +157,7 @@ horizon.network_topology = {
self.translate = null;
});
angular.element(window).on('message', function(e) {
- var message = angular.element.parseJSON(e.originalEvent.data);
+ var message = JSON.parse(e.originalEvent.data);
if (self.previous_message !== message.message) {
horizon.alert(message.type, message.message);
self.previous_message = message.message;
diff --git a/openstack_dashboard/static/js/horizon.networktopologycommon.js b/openstack_dashboard/static/js/horizon.networktopologycommon.js
index a2722e8fe..417b028dc 100644
--- a/openstack_dashboard/static/js/horizon.networktopologycommon.js
+++ b/openstack_dashboard/static/js/horizon.networktopologycommon.js
@@ -88,7 +88,7 @@ horizon.networktopologymessager = {
// listens for message events
angular.element(window).on('message', function(e) {
- var message = angular.element.parseJSON(e.originalEvent.data);
+ var message = JSON.parse(e.originalEvent.data);
if (self.previous_message !== message.message) {
horizon.toast.add(message.type, message.message);
self.previous_message = message.message;