diff --git a/index.html b/index.html index 287f125..67427e5 100644 --- a/index.html +++ b/index.html @@ -1,75 +1,75 @@ - - - SOAPUI test page - - - - - - - - -

Get information about Spain

-
- - -
+ -

Get information about Poland

-
- - -
+ -

Get information about funny country

-
- - -
- + + diff --git a/soapui.js b/soapui.js index 4e16e89..87a7ad3 100644 --- a/soapui.js +++ b/soapui.js @@ -36,102 +36,102 @@ */ (function(factory) { - if(typeof module === 'object' && typeof module.exports === 'object') { - module.exports = factory(require('jquery')); - } else if (jQuery) { - factory(jQuery); - } else { - console.error('no jQuery found!') - } + if(typeof module === 'object' && typeof module.exports === 'object') { + module.exports = factory(require('jquery')); + } else if (jQuery) { + factory(jQuery); + } else { + console.error('no jQuery found!') + } })(function($) { - function soapui(root_node, soap_options) { - root_node = $(root_node); // Make sure it is a jQuery object + function soapui(root_node, soap_options) { + root_node = $(root_node); // Make sure it is a jQuery object - // Detect if vkbeautify is loaded - var vkbeautify = window.vkbeautify; - if (vkbeautify == null) { - console.log("vkbeautify not loaded, using a poor replacement for XML Pretty Printing"); - vkbeautify = { xml: function (xml) { - // Poor man XML pretty printing - return xml.replace(/(>)|([^>])(?=<)/g, "$1$2\n"); - } } - } + // Detect if vkbeautify is loaded + var vkbeautify = window.vkbeautify; + if (vkbeautify == null) { + console.log("vkbeautify not loaded, using a poor replacement for XML Pretty Printing"); + vkbeautify = { xml: function (xml) { + // Poor man XML pretty printing + return xml.replace(/(>)|([^>])(?=<)/g, "$1$2\n"); + } } + } - // SOAP request section - var soapActionNode = $(root_node).find("soap-action").get(0); - soapActionNode = soapActionNode != null ? $(soapActionNode) : null; - var soapAction = soapActionNode != null ? soapActionNode.text() : null; - if (soapAction != null && soapAction != "") { - soapActionNode.before("SOAP Action"); - soapActionNode.replaceWith(function (i, e) { - return $("", { value: soapAction, type: "text"}); - }); - } else { - soapActionNode.find("soap-action") - .remove(); - } + // SOAP request section + var soapActionNode = $(root_node).find("soap-action").get(0); + soapActionNode = soapActionNode != null ? $(soapActionNode) : null; + var soapAction = soapActionNode != null ? soapActionNode.text() : null; + if (soapAction != null && soapAction != "") { + soapActionNode.before("SOAP Action"); + soapActionNode.replaceWith(function (i, e) { + return $("", { value: soapAction, type: "text"}); + }); + } else { + soapActionNode.find("soap-action") + .remove(); + } - var soapBodyNode = root_node.find("soap-body") - .contents() - .filter(function() { - return this.nodeType == Node.COMMENT_NODE; - }) - .get(0); - var soapBody = soapBodyNode != null ? soapBodyNode.data : ""; - var newSoapBodyNode = $("