From: Aleksander Ɓukasz Date: Mon, 24 Mar 2014 11:28:32 +0000 (+0100) Subject: wlxml: allow extending WLXMLDocument X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/e1acb388e008f83e89976e3779330d2a268f525e?ds=sidebyside;hp=78f57106d86fd31156033dce3d4fa9d8df5361fa wlxml: allow extending WLXMLDocument --- diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index 4f6e356..034312d 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -343,14 +343,17 @@ var wlxmlClasses = { return { - WLXMLDocumentFromXML: function(xml, options) { + WLXMLDocumentFromXML: function(xml, options, Factory) { options = _.extend({wlxmlClasses: wlxmlClasses}, options); - return new WLXMLDocument(xml, options); + Factory = Factory || WLXMLDocument; + return new Factory(xml, options); }, WLXMLElementNodeFromXML: function(xml) { return this.WLXMLDocumentFromXML(xml).root; - } + }, + + WLXMLDocument: WLXMLDocument }; }); \ No newline at end of file