From 3db8e91b5174b581c873189fe2edee4d57a9a601 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Thu, 19 Nov 2015 05:36:05 +0100 Subject: [PATCH] Bye bye syncRequest --- data/js/tomahawk.js | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/data/js/tomahawk.js b/data/js/tomahawk.js index e6eb59ea0..34cbefa90 100644 --- a/data/js/tomahawk.js +++ b/data/js/tomahawk.js @@ -335,34 +335,6 @@ Tomahawk.valueForSubNode = function (node, tag) { return element.textContent; }; -/** - * Do a synchronous HTTP(S) request. For further options see - * Tomahawk.asyncRequest - */ -Tomahawk.syncRequest = function (url, extraHeaders, options) { - // unpack options - var opt = options || {}; - var method = opt.method || 'GET'; - - var xmlHttpRequest = new XMLHttpRequest(); - xmlHttpRequest.open(method, url, false, opt.username, opt.password); - if (extraHeaders) { - for (var headerName in extraHeaders) { - xmlHttpRequest.setRequestHeader(headerName, extraHeaders[headerName]); - } - } - xmlHttpRequest.send(null); - if (httpSuccessStatuses.indexOf(xmlHttpRequest.status) != -1) { - return xmlHttpRequest.responseText; - } else { - Tomahawk.log("Failed to do GET request: to: " + url); - Tomahawk.log("Status Code was: " + xmlHttpRequest.status); - if (opt.hasOwnProperty('errorHandler')) { - opt.errorHandler.call(window, xmlHttpRequest); - } - } -}; - /** * Internal counter used to identify retrievedMetadata call back from native * code.