summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-11-14 12:28:36 +0100
committerAzul <azul@riseup.net>2012-11-14 12:28:36 +0100
commit47c7a78e948f139074ec8d975cdd38cc3335253d (patch)
tree056f4ede78c4d851d4552347dde538232af1bde8
parent0bf072f0e5d26016e61fbe68a5c0fec60e13e5e3 (diff)
cleaned up unused parser functions
-rw-r--r--src/jqueryRest.js46
1 files changed, 0 insertions, 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)
{