From ff199a4d786e1fa8cb243d9b46d677bdd0849d2b Mon Sep 17 00:00:00 2001 From: paweldomas Date: Fri, 28 Aug 2015 17:07:02 +0200 Subject: [PATCH] Updates app.bundle.js --- index.html | 2 +- libs/app.bundle.js | 35 ++++++++++++++++------------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/index.html b/index.html index 54d715410d..fc5ce10f5d 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ - + diff --git a/libs/app.bundle.js b/libs/app.bundle.js index 780353540c..b46351486c 100644 --- a/libs/app.bundle.js +++ b/libs/app.bundle.js @@ -11510,14 +11510,21 @@ var HttpConfig = { console.info( "Send config request to " + endpoint + " for room: " + roomName); - var request = new XMLHttpRequest(); - var error = null; - request.onreadystatechange = function (aEvt) { - if (request.readyState == 4) { - var status = request.status; - if (status === 200) { + + $.ajax( + endpoint, + { + method: 'POST', + contentType: 'application/json', + data: JSON.stringify({"roomName": roomName}), + dataType: 'json', + error: function(jqXHR, textStatus, errorThrown) { + console.error("Get config error: ", jqXHR, errorThrown) + error = "Get config response status: " + textStatus; + complete(false, error); + }, + success: function(data, textStatus, jqXHR) { try { - var data = JSON.parse(request.responseText); configUtil.overrideConfigJSON( config, interfaceConfig, data); complete(true); @@ -11525,21 +11532,11 @@ var HttpConfig = { } catch (exception) { console.error("Parse config error: ", exception); error = exception; + complete(false, error); } - } else { - console.error("Get config error: ", request, status); - error = "Get config response status: " + status; } - complete(false, error); } - }; - - request.open("POST", endpoint, true); - - request.setRequestHeader( - "Content-Type", "application/json;charset=UTF-8"); - - request.send({ "roomName": roomName }); + ); } };