From 381550871001f9fa037014efe1b361d072983bcd Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 18 Nov 2016 14:38:12 +0800 Subject: webui: Rename jQuery ".fail()" callback argument "error" to "jqxhr" --- fg21sim/webui/static/js/configs.js | 30 +++++++++++++++--------------- fg21sim/webui/static/js/console.js | 12 ++++++------ 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'fg21sim') diff --git a/fg21sim/webui/static/js/configs.js b/fg21sim/webui/static/js/configs.js index ed1e177..67fe032 100644 --- a/fg21sim/webui/static/js/configs.js +++ b/fg21sim/webui/static/js/configs.js @@ -361,12 +361,12 @@ var resetConfigs = function (url) { showModalConfigs(modalData); }); }) - .fail(function (error) { + .fail(function (jqxhr) { var modalData = {}; modalData.icon = "times-circle"; modalData.message = "Failed to reset the configurations!"; - modalData.code = error.status; - modalData.reason = error.statusText; + modalData.code = jqxhr.status; + modalData.reason = jqxhr.statusText; showModalConfigs(modalData); }); }; @@ -390,12 +390,12 @@ var setServerConfigs = function (url, data) { function (response) { setFormConfigs({}, response.errors); }) - .fail(function (error) { + .fail(function (jqxhr) { var modalData = {}; modalData.icon = "times-circle"; modalData.message = "Failed to update/set the configuration data!"; - modalData.code = error.status; - modalData.reason = error.statusText; + modalData.code = jqxhr.status; + modalData.reason = jqxhr.statusText; showModalConfigs(modalData); }); }; @@ -414,12 +414,12 @@ var loadServerConfigFile = function (url, userconfig) { userconfig = getFormConfigSingle("userconfig"); } return $.postJSON(url, {action: "load", userconfig: userconfig}) - .fail(function (error) { + .fail(function (jqxhr) { var modalData = {}; modalData.icon = "times-circle"; modalData.message = "Failed to load the user configuration file!"; - modalData.code = error.status; - modalData.reason = error.statusText; + modalData.code = jqxhr.status; + modalData.reason = jqxhr.statusText; showModalConfigs(modalData); }); }; @@ -452,12 +452,12 @@ var saveServerConfigFile = function (url, clobber) { } showModalConfigs(modalData); }) - .fail(function (error) { + .fail(function (jqxhr) { var modalData = {}; modalData.icon = "times-circle"; modalData.message = "Failed to save the configurations!"; - modalData.code = error.status; - modalData.reason = error.statusText; + modalData.code = jqxhr.status; + modalData.reason = jqxhr.statusText; showModalConfigs(modalData); }); }; @@ -470,13 +470,13 @@ var existsServerFile = function (url, filepath, callback) { var data = {action: "exists", filepath: JSON.stringify(filepath)}; return $.getJSON(url, data, callback) - .fail(function (error) { + .fail(function (jqxhr) { var modalData = {}; modalData.icon = "times-circle"; modalData.message = ("Failed to check the existence " + "of the user configuration file!"); - modalData.code = error.status; - modalData.reason = error.statusText; + modalData.code = jqxhr.status; + modalData.reason = jqxhr.statusText; showModalConfigs(modalData); }); }; diff --git a/fg21sim/webui/static/js/console.js b/fg21sim/webui/static/js/console.js index 86062a7..4417b6f 100644 --- a/fg21sim/webui/static/js/console.js +++ b/fg21sim/webui/static/js/console.js @@ -146,12 +146,12 @@ var deleteLogMessages = function () { */ var getServerTaskStatus = function (url) { return $.getJSON(url) - .fail(function (error) { + .fail(function (jqxhr) { var modalData = {}; modalData.icon = "times-circle"; modalData.message = "Failed to get the task status!"; - modalData.code = error.status; - modalData.reason = error.statusText; + modalData.code = jqxhr.status; + modalData.reason = jqxhr.statusText; showModalConsole(modalData); }); }; @@ -169,12 +169,12 @@ var startServerTask = function (url, task, kwargs) { kwargs = typeof kwargs !== "undefined" ? kwargs : {}; var data = {action: "start", task: task, kwargs: kwargs}; return $.postJSON(url, data) - .fail(function (error) { + .fail(function (jqxhr) { var modalData = {}; modalData.icon = "times-circle"; modalData.message = "Failed to start the task!"; - modalData.code = error.status; - modalData.reason = error.statusText; + modalData.code = jqxhr.status; + modalData.reason = jqxhr.statusText; showModalConsole(modalData); }); }; -- cgit v1.2.2