aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmlrpc.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xmlrpc.js')
-rw-r--r--lib/xmlrpc.js44
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/xmlrpc.js b/lib/xmlrpc.js
index 69bb77e..f074f39 100644
--- a/lib/xmlrpc.js
+++ b/lib/xmlrpc.js
@@ -33,10 +33,10 @@ XMLRPCMessage.prototype.addParameter = function(data) {
XMLRPCMessage.prototype.xml = function() {
- let method = this.method;
+ var method = this.method;
// assemble the XML message header
- let xml = "";
+ var xml = "";
xml += "<?xml version=\"1.0\"?>\n";
xml += "<methodCall>\n";
@@ -44,8 +44,8 @@ XMLRPCMessage.prototype.xml = function() {
xml += "<params>\n";
// do individual parameters
- for ( let i = 0; i < this.params.length; i++) {
- let data = this.params[i];
+ for ( var i = 0; i < this.params.length; i++) {
+ var data = this.params[i];
xml += "<param>\n";
xml += "<value>"
+ this.getParamXML(this.dataTypeOf(data),
@@ -61,7 +61,7 @@ XMLRPCMessage.prototype.xml = function() {
XMLRPCMessage.prototype.dataTypeOf = function(o) {
// identifies the data type
- let type = typeof (o);
+ var type = typeof (o);
type = type.toLowerCase();
switch (type) {
case "number":
@@ -71,7 +71,7 @@ XMLRPCMessage.prototype.dataTypeOf = function(o) {
type = "double";
break;
case "object":
- let con = o.constructor;
+ var con = o.constructor;
if (con == Date)
type = "date";
else if (con == Array)
@@ -84,45 +84,45 @@ XMLRPCMessage.prototype.dataTypeOf = function(o) {
};
XMLRPCMessage.prototype.doValueXML = function(type, data) {
- let xml = "<" + type + ">" + data + "</" + type + ">";
+ var xml = "<" + type + ">" + data + "</" + type + ">";
return xml;
};
XMLRPCMessage.prototype.doBooleanXML = function(data) {
- let value = (data == true) ? 1 : 0;
- let xml = "<boolean>" + value + "</boolean>";
+ var value = (data == true) ? 1 : 0;
+ var xml = "<boolean>" + value + "</boolean>";
return xml;
};
XMLRPCMessage.prototype.doDateXML = function(data) {
- let leadingZero = function (n) {
+ var leadingZero = function (n) {
// pads a single number with a leading zero. Heh.
if (n.length == 1)
n = "0" + n;
return n;
};
- let dateToISO8601 = function(date) {
+ var dateToISO8601 = function(date) {
// wow I hate working with the Date object
- let year = new String(date.getYear());
- let month = this.leadingZero(new String(date.getMonth()));
- let day = this.leadingZero(new String(date.getDate()));
- let time = this.leadingZero(new String(date.getHours())) + ":"
+ var year = new String(date.getYear());
+ var month = this.leadingZero(new String(date.getMonth()));
+ var day = this.leadingZero(new String(date.getDate()));
+ var time = this.leadingZero(new String(date.getHours())) + ":"
+ this.leadingZero(new String(date.getMinutes())) + ":"
+ this.leadingZero(new String(date.getSeconds()));
- let converted = year + month + day + "T" + time;
+ var converted = year + month + day + "T" + time;
return converted;
};
- let xml = "<dateTime.iso8601>";
+ var xml = "<dateTime.iso8601>";
xml += dateToISO8601(data);
xml += "</dateTime.iso8601>";
return xml;
};
XMLRPCMessage.prototype.doArrayXML = function(data) {
- let xml = "<array><data>\n";
- for ( let i = 0; i < data.length; i++) {
+ var xml = "<array><data>\n";
+ for ( var i = 0; i < data.length; i++) {
xml += "<value>"
+ this.getParamXML(this.dataTypeOf(data[i]),
data[i]) + "</value>\n";
@@ -132,8 +132,8 @@ XMLRPCMessage.prototype.doArrayXML = function(data) {
};
XMLRPCMessage.prototype.doStructXML = function(data) {
- let xml = "<struct>\n";
- for ( let i in data) {
+ var xml = "<struct>\n";
+ for ( var i in data) {
xml += "<member>\n";
xml += "<name>" + i + "</name>\n";
xml += "<value>"
@@ -146,7 +146,7 @@ XMLRPCMessage.prototype.doStructXML = function(data) {
};
XMLRPCMessage.prototype.getParamXML = function(type, data) {
- let xml;
+ var xml;
switch (type) {
case "date":
xml = this.doDateXML(data);