From 47c7a78e948f139074ec8d975cdd38cc3335253d Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 14 Nov 2012 12:28:36 +0100 Subject: cleaned up unused parser functions --- src/jqueryRest.js | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/src/jqueryRest.js b/src/jqueryRest.js index 133e3fd..54a0908 100644 --- a/src/jqueryRest.js +++ b/src/jqueryRest.js @@ -1,51 +1,5 @@ jqueryRest = function() { - function parseResponse() { - if (responseIsXML()) { - return parseXML(xhr.responseXML); - } else if (responseIsJSON()) { - return JSON.parse(xhr.responseText); - } - } - - function responseIsXML() { - return (xhr.responseType == 'document') || - (xhr.getResponseHeader("Content-Type").indexOf('application/xml') >= 0); - } - - function responseIsJSON() { - return (xhr.responseType == 'json') || - (xhr.getResponseHeader("Content-Type").indexOf('application/json') >= 0); - } - - function parseXML(xml) { - if (xml.getElementsByTagName("r").length > 0) { - return parseAttributesOfElement(xml.getElementsByTagName("r")[0]); - } else { - return parseNodes(xml.childNodes); - } - } - - function parseAttributesOfElement(elem) { - var response = {}; - for (var i = 0; i < elem.attributes.length; i++) { - var attrib = elem.attributes[i]; - if (attrib.specified) { - response[attrib.name] = attrib.value; - } - } - return response; - } - - function parseNodes(nodes) { - var response = {}; - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - response[node.tagName] = node.textContent || true; - } - return response; - } - // we do not fetch the salt from the server function register(session, callback) { -- cgit v1.2.3