diff --git a/js/main.js b/js/main.js index 111e251..09fd3cf 100644 --- a/js/main.js +++ b/js/main.js @@ -8,16 +8,16 @@ const data = { IncomingMailServerAuthentication: "", IncomingMailServerHostName: "", - IncomingMailServerPortNumber: null, + IncomingMailServerPortNumber: 993, IncomingMailServerUsername: "", - IncomingMailServerUseSSL: null, + IncomingMailServerUseSSL: false, OutgoingMailServerAuthentication: "", OutgoingMailServerHostName: "", - OutgoingMailServerPortNumber: null, + OutgoingMailServerPortNumber: 465, OutgoingMailServerUsername: "", - OutgoingMailServerUseSSL: null, - OutgoingPasswordSameAsIncomingPassword: null, + OutgoingMailServerUseSSL: false, + OutgoingPasswordSameAsIncomingPassword: false, PayloadDescription: "", PayloadDisplayName: "", @@ -98,31 +98,25 @@ const app = new Vue({ generatedProfile: function () { const template = "\n" + "\n" + - "" + "PayloadContent" + const parser = new DOMParser(); const xmlDoc = parser.parseFromString(template, "application/xml"); const dict = xmlDoc.getElementsByTagName("dict")[0]; - const contentElement = xmlDoc.createElement("key"); - contentElement.innerHTML = "PayloadContent"; - dict.appendChild(contentElement); - const arrayElement = xmlDoc.createElement("array"); - dict.appendChild(arrayElement); - const contentDict = xmlDoc.createElement("dict"); - arrayElement.appendChild(contentDict); - - for (const [key, value] of Object.entries(this.payload)) { - const [keyElement, valueElement] = convertKeyValueToXml(xmlDoc, key, value); - contentDict.appendChild(keyElement); - contentDict.appendChild(valueElement); - } - for (const [key, value] of Object.entries(this.container)) { const [keyElement, valueElement] = convertKeyValueToXml(xmlDoc, key, value); dict.appendChild(keyElement); dict.appendChild(valueElement); } + const contentDict = xmlDoc.getElementsByTagName("dict")[1]; + for (const [key, value] of Object.entries(this.payload)) { + const [keyElement, valueElement] = convertKeyValueToXml(xmlDoc, key, value); + contentDict.appendChild(keyElement); + contentDict.appendChild(valueElement); + } + const serializer = new XMLSerializer(); return serializer.serializeToString(xmlDoc); },